/*********************************************************************
* C:/Apache24/sites/saas/public/backoffice/assets/css/backoffice.css
* @title 🎨 Back-office — Feuille de styles principale
* @description Définit l’apparence générale, les composants, les mises en page responsives et les écrans du back-office SaaS.
*********************************************************************/

:root {
  --bg: #0b1020;
  --panel: #121a2f;
  --panel-2: #19233d;
  --panel-3: #0f172a;
  --text: #eef3fb;
  --muted: #9fb0cf;
  --line: rgba(255, 255, 255, 0.08);
  --accent: #84a9ff;
  --danger: #ff6b6b;
  --ok: #3dd598;
  --warning: #ffcf5a;
  --radius: 16px;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
  min-width: 0;
}

/* Utilitaire global : permet de masquer aussi les éléments
   dont le HTML utilise class="hidden" au lieu de l’attribut hidden. */
.hidden,
[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
  height: 100%;
}

body {
  background: linear-gradient(135deg, #0b1020 0%, #11182d 45%, #0b1020 100%);
  color: var(--text);
  font-family:
    Inter,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Arial,
    sans-serif;
  overflow-x: hidden;
}

body[data-page] {
  height: 100dvh;
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  border: 1px solid transparent;
  background: var(--accent);
  color: #08111f;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 700;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease;
}

button:hover {
  transform: translateY(-1px);
}

button.btn-secondary,
.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-color: var(--line);
}

button.danger {
  background: var(--danger);
  color: #fff;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 12px;
  padding: 11px 12px;
}

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

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(132, 169, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(132, 169, 255, 0.12);
}

h1,
h2,
h3 {
  margin: 0;
}

.muted {
  color: var(--muted);
}

.alert {
  margin: 0;
  padding: 12px;
  border-radius: 12px;
  background: rgba(61, 213, 152, 0.1);
  border: 1px solid rgba(61, 213, 152, 0.25);
  color: #d8fff0;
}

.alert.is-error {
  background: rgba(255, 107, 107, 0.12);
  border-color: rgba(255, 107, 107, 0.25);
  color: #ffd4d4;
}

.empty-box {
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
}

.brand-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(132, 169, 255, 0.15);
}

.w-full {
  width: 100%;
}

/* ✅ AJOUT : conteneur scroll générique (utile pour Apps/Instances) */
.panel-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

/* ✅ AJOUT : conteneur table générique (utile si tu injectes une table dans une card) */
.table-host {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.table-host .table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

/* Scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(132, 169, 255, 0.35) rgba(255, 255, 255, 0.03);
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  background: rgba(132, 169, 255, 0.28);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* LOGIN */
.login-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(460px, 100%);
  max-height: calc(100dvh - 48px);
  overflow: auto;
  background: rgba(18, 26, 47, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.brand-line {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.form-stack {
  display: grid;
  gap: 10px;
}

.form-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin: 12px 0;
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0;
}

/* APP */
.bo-app {
  height: 100dvh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  overflow: hidden;
}

.bo-sidebar {
  border-right: 1px solid var(--line);
  background: rgba(18, 26, 47, 0.86);
  backdrop-filter: blur(12px);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
  overflow-y: auto;
}

.bo-logo {
  display: flex;
  gap: 12px;
  align-items: center;
}

.bo-kicker {
  font-size: 12px;
  color: var(--muted);
}

.bo-title {
  font-size: 18px;
  font-weight: 800;
}

.bo-nav {
  display: grid;
  gap: 8px;
}

.bo-nav a {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease;
}

.bo-nav a.is-active,
.bo-nav a:hover {
  color: var(--text);
  border-color: var(--line);
  background: rgba(132, 169, 255, 0.08);
}

.sidebar-bottom {
  margin-top: auto;
}

.bo-main {
  min-width: 0;
  min-height: 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}

.bo-main > * {
  min-width: 0;
}

.bo-topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  flex: 0 0 auto;
}

.topbar-left,
.topbar-right {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.topbar-left > * {
  min-width: 0;
}

/* En-tête compact : titre + utilisateur connecté */
.page-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-width: 0;
}

.page-title-row h1 {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bo-user-pill {
  flex: 0 1 auto;
  max-width: min(360px, 42vw);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 5px 10px 5px 6px;
  border-radius: 999px;
  border: 1px solid rgba(132, 169, 255, 0.22);
  background:
    radial-gradient(
      circle at top left,
      rgba(132, 169, 255, 0.18),
      transparent 58%
    ),
    rgba(255, 255, 255, 0.035);
  color: #dbe7ff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.bo-user-pill__avatar {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(132, 169, 255, 0.18);
  border: 1px solid rgba(132, 169, 255, 0.24);
}

.bo-user-pill__avatar svg {
  width: 15px;
  height: 15px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bo-user-pill__email {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.topbar-right {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar-right > * {
  min-width: 0;
}

#pageSearch {
  min-width: 220px;
}

#pageStatusFilter {
  min-width: 180px;
}

/* Contexte client */
.active-context {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(132, 169, 255, 0.16);
  background: linear-gradient(
    135deg,
    rgba(132, 169, 255, 0.12),
    rgba(18, 26, 47, 0.9)
  );
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex: 0 0 auto;
}

.active-context-main {
  min-width: 0;
  flex: 1;
}

.active-context-kicker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #b8cbf7;
  margin-bottom: 4px;
}

.active-context-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.active-context-meta {
  margin-top: 4px;
  font-size: 13px;
}

.active-context-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.active-context-actions .btn-secondary,
.active-context-actions .danger {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 13px;
}

/* Résumé */
.page-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  flex: 0 0 auto;
}

.summary-pill {
  background: rgba(18, 26, 47, 0.72);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}

.summary-pill span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.summary-pill strong {
  font-size: 18px;
}

/* IMPORTANT : garantit qu'une seule page backoffice s'affiche */
.page-panel[hidden] {
  display: none !important;
}

.page-panel:not([hidden]) {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  gap: 16px;
}

.page-panel > * {
  min-width: 0;
  min-height: 0;
}

.card,
.stat-card {
  background: rgba(18, 26, 47, 0.88);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  min-width: 0;
  min-height: 0;
}

.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.quote-editor-card {
  min-height: 0;
}

.quote-editor-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
}

.quote-editor-scroll > * {
  flex: 0 0 auto;
}

/* On évite un double ascenseur dans l’éditeur */
.quote-editor-scroll #quoteDraftLines {
  flex: 0 0 auto;
  min-height: auto;
  overflow: visible;
  padding-right: 0;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex: 0 0 auto;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  min-width: 0;
  min-height: 0;
  align-items: stretch;
}

.quote-layout {
  align-items: stretch;
}

.stack-col {
  display: grid;
  gap: 16px;
  min-width: 0;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  min-width: 0;
}

.stat-card {
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(
    90deg,
    rgba(132, 169, 255, 0.55),
    rgba(61, 213, 152, 0.35),
    transparent
  );
}

.stat-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

.stat-card strong {
  font-size: 28px;
}

.stat-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 10px;
}

.list-item {
  width: 100%;
  text-align: left;
  margin-bottom: 0;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border-color: var(--line);
}

.detail-block,
.detail-card,
.quote-line-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  margin-bottom: 10px;
}

.detail-block:last-child,
.detail-card:last-child,
.quote-line-card:last-child {
  margin-bottom: 0;
}

.line-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  margin: 10px 0;
}

.total-box {
  margin: 14px 0;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
}

.table-wrap {
  width: 100%;
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
}

.table {
  width: 100%;
  min-width: max-content;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.table td {
  word-break: break-word;
}

.table th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.table-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.mini-btn {
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.2;
}

.status-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-pill.is-on {
  background: rgba(61, 213, 152, 0.12);
  color: #8ff0c0;
  border: 1px solid rgba(61, 213, 152, 0.2);
}

.status-pill.is-off {
  background: rgba(255, 107, 107, 0.12);
  color: #ffc2c2;
  border: 1px solid rgba(255, 107, 107, 0.2);
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-color: var(--line);
}

/* Correctif composants — fermeture de modale
   La croix de fermeture est un bouton, mais ne doit pas hériter
   du padding global des boutons d'action. */
.bo-modal-head .icon-btn[data-modal-close],
.bo-modal-close {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 14px;
  display: inline-grid;
  place-items: center;
  line-height: 1;
  font-size: 28px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid var(--line);
}

.bo-modal-head .icon-btn[data-modal-close]:hover,
.bo-modal-close:hover {
  transform: translateY(-1px);
  background: rgba(132, 169, 255, 0.08);
  border-color: rgba(132, 169, 255, 0.22);
}

/* Boutons dans tableaux */
.table td .mini-btn,
.table td .btn-secondary {
  white-space: nowrap;
}

.table td > .mini-btn.btn-secondary,
.table td > .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
}

button[data-license-focus],
button[data-payment-focus],
button[data-order-focus],
button[data-quote-view][data-context-client-id] {
  min-width: 58px;
}

.table td .table-actions {
  margin: 0;
}

.detail-block .form-actions,
.detail-card .form-actions {
  margin-top: 10px;
  margin-bottom: 0;
}

/* Activité récente */
.activity-list {
  display: grid;
  gap: 10px;
}

.activity-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.activity-item:hover {
  transform: translateY(-1px);
  border-color: rgba(132, 169, 255, 0.18);
  background: rgba(255, 255, 255, 0.03);
}

.activity-item strong {
  display: block;
  margin-bottom: 4px;
}

.activity-item small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.activity-item .form-actions {
  margin-bottom: 0;
}

.activity-item[data-activity-context] {
  cursor: pointer;
  border-color: rgba(132, 169, 255, 0.12);
}

.activity-item[data-activity-context]:hover {
  border-color: rgba(132, 169, 255, 0.26);
  background: rgba(132, 169, 255, 0.05);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* Raccourcis dashboard */
.form-actions a.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 12px;
  transition: 0.2s ease;
}

.form-actions a.btn-secondary:hover {
  background: rgba(132, 169, 255, 0.08);
  border-color: var(--line);
}

/* Détail devis */
#quoteDetail .form-actions {
  margin-top: 10px;
  margin-bottom: 16px;
}

#quoteDetail .form-actions .mini-btn,
#quoteDetail .form-actions .btn-secondary {
  min-height: 38px;
}

/* Mise en valeur de l’éditeur de devis */
#pageQuotes .card:first-child {
  position: relative;
}

#pageQuotes .card:first-child::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  border-radius: 16px 0 0 16px;
  background: linear-gradient(
    180deg,
    rgba(132, 169, 255, 0.7),
    rgba(61, 213, 152, 0.45)
  );
}

/* Zones scrollables desktop */
#pageDashboard > #dashboardKpis {
  flex: 0 0 auto;
}

#pageDashboard > .grid-2,
#pageClients > .grid-2,
#pageQuotes > .grid-2 {
  flex: 1 1 auto;
  min-height: 0;
}

#pageLicenses > .card,
#pagePayments > .card,
#pageOrders > .card {
  flex: 1 1 auto;
}

#dashboardActivity,
#clientsList,
#clientDetail,
#quoteDetail,
#quoteDraftLines {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

#licensesTable,
#paymentsTable,
#quotesTable,
#ordersTable {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#licensesTable .table-wrap,
#paymentsTable .table-wrap,
#quotesTable .table-wrap,
#ordersTable .table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

#quoteDetailEmpty,
#clientDetailEmpty {
  flex: 0 0 auto;
}

#pageQuotes .quote-layout > .card:first-child,
#pageQuotes .stack-col > .card {
  min-height: 0;
}

#quoteDraftLines {
  min-height: 150px;
}

/* MODAL */
.bo-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
}

.bo-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(6px);
}

.bo-modal-card {
  position: relative;
  z-index: 2;
  width: min(620px, calc(100% - 32px));
  max-height: calc(100dvh - 48px);
  margin: 24px auto 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.bo-modal-head,
.bo-modal-foot {
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.bo-modal-head {
  border-bottom: 1px solid var(--line);
}

.bo-modal-foot {
  border-top: 1px solid var(--line);
  justify-content: flex-end;
}

.bo-modal-body {
  padding: 18px;
  display: grid;
  gap: 12px;
  min-height: 0;
  overflow: auto;
}

/* TABLETTE */
@media (max-width: 1100px) {
  .page-summary {
    grid-template-columns: 1fr 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 980px) {
  body[data-page] {
    height: auto;
    min-height: 100%;
    overflow-y: auto;
  }

  .bo-app {
    height: auto;
    min-height: 100dvh;
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .bo-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--line);
    overflow: visible;
    padding: 14px;
    gap: 14px;
  }

  .bo-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .bo-nav a {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .sidebar-bottom {
    margin-top: 0;
  }

  .bo-main {
    overflow: visible;
    padding: 16px;
  }

  .page-panel:not([hidden]) {
    display: flex;
    overflow: visible;
    flex: 0 0 auto;
  }

  .grid-2,
  .stats-grid,
  .page-summary {
    grid-template-columns: 1fr;
  }

  .stack-col {
    grid-template-rows: none;
  }

  .bo-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-right {
    min-width: 100%;
    flex-direction: column;
    align-items: stretch;
    justify-content: stretch;
  }

  .page-title-row {
    gap: 10px;
  }

  .bo-user-pill {
    max-width: 220px;
    min-height: 32px;
  }

  .bo-user-pill__email {
    max-width: 160px;
    font-size: 12px;
  }

  .active-context {
    flex-direction: column;
    align-items: stretch;
  }

  .active-context-title {
    white-space: normal;
    overflow: visible;
    text-overflow: initial;
  }

  .active-context-actions {
    justify-content: stretch;
  }

  .active-context-actions .btn-secondary,
  .active-context-actions .danger {
    width: 100%;
  }

  .table-actions {
    align-items: stretch;
  }

  .table-actions .mini-btn,
  .table-actions .btn-secondary {
    width: 100%;
    justify-content: center;
  }

  #pageSearch,
  #pageStatusFilter,
  #topbarRefreshBtn {
    min-width: 100%;
    width: 100%;
  }

  /* On enlève les scrolls internes verticaux sur tablette/mobile
     pour éviter les doubles ascenseurs tactiles */
  #dashboardActivity,
  #clientsList,
  #clientDetail,
  #quoteDetail,
  #quoteDraftLines,
  #licensesTable,
  #paymentsTable,
  #quotesTable,
  #ordersTable,
  .panel-scroll,
  .table-host {
    overflow: visible;
    min-height: auto;
    flex: 0 0 auto;
    padding-right: 0;
  }

  #licensesTable .table-wrap,
  #paymentsTable .table-wrap,
  #quotesTable .table-wrap,
  #ordersTable .table-wrap,
  .table-host .table-wrap {
    min-height: auto;
    flex: 0 0 auto;
  }

  .quote-editor-scroll {
    overflow: visible;
    min-height: auto;
    flex: 0 0 auto;
    padding-right: 0;
  }
}

/* MOBILE */
@media (max-width: 700px) {
  .login-shell {
    padding: 14px;
  }

  .login-card {
    padding: 16px;
    max-height: calc(100dvh - 28px);
  }

  .page-title-row {
    align-items: flex-start;
  }

  .page-title-row h1 {
    white-space: normal;
    line-height: 1.08;
  }

  .bo-user-pill {
    width: 34px;
    height: 34px;
    min-height: 34px;
    max-width: 34px;
    padding: 0;
    justify-content: center;
  }

  .bo-user-pill__avatar {
    width: 26px;
    height: 26px;
  }

  .bo-user-pill__email {
    display: none;
  }

  .bo-sidebar {
    padding: 12px;
  }

  .bo-main {
    padding: 12px;
    gap: 12px;
  }

  .card,
  .stat-card {
    padding: 14px;
    border-radius: 14px;
  }

  .card-head {
    flex-direction: column;
    align-items: stretch;
  }

  .form-inline {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .form-actions > * {
    width: 100%;
  }

  .list-row {
    grid-template-columns: 1fr;
  }

  .list-row > .table-actions,
  .list-row > button,
  .list-row > .btn-secondary {
    width: 100%;
  }

  .total-box {
    flex-direction: column;
    align-items: flex-start;
  }

  .line-item {
    flex-direction: column;
    align-items: stretch;
  }

  .line-item .mini-btn,
  .line-item .danger {
    width: 100%;
  }

  .table th,
  .table td {
    padding: 10px 8px;
    font-size: 13px;
  }

  .summary-pill strong {
    font-size: 16px;
  }

  .stat-card strong {
    font-size: 24px;
  }

  .bo-modal-card {
    width: calc(100% - 20px);
    max-height: calc(100dvh - 20px);
    margin: 10px auto 0;
    border-radius: 16px;
  }

  .bo-modal-head,
  .bo-modal-foot,
  .bo-modal-body {
    padding: 14px;
  }
}

/* ======================================================
   Assistant Stripe Connect - Plateforme SaaS
   Version compacte avec boutons toujours visibles
   ====================================================== */

body[data-page="platform"] #pageSummary {
  display: none !important;
}

body[data-page="platform"] .bo-main {
  padding: 12px 16px;
  gap: 10px;
  overflow: hidden;
}

body[data-page="platform"] .page-panel-platform {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  gap: 0;
  overflow: hidden;
}

body[data-page="platform"] .bo-platform-wizard {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 18px;
}

/* En-tête de l'étape */
body[data-page="platform"] .bo-wizard-head {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 12px 18px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

body[data-page="platform"] .bo-wizard-head h3 {
  margin: 4px 0 4px;
  font-size: clamp(23px, 2vw, 32px);
  line-height: 1.05;
}

body[data-page="platform"] .bo-wizard-head p {
  margin: 0;
  max-width: 760px;
  color: var(--muted, #a8b3cf);
  font-size: 0.92rem;
  line-height: 1.35;
}

body[data-page="platform"] .bo-wizard-percent {
  flex: 0 0 auto;
  min-width: 96px;
  padding: 10px 12px;
  border-radius: 18px;
  text-align: center;
  background:
    radial-gradient(
      circle at top left,
      rgba(99, 102, 241, 0.35),
      transparent 52%
    ),
    rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.22);
}

body[data-page="platform"] .bo-wizard-percent strong {
  display: block;
  font-size: 26px;
  line-height: 1;
}

body[data-page="platform"] .bo-wizard-percent span {
  display: block;
  margin-top: 4px;
  color: var(--muted, #a8b3cf);
  font-size: 0.76rem;
}

/* Barre de progression */
body[data-page="platform"] .bo-wizard-progress {
  flex: 0 0 auto;
  height: 8px;
  margin: 0 20px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.16);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

body[data-page="platform"] .bo-wizard-progress span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #38bdf8, #6366f1, #a855f7);
  transition: width 0.35s ease;
}

/* Numéros d'étapes */
body[data-page="platform"] .bo-wizard-stepper {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(12, minmax(28px, 1fr));
  gap: 8px;
  padding: 10px 20px 12px;
}

body[data-page="platform"] .bo-wizard-dot {
  min-height: 34px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted, #a8b3cf);
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    color 0.18s ease;
}

body[data-page="platform"] .bo-wizard-dot:hover {
  transform: translateY(-1px);
  border-color: rgba(129, 140, 248, 0.6);
}

body[data-page="platform"] .bo-wizard-dot.is-active {
  color: #ffffff;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  border-color: rgba(199, 210, 254, 0.8);
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.28);
}

body[data-page="platform"] .bo-wizard-dot.is-done {
  color: #bbf7d0;
  background: rgba(22, 163, 74, 0.16);
  border-color: rgba(34, 197, 94, 0.34);
}

/* Zone centrale scrollable */
body[data-page="platform"] .bo-platform-steps {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 20px 12px;
  scroll-padding-bottom: 18px;
}

body[data-page="platform"] .bo-platform-step[hidden] {
  display: none !important;
}

body[data-page="platform"] .bo-platform-step.is-active {
  animation: boStepIn 0.2s ease-out;
}

@keyframes boStepIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Carte de l'étape */
body[data-page="platform"] .bo-step-card {
  position: relative;
  padding: 16px 18px;
  border-radius: 22px;
  background:
    radial-gradient(
      circle at top right,
      rgba(56, 189, 248, 0.12),
      transparent 36%
    ),
    rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

body[data-page="platform"] .bo-step-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(96, 165, 250, 0.25);
  font-weight: 800;
  font-size: 0.78rem;
}

body[data-page="platform"] .bo-step-card h3 {
  margin: 0 0 10px;
  font-size: clamp(24px, 2.35vw, 36px);
  line-height: 1.05;
}

body[data-page="platform"] .bo-step-card p {
  margin: 0 0 10px;
  font-size: 0.98rem;
  line-height: 1.45;
}

body[data-page="platform"] .bo-code-list {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}

body[data-page="platform"] .bo-code-list code {
  display: block;
  padding: 9px 11px;
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.34);
  border: 1px solid rgba(148, 163, 184, 0.16);
  color: #e5edff;
  font-size: 0.86rem;
  line-height: 1.35;
  white-space: normal;
  word-break: break-word;
}

body[data-page="platform"] .bo-callout,
body[data-page="platform"] .bo-action-box {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 16px;
}

body[data-page="platform"] .bo-callout {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(129, 140, 248, 0.28);
}

body[data-page="platform"] .bo-action-box {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.24);
}

body[data-page="platform"] .bo-action-box strong {
  display: block;
  color: #bbf7d0;
  margin-bottom: 4px;
}

body[data-page="platform"] .bo-action-box p {
  margin: 0;
}

body[data-page="platform"] .bo-warning-box {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.22);
}

body[data-page="platform"] .bo-warning-box strong {
  color: #fecaca;
}

body[data-page="platform"] .bo-step-list,
body[data-page="platform"] .bo-warning-box ul {
  margin: 10px 0 0;
  padding-left: 22px;
}

body[data-page="platform"] .bo-step-list li,
body[data-page="platform"] .bo-warning-box li {
  margin: 4px 0;
  font-size: 0.95rem;
  line-height: 1.35;
}

body[data-page="platform"] .bo-platform-steps .muted {
  margin: 10px 0 4px;
  font-size: 0.92rem;
}

/* Boutons fixes en bas de l'assistant */
body[data-page="platform"] .bo-wizard-actions {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 20px 12px;
  margin: 0;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(18, 26, 47, 0.96);
}

body[data-page="platform"] .bo-wizard-actions button {
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.92rem;
}

body[data-page="platform"] .bo-wizard-actions [data-platform-next] {
  min-width: 210px;
}

body[data-page="platform"] .bo-wizard-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Écrans moins hauts : on compacte encore */
@media (max-height: 900px) {
  body[data-page="platform"] .bo-main {
    padding: 10px 14px;
    gap: 8px;
  }

  body[data-page="platform"] .bo-wizard-head {
    padding: 9px 16px 8px;
  }

  body[data-page="platform"] .bo-wizard-head h3 {
    font-size: clamp(21px, 1.8vw, 28px);
  }

  body[data-page="platform"] .bo-wizard-head p {
    font-size: 0.86rem;
    line-height: 1.25;
  }

  body[data-page="platform"] .bo-wizard-percent {
    min-width: 82px;
    padding: 8px 10px;
    border-radius: 16px;
  }

  body[data-page="platform"] .bo-wizard-percent strong {
    font-size: 22px;
  }

  body[data-page="platform"] .bo-wizard-percent span {
    font-size: 0.7rem;
  }

  body[data-page="platform"] .bo-wizard-progress {
    height: 6px;
  }

  body[data-page="platform"] .bo-wizard-stepper {
    gap: 6px;
    padding: 8px 18px 9px;
  }

  body[data-page="platform"] .bo-wizard-dot {
    min-height: 30px;
    font-size: 0.8rem;
  }

  body[data-page="platform"] .bo-platform-steps {
    padding: 8px 18px 10px;
  }

  body[data-page="platform"] .bo-step-card {
    padding: 13px 15px;
    border-radius: 18px;
  }

  body[data-page="platform"] .bo-step-card h3 {
    font-size: clamp(21px, 2vw, 30px);
    margin-bottom: 8px;
  }

  body[data-page="platform"] .bo-step-card p {
    font-size: 0.92rem;
    line-height: 1.35;
  }

  body[data-page="platform"] .bo-callout,
  body[data-page="platform"] .bo-action-box,
  body[data-page="platform"] .bo-warning-box {
    margin: 9px 0;
    padding: 10px 12px;
    border-radius: 14px;
  }

  body[data-page="platform"] .bo-step-list li,
  body[data-page="platform"] .bo-warning-box li {
    font-size: 0.9rem;
    line-height: 1.28;
  }

  body[data-page="platform"] .bo-wizard-actions {
    padding: 8px 18px 10px;
  }

  body[data-page="platform"] .bo-wizard-actions button {
    min-height: 36px;
    padding: 7px 11px;
    font-size: 0.88rem;
  }
}

/* Très petits laptops */
@media (max-height: 760px) {
  body[data-page="platform"] .bo-wizard-head p {
    display: none;
  }

  body[data-page="platform"] .bo-wizard-head h3 {
    margin-bottom: 0;
  }

  body[data-page="platform"] .bo-step-badge {
    display: none;
  }
}

/* Responsive tablette / mobile */
@media (max-width: 980px) {
  body[data-page="platform"] {
    height: auto;
    min-height: 100%;
    overflow-y: auto;
  }

  body[data-page="platform"] .bo-main,
  body[data-page="platform"] .page-panel-platform,
  body[data-page="platform"] .bo-platform-wizard {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  body[data-page="platform"] .bo-platform-steps {
    overflow: visible;
  }

  body[data-page="platform"] .bo-wizard-head {
    flex-direction: column;
    align-items: stretch;
  }

  body[data-page="platform"] .bo-wizard-percent {
    width: 100%;
  }

  body[data-page="platform"] .bo-wizard-stepper {
    grid-template-columns: repeat(6, 1fr);
  }

  body[data-page="platform"] .bo-wizard-actions {
    flex-direction: column;
    align-items: stretch;
  }

  body[data-page="platform"] .bo-wizard-actions [data-platform-next] {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 560px) {
  body[data-page="platform"] .bo-wizard-stepper {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ==========================================================
   Blocage licence / fil client

.check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin: 10px 0 14px;
}

.check-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.thread-list {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow: auto;
  margin-bottom: 14px;
  padding-right: 4px;
}

.thread-message {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.thread-message.is-admin {
  border-color: rgba(132, 169, 255, 0.24);
}

.thread-message.is-client {
  border-color: rgba(61, 213, 152, 0.24);
  background: rgba(61, 213, 152, 0.055);
}

.thread-message-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 4px;
}

.thread-message-head span {
  color: var(--muted);
  font-size: 0.78rem;
}

.thread-message p {
  margin: 8px 0 0;
  line-height: 1.5;
}

/* ==========================================================
   Suivi / relance / blocage programmé des licences

.license-followup-form .followup-box {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(132, 169, 255, 0.18);
  background: rgba(132, 169, 255, 0.06);
}

.followup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}

.followup-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.license-followup-form .message--warning,
.message.message--warning {
  background: rgba(255, 207, 90, 0.12);
  border: 1px solid rgba(255, 207, 90, 0.28);
  color: #ffe9a8;
}

@media (max-width: 700px) {
  .followup-grid,
  .check-grid {
    grid-template-columns: 1fr;
  }
}

/* ======================================================
   DevBoard / Roadmap & Bugs
   ====================================================== */

.page-panel-devboard:not([hidden]) {
  min-height: 0;
}

.devboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.65fr);
  gap: 16px;
  min-height: 0;
  flex: 1 1 auto;
}

.devboard-head {
  align-items: flex-start;
}

.devboard-toolbar {
  display: grid;
  grid-template-columns:
    minmax(170px, 1fr) minmax(150px, 0.8fr) minmax(150px, 0.8fr)
    auto auto;
  gap: 10px;
  margin-bottom: 14px;
  flex: 0 0 auto;
}

.devboard-check {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  min-height: 44px;
}

.devboard-check input {
  width: auto;
}

.devboard-items {
  display: grid;
  gap: 12px;
}

.devboard-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    transform 0.16s ease;
}

.devboard-card:hover,
.devboard-card.is-selected {
  border-color: rgba(132, 169, 255, 0.28);
  background: rgba(132, 169, 255, 0.06);
  transform: translateY(-1px);
}

.devboard-card-top,
.devboard-card-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.devboard-card-id {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.devboard-card h3 {
  font-size: 17px;
  line-height: 1.25;
}

.devboard-card p {
  margin: 10px 0;
  color: #dbe7fb;
}

.devboard-badges,
.devboard-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.devboard-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.devboard-badge--urgent,
.devboard-badge--critical {
  background: rgba(255, 207, 90, 0.14);
  color: #ffe9a6;
  border-color: rgba(255, 207, 90, 0.28);
}

.devboard-badge--blocked,
.devboard-badge--bug {
  background: rgba(255, 107, 107, 0.14);
  color: #ffc9c9;
  border-color: rgba(255, 107, 107, 0.28);
}

.devboard-badge--in_progress,
.devboard-badge--testing,
.devboard-badge--high {
  background: rgba(132, 169, 255, 0.14);
  color: #dbe6ff;
  border-color: rgba(132, 169, 255, 0.3);
}

.devboard-badge--done,
.devboard-badge--published,
.devboard-badge--public {
  background: rgba(61, 213, 152, 0.13);
  color: #b9f8df;
  border-color: rgba(61, 213, 152, 0.28);
}

.devboard-tags span {
  color: var(--muted);
  font-size: 12px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
}

.devboard-latest-note {
  margin-top: 10px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  color: #dbe7fb;
  font-size: 13px;
}

.devboard-card-footer {
  margin-top: 12px;
  align-items: center;
}

.devboard-editor-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.devboard-editor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.devboard-public-toggle {
  justify-content: flex-start;
  margin-top: 4px;
}

.devboard-notes-block {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 16px;
}

.devboard-notes-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.devboard-note {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.devboard-note p {
  margin: 6px 0 0;
}

@media (max-width: 1180px) {
  .devboard-layout,
  .devboard-toolbar,
  .devboard-editor-grid {
    grid-template-columns: 1fr;
  }

  .devboard-check {
    justify-content: flex-start;
  }
}

/* ======================================================
   DevBoard — Kanban principal + actions internes
   ====================================================== */

.page-panel-devboard:not([hidden]) {
  min-height: 0;
}
.devboard-layout {
  display: block;
  min-height: auto;
}
.devboard-list-card {
  min-height: auto;
  overflow: visible;
}
.devboard-head {
  align-items: flex-start;
  gap: 16px;
}
.devboard-view-actions {
  justify-content: flex-end;
  align-items: center;
}
.devboard-view-actions [data-devboard-view].is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #08111f;
  box-shadow: 0 10px 26px rgba(132, 169, 255, 0.2);
}
.devboard-searchbar {
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin: 14px 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(132, 169, 255, 0.2);
  border-radius: 16px;
  background: rgba(132, 169, 255, 0.06);
}
.devboard-searchbar i {
  color: var(--accent);
}
.devboard-searchbar input {
  border: 0;
  background: transparent;
  padding: 8px 4px;
  color: var(--text);
  outline: none;
}
.devboard-toolbar {
  display: grid;
  grid-template-columns:
    minmax(180px, 1.1fr) minmax(160px, 0.8fr) minmax(160px, 0.8fr)
    auto auto;
  gap: 10px;
  margin-bottom: 14px;
  align-items: center;
}
.devboard-check {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  min-height: 44px;
}
.devboard-check input {
  width: auto;
}
#devboardKanban,
#devboardItems {
  max-height: none;
  min-height: auto;
  overflow: visible;
  padding-right: 0;
}
#devboardKanban[hidden],
#devboardItems[hidden] {
  display: none !important;
}
.devboard-kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(190px, 1fr));
  gap: 10px;
  align-items: stretch;
}
.devboard-kanban-column {
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
  padding: 10px;
  transition:
    border-color 0.16s ease,
    background 0.16s ease;
}
.devboard-kanban-column.is-drag-over,
.devboard-action-column.is-drag-over {
  border-color: rgba(61, 213, 152, 0.55);
  background: rgba(61, 213, 152, 0.08);
}
.devboard-kanban-column__head,
.devboard-action-column__head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.devboard-kanban-column__head span,
.devboard-action-column__head span {
  display: inline-flex;
  min-width: 28px;
  height: 28px;
  justify-content: center;
  align-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-weight: 800;
}
.devboard-kanban-column__items {
  display: grid;
  gap: 10px;
  align-content: start;
}
.devboard-kanban-card,
.devboard-card {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(11, 16, 32, 0.55);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}
.devboard-kanban-card {
  cursor: grab;
}
.devboard-kanban-card.is-selected,
.devboard-card.is-selected {
  border-color: rgba(132, 169, 255, 0.5);
  background: rgba(132, 169, 255, 0.08);
}
.devboard-kanban-card.is-hot {
  border-color: rgba(255, 207, 90, 0.35);
  background: linear-gradient(
    180deg,
    rgba(255, 207, 90, 0.08),
    rgba(11, 16, 32, 0.55)
  );
}
.devboard-kanban-card__head,
.devboard-card-top,
.devboard-card-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}
.devboard-card-id {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}
.devboard-badges,
.devboard-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.devboard-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}
.devboard-badge--urgent,
.devboard-badge--critical {
  background: rgba(255, 207, 90, 0.14);
  color: #ffe9a6;
  border-color: rgba(255, 207, 90, 0.28);
}
.devboard-badge--blocked,
.devboard-badge--bug {
  background: rgba(255, 107, 107, 0.14);
  color: #ffc9c9;
  border-color: rgba(255, 107, 107, 0.28);
}
.devboard-badge--in_progress,
.devboard-badge--testing,
.devboard-badge--high {
  background: rgba(132, 169, 255, 0.14);
  color: #dbe6ff;
  border-color: rgba(132, 169, 255, 0.3);
}
.devboard-badge--done,
.devboard-badge--published,
.devboard-badge--public {
  background: rgba(61, 213, 152, 0.13);
  color: #b9f8df;
  border-color: rgba(61, 213, 152, 0.28);
}
.devboard-badge--meta {
  background: rgba(255, 255, 255, 0.06);
  color: #cfd8f6;
  border-color: rgba(255, 255, 255, 0.1);
}
.devboard-tags span {
  color: var(--muted);
  font-size: 12px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
}
.devboard-progress {
  margin-top: 10px;
}
.devboard-progress__head {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}
.devboard-progress__bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.devboard-progress__bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--ok);
  transition: width 0.2s ease;
}
.devboard-latest-note {
  margin-top: 10px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  color: #dbe7fb;
  font-size: 13px;
}
.devboard-items {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.devboard-editor-card {
  position: fixed;
  z-index: 150;
  top: 0;
  right: 0;
  width: min(600px, calc(100vw - 22px));
  height: 100dvh;
  border-radius: 18px 0 0 18px;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  transform: translateX(110%);
  transition: transform 0.2s ease;
  box-shadow: -28px 0 80px rgba(0, 0, 0, 0.45);
}
.devboard-editor-card.is-open {
  transform: translateX(0);
}
.devboard-editor-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}
.devboard-editor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.devboard-actions-block,
.devboard-notes-block,
.devboard-history-block {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 16px;
}
.devboard-subsection-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}
.devboard-actions-progress {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(61, 213, 152, 0.25);
  color: #b9f8df;
  background: rgba(61, 213, 152, 0.08);
  font-weight: 800;
}
.devboard-action-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 130px 130px auto;
  gap: 10px;
  margin-bottom: 10px;
}
.devboard-action-kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.devboard-action-column {
  min-height: 160px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  padding: 8px;
}
.devboard-action-card {
  cursor: grab;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px;
  background: rgba(255, 255, 255, 0.035);
  margin-bottom: 8px;
}
.devboard-action-card.is-hot {
  border-color: rgba(255, 207, 90, 0.35);
  background: rgba(255, 207, 90, 0.06);
}
.devboard-action-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.devboard-action-card p {
  margin: 7px 0 0;
  color: #dbe7fb;
  font-size: 13px;
}
.devboard-note-options {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto auto;
  gap: 10px;
  margin-bottom: 10px;
}
.devboard-note,
.devboard-history-item {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}
.devboard-note.is-important {
  border-color: rgba(255, 207, 90, 0.32);
  background: rgba(255, 207, 90, 0.06);
}
.devboard-note-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 6px;
}
.devboard-note-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.devboard-notes-list,
.devboard-history-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}
.devboard-history-item {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 10px;
}
.devboard-history-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(132, 169, 255, 0.12);
}
@media (max-width: 1500px) {
  .devboard-kanban {
    grid-template-columns: repeat(3, minmax(220px, 1fr));
  }
  .devboard-action-kanban {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }
}
@media (max-width: 980px) {
  .devboard-kanban,
  .devboard-toolbar,
  .devboard-searchbar,
  .devboard-items,
  .devboard-editor-grid,
  .devboard-action-form,
  .devboard-action-kanban,
  .devboard-note-options {
    grid-template-columns: 1fr;
  }
}

/* ======================================================
   Correctif DevBoard — réactive le défilement vertical
   ====================================================== */

body[data-page="devboard"] {
  height: 100dvh;
  overflow: hidden;
}

body[data-page="devboard"] .bo-shell,
body[data-page="devboard"] .bo-main {
  min-height: 0;
}

body[data-page="devboard"] .bo-main {
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding-bottom: 48px;
}

body[data-page="devboard"] .page-panel-devboard:not([hidden]) {
  display: block;
  min-height: auto;
  overflow: visible;
}

body[data-page="devboard"] .devboard-layout,
body[data-page="devboard"] .devboard-list-card,
body[data-page="devboard"] #devboardKanban,
body[data-page="devboard"] #devboardItems {
  min-height: auto;
  max-height: none;
  overflow: visible;
}

body[data-page="devboard"] .devboard-kanban {
  align-items: flex-start;
}

body[data-page="devboard"] .devboard-kanban-column {
  min-height: 520px;
  height: auto;
  max-height: none;
}

body[data-page="devboard"] .devboard-kanban-column__items {
  max-height: none;
  overflow: visible;
}

body[data-page="devboard"] .devboard-items {
  max-height: none;
  overflow: visible;
}

/* ======================================================
   DevBoard Corbeille / restauration
   ====================================================== */

.devboard-trash-panel {
  margin: 14px 0 16px;
  padding: 14px;
  border: 1px solid rgba(255, 207, 90, 0.25);
  border-radius: 18px;
  background: rgba(255, 207, 90, 0.06);
}

.devboard-trash-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.devboard-trash-head h3 {
  margin: 0 0 4px;
}

.devboard-trash-list {
  display: grid;
  gap: 10px;
}

.devboard-trash-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(11, 16, 32, 0.45);
}

@media (max-width: 760px) {
  .devboard-trash-head,
  .devboard-trash-card {
    grid-template-columns: 1fr;
    display: grid;
  }
}

/* ======================================================
   DevBoard — modèles rapides
   ====================================================== */

.devboard-templatebar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(132, 169, 255, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
}

.devboard-templatebar .mini-btn {
  min-height: 32px;
  border-color: rgba(132, 169, 255, 0.22);
}

.devboard-templatebar .mini-btn:not(.btn-secondary) {
  background: rgba(132, 169, 255, 0.14);
}

@media (max-width: 760px) {
  .devboard-templatebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .devboard-templatebar .muted {
    grid-column: 1 / -1;
  }
}

/* ======================================================
   DevBoard — correction lisibilité modèles rapides
   ====================================================== */

.devboard-templatebar {
  background: rgba(132, 169, 255, 0.055);
  border-color: rgba(132, 169, 255, 0.22);
}

.devboard-templatebar .muted {
  color: #dbe7fb;
  font-weight: 800;
}

.devboard-templatebar .mini-btn,
.devboard-templatebar .mini-btn.btn-secondary {
  color: #f7faff !important;
  font-weight: 900;
  letter-spacing: 0.01em;
  background: rgba(132, 169, 255, 0.2) !important;
  border: 1px solid rgba(132, 169, 255, 0.44) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.devboard-templatebar .mini-btn:hover,
.devboard-templatebar .mini-btn.btn-secondary:hover,
.devboard-templatebar .mini-btn:focus-visible,
.devboard-templatebar .mini-btn.btn-secondary:focus-visible {
  color: #08111f !important;
  background: #a9bfff !important;
  border-color: #c5d3ff !important;
  outline: none;
  transform: translateY(-1px);
}

.devboard-templatebar .mini-btn:active,
.devboard-templatebar .mini-btn.btn-secondary:active {
  transform: translateY(0);
}

/* ======================================================
   DevBoard — correctif contours cartes v3
   Objectif : renforcer les cartes normales sans écraser
   le style spécial Urgent / Bloquant.
   ====================================================== */

body[data-page="devboard"] .devboard-card:not(.is-hot),
body[data-page="devboard"] .devboard-kanban-card:not(.is-hot) {
  border: 1px solid rgba(132, 169, 255, 0.38) !important;
  border-left: 4px solid rgba(132, 169, 255, 0.68) !important;
  background:
    linear-gradient(
        180deg,
        rgba(132, 169, 255, 0.075),
        rgba(255, 255, 255, 0.025)
      )
      !important,
    rgba(11, 16, 32, 0.64) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.055),
    0 0 0 1px rgba(132, 169, 255, 0.055),
    0 12px 30px rgba(0, 0, 0, 0.24) !important;
}

body[data-page="devboard"] .devboard-card:not(.is-hot):hover,
body[data-page="devboard"] .devboard-kanban-card:not(.is-hot):hover {
  border-color: rgba(132, 169, 255, 0.56) !important;
  border-left-color: rgba(132, 169, 255, 0.92) !important;
  background:
    linear-gradient(
        180deg,
        rgba(132, 169, 255, 0.105),
        rgba(255, 255, 255, 0.032)
      )
      !important,
    rgba(11, 16, 32, 0.72) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 0 0 1px rgba(132, 169, 255, 0.1),
    0 16px 38px rgba(0, 0, 0, 0.3) !important;
}

body[data-page="devboard"] .devboard-kanban-card.is-hot,
body[data-page="devboard"] .devboard-card.is-hot {
  border: 1px solid rgba(255, 207, 90, 0.5) !important;
  border-left: 4px solid rgba(255, 207, 90, 0.96) !important;
  background:
    linear-gradient(
        180deg,
        rgba(255, 207, 90, 0.12),
        rgba(255, 107, 107, 0.035)
      )
      !important,
    rgba(11, 16, 32, 0.64) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 0 1px rgba(255, 207, 90, 0.08),
    0 12px 30px rgba(0, 0, 0, 0.26) !important;
}

body[data-page="devboard"] .devboard-kanban-card.is-hot:hover,
body[data-page="devboard"] .devboard-card.is-hot:hover {
  border-color: rgba(255, 207, 90, 0.68) !important;
  border-left-color: rgba(255, 207, 90, 1) !important;
  background:
    linear-gradient(
        180deg,
        rgba(255, 207, 90, 0.16),
        rgba(255, 107, 107, 0.045)
      )
      !important,
    rgba(11, 16, 32, 0.72) !important;
}

/* =========================================================
   Licences - interface guidée
   ========================================================= */
.license-simple-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  overflow: hidden;
}

.license-simple-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid rgba(132, 169, 255, 0.16);
  border-radius: 18px;
  background: linear-gradient(
    135deg,
    rgba(132, 169, 255, 0.1),
    rgba(255, 255, 255, 0.02)
  );
}

.license-simple-intro h3 {
  margin: 0 0 6px;
  font-size: 22px;
}

.license-simple-intro p {
  margin: 0;
  max-width: 760px;
}

.license-simple-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 13px;
}

.license-simple-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
}

.license-simple-legend .dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  display: inline-block;
}

.license-simple-legend .dot.ok {
  background: var(--ok);
}
.license-simple-legend .dot.warn {
  background: var(--warning);
}
.license-simple-legend .dot.danger {
  background: var(--danger);
}

.license-card-list {
  display: grid;
  gap: 14px;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.license-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 20px;
  background: rgba(18, 26, 47, 0.86);
  box-shadow: var(--shadow);
}

.license-card.is-active {
  border-left-color: var(--ok);
}
.license-card.is-warning,
.license-card.is-expired {
  border-left-color: var(--warning);
}
.license-card.is-blocked {
  border-left-color: var(--danger);
}

.license-card-main,
.license-card-actions {
  min-width: 0;
}

.license-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.license-card-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.license-card-title-row h3 {
  font-size: 20px;
}

.license-card-plan {
  flex: 0 0 auto;
  min-width: 112px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  text-align: right;
}

.license-card-plan span,
.license-field-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.license-card-plan strong {
  font-size: 16px;
}

.license-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.license-card-grid > div,
.license-client-preview {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.license-card-grid strong {
  display: block;
  overflow-wrap: anywhere;
}

.license-client-preview p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.license-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.license-alert-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  color: #fff5dc;
  background: rgba(255, 207, 90, 0.14);
  border: 1px solid rgba(255, 207, 90, 0.3);
  font-weight: 800;
  font-size: 12px;
}

.license-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.license-pill.is-active {
  color: #c9fce6;
  background: rgba(61, 213, 152, 0.12);
  border-color: rgba(61, 213, 152, 0.28);
}

.license-pill.is-warning,
.license-pill.is-expired {
  color: #fff0be;
  background: rgba(255, 207, 90, 0.12);
  border-color: rgba(255, 207, 90, 0.28);
}

.license-pill.is-blocked {
  color: #ffd8d8;
  background: rgba(255, 107, 107, 0.12);
  border-color: rgba(255, 107, 107, 0.3);
}

.license-card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-self: stretch;
}

.license-card-actions .mini-btn,
.license-card-actions .context-btn {
  width: 100%;
  justify-content: center;
  text-align: center;
  min-height: 38px;
}

.license-guided-modal {
  display: grid;
  gap: 14px;
}

.license-guided-summary {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(132, 169, 255, 0.18);
  border-radius: 16px;
  background: rgba(132, 169, 255, 0.08);
}

.license-guided-summary h3,
.license-guided-summary p,
.license-guided-step h4,
.license-guided-step p {
  margin: 0;
}

.license-guided-step {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
}

.license-step-number {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(132, 169, 255, 0.18);
  border: 1px solid rgba(132, 169, 255, 0.28);
  font-weight: 900;
}

.license-action-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.license-action-choice-grid label,
.license-primary-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.license-action-choice-grid input,
.license-primary-check input {
  width: auto;
  margin-top: 4px;
  flex: 0 0 auto;
}

.license-action-choice-grid strong,
.license-action-choice-grid span,
.license-primary-check span,
.license-primary-check small {
  display: block;
}

.license-action-choice-grid span,
.license-primary-check small {
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.35;
}

.license-advanced-settings {
  border: 1px dashed rgba(132, 169, 255, 0.28);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
}

.license-advanced-settings summary {
  cursor: pointer;
  color: #c8d6ff;
  font-weight: 800;
}

.license-advanced-settings .form-stack {
  margin-top: 14px;
}

@media (max-width: 1100px) {
  .license-card {
    grid-template-columns: 1fr;
  }

  .license-card-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .license-card-grid,
  .license-action-choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .license-simple-intro,
  .license-card-top,
  .license-guided-summary {
    flex-direction: column;
  }

  .license-card-grid,
  .license-action-choice-grid,
  .license-card-actions {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   Ajustements UX licences : choix client + paramètres avancés
   ========================================================= */
.license-action-choice-grid label {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  min-height: 132px;
  padding: 16px;
}

.license-action-choice-grid input,
.license-primary-check input,
.license-advanced-check input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}

.license-choice-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.license-choice-copy strong {
  display: block;
  line-height: 1.22;
  font-size: 15px;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.license-choice-copy span {
  display: block;
  color: var(--muted);
  line-height: 1.45;
  font-size: 13px;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.license-guided-step .form-stack > .muted {
  margin-top: -4px;
}

.license-advanced-settings summary {
  padding: 4px 0;
}

.license-advanced-help {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(132, 169, 255, 0.18);
  border-radius: 14px;
  background: rgba(132, 169, 255, 0.08);
  color: #c8d6ff;
  line-height: 1.45;
}

.followup-grid label small,
.license-advanced-check small {
  display: block;
  color: var(--muted);
  line-height: 1.35;
  margin: 4px 0 8px;
  font-size: 12px;
}

.license-advanced-check-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.license-advanced-check {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.license-advanced-check strong {
  display: block;
  font-size: 14px;
  line-height: 1.25;
}

@media (max-width: 980px) {
  .license-action-choice-grid,
  .license-advanced-check-grid {
    grid-template-columns: 1fr;
  }

  .license-action-choice-grid label {
    min-height: auto;
  }
}

/* =========================================================
   Ajustements UX licences — version nettoyée
   ========================================================= */
.license-payment-help {
  margin: 10px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 207, 90, 0.22);
  border-radius: 12px;
  background: rgba(255, 207, 90, 0.08);
  color: #f8e3a1;
  line-height: 1.45;
  font-size: 13px;
}

.license-action-choice-grid label,
.license-primary-check,
.license-advanced-check {
  display: grid !important;
  grid-template-columns: 24px minmax(0, 1fr) !important;
  align-items: start !important;
  gap: 12px !important;
  cursor: pointer;
}

.license-action-choice-grid label:has(input:checked),
.license-advanced-check:has(input:checked),
.license-primary-check:has(input:checked) {
  border-color: rgba(132, 169, 255, 0.42);
  background: rgba(132, 169, 255, 0.085);
}

.license-action-choice-grid label,
.license-primary-check {
  min-height: 128px;
}

.license-advanced-check {
  min-height: 128px !important;
  padding: 14px !important;
}

.license-action-card input[type="checkbox"],
.license-advanced-check input[type="checkbox"],
.license-choice-card input[type="checkbox"],
.license-block-modal input[type="checkbox"],
.license-action-choice-grid input[type="checkbox"],
.license-primary-check input[type="checkbox"] {
  appearance: none !important;
  -webkit-appearance: none !important;
  flex: 0 0 18px !important;
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  margin: 3px 0 0 !important;
  padding: 0 !important;
  border-radius: 3px !important;
  border: 2px solid rgba(255, 255, 255, 0.78) !important;
  background: #ffffff !important;
  box-shadow: none !important;
  display: block !important;
  cursor: pointer !important;
  position: relative !important;
  opacity: 1 !important;
}

.license-action-card input[type="checkbox"]:checked,
.license-advanced-check input[type="checkbox"]:checked,
.license-choice-card input[type="checkbox"]:checked,
.license-block-modal input[type="checkbox"]:checked,
.license-action-choice-grid input[type="checkbox"]:checked,
.license-primary-check input[type="checkbox"]:checked {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 2px rgba(132, 169, 255, 0.15) !important;
}

.license-action-card input[type="checkbox"]:checked::after,
.license-advanced-check input[type="checkbox"]:checked::after,
.license-choice-card input[type="checkbox"]:checked::after,
.license-block-modal input[type="checkbox"]:checked::after,
.license-action-choice-grid input[type="checkbox"]:checked::after,
.license-primary-check input[type="checkbox"]:checked::after {
  content: "" !important;
  position: absolute !important;
  left: 3px !important;
  top: 0px !important;
  width: 4px !important;
  height: 9px !important;
  border: solid #111827 !important;
  border-width: 0 3px 3px 0 !important;
  transform: rotate(45deg) !important;
}

.license-action-card input[type="checkbox"]:focus-visible,
.license-advanced-check input[type="checkbox"]:focus-visible,
.license-choice-card input[type="checkbox"]:focus-visible,
.license-block-modal input[type="checkbox"]:focus-visible,
.license-action-choice-grid input[type="checkbox"]:focus-visible,
.license-primary-check input[type="checkbox"]:focus-visible {
  outline: none !important;
  box-shadow: 0 0 0 4px rgba(132, 169, 255, 0.24) !important;
}

.license-action-choice-grid label > span,
.license-primary-check > span,
.license-advanced-check > span,
.license-choice-copy {
  display: block !important;
  min-width: 0 !important;
}

.license-action-choice-grid label strong,
.license-primary-check strong,
.license-advanced-check strong,
.license-choice-copy strong {
  display: block !important;
  color: var(--text);
}

.license-action-choice-grid label span,
.license-primary-check small,
.license-advanced-check small,
.license-choice-copy span {
  display: block !important;
}

.license-advanced-settings summary {
  display: list-item !important;
  list-style-position: inside;
  cursor: pointer;
  color: #c8d6ff;
  font-weight: 800;
  padding: 8px 0;
}

.license-advanced-settings .followup-grid {
  gap: 14px;
}

.license-advanced-settings .followup-grid label {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
}

.license-advanced-settings .followup-grid label small {
  margin: -2px 0 0;
}

.license-advanced-check-grid {
  gap: 12px;
}

.license-advanced-check strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1.25;
}

.license-advanced-check small {
  margin-top: 7px;
  font-size: 12.5px;
  line-height: 1.45;
}

@media (max-width: 980px) {
  .license-action-choice-grid,
  .license-advanced-check-grid {
    grid-template-columns: 1fr;
  }

  .license-action-choice-grid label {
    min-height: auto;
  }
}

/* =========================================================
   Licences — paiement direct / virement
   ========================================================= */

.license-payment-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(132, 169, 255, 0.28);
  background: rgba(132, 169, 255, 0.1);
  color: #dbe7ff;
  font-size: 0.82rem;
  font-weight: 800;
}

.license-payment-action-modal {
  gap: 16px;
}

.license-payment-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.license-payment-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    transform 0.16s ease;
}

.license-payment-choice:hover,
.license-payment-choice.is-selected {
  transform: translateY(-1px);
  border-color: rgba(132, 169, 255, 0.38);
  background: rgba(132, 169, 255, 0.07);
}

.license-payment-choice input[type="radio"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.license-payment-choice strong {
  display: block;
  color: var(--text);
  margin-bottom: 4px;
}

.license-payment-choice small {
  display: block;
  line-height: 1.45;
}

.license-bank-transfer-block {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 207, 90, 0.25);
  background: rgba(255, 207, 90, 0.06);
}

@media (max-width: 760px) {
  .license-payment-choice-grid {
    grid-template-columns: 1fr;
  }
}

/* ======================================================
   Paiements — paiements licences et rapprochement virement
   ====================================================== */

.payment-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid rgba(132, 169, 255, 0.18);
  border-radius: 16px;
  background: rgba(132, 169, 255, 0.06);
}

.payment-toolbar p {
  margin: 4px 0 0;
}

.payment-type-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 900;
}

.payment-type-pill.is-license {
  color: #dbe6ff;
  background: rgba(132, 169, 255, 0.14);
  border-color: rgba(132, 169, 255, 0.3);
}

.payment-type-pill.is-order {
  color: #b9f8df;
  background: rgba(61, 213, 152, 0.12);
  border-color: rgba(61, 213, 152, 0.25);
}

.payment-reference-cell {
  display: grid;
  gap: 4px;
}

.payment-reference-cell strong {
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    monospace;
  letter-spacing: 0.02em;
}

.payment-reference-cell small {
  color: var(--muted);
}

@media (max-width: 760px) {
  .payment-toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }
}

/* ======================================================
   Paiements — import CSV bancaire / rapprochement
   ====================================================== */

.payment-toolbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.bank-import-help {
  padding: 14px;
  border: 1px solid rgba(132, 169, 255, 0.2);
  border-radius: 14px;
  background: rgba(132, 169, 255, 0.07);
}

.bank-import-help strong {
  display: block;
  margin-bottom: 6px;
}

.bank-import-help p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.bank-import-help code,
.bank-match-card code {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #eef3fb;
}

.bank-import-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.bank-import-summary-grid article {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.bank-import-summary-grid span,
.bank-match-grid span,
.bank-match-kicker {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

.bank-import-summary-grid strong {
  font-size: 20px;
}

.bank-import-results {
  display: grid;
  gap: 12px;
}

.bank-match-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.bank-match-card.is-exact {
  border-color: rgba(61, 213, 152, 0.35);
  background: rgba(61, 213, 152, 0.07);
}

.bank-match-card.is-amount_mismatch,
.bank-match-card.is-reference_only {
  border-color: rgba(255, 207, 90, 0.35);
  background: rgba(255, 207, 90, 0.07);
}

.bank-match-card.is-unknown,
.bank-match-card.is-already_paid {
  border-color: rgba(255, 255, 255, 0.12);
}

.bank-match-card__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.bank-match-status {
  flex: 0 0 auto;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  font-size: 12px;
  font-weight: 800;
}

.bank-match-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.bank-match-grid > div,
.bank-match-context {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(11, 16, 32, 0.36);
}

.bank-match-context {
  margin-top: 10px;
  color: #dbe7fb;
  font-weight: 700;
}

@media (max-width: 980px) {
  .bank-import-summary-grid,
  .bank-match-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .payment-toolbar-actions,
  .bank-match-card__head {
    flex-direction: column;
    align-items: stretch;
  }

  .payment-toolbar-actions > *,
  .bank-import-summary-grid,
  .bank-match-grid {
    width: 100%;
    grid-template-columns: 1fr;
  }
}

/* ======================================================
   Paiements — rapprochement bancaire intelligent
   ====================================================== */

.bank-import-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.bank-import-legend {
  display: flex;
  gap: 10px 14px;
  flex-wrap: wrap;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
}

.bank-confidence-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  margin-right: -6px;
}

.bank-confidence-dot.is-exact,
.bank-match-card.is-exact .bank-confidence-bar span {
  background: #3dd598;
}

.bank-confidence-dot.is-very_probable,
.bank-match-card.is-very_probable .bank-confidence-bar span {
  background: #84a9ff;
}

.bank-confidence-dot.is-probable,
.bank-match-card.is-probable .bank-confidence-bar span {
  background: #ffcf5a;
}

.bank-confidence-dot.is-review,
.bank-match-card.is-review .bank-confidence-bar span {
  background: #c4b5fd;
}

.bank-confidence-dot.is-conflict,
.bank-match-card.is-conflict .bank-confidence-bar span {
  background: #ff6b6b;
}

.bank-match-card.is-very_probable {
  border-color: rgba(132, 169, 255, 0.38);
  background: rgba(132, 169, 255, 0.075);
}

.bank-match-card.is-probable {
  border-color: rgba(255, 207, 90, 0.36);
  background: rgba(255, 207, 90, 0.065);
}

.bank-match-card.is-review {
  border-color: rgba(196, 181, 253, 0.32);
  background: rgba(196, 181, 253, 0.055);
}

.bank-match-card.is-conflict {
  border-color: rgba(255, 107, 107, 0.38);
  background: rgba(255, 107, 107, 0.08);
}

.bank-match-status-group {
  display: grid;
  gap: 6px;
  justify-items: end;
}

.bank-confidence-score {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.bank-confidence-bar {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  margin: 0 0 12px;
  background: rgba(255, 255, 255, 0.075);
  overflow: hidden;
}

.bank-confidence-bar span {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  transition: width 0.2s ease;
}

.bank-raw-reference {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    monospace;
}

.bank-confidence-reasons {
  display: grid;
  gap: 4px;
  margin: 10px 0;
  padding-left: 18px;
  color: #dbe7fb;
}

.bank-confidence-reasons li {
  line-height: 1.35;
}

.bank-suggestions {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  overflow: hidden;
}

.bank-suggestions summary {
  cursor: pointer;
  padding: 10px 12px;
  color: var(--muted);
  font-weight: 800;
}

.bank-suggestions-list {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
}

.bank-suggestion-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto;
  gap: 4px 10px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(11, 16, 32, 0.32);
  border: 1px solid var(--line);
}

.bank-suggestion-row strong {
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    monospace;
}

.bank-suggestion-row span {
  justify-self: end;
  font-weight: 900;
  color: #dbe7fb;
}

.bank-suggestion-row small {
  grid-column: 1 / -1;
  color: var(--muted);
}

@media (max-width: 980px) {
  .bank-import-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bank-match-status-group {
    justify-items: start;
  }
}

@media (max-width: 640px) {
  .bank-import-summary-grid,
  .bank-suggestion-row {
    grid-template-columns: 1fr;
  }

  .bank-suggestion-row span {
    justify-self: start;
  }
}

/* ======================================================
   Paiements — historique des rapprochements bancaires
   ====================================================== */

.bank-reconciliation-history {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.025);
}

.bank-reconciliation-history__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.bank-reconciliation-history__head p {
  margin: 4px 0 0;
}

.bank-history-count,
.bank-history-source {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(132, 169, 255, 0.22);
  background: rgba(132, 169, 255, 0.08);
  color: #dbe7ff;
  font-size: 12px;
  font-weight: 800;
}

.bank-history-list {
  display: grid;
  gap: 10px;
}

.bank-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(11, 16, 32, 0.28);
}

.bank-history-row.has-mismatch {
  border-color: rgba(255, 207, 90, 0.3);
  background: rgba(255, 207, 90, 0.06);
}

.bank-history-main {
  display: grid;
  gap: 4px;
}

.bank-history-main small {
  color: var(--muted);
  line-height: 1.35;
}

.bank-history-meta {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.bank-history-meta span:not(.bank-history-source) {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #dbe7fb;
  font-size: 12px;
  font-weight: 700;
}

.bank-history-details {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.bank-history-details summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 800;
}

.bank-history-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.bank-history-detail-grid > div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.bank-history-detail-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

@media (max-width: 980px) {
  .bank-history-row,
  .bank-reconciliation-history__head {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .bank-history-meta {
    justify-content: flex-start;
  }

  .bank-history-detail-grid {
    grid-template-columns: 1fr;
  }
}

/* ======================================================
   Paiements — validation bancaire par lot
   ====================================================== */

.bank-import-bulk-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border: 1px solid rgba(132, 169, 255, 0.18);
  border-radius: 16px;
  background: rgba(132, 169, 255, 0.055);
  margin: 12px 0;
}

.bank-import-bulk-actions strong,
.bank-import-bulk-actions span {
  display: block;
}

.bank-import-bulk-actions span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.bank-import-bulk-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (max-width: 760px) {
  .bank-import-bulk-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .bank-import-bulk-buttons,
  .bank-import-bulk-buttons > * {
    width: 100%;
  }
}

/* ======================================================
   Rapprochement bancaire — anti-doublon import CSV
   ====================================================== */

.dot-reconciled {
  background: #9ca3af;
}

.bank-match-card.is-already_reconciled {
  border-color: rgba(156, 163, 175, 0.36);
  background: rgba(156, 163, 175, 0.08);
}

.bank-duplicate-box {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(156, 163, 175, 0.26);
  background: rgba(156, 163, 175, 0.08);
  color: #e5e7eb;
}

.bank-duplicate-box strong {
  color: #f3f4f6;
}

.bank-duplicate-box span {
  color: var(--muted);
  font-size: 0.88rem;
}

/* ======================================================
   Paiements — export historique rapprochements bancaires
   ====================================================== */
.bank-history-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.bank-history-actions .mini-btn {
  min-height: 32px;
}

@media (max-width: 700px) {
  .bank-history-actions {
    width: 100%;
    justify-content: stretch;
  }

  .bank-history-actions .mini-btn,
  .bank-history-actions .bank-history-count {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
}

/* ======================================================
   Correctif Paiements — scroll vertical complet
   ====================================================== */

/* La page Paiements contient maintenant plusieurs blocs
   (rapprochement manuel, tableau, historique bancaire, futures sections).
   On fait donc défiler le contenu complet de la page au lieu de bloquer
   l'historique sous le tableau. */
#pagePayments > .card {
  min-height: 0;
  overflow: hidden;
}

#paymentsTable {
  flex: 1 1 auto;
  min-height: 0;
  display: block;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
}

#paymentsTable .payment-toolbar,
#paymentsTable .bank-reconciliation-history {
  flex: 0 0 auto;
}

#paymentsTable .table-wrap {
  flex: 0 0 auto;
  min-height: auto;
  max-height: 38vh;
  overflow: auto;
  margin-bottom: 16px;
}

/* L'historique a aussi son propre scroll interne quand il contient beaucoup
   de rapprochements, sans empêcher le reste de la page de défiler. */
.bank-reconciliation-history {
  max-height: none;
  overflow: visible;
}

.bank-history-list {
  max-height: 44vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
}

/* Les détails ouverts peuvent être longs : on évite qu'ils cassent la page. */
.bank-history-details[open] {
  max-height: 34vh;
  overflow-y: auto;
  padding-right: 4px;
}

@media (max-width: 980px) {
  #paymentsTable {
    overflow: visible;
    padding-right: 0;
  }

  #paymentsTable .table-wrap,
  .bank-history-list,
  .bank-history-details[open] {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
}

/* ======================================================
   Historique rapprochements bancaires — annulation
   ====================================================== */

.bank-history-row.is-cancelled {
  opacity: 0.74;
  border-style: dashed;
  background: rgba(255, 255, 255, 0.018);
}

.bank-history-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.bank-history-state.is-validated {
  color: #b9f8df;
  background: rgba(61, 213, 152, 0.11);
  border-color: rgba(61, 213, 152, 0.22);
}

.bank-history-state.is-cancelled {
  color: #ffd4d4;
  background: rgba(255, 107, 107, 0.12);
  border-color: rgba(255, 107, 107, 0.25);
}

.bank-history-row-actions {
  margin-top: 12px;
  margin-bottom: 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.bank-history-row-actions .danger {
  color: #fff;
}

/* ======================================================
   Historique rapprochements bancaires — filtres avancés
   ====================================================== */

.bank-history-filters {
  display: grid;
  grid-template-columns:
    minmax(220px, 1.4fr) repeat(3, minmax(145px, 0.8fr))
    auto;
  gap: 10px;
  align-items: end;
  margin: 12px 0 14px;
  padding: 12px;
  border: 1px solid rgba(132, 169, 255, 0.16);
  border-radius: 16px;
  background: rgba(132, 169, 255, 0.055);
}

.bank-history-filters label,
.bank-history-filter-search {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.bank-history-filters input,
.bank-history-filters select {
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 11px;
}

.bank-history-filter-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.bank-history-filter-actions .bank-history-count,
.bank-history-filter-actions .bank-history-visible-count {
  min-height: 32px;
  white-space: nowrap;
}

.bank-history-limit-note {
  margin: 10px 0 0;
  font-size: 12px;
}

@media (max-width: 1180px) {
  .bank-history-filters {
    grid-template-columns: 1fr 1fr;
  }

  .bank-history-filter-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 700px) {
  .bank-history-filters {
    grid-template-columns: 1fr;
  }

  .bank-history-filter-actions,
  .bank-history-filter-actions .mini-btn,
  .bank-history-filter-actions .bank-history-count,
  .bank-history-filter-actions .bank-history-visible-count {
    width: 100%;
    justify-content: center;
  }
}

/* ======================================================
   Rapprochement bancaire — choix manuel d'une suggestion
   ====================================================== */

.bank-suggestion-row {
  grid-template-columns: minmax(170px, 1fr) auto auto;
  align-items: center;
}

.bank-suggestion-row small {
  grid-column: 1 / -1;
}

.bank-suggestion-choose {
  justify-self: end;
  white-space: nowrap;
}

@media (max-width: 700px) {
  .bank-suggestion-row {
    grid-template-columns: 1fr;
  }

  .bank-suggestion-row span,
  .bank-suggestion-choose {
    justify-self: stretch;
    width: 100%;
  }
}

/* ======================================================
   Rapprochement bancaire — retour visuel validation modale
   ====================================================== */

.bank-import-modal-message {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(61, 213, 152, 0.28);
  background: rgba(61, 213, 152, 0.1);
  color: #d8fff0;
  font-weight: 700;
}

.bank-import-modal-message.is-error {
  border-color: rgba(255, 107, 107, 0.28);
  background: rgba(255, 107, 107, 0.12);
  color: #ffd4d4;
}

.bank-match-card.is-validated {
  border-color: rgba(61, 213, 152, 0.55);
  background: rgba(61, 213, 152, 0.12);
}

.bank-match-card.is-validated .bank-match-status {
  border-color: rgba(61, 213, 152, 0.45);
  background: rgba(61, 213, 152, 0.18);
  color: #b9f8df;
}

.bank-match-card button.is-loading,
.bank-import-bulk-actions button.is-loading {
  opacity: 0.75;
  cursor: wait;
}

/* ======================================================
   Rapprochement bancaire — fenêtre d'analyse plus lisible
   ====================================================== */

.bank-analysis-help {
  display: grid;
  gap: 6px;
  padding: 13px 14px;
  border-radius: 15px;
  border: 1px solid rgba(132, 169, 255, 0.22);
  background: rgba(132, 169, 255, 0.07);
  color: #dbe7fb;
}

.bank-analysis-help strong {
  font-size: 15px;
}

.bank-analysis-help span {
  color: var(--muted);
  line-height: 1.45;
}

.bank-preview-message {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(61, 213, 152, 0.25);
  background: rgba(61, 213, 152, 0.1);
  color: #d8fff0;
  font-weight: 800;
}

.bank-preview-message.is-error {
  border-color: rgba(255, 107, 107, 0.28);
  background: rgba(255, 107, 107, 0.12);
  color: #ffd4d4;
}

.bank-readable-card {
  display: grid;
  gap: 14px;
}

.bank-readable-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.bank-readable-head h3 {
  margin: 4px 0 4px;
  font-size: 22px;
  line-height: 1.12;
}

.bank-readable-head small {
  color: var(--muted);
}

.bank-readable-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.bank-compare-panel {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  background: rgba(11, 16, 32, 0.38);
}

.bank-compare-panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.bank-compare-panel-head span {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: rgba(132, 169, 255, 0.16);
  color: #dbe7ff;
  font-size: 13px;
  font-weight: 900;
}

.bank-compare-panel-head h4 {
  margin: 0;
  font-size: 16px;
}

.bank-bankline-box,
.bank-payment-reference-box {
  display: grid;
  gap: 5px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  margin-bottom: 12px;
}

.bank-bankline-box span,
.bank-payment-reference-box span,
.bank-compare-field span {
  color: var(--muted);
  font-size: 12px;
}

.bank-bankline-box strong,
.bank-payment-reference-box strong {
  color: #eef3fb;
  font-size: 15px;
  line-height: 1.35;
  word-break: break-word;
}

.bank-compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.bank-compare-field {
  display: grid;
  gap: 5px;
  padding: 11px 12px;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
}

.bank-compare-field strong {
  color: #eef3fb;
  word-break: break-word;
}

.bank-compare-field.is-warning strong {
  color: #ffe9a8;
}

.bank-decision-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 10px;
}

.bank-decision-summary span {
  color: var(--muted);
  font-weight: 900;
}

.bank-decision-reasons {
  margin: 10px 0;
  padding-left: 22px;
  color: #dce7fb;
}

.bank-decision-reasons li {
  margin: 5px 0;
}

.bank-action-box {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.035);
}

.bank-action-box strong {
  color: #eef3fb;
}

.bank-action-box span {
  color: var(--muted);
  line-height: 1.35;
}

.bank-action-box--ok {
  border-color: rgba(61, 213, 152, 0.28);
  background: rgba(61, 213, 152, 0.08);
}

.bank-action-box--warning {
  border-color: rgba(255, 207, 90, 0.32);
  background: rgba(255, 207, 90, 0.08);
}

.bank-action-box--duplicate {
  border-color: rgba(132, 169, 255, 0.28);
  background: rgba(132, 169, 255, 0.08);
}

.bank-action-box--muted {
  opacity: 0.92;
}

.bank-primary-reconcile-btn {
  justify-self: start;
  margin-top: 4px;
}

.readable-bank-suggestions {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 207, 90, 0.22);
  background: rgba(255, 207, 90, 0.06);
}

.readable-bank-suggestions summary {
  cursor: pointer;
  font-weight: 900;
  color: #ffe9a8;
}

.readable-bank-suggestion-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
}

.bank-suggestion-score {
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 900;
}

@media (max-width: 860px) {
  .bank-readable-head,
  .bank-decision-summary,
  .readable-bank-suggestion-row {
    grid-template-columns: 1fr;
    display: grid;
  }

  .bank-compare-grid {
    grid-template-columns: 1fr;
  }
}

/* ======================================================
   Rapprochement bancaire — choix manuel cohérent en conflit
   ====================================================== */
.bank-compare-panel--choices {
  border-color: rgba(255, 207, 90, 0.24);
  background: rgba(255, 207, 90, 0.045);
}

.bank-choice-intro {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 207, 90, 0.2);
  border-radius: 14px;
  background: rgba(255, 207, 90, 0.06);
}

.bank-choice-intro strong {
  color: #ffe9a8;
}

.bank-choice-intro span {
  color: var(--muted);
  line-height: 1.45;
}

.bank-choice-list {
  display: grid;
  gap: 10px;
}

.bank-choice-row {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  text-align: left;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
}

.bank-choice-row:hover:not(:disabled),
.bank-choice-row.is-selected {
  transform: none;
  border-color: rgba(132, 169, 255, 0.48);
  background: rgba(132, 169, 255, 0.1);
}

.bank-choice-row:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.bank-choice-radio {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  display: inline-block;
  position: relative;
}

.bank-choice-row.is-selected .bank-choice-radio {
  border-color: var(--accent);
}

.bank-choice-row.is-selected .bank-choice-radio::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: inherit;
  background: var(--accent);
}

.bank-choice-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.bank-choice-main strong {
  font-size: 15px;
  word-break: break-word;
}

.bank-choice-main small,
.bank-choice-main em {
  color: var(--muted);
  font-style: normal;
  line-height: 1.35;
}

.bank-choice-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 900;
}

.bank-action-box--selection button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (max-width: 700px) {
  .bank-choice-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .bank-choice-score {
    grid-column: 2;
    justify-self: flex-start;
  }
}

/* ======================================================
   Migrations de données
   ====================================================== */

.page-panel-migrations:not([hidden]) {
  min-height: 0;
}

.migrations-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(380px, 0.8fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
  min-height: 0;
  flex: 1 1 auto;
}

.migrations-control-card {
  grid-column: 1 / -1;
}

.migrations-list-card,
.migrations-detail-card {
  min-height: 0;
}

.migration-help-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.migration-help-grid .detail-block {
  margin-bottom: 0;
}

.migration-detail-stack {
  display: grid;
  gap: 12px;
}

.migration-route-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.migration-db-name {
  margin-top: 8px;
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-size: 0.9rem;
  color: #dbeafe;
  word-break: break-word;
}

.migration-current-block {
  position: relative;
  border-color: rgba(132, 169, 255, 0.18);
  background:
    radial-gradient(
      circle at top right,
      rgba(132, 169, 255, 0.1),
      transparent 42%
    ),
    rgba(255, 255, 255, 0.025);
}

.migration-current-block.is-ok {
  border-color: rgba(61, 213, 152, 0.24);
}

.migration-current-block.is-warning {
  border-color: rgba(255, 207, 90, 0.32);
}

.migration-current-label {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(132, 169, 255, 0.1);
  border: 1px solid rgba(132, 169, 255, 0.18);
  color: #dbeafe;
  font-size: 12px;
  font-weight: 800;
}

.migration-action-empty {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 0;
}

.migration-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.migration-sql-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.migration-sql-grid > div {
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
}

.migration-sql-grid span {
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
}

.migration-sql-grid strong {
  font-size: 20px;
}

body[data-page="migrations"] .table .status-pill {
  margin: 0 4px 4px 0;
}

body[data-page="migrations"] .bo-modal-body .bo-warning-box {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 207, 90, 0.12);
  border: 1px solid rgba(255, 207, 90, 0.28);
  color: #fff3c4;
}

body[data-page="migrations"] .bo-modal-body .bo-warning-box p {
  margin: 0;
}

.migration-audit-card {
  display: grid;
  gap: 10px;
}

.migration-audit-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.migration-audit-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
}

.migration-audit-item.is-ok {
  border-color: rgba(61, 213, 152, 0.18);
}

.migration-audit-item.is-error {
  border-color: rgba(255, 107, 107, 0.24);
}

.migration-audit-item strong,
.migration-audit-item span,
.migration-audit-item small {
  display: block;
}

.migration-audit-item p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.migration-audit-meta {
  text-align: right;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1180px) {
  .migrations-layout {
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }

  .migration-help-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .migration-help-grid,
  .migration-route-card,
  .migration-sql-grid,
  .migration-audit-item {
    grid-template-columns: 1fr;
  }
}

/* ======================================================
   Migrations — backup SQL et test de restauration
   ====================================================== */

.migration-backup-card,
.migration-restore-card {
  display: grid;
  gap: 12px;
  border-color: rgba(132, 169, 255, 0.2);
  background:
    radial-gradient(
      circle at top right,
      rgba(132, 169, 255, 0.11),
      transparent 42%
    ),
    rgba(255, 255, 255, 0.025);
}

.migration-backup-card.is-ok,
.migration-restore-card.is-ok {
  border-color: rgba(61, 213, 152, 0.28);
  background:
    radial-gradient(
      circle at top right,
      rgba(61, 213, 152, 0.1),
      transparent 42%
    ),
    rgba(61, 213, 152, 0.04);
}

.migration-backup-card.is-warning,
.migration-restore-card.is-warning {
  border-color: rgba(255, 207, 90, 0.34);
  background:
    radial-gradient(
      circle at top right,
      rgba(255, 207, 90, 0.12),
      transparent 42%
    ),
    rgba(255, 207, 90, 0.045);
}

.migration-backup-card.is-error,
.migration-restore-card.is-error {
  border-color: rgba(255, 107, 107, 0.3);
  background:
    radial-gradient(
      circle at top right,
      rgba(255, 107, 107, 0.12),
      transparent 42%
    ),
    rgba(255, 107, 107, 0.045);
}

.migration-backup-card h3,
.migration-restore-card h3 {
  margin: 0;
  font-size: 18px;
}

.migration-backup-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.migration-backup-grid > div,
.migration-backup-path {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(11, 16, 32, 0.34);
}

.migration-backup-grid strong,
.migration-backup-path code {
  color: #eef3fb;
  word-break: break-word;
}

.migration-backup-path code {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    monospace;
  font-size: 12px;
  line-height: 1.45;
}

.migration-restore-checks {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 980px) {
  .migration-backup-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .migration-backup-grid {
    grid-template-columns: 1fr;
  }
}

/* ======================================================
   Migrations — UX guidée et détail lisible
   ====================================================== */

body[data-page="migrations"] .migration-help-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.migration-guide-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 168px;
  border-color: rgba(132, 169, 255, 0.18);
  background: rgba(132, 169, 255, 0.045);
}

.migration-guide-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.migration-guide-head span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  color: #08111f;
  background: var(--accent);
  font-weight: 900;
  flex: 0 0 auto;
}

.migration-guide-head strong {
  font-size: 15px;
  line-height: 1.2;
}

.migration-guide-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.migration-guide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: auto;
}

.migration-guide-action {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  color: #dbeafe;
  background: rgba(132, 169, 255, 0.12);
  border: 1px solid rgba(132, 169, 255, 0.22);
  font-size: 12px;
  font-weight: 800;
}

.migration-detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.migration-detail-hero h3 {
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.migration-route-card--readable {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.migration-flow-section {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
}

.migration-flow-section.is-ok {
  border-color: rgba(61, 213, 152, 0.28);
  background: rgba(61, 213, 152, 0.045);
}

.migration-flow-section.is-warning {
  border-color: rgba(255, 207, 90, 0.32);
  background: rgba(255, 207, 90, 0.045);
}

.migration-flow-section__head,
.migration-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.migration-flow-section__head {
  justify-content: flex-start;
  align-items: center;
}

.migration-flow-section__head span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(132, 169, 255, 0.14);
  border: 1px solid rgba(132, 169, 255, 0.22);
  color: #dbeafe;
  font-weight: 900;
  flex: 0 0 auto;
}

.migration-readable-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.migration-readable-stack {
  display: grid;
  gap: 10px;
}

.migration-value-row {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(11, 16, 32, 0.34);
}

.migration-value-row span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.migration-value-row strong,
.migration-value-row code {
  color: #eef3fb;
  overflow-wrap: anywhere;
  word-break: normal;
}

.migration-value-row code {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    monospace;
  font-size: 12px;
  line-height: 1.45;
}

.migration-validation-card {
  display: grid;
  gap: 12px;
}

.migration-validation-group {
  display: grid;
  gap: 8px;
}

.migration-validation-group > strong {
  color: #dbeafe;
  font-size: 14px;
}

.migration-validation-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
}

.migration-validation-pill.is-ok {
  color: #bff7d7;
  background: rgba(61, 213, 152, 0.12);
  border: 1px solid rgba(61, 213, 152, 0.26);
}

.migration-validation-pill.is-neutral {
  color: #dbeafe;
  background: rgba(132, 169, 255, 0.1);
  border: 1px solid rgba(132, 169, 255, 0.2);
}

.migration-validation-pill.is-warning {
  color: #fff0be;
  background: rgba(255, 207, 90, 0.12);
  border: 1px solid rgba(255, 207, 90, 0.28);
}

.migration-validation-pill.is-error {
  color: #ffd4d4;
  background: rgba(255, 107, 107, 0.12);
  border: 1px solid rgba(255, 107, 107, 0.28);
}

body[data-page="migrations"] .migration-sql-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body[data-page="migrations"] .migration-backup-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body[data-page="migrations"] .migration-backup-grid > div,
body[data-page="migrations"] .migration-backup-path {
  min-height: auto;
}

body[data-page="migrations"] .migration-backup-card,
body[data-page="migrations"] .migration-restore-card {
  gap: 14px;
}

body[data-page="migrations"] .migration-backup-card h3,
body[data-page="migrations"] .migration-restore-card h3 {
  line-height: 1.2;
}

.migration-detail-actions {
  align-items: stretch;
}

.migration-detail-actions button {
  white-space: normal;
  text-align: center;
}

.migration-audit-item {
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 13px;
}

.migration-audit-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.migration-audit-main strong {
  color: #eef3fb;
  line-height: 1.2;
}

.migration-audit-main small {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.migration-audit-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  font-size: 12px;
}

.migration-action-modal .migration-modal-help {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(132, 169, 255, 0.24);
  background: rgba(132, 169, 255, 0.07);
}

.migration-action-modal .migration-modal-help p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

body[data-page="migrations"] .table td .table-actions {
  min-width: 190px;
}

body[data-page="migrations"] .table td .table-actions .mini-btn {
  white-space: normal;
  text-align: center;
}

@media (max-width: 1500px) {
  body[data-page="migrations"] .migration-help-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  body[data-page="migrations"] .migration-help-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  body[data-page="migrations"] .migration-help-grid,
  .migration-readable-grid,
  body[data-page="migrations"] .migration-sql-grid,
  body[data-page="migrations"] .migration-backup-grid {
    grid-template-columns: 1fr;
  }

  .migration-card-heading,
  .migration-audit-meta {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ======================================================
   Correctif UX migrations — guide compact
   Objectif : garder le guide utile sans prendre la place
   des sections Jobs et Détail.
   ====================================================== */

body[data-page="migrations"] .migrations-control-card {
  padding: 14px 16px 12px;
}

body[data-page="migrations"] .migrations-control-card .card-head {
  margin-bottom: 10px;
}

body[data-page="migrations"] .migrations-control-card .card-head h2 {
  font-size: clamp(22px, 1.7vw, 30px);
}

body[data-page="migrations"] .migrations-control-card .card-head p {
  margin: 4px 0 0;
  font-size: 0.95rem;
  line-height: 1.25;
}

body[data-page="migrations"] .migration-help-grid {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 10px !important;
  align-items: stretch;
}

body[data-page="migrations"] .migration-guide-card {
  min-height: 112px;
  padding: 10px 12px;
  gap: 7px;
}

body[data-page="migrations"] .migration-guide-head {
  gap: 8px;
}

body[data-page="migrations"] .migration-guide-head span {
  width: 24px;
  height: 24px;
  font-size: 13px;
}

body[data-page="migrations"] .migration-guide-head strong {
  font-size: 13.5px;
  line-height: 1.15;
}

body[data-page="migrations"] .migration-guide-card p {
  font-size: 13px;
  line-height: 1.35;
}

body[data-page="migrations"] .migration-guide-actions {
  display: none;
}

body[data-page="migrations"] .migration-guide-action {
  min-height: 22px;
  padding: 2px 7px;
  margin: 0 2px;
  vertical-align: baseline;
  font-size: 11.5px;
  line-height: 1.2;
  white-space: nowrap;
}

@media (max-width: 1420px) {
  body[data-page="migrations"] .migration-help-grid {
    display: flex !important;
    grid-template-columns: none !important;
    gap: 10px !important;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
  }

  body[data-page="migrations"] .migration-guide-card {
    flex: 0 0 246px;
    min-height: 118px;
    scroll-snap-align: start;
  }
}

@media (max-width: 700px) {
  body[data-page="migrations"] .migration-help-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    overflow: visible;
    padding-bottom: 0;
  }

  body[data-page="migrations"] .migration-guide-card {
    min-height: auto;
  }
}

/* ======================================================
   Correctif UX global — espace utile et composants compacts
   Objectif : garder la place pour le contenu métier, masquer
   les alertes vides et uniformiser les indicateurs de page.
   ====================================================== */

.alert[hidden],
.alert:empty {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  min-height: 0 !important;
}

body[data-page] .page-summary[hidden],
body[data-page] .page-summary:empty {
  display: none !important;
}

body[data-page] .page-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 0 0 auto;
  margin: 0;
}

body[data-page] .summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  min-width: 116px;
  padding: 7px 10px;
  border-radius: 12px;
  box-shadow: none;
}

body[data-page] .summary-pill span {
  margin: 0;
  font-size: 11px;
  line-height: 1.2;
}

body[data-page] .summary-pill strong {
  font-size: 16px;
  line-height: 1;
}

body[data-page="migrations"] .bo-main {
  gap: 10px;
}

body[data-page="migrations"] .migrations-layout {
  gap: 12px;
}

body[data-page="migrations"] .migrations-control-card {
  padding: 12px 14px;
}

body[data-page="migrations"] .migrations-control-card .card-head {
  margin-bottom: 8px;
}

body[data-page="migrations"] .migrations-control-card .card-head h2 {
  font-size: clamp(21px, 1.45vw, 28px);
}

body[data-page="migrations"] .migrations-control-card .card-head p {
  margin: 3px 0 0;
  font-size: 0.9rem;
  line-height: 1.25;
}

body[data-page="migrations"] .migration-help-grid.migration-help-collapsible {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 8px !important;
  overflow: visible;
  padding-bottom: 0;
}

.migration-guide-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid rgba(132, 169, 255, 0.16);
  border-radius: 14px;
  background: rgba(132, 169, 255, 0.055);
}

.migration-guide-toggle-row strong,
.migration-guide-toggle-row span {
  display: block;
}

.migration-guide-toggle-row strong {
  color: #eef3fb;
  font-size: 14px;
  line-height: 1.2;
}

.migration-guide-toggle-row span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.migration-guide-toggle-row button {
  flex: 0 0 auto;
  min-height: 30px;
  white-space: nowrap;
}

.migration-help-content[hidden] {
  display: none !important;
}

body[data-page="migrations"] .migration-help-content {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

body[data-page="migrations"] .migration-help-content .migration-guide-card {
  min-height: auto;
  padding: 9px 10px;
  gap: 6px;
}

body[data-page="migrations"] .migration-help-content .migration-guide-head {
  gap: 7px;
}

body[data-page="migrations"]
  .migration-help-content
  .migration-guide-head
  span {
  width: 22px;
  height: 22px;
  font-size: 12px;
}

body[data-page="migrations"]
  .migration-help-content
  .migration-guide-head
  strong {
  font-size: 13px;
  line-height: 1.15;
}

body[data-page="migrations"] .migration-help-content .migration-guide-card p {
  font-size: 12.5px;
  line-height: 1.32;
}

body[data-page="migrations"] .migration-help-content .migration-guide-action {
  min-height: 20px;
  padding: 2px 6px;
  margin: 0 1px;
  vertical-align: baseline;
  font-size: 11px;
  line-height: 1.15;
  white-space: nowrap;
}

@media (max-width: 1420px) {
  body[data-page="migrations"] .migration-help-grid.migration-help-collapsible {
    display: grid !important;
    overflow: visible;
  }

  body[data-page="migrations"] .migration-help-content {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
  }

  body[data-page="migrations"] .migration-help-content .migration-guide-card {
    flex: 0 0 238px;
    scroll-snap-align: start;
  }
}

@media (max-width: 760px) {
  body[data-page] .page-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-page] .summary-pill {
    width: 100%;
  }

  .migration-guide-toggle-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .migration-guide-toggle-row button {
    width: 100%;
  }

  body[data-page="migrations"] .migration-help-content {
    display: grid;
    grid-template-columns: 1fr;
    overflow: visible;
    padding-bottom: 0;
  }

  body[data-page="migrations"] .migration-help-content .migration-guide-card {
    flex: none;
  }
}

/* ======================================================
   Back-office — guide rapide global dans l’en-tête
   ====================================================== */

.topbar-left {
  flex: 1 1 auto;
}

.page-title-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  flex: 0 0 auto;
}

.bo-guide-pill,
.bo-guide-pill.btn-secondary {
  flex: 0 0 auto;
  max-width: min(220px, 34vw);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
  padding: 5px 11px 5px 6px;
  border-radius: 999px;
  border: 1px solid rgba(132, 169, 255, 0.22);
  background:
    radial-gradient(
      circle at top left,
      rgba(132, 169, 255, 0.2),
      transparent 58%
    ),
    rgba(132, 169, 255, 0.075);
  color: #dbe7ff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.bo-guide-pill:hover,
.bo-guide-pill.is-open {
  transform: translateY(-1px);
  border-color: rgba(132, 169, 255, 0.4);
  background:
    radial-gradient(
      circle at top left,
      rgba(132, 169, 255, 0.28),
      transparent 58%
    ),
    rgba(132, 169, 255, 0.13);
}

.bo-guide-pill__icon {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(132, 169, 255, 0.18);
  border: 1px solid rgba(132, 169, 255, 0.24);
}

.bo-guide-pill__icon svg {
  width: 15px;
  height: 15px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bo-guide-pill__label {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.page-quick-guide {
  flex: 0 0 auto;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid rgba(132, 169, 255, 0.16);
  border-radius: 18px;
  background:
    radial-gradient(
      circle at top right,
      rgba(132, 169, 255, 0.12),
      transparent 34%
    ),
    rgba(18, 26, 47, 0.78);
  box-shadow: var(--shadow);
}

.page-quick-guide__head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.page-quick-guide__head h2 {
  margin: 2px 0 4px;
  font-size: clamp(19px, 1.35vw, 24px);
  line-height: 1.1;
}

.page-quick-guide__head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.page-quick-guide__content {
  min-width: 0;
}

body[data-page="migrations"]
  .migrations-control-card
  .migration-help-grid[hidden] {
  display: none !important;
}

body[data-page="migrations"] .page-quick-guide .migration-help-content {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

body[data-page="migrations"] .page-quick-guide .migration-guide-card {
  min-height: 112px;
  padding: 10px 12px;
  gap: 7px;
}

@media (max-width: 1420px) {
  body[data-page="migrations"] .page-quick-guide .migration-help-content {
    display: flex !important;
    grid-template-columns: none !important;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
  }

  body[data-page="migrations"] .page-quick-guide .migration-guide-card {
    flex: 0 0 246px;
    min-height: 118px;
    scroll-snap-align: start;
  }
}

@media (max-width: 980px) {
  .page-title-actions {
    gap: 8px;
  }

  .bo-guide-pill {
    max-width: 132px;
    min-height: 32px;
    padding-right: 9px;
  }

  .bo-guide-pill__label {
    font-size: 12px;
  }

  .bo-guide-pill .bo-guide-pill__label {
    max-width: 82px;
  }

  .bo-guide-pill:not(.is-open) .bo-guide-pill__label {
    font-size: 0;
  }

  .bo-guide-pill:not(.is-open) .bo-guide-pill__label::after {
    content: "Guide";
    font-size: 12px;
  }
}

@media (max-width: 700px) {
  .page-title-row {
    align-items: flex-start;
  }

  .page-title-actions {
    flex: 0 0 auto;
  }

  .bo-guide-pill {
    width: 34px;
    height: 34px;
    min-height: 34px;
    max-width: 34px;
    padding: 0;
    justify-content: center;
  }

  .bo-guide-pill__icon {
    width: 26px;
    height: 26px;
  }

  .bo-guide-pill__label {
    display: none;
  }

  .page-quick-guide {
    padding: 12px;
    border-radius: 16px;
  }

  body[data-page="migrations"] .page-quick-guide .migration-help-content {
    display: grid !important;
    grid-template-columns: 1fr !important;
    overflow: visible;
    padding-bottom: 0;
  }

  body[data-page="migrations"] .page-quick-guide .migration-guide-card {
    flex: initial;
    min-height: auto;
  }
}

/* ======================================================
   Migrations — résultat du diagnostic
   ====================================================== */

.migration-diagnostic-card {
  display: grid;
  gap: 14px;
  border-color: rgba(132, 169, 255, 0.2);
  background:
    radial-gradient(
      circle at top right,
      rgba(132, 169, 255, 0.1),
      transparent 42%
    ),
    rgba(255, 255, 255, 0.025);
}

.migration-diagnostic-card.is-ok {
  border-color: rgba(61, 213, 152, 0.28);
  background:
    radial-gradient(
      circle at top right,
      rgba(61, 213, 152, 0.1),
      transparent 42%
    ),
    rgba(61, 213, 152, 0.04);
}

.migration-diagnostic-card.is-warning {
  border-color: rgba(255, 207, 90, 0.34);
  background:
    radial-gradient(
      circle at top right,
      rgba(255, 207, 90, 0.12),
      transparent 42%
    ),
    rgba(255, 207, 90, 0.045);
}

.migration-diagnostic-card.is-error {
  border-color: rgba(255, 107, 107, 0.3);
  background:
    radial-gradient(
      circle at top right,
      rgba(255, 107, 107, 0.12),
      transparent 42%
    ),
    rgba(255, 107, 107, 0.045);
}

.migration-diagnostic-checks {
  display: grid;
  gap: 8px;
}

.migration-diagnostic-check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(11, 16, 32, 0.32);
}

.migration-diagnostic-check.is-ok {
  border-color: rgba(61, 213, 152, 0.18);
}

.migration-diagnostic-check.is-warning {
  border-color: rgba(255, 207, 90, 0.28);
}

.migration-diagnostic-check.is-error {
  border-color: rgba(255, 107, 107, 0.28);
}

.migration-diagnostic-check strong,
.migration-diagnostic-check small {
  display: block;
}

.migration-diagnostic-check small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

@media (max-width: 700px) {
  .migration-diagnostic-check {
    grid-template-columns: 1fr;
  }
}

/* ======================================================
   Correctif DevBoard — bouton suppression action centré
   ====================================================== */

body[data-page="devboard"] button.mini-btn.danger[data-devboard-action-delete] {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  min-height: 34px !important;
  max-width: 34px !important;
  max-height: 34px !important;
  flex: 0 0 34px !important;
  padding: 0 !important;
  border-radius: 12px !important;
  display: inline-grid !important;
  place-items: center !important;
  text-align: center !important;
  line-height: 1 !important;
  font-size: 20px !important;
  font-weight: 700 !important;
}

/* ======================================================
   Monitoring — socle d’accueil des mesures Chantier 03
   ====================================================== */

.page-panel-monitoring:not([hidden]) {
  min-height: 0;
}

.monitoring-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  flex: 1 1 auto;
}

.monitoring-hero-card {
  flex: 0 0 auto;
}

.monitoring-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.monitoring-hero h2 {
  margin: 4px 0 8px;
  font-size: clamp(24px, 2.1vw, 34px);
  line-height: 1.08;
}

.monitoring-hero p {
  max-width: 920px;
  line-height: 1.5;
}

.monitoring-next-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.monitoring-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  flex: 0 0 auto;
}

.monitoring-kpi strong {
  font-size: 30px;
}

.monitoring-grid {
  flex: 1 1 auto;
  min-height: 0;
}

.monitoring-app-list {
  display: grid;
  gap: 12px;
}

.monitoring-app-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(132, 169, 255, 0.18);
  border-radius: 16px;
  background:
    radial-gradient(
      circle at top right,
      rgba(132, 169, 255, 0.1),
      transparent 42%
    ),
    rgba(255, 255, 255, 0.025);
}

.monitoring-app-card.is-disabled {
  opacity: 0.72;
  border-style: dashed;
}

.monitoring-app-card__head,
.monitoring-instance-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.monitoring-app-card__head strong,
.monitoring-instance-row strong,
.monitoring-step strong {
  display: block;
  color: var(--text);
}

.monitoring-app-card__head small,
.monitoring-instance-row small,
.monitoring-step small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.monitoring-app-card__meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.monitoring-app-card__meta span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: #dbe7fb;
  font-size: 12px;
  font-weight: 800;
}

.monitoring-instance-list {
  display: grid;
  gap: 8px;
}

.monitoring-instance-row {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(11, 16, 32, 0.34);
}

.monitoring-health-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  border: 1px solid rgba(132, 169, 255, 0.22);
  background: rgba(132, 169, 255, 0.1);
  color: #dbe7ff;
  white-space: nowrap;
}

.monitoring-health-pill.is-pending {
  border-color: rgba(255, 207, 90, 0.28);
  background: rgba(255, 207, 90, 0.1);
  color: #ffe9a8;
}

.monitoring-health-pill.is-muted {
  border-color: rgba(156, 163, 175, 0.22);
  background: rgba(156, 163, 175, 0.08);
  color: #e5e7eb;
}

.monitoring-empty-stack {
  display: grid;
  gap: 12px;
}

.monitoring-empty-stack .empty-box p {
  margin: 8px 0 0;
  line-height: 1.5;
}

.monitoring-next-steps {
  display: grid;
  gap: 10px;
}

.monitoring-step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.monitoring-step span {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(132, 169, 255, 0.16);
  border: 1px solid rgba(132, 169, 255, 0.24);
  color: #dbe7ff;
  font-weight: 900;
}

.monitoring-events-card {
  flex: 0 0 auto;
}

.monitoring-events-list {
  display: grid;
  gap: 10px;
}

.quick-guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.quick-guide-grid article {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.quick-guide-grid strong,
.quick-guide-grid span {
  display: block;
}

.quick-guide-grid span {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.4;
}

@media (max-width: 1180px) {
  .monitoring-kpi-grid,
  .quick-guide-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .monitoring-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .monitoring-hero,
  .monitoring-app-card__head,
  .monitoring-instance-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .monitoring-kpi-grid,
  .quick-guide-grid {
    grid-template-columns: 1fr;
  }

  .monitoring-health-pill {
    justify-self: start;
    white-space: normal;
  }
}

/* ======================================================
   Emails — gestionnaire visuel des fournisseurs
   ====================================================== */

.page-panel-emails:not([hidden]) {
  min-height: 0;
}

.email-provider-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.72fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
  min-height: 0;
  flex: 1 1 auto;
}

.email-provider-hero {
  grid-column: 1 / -1;
}

.email-provider-hero__content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.email-provider-hero h2 {
  margin: 4px 0 8px;
  font-size: clamp(24px, 2vw, 34px);
  line-height: 1.08;
}

.email-provider-hero p {
  max-width: 920px;
  margin: 0;
  line-height: 1.5;
}

.email-provider-hero__actions {
  flex: 0 0 auto;
}

.email-provider-status {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.email-provider-status__item {
  display: grid;
  gap: 5px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.email-provider-status__item span {
  color: var(--muted);
  font-size: 12px;
}

.email-provider-status__item strong {
  overflow-wrap: anywhere;
}

.email-provider-picker-card,
.email-provider-editor-card {
  min-height: 0;
}

.email-provider-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.email-provider-card {
  width: 100%;
  min-height: 150px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px;
  text-align: left;
  color: var(--text);
  border: 1px solid var(--line);
  border-left: 4px solid rgba(132, 169, 255, 0.28);
  border-radius: 17px;
  background:
    radial-gradient(
      circle at top right,
      rgba(132, 169, 255, 0.08),
      transparent 42%
    ),
    rgba(255, 255, 255, 0.025);
}

.email-provider-card:hover {
  border-color: rgba(132, 169, 255, 0.34);
  border-left-color: rgba(132, 169, 255, 0.72);
  background: rgba(132, 169, 255, 0.07);
}

.email-provider-card.is-selected {
  border-color: rgba(132, 169, 255, 0.52);
  border-left-color: var(--accent);
  background: rgba(132, 169, 255, 0.11);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.25);
}

.email-provider-card.is-active {
  border-color: rgba(61, 213, 152, 0.4);
  border-left-color: var(--ok);
}

.email-provider-card__icon {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border-radius: 13px;
  background: rgba(132, 169, 255, 0.14);
  border: 1px solid rgba(132, 169, 255, 0.22);
  font-size: 19px;
}

.email-provider-card__content {
  display: grid;
  gap: 7px;
}

.email-provider-card__title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.email-provider-card__title strong {
  font-size: 16px;
}

.email-provider-card__content p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.42;
}

.email-provider-card__badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: auto;
}

.email-provider-mini-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: #dbe7fb;
  font-size: 11px;
  font-weight: 800;
}

.email-provider-mini-badge.is-active {
  color: #b9f8df;
  border-color: rgba(61, 213, 152, 0.28);
  background: rgba(61, 213, 152, 0.1);
}

.email-provider-mini-badge.is-draft {
  color: #ffe9a8;
  border-color: rgba(255, 207, 90, 0.3);
  background: rgba(255, 207, 90, 0.1);
}

.email-provider-form {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.email-provider-fields {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 12px;
  padding-right: 4px;
}

.email-provider-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.email-provider-field {
  display: grid;
  gap: 6px;
}

.email-provider-field > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.email-provider-field small {
  color: var(--muted);
  line-height: 1.35;
}

.email-provider-field--full {
  grid-column: 1 / -1;
}

.email-provider-check {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.email-provider-check input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}

.email-provider-check strong,
.email-provider-check small {
  display: block;
}

.email-provider-check small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.4;
}

.email-provider-secret-note {
  padding: 10px 12px;
  border-radius: 13px;
  border: 1px solid rgba(132, 169, 255, 0.2);
  background: rgba(132, 169, 255, 0.07);
  color: #dbe7fb;
  font-size: 13px;
  line-height: 1.4;
}

.email-provider-warning {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 207, 90, 0.3);
  background: rgba(255, 207, 90, 0.09);
  color: #ffe9a8;
  line-height: 1.45;
}

.email-provider-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.email-provider-actions button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
}

@media (max-width: 1180px) {
  .email-provider-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .email-provider-hero {
    grid-column: auto;
  }

  .email-provider-status {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .email-provider-cards,
  .email-provider-fields {
    overflow: visible;
  }
}

@media (max-width: 760px) {
  .email-provider-hero__content,
  .email-provider-card__title {
    display: grid;
    grid-template-columns: 1fr;
  }

  .email-provider-hero__actions,
  .email-provider-hero__actions button,
  .email-provider-status,
  .email-provider-cards,
  .email-provider-field-grid,
  .email-provider-actions,
  .email-provider-actions button {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .email-provider-actions {
    display: grid;
  }
}

/* ======================================================
   Emails — supervision opérationnelle du relais central
   ====================================================== */

body[data-page="emails"] .bo-main {
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding-bottom: 48px;
}

body[data-page="emails"] .page-panel-emails:not([hidden]) {
  display: flex;
  min-height: auto;
  overflow: visible;
}

body[data-page="emails"] .email-provider-layout {
  flex: 0 0 auto;
  min-height: 720px;
}

.email-operations {
  display: grid;
  gap: 16px;
  padding-top: 4px;
}

.email-operations__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.email-operations__head h2 {
  margin: 4px 0 6px;
}

.email-operations__head p {
  margin: 0;
}

.email-relay-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.email-relay-filters-card {
  overflow: visible;
}

.email-relay-filters {
  display: grid;
  grid-template-columns:
    repeat(4, minmax(150px, 1fr))
    repeat(2, minmax(135px, 0.7fr));
  gap: 10px;
}

.email-relay-filters label {
  display: grid;
  gap: 6px;
}

.email-relay-filters label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.email-relay-filter-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.email-relay-list-card {
  min-height: 430px;
}

.email-relay-table td small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  max-width: 320px;
}

.email-relay-table td:nth-child(3) strong,
.email-relay-table td:nth-child(3) small {
  overflow-wrap: anywhere;
}

.email-relay-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.email-relay-pagination button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.email-relay-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.email-relay-detail-grid > div {
  display: grid;
  gap: 5px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.025);
}

.email-relay-detail-grid span,
.email-relay-hashes small {
  color: var(--muted);
  font-size: 12px;
}

.email-relay-detail-grid strong {
  overflow-wrap: anywhere;
}

.email-relay-hashes {
  display: grid;
  gap: 6px;
  margin-top: 4px;
}

.email-relay-hashes code {
  display: block;
  overflow-wrap: anywhere;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(2, 6, 23, 0.36);
  color: #dbe7fb;
  font-size: 12px;
}

@media (max-width: 1250px) {
  .email-relay-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .email-relay-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .email-operations__head,
  .email-relay-pagination {
    flex-direction: column;
    align-items: stretch;
  }

  .email-operations__head button,
  .email-relay-pagination button {
    width: 100%;
  }

  .email-relay-summary,
  .email-relay-filters,
  .email-relay-detail-grid {
    grid-template-columns: 1fr;
  }

  .email-relay-filter-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}


/* ======================================================
   Emails — correctif tableau compact et relance visible
   ====================================================== */

body[data-page="emails"] .email-relay-list-card {
  min-height: 0;
  height: min(560px, 58vh);
  max-height: 58vh;
}

body[data-page="emails"] #emailRelayTable {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

body[data-page="emails"] #emailRelayTable .table-wrap {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: auto;
  overscroll-behavior: contain;
}

body[data-page="emails"] .email-relay-table {
  width: 100%;
  min-width: 980px;
  table-layout: fixed;
}

body[data-page="emails"] .email-relay-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #121a2f;
  box-shadow: 0 1px 0 var(--line);
}

body[data-page="emails"] .email-relay-table th,
body[data-page="emails"] .email-relay-table td {
  padding: 9px 8px;
  font-size: 12.5px;
}

body[data-page="emails"] .email-relay-table th:nth-child(1),
body[data-page="emails"] .email-relay-table td:nth-child(1) {
  width: 142px;
}

body[data-page="emails"] .email-relay-table th:nth-child(2),
body[data-page="emails"] .email-relay-table td:nth-child(2) {
  width: 185px;
}

body[data-page="emails"] .email-relay-table th:nth-child(3),
body[data-page="emails"] .email-relay-table td:nth-child(3) {
  width: 270px;
}

body[data-page="emails"] .email-relay-table th:nth-child(4),
body[data-page="emails"] .email-relay-table td:nth-child(4) {
  width: 105px;
}

body[data-page="emails"] .email-relay-table th:nth-child(5),
body[data-page="emails"] .email-relay-table td:nth-child(5) {
  width: 90px;
}

body[data-page="emails"] .email-relay-table th:nth-child(6),
body[data-page="emails"] .email-relay-table td:nth-child(6) {
  width: 135px;
}

body[data-page="emails"] .email-relay-table th:nth-child(7),
body[data-page="emails"] .email-relay-table td:nth-child(7) {
  position: sticky;
  right: 0;
  z-index: 3;
  width: 82px;
  min-width: 82px;
  background: #121a2f;
  box-shadow: -10px 0 18px rgba(11, 16, 32, 0.82);
}

body[data-page="emails"] .email-relay-table thead th:nth-child(7) {
  z-index: 6;
}

body[data-page="emails"] .email-relay-table td strong,
body[data-page="emails"] .email-relay-table td small {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

body[data-page="emails"] .email-relay-table td strong {
  white-space: nowrap;
}

body[data-page="emails"] .email-relay-table td small {
  white-space: nowrap;
}

body[data-page="emails"] .email-relay-error-preview {
  color: #ffc2c2 !important;
  font-weight: 800;
}

body[data-page="emails"] .email-relay-table td:nth-child(3) strong,
body[data-page="emails"] .email-relay-table td:nth-child(3) small {
  overflow-wrap: normal;
  word-break: normal;
}

.email-relay-retry-feedback {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(132, 169, 255, 0.28);
  background: rgba(132, 169, 255, 0.09);
  color: #dbe7ff;
  font-weight: 800;
  line-height: 1.4;
}

.email-relay-retry-feedback.is-success {
  border-color: rgba(61, 213, 152, 0.3);
  background: rgba(61, 213, 152, 0.1);
  color: #d8fff0;
}

.email-relay-retry-feedback.is-error {
  border-color: rgba(255, 107, 107, 0.32);
  background: rgba(255, 107, 107, 0.12);
  color: #ffd4d4;
}

#boModalConfirmBtn:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

@media (max-width: 980px) {
  body[data-page="emails"] .email-relay-list-card {
    height: auto;
    max-height: none;
  }

  body[data-page="emails"] #emailRelayTable .table-wrap {
    max-height: 62vh;
  }

  body[data-page="emails"] .email-relay-table {
    min-width: 900px;
  }
}


/* ======================================================
   Emails — historique et audit des relances manuelles
   ====================================================== */

.email-relay-audit-section {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
}

.email-relay-audit-section__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.email-relay-audit-section__head h3 {
  margin: 3px 0 0;
  font-size: 17px;
}

.email-relay-audit-section__head > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.email-relay-audit-list {
  display: grid;
  gap: 10px;
}

.email-relay-audit-item {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(11, 16, 32, 0.48);
}

.email-relay-audit-item__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.email-relay-audit-item__head strong,
.email-relay-audit-item__head small {
  display: block;
}

.email-relay-audit-item__head small {
  margin-top: 3px;
  color: var(--muted);
}

.email-relay-audit-http {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.email-relay-audit-http.is-success {
  border-color: rgba(61, 213, 152, 0.32);
  background: rgba(61, 213, 152, 0.1);
  color: #bdf8df;
}

.email-relay-audit-http.is-error {
  border-color: rgba(255, 107, 107, 0.32);
  background: rgba(255, 107, 107, 0.1);
  color: #ffd0d0;
}

.email-relay-audit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(100px, 0.6fr);
  gap: 9px;
}

.email-relay-audit-grid > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.email-relay-audit-grid > div:last-child {
  grid-column: 1 / -1;
}

.email-relay-audit-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.email-relay-audit-grid strong,
.email-relay-audit-grid code {
  overflow-wrap: anywhere;
}

.email-relay-audit-item p {
  margin: 0;
  color: #dfe7ff;
  line-height: 1.45;
}

.email-relay-audit-empty {
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 720px) {
  .email-relay-audit-section__head,
  .email-relay-audit-item__head {
    align-items: stretch;
    flex-direction: column;
  }

  .email-relay-audit-grid {
    grid-template-columns: 1fr;
  }

  .email-relay-audit-grid > div:last-child {
    grid-column: auto;
  }
}


/* ======================================================
   Tarification Marketplace — gestion simple des frais
   ====================================================== */

body[data-page="pricing"] .bo-main {
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 40px;
}

body[data-page="pricing"] .page-panel-pricing:not([hidden]) {
  display: block;
  min-height: auto;
  overflow: visible;
}

.pricing-layout {
  display: grid;
  gap: 16px;
}

.pricing-hero-card {
  overflow: visible;
}

.pricing-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.pricing-hero h2 {
  margin: 4px 0 8px;
  font-size: clamp(24px, 2.3vw, 34px);
}

.pricing-hero p {
  margin: 0;
  max-width: 860px;
  line-height: 1.5;
}

.pricing-hero-actions,
.pricing-status {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pricing-status {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.pricing-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
  gap: 16px;
  align-items: start;
}

.pricing-form-card,
.pricing-preview-card {
  overflow: visible;
}

.pricing-form-scroll {
  display: grid;
  gap: 14px;
}

.pricing-section {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.025);
}

.pricing-section-head {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.pricing-section-head > span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #08111f;
  background: var(--accent);
  font-weight: 900;
}

.pricing-section-head h3,
.pricing-section-head p {
  margin: 0;
}

.pricing-section-head p {
  margin-top: 4px;
  line-height: 1.4;
}

.pricing-choice-grid,
.pricing-field-grid,
.pricing-fixed-rules,
.pricing-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.pricing-choice-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
}

.pricing-choice-card:has(input:checked) {
  border-color: rgba(132, 169, 255, 0.46);
  background: rgba(132, 169, 255, 0.09);
}

.pricing-choice-card input {
  width: 19px;
  height: 19px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}

.pricing-choice-card strong,
.pricing-choice-card small {
  display: block;
}

.pricing-choice-card small {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.45;
}

.pricing-field-grid label,
.pricing-preview-card > label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.pricing-field-grid label.is-disabled {
  opacity: 0.48;
}

.pricing-input-suffix {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
}

.pricing-input-suffix input {
  border-radius: 12px 0 0 12px;
}

.pricing-input-suffix > span {
  min-width: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 12px 12px 0;
  background: rgba(255, 255, 255, 0.06);
  color: #dbe7fb;
  font-weight: 900;
}

.pricing-advanced-settings {
  border: 1px dashed rgba(132, 169, 255, 0.28);
  border-radius: 15px;
  padding: 12px 14px;
  background: rgba(132, 169, 255, 0.04);
}

.pricing-advanced-settings summary {
  cursor: pointer;
  color: #dbe7ff;
  font-weight: 800;
}

.pricing-advanced-settings .pricing-field-grid {
  margin-top: 14px;
}

.pricing-lock-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 207, 90, 0.28);
  border-radius: 16px;
  background: rgba(255, 207, 90, 0.075);
}

.pricing-lock-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 207, 90, 0.13);
}

.pricing-lock-card p {
  margin: 5px 0 0;
  color: #f4e4aa;
  line-height: 1.45;
}

.pricing-fixed-rules > div,
.pricing-guide-grid > div {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.pricing-fixed-rules span,
.pricing-guide-grid span {
  color: var(--muted);
  font-size: 12px;
}

.pricing-form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.pricing-preview-card {
  position: sticky;
  top: 0;
}

.pricing-sample-input {
  margin: 8px 0 14px;
}

.pricing-preview {
  display: grid;
  gap: 12px;
}

.pricing-public-price {
  display: grid;
  gap: 5px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(61, 213, 152, 0.28);
  background:
    radial-gradient(circle at top right, rgba(61, 213, 152, 0.16), transparent 44%),
    rgba(61, 213, 152, 0.06);
}

.pricing-public-price span,
.pricing-public-price small {
  color: var(--muted);
}

.pricing-public-price strong {
  font-size: clamp(38px, 5vw, 62px);
  line-height: 1;
  color: #c8ffe6;
}

.pricing-preview-breakdown {
  display: grid;
  gap: 8px;
}

.pricing-preview-breakdown > div,
.pricing-current-charge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.025);
}

.pricing-preview-breakdown span,
.pricing-current-charge span,
.pricing-current-charge small {
  color: var(--muted);
}

.pricing-preview-breakdown .is-highlight {
  border-color: rgba(132, 169, 255, 0.3);
  background: rgba(132, 169, 255, 0.08);
}

.pricing-current-charge {
  display: grid;
  gap: 5px;
  border-color: rgba(255, 207, 90, 0.25);
  background: rgba(255, 207, 90, 0.06);
}

.pricing-preview-note {
  margin-top: 14px;
  padding: 13px;
  border: 1px solid rgba(132, 169, 255, 0.2);
  border-radius: 15px;
  background: rgba(132, 169, 255, 0.06);
}

.pricing-preview-note p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.pricing-history {
  display: grid;
  gap: 10px;
}

.pricing-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.pricing-history-row > div:first-child,
.pricing-history-values {
  display: grid;
  gap: 4px;
}

.pricing-history-row span {
  color: var(--muted);
  font-size: 12px;
}

.pricing-history-values {
  text-align: right;
}

@media (max-width: 1180px) {
  .pricing-main-grid {
    grid-template-columns: 1fr;
  }

  .pricing-preview-card {
    position: static;
  }
}

@media (max-width: 760px) {
  .pricing-hero,
  .pricing-form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .pricing-choice-grid,
  .pricing-field-grid,
  .pricing-fixed-rules,
  .pricing-guide-grid,
  .pricing-history-row {
    grid-template-columns: 1fr;
  }

  .pricing-history-values {
    text-align: left;
  }

  .pricing-preview-breakdown > div {
    align-items: flex-start;
    flex-direction: column;
  }

  .pricing-hero-actions,
  .pricing-hero-actions > *,
  .pricing-form-actions > * {
    width: 100%;
  }
}

/* ======================================================
   Navigation SaaS — groupes repliables et page active
   ====================================================== */

.bo-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bo-nav-groups {
  display: grid;
  gap: 8px;
}

.bo-nav-group {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.018);
  transition:
    border-color 0.16s ease,
    background 0.16s ease;
}

.bo-nav-group.is-open,
.bo-nav-group.is-current {
  border-color: rgba(132, 169, 255, 0.18);
  background: rgba(132, 169, 255, 0.04);
}

.bo-nav-group-toggle {
  width: 100%;
  min-height: 44px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  box-shadow: none;
}

.bo-nav-group-toggle:hover,
.bo-nav-group-toggle:focus-visible,
.bo-nav-group.is-open .bo-nav-group-toggle {
  transform: none;
  color: var(--text);
  background: rgba(132, 169, 255, 0.065);
}

.bo-nav-group-toggle:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(132, 169, 255, 0.35);
}

.bo-nav-group-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.015em;
}

.bo-nav-group-chevron {
  justify-self: end;
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px);
  transform-origin: center;
  transition: transform 0.16s ease;
}

.bo-nav-group.is-open .bo-nav-group-chevron {
  transform: rotate(225deg) translate(-1px, -1px);
}

.bo-nav-group-panel {
  display: grid;
  gap: 5px;
  padding: 4px 6px 7px;
}

.bo-nav-group-panel[hidden] {
  display: none !important;
}

.bo-nav a.bo-nav-link {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 9px 11px;
  border-radius: 11px;
  border: 1px solid transparent;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.018);
  line-height: 1.25;
}

.bo-nav a.bo-nav-link--standalone {
  min-height: 44px;
  padding: 11px 13px;
  border-radius: 14px;
  font-weight: 850;
}

.bo-nav a.bo-nav-link.is-active,
.bo-nav a.bo-nav-link:hover,
.bo-nav a.bo-nav-link:focus-visible {
  color: var(--text);
  border-color: rgba(132, 169, 255, 0.2);
  background: rgba(132, 169, 255, 0.095);
}

.bo-nav a.bo-nav-link.is-active {
  box-shadow: inset 3px 0 0 var(--accent);
  font-weight: 850;
}

.bo-nav a.bo-nav-link:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(132, 169, 255, 0.35);
}

@media (max-width: 980px) {
  .bo-nav {
    display: grid;
    gap: 8px;
    overflow: visible;
    padding: 0;
  }

  .bo-nav-groups {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .bo-nav-group.is-open {
    grid-column: 1 / -1;
  }

  .bo-nav-group-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bo-nav a.bo-nav-link {
    flex: initial;
    white-space: normal;
  }
}

@media (max-width: 700px) {
  .bo-nav-groups,
  .bo-nav-group-panel {
    grid-template-columns: 1fr;
  }

  .bo-nav-group.is-open {
    grid-column: auto;
  }

  .bo-nav-group-label {
    white-space: normal;
  }
}
/* ======================================================
   Navigation SaaS — tiroir responsive moderne
   ====================================================== */

.bo-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.bo-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
}

.bo-menu-toggle,
.bo-sidebar-close,
.bo-sidebar-backdrop {
  display: none;
}

.bo-menu-toggle,
.bo-sidebar-close {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 13px;
  place-items: center;
  border: 1px solid rgba(132, 169, 255, 0.22);
  background:
    radial-gradient(
      circle at top left,
      rgba(132, 169, 255, 0.2),
      transparent 60%
    ),
    rgba(255, 255, 255, 0.035);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.bo-menu-toggle:hover,
.bo-menu-toggle:focus-visible,
.bo-sidebar-close:hover,
.bo-sidebar-close:focus-visible {
  transform: none;
  border-color: rgba(132, 169, 255, 0.42);
  background:
    radial-gradient(
      circle at top left,
      rgba(132, 169, 255, 0.28),
      transparent 60%
    ),
    rgba(132, 169, 255, 0.1);
  outline: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 0 0 3px rgba(132, 169, 255, 0.11);
}

.bo-menu-toggle__bars {
  width: 18px;
  display: grid;
  gap: 4px;
}

.bo-menu-toggle__bars span {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition:
    transform 0.18s ease,
    opacity 0.18s ease;
}

body.is-sidebar-open .bo-menu-toggle__bars span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

body.is-sidebar-open .bo-menu-toggle__bars span:nth-child(2) {
  opacity: 0;
}

body.is-sidebar-open .bo-menu-toggle__bars span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.bo-sidebar-close span {
  position: relative;
  width: 18px;
  height: 18px;
}

.bo-sidebar-close span::before,
.bo-sidebar-close span::after {
  content: "";
  position: absolute;
  top: 8px;
  left: 1px;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.bo-sidebar-close span::before {
  transform: rotate(45deg);
}

.bo-sidebar-close span::after {
  transform: rotate(-45deg);
}

/* Laptop intermédiaire : menu moins envahissant sans perdre les libellés. */
@media (min-width: 1181px) and (max-width: 1360px) {
  .bo-app {
    grid-template-columns: 248px minmax(0, 1fr);
  }

  .bo-sidebar {
    padding: 14px;
    gap: 14px;
  }

  .bo-nav-group-label,
  .bo-nav a.bo-nav-link {
    font-size: 12.5px;
  }
}

/* Écrans intermédiaires, tablettes et petits laptops : tiroir off-canvas. */
@media (max-width: 1180px) {
  body[data-page] {
    overflow-x: hidden;
  }

  body[data-page].is-sidebar-open {
    overflow: hidden !important;
  }

  .bo-app {
    grid-template-columns: minmax(0, 1fr);
  }

  .bo-menu-toggle,
  .bo-sidebar-close {
    display: inline-grid;
  }

  .bo-sidebar {
    position: fixed;
    z-index: 130;
    inset: 0 auto 0 0;
    width: min(320px, calc(100vw - 42px));
    height: 100dvh;
    max-height: 100dvh;
    padding: 16px;
    gap: 16px;
    overflow-y: auto;
    overflow-x: hidden;
    border-right: 1px solid rgba(132, 169, 255, 0.2);
    border-bottom: 0;
    border-radius: 0 22px 22px 0;
    background:
      radial-gradient(
        circle at top left,
        rgba(132, 169, 255, 0.16),
        transparent 32%
      ),
      rgba(14, 21, 39, 0.975);
    box-shadow: 24px 0 70px rgba(0, 0, 0, 0.46);
    backdrop-filter: blur(22px);
    transform: translateX(calc(-100% - 24px));
    visibility: hidden;
    transition:
      transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
      visibility 0s linear 0.22s;
    overscroll-behavior: contain;
  }

  body.is-sidebar-open .bo-sidebar {
    transform: translateX(0);
    visibility: visible;
    transition:
      transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
      visibility 0s;
  }

  .bo-sidebar-backdrop {
    position: fixed;
    z-index: 120;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    display: block;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    background: rgba(3, 7, 18, 0.62);
    backdrop-filter: blur(4px);
    transition:
      opacity 0.2s ease,
      visibility 0s linear 0.2s;
  }

  body.is-sidebar-open .bo-sidebar-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition:
      opacity 0.2s ease,
      visibility 0s;
  }

  .bo-nav {
    display: grid;
    gap: 8px;
    overflow: visible;
    padding: 0;
  }

  .bo-nav-groups,
  .bo-nav-group-panel {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .bo-nav-group.is-open {
    grid-column: auto;
  }

  .bo-nav a.bo-nav-link {
    flex: initial;
    white-space: normal;
  }

  .sidebar-bottom {
    margin-top: auto;
  }

  .bo-main {
    width: 100%;
    padding: 16px;
  }

  .topbar-left {
    width: 100%;
  }

  .page-title-row {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
  }

  .page-title-row h1 {
    min-width: 0;
  }

  .page-title-actions {
    justify-self: end;
  }
}

@media (max-width: 700px) {
  .bo-sidebar {
    width: min(310px, calc(100vw - 18px));
    padding: 14px;
    border-radius: 0 18px 18px 0;
  }

  .bo-main {
    padding: 12px;
  }

  .page-title-row {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 9px;
  }

  .bo-menu-toggle,
  .bo-sidebar-close {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    border-radius: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bo-sidebar,
  .bo-sidebar-backdrop,
  .bo-menu-toggle__bars span {
    transition: none !important;
  }
}

/* ======================================================
   Tarification Marketplace — offres commerciales
   ====================================================== */

.pricing-commercial-shell {
  min-width: 0;
}

.pricing-commercial-card {
  gap: 16px;
  overflow: visible;
}

.pricing-commercial-head,
.pricing-commercial-block-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.pricing-commercial-head h2 {
  margin: 4px 0 7px;
  font-size: clamp(22px, 1.8vw, 30px);
  line-height: 1.1;
}

.pricing-commercial-head p,
.pricing-commercial-block-head p {
  margin: 0;
  max-width: 920px;
  line-height: 1.45;
}

.pricing-commercial-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex: 0 0 auto;
}

.pricing-commercial-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.pricing-commercial-summary article {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.pricing-commercial-summary span,
.pricing-commercial-plan-grid span {
  color: var(--muted);
  font-size: 12px;
}

.pricing-commercial-summary strong {
  font-size: 20px;
  overflow-wrap: anywhere;
}

.pricing-commercial-unavailable {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid rgba(255, 207, 90, 0.28);
  border-radius: 15px;
  background: rgba(255, 207, 90, 0.08);
  color: #fff0be;
}

.pricing-commercial-unavailable span {
  color: var(--muted);
}

.pricing-commercial-content {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
  gap: 16px;
  min-width: 0;
}

.pricing-commercial-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.018);
}

.pricing-commercial-block-head h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

.pricing-commercial-plan-list,
.pricing-commercial-assignment-list {
  display: grid;
  gap: 10px;
}

.pricing-commercial-plan-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(132, 169, 255, 0.22);
  border-left: 4px solid rgba(132, 169, 255, 0.68);
  border-radius: 16px;
  background:
    radial-gradient(
      circle at top right,
      rgba(132, 169, 255, 0.1),
      transparent 42%
    ),
    rgba(11, 16, 32, 0.34);
}

.pricing-commercial-plan-card.is-default {
  border-color: rgba(61, 213, 152, 0.34);
  border-left-color: var(--ok);
  background:
    radial-gradient(
      circle at top right,
      rgba(61, 213, 152, 0.11),
      transparent 42%
    ),
    rgba(11, 16, 32, 0.34);
}

.pricing-commercial-plan-card.is-disabled {
  opacity: 0.7;
  border-style: dashed;
}

.pricing-commercial-plan-top,
.pricing-commercial-plan-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.pricing-commercial-plan-title {
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
}

.pricing-commercial-plan-title h3 {
  margin: 0;
  font-size: 18px;
}

.pricing-commercial-plan-card code {
  display: inline-flex;
  margin-top: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: #dbe7fb;
  font-size: 12px;
}

.pricing-commercial-plan-card > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.pricing-commercial-plan-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.pricing-commercial-plan-grid > div {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.pricing-commercial-plan-grid strong {
  overflow-wrap: anywhere;
}

.pricing-commercial-assignment-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(11, 16, 32, 0.32);
}

.pricing-commercial-assignment-row.is-ended {
  opacity: 0.7;
  border-style: dashed;
}

.pricing-commercial-assignment-row strong,
.pricing-commercial-assignment-row span,
.pricing-commercial-assignment-row small {
  display: block;
}

.pricing-commercial-assignment-row span,
.pricing-commercial-assignment-row small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.pricing-commercial-assignment-meta {
  min-width: 150px;
  text-align: right;
}

.pricing-commercial-assignment-row .danger {
  min-height: 34px;
  white-space: nowrap;
}

.pricing-commercial-modal {
  gap: 14px;
}

.pricing-commercial-modal-intro,
.pricing-commercial-safety-note {
  display: grid;
  gap: 5px;
  padding: 13px 14px;
  border: 1px solid rgba(132, 169, 255, 0.22);
  border-radius: 14px;
  background: rgba(132, 169, 255, 0.07);
}

.pricing-commercial-modal-intro.is-warning {
  border-color: rgba(255, 207, 90, 0.28);
  background: rgba(255, 207, 90, 0.08);
}

.pricing-commercial-modal-intro span,
.pricing-commercial-safety-note span {
  color: var(--muted);
  line-height: 1.45;
}

.pricing-commercial-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.pricing-commercial-modal-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.pricing-commercial-modal-grid label small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
}

.pricing-commercial-toggle-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.pricing-commercial-toggle-grid label {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
}

.pricing-commercial-toggle-grid input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}

.pricing-commercial-toggle-grid strong,
.pricing-commercial-toggle-grid small {
  display: block;
}

.pricing-commercial-toggle-grid small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.pricing-commercial-commission-fields {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 14px;
  border: 1px solid rgba(132, 169, 255, 0.22);
  border-radius: 15px;
  background: rgba(132, 169, 255, 0.055);
}

.pricing-commercial-commission-fields legend {
  padding: 0 7px;
  color: #dbe7fb;
  font-weight: 900;
}

.pricing-commercial-commission-fields.is-disabled {
  opacity: 0.56;
}

@media (max-width: 1180px) {
  .pricing-commercial-content,
  .pricing-commercial-summary,
  .pricing-commercial-plan-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pricing-commercial-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .pricing-commercial-head,
  .pricing-commercial-plan-top {
    display: grid;
    grid-template-columns: 1fr;
  }

  .pricing-commercial-actions,
  .pricing-commercial-actions > *,
  .pricing-commercial-summary,
  .pricing-commercial-plan-grid,
  .pricing-commercial-modal-grid,
  .pricing-commercial-toggle-grid,
  .pricing-commercial-assignment-row {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .pricing-commercial-assignment-meta {
    min-width: 0;
    text-align: left;
  }

  .pricing-commercial-assignment-row .danger,
  .pricing-commercial-plan-top .mini-btn {
    width: 100%;
  }
}
/* ======================================================
   Emails — aide guidée Brevo
   ====================================================== */

body[data-page="emails"] .email-provider-brevo-help {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid rgba(132, 169, 255, 0.26);
  border-radius: 16px;
  background:
    radial-gradient(
      circle at top right,
      rgba(132, 169, 255, 0.14),
      transparent 42%
    ),
    rgba(132, 169, 255, 0.06);
}

body[data-page="emails"] .email-provider-brevo-help__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

body[data-page="emails"] .email-provider-brevo-help__head > div {
  display: grid;
  gap: 4px;
}

body[data-page="emails"] .email-provider-brevo-help__head strong {
  color: var(--text);
  font-size: 15px;
}

body[data-page="emails"] .email-provider-brevo-help__head span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

body[data-page="emails"] .email-provider-brevo-help__link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  white-space: nowrap;
}

body[data-page="emails"] .email-provider-brevo-help__steps {
  margin: 0;
  padding-left: 22px;
  color: #dbe7fb;
}

body[data-page="emails"] .email-provider-brevo-help__steps li {
  margin: 6px 0;
  line-height: 1.45;
}

body[data-page="emails"] .email-provider-brevo-help__warning {
  padding: 10px 12px;
  border: 1px solid rgba(255, 207, 90, 0.28);
  border-radius: 13px;
  background: rgba(255, 207, 90, 0.08);
  color: #ffe9a8;
  font-size: 12.5px;
  line-height: 1.45;
}

@media (max-width: 760px) {
  body[data-page="emails"] .email-provider-brevo-help__head {
    display: grid;
    grid-template-columns: 1fr;
  }

  body[data-page="emails"] .email-provider-brevo-help__link {
    width: 100%;
  }
}
/* ======================================================
   Emails - Brevo guided setup V4
   ====================================================== */

body[data-page="emails"] .email-provider-brevo-help {
  display: grid;
  gap: 10px;
  margin-bottom: 4px;
  padding: 12px;
}

body[data-page="emails"] .email-provider-brevo-help__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

body[data-page="emails"] .email-provider-brevo-help__head > div {
  display: grid;
  gap: 3px;
}

body[data-page="emails"] .email-provider-brevo-help__head strong {
  color: var(--text);
  font-size: 14px;
}

body[data-page="emails"] .email-provider-brevo-help__head span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

body[data-page="emails"] .email-provider-brevo-help__link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  white-space: nowrap;
}

body[data-page="emails"] .email-provider-brevo-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

body[data-page="emails"] .email-provider-brevo-steps article {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
}

body[data-page="emails"] .email-provider-brevo-step-number {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(132, 169, 255, 0.18);
  border: 1px solid rgba(132, 169, 255, 0.30);
  color: #eef3fb;
  font-size: 11px;
  font-weight: 900;
}

body[data-page="emails"] .email-provider-brevo-steps strong,
body[data-page="emails"] .email-provider-brevo-steps small {
  display: block;
}

body[data-page="emails"] .email-provider-brevo-steps strong {
  margin-bottom: 3px;
  color: var(--text);
  font-size: 12px;
}

body[data-page="emails"] .email-provider-brevo-steps small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.36;
}

body[data-page="emails"] .email-provider-brevo-steps b {
  color: #dbe7ff;
  font-weight: 800;
}

body[data-page="emails"] .email-provider-brevo-help__warning {
  padding: 8px 10px;
  border: 1px solid rgba(255, 207, 90, 0.28);
  border-radius: 11px;
  background: rgba(255, 207, 90, 0.08);
  color: #ffe9a8;
  font-size: 11px;
  line-height: 1.4;
}

body[data-page="emails"] .email-provider-brevo-field-help {
  margin-top: -1px;
  color: #aebfe1;
  font-size: 10.5px;
  line-height: 1.3;
}

@media (max-width: 760px) {
  body[data-page="emails"] .email-provider-brevo-help__head,
  body[data-page="emails"] .email-provider-brevo-steps {
    display: grid;
    grid-template-columns: 1fr;
  }

  body[data-page="emails"] .email-provider-brevo-help__link {
    width: 100%;
  }
}
/* ======================================================
   Emails - assistant Brevo V5
   ====================================================== */

body[data-page="emails"] .email-provider-guided-form-v5 {
  display: grid;
  gap: 12px;
}

body[data-page="emails"] .email-provider-guided-step {
  display: grid;
  gap: 11px;
  padding: 13px;
  border: 1px solid rgba(132, 169, 255, 0.18);
  border-radius: 16px;
  background: rgba(132, 169, 255, 0.045);
}

body[data-page="emails"] .email-provider-guided-step__head {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

body[data-page="emails"] .email-provider-guided-step__number {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #08111f;
  font-size: 13px;
  font-weight: 900;
}

body[data-page="emails"] .email-provider-guided-step__head h3 {
  margin: 1px 0 3px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.2;
}

body[data-page="emails"] .email-provider-guided-step__head p {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.4;
}

body[data-page="emails"] .email-provider-guided-step__body {
  display: grid;
  gap: 10px;
}

body[data-page="emails"] .email-provider-guided-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

body[data-page="emails"] .email-provider-guided-fields--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body[data-page="emails"]
  .email-provider-guided-fields--2
  .email-provider-field--full {
  grid-column: auto;
}

body[data-page="emails"] .email-provider-guided-field-help {
  color: #afc0df !important;
  font-size: 10.5px !important;
  line-height: 1.3 !important;
}

body[data-page="emails"] .email-provider-guided-technical {
  border: 1px dashed rgba(132, 169, 255, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.018);
}

body[data-page="emails"] .email-provider-guided-technical summary {
  cursor: pointer;
  padding: 9px 10px;
  color: #cbd8f5;
  font-size: 11px;
  font-weight: 800;
}

body[data-page="emails"] .email-provider-guided-technical__body {
  padding: 0 10px 10px;
}

body[data-page="emails"] .email-provider-guided-security {
  padding: 9px 10px;
  border: 1px solid rgba(255, 207, 90, 0.24);
  border-radius: 11px;
  background: rgba(255, 207, 90, 0.07);
  color: #ffe9a8;
  font-size: 10.5px;
  line-height: 1.4;
}

body[data-page="emails"] .email-provider-guided-step--actions {
  margin-top: 0;
  border-color: rgba(61, 213, 152, 0.2);
  background: rgba(61, 213, 152, 0.045);
}

body[data-page="emails"] .email-provider-actions--guided {
  margin-top: -4px;
  padding-top: 0;
  border-top: 0;
}

body[data-page="emails"] .email-provider-guided-leftover {
  display: none !important;
}

@media (max-width: 760px) {
  body[data-page="emails"] .email-provider-guided-fields--2 {
    grid-template-columns: 1fr;
  }
}
/* ======================================================
   Emails - assistant Brevo V6
   ====================================================== */

body[data-page="emails"] .email-provider-guided-form-v6 {
  display: grid;
  gap: 12px;
}

body[data-page="emails"] .email-provider-guided-inline-help {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.35;
}