:root {
  /* Fond & surfaces */
  --bg-main: #030712;
  --bg-gradient-top: #111827;
  --bg-gradient-bottom: #020617;
  --bg-card: rgba(15, 23, 42, 0.96);
  --bg-elevated: rgba(15, 23, 42, 0.98);

  /* Couleurs néon / accents */
  --accent-purple: #a855f7;
  --accent-pink: #ec4899;
  --accent-blue: #38bdf8;
  --accent-orange: #f97316;

  /* Texte */
  --text-main: #e5e7eb;
  --text-soft: #9ca3af;
  --text-muted: #6b7280;

  /* Bordures & ombres */
  --border-subtle: rgba(148, 163, 184, 0.28);
  --border-strong: rgba(148, 163, 184, 0.45);
  --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.85);

  /* Rayons */
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 9px;
  --radius-pill: 999px;

  /* Transitions */
  --transition-fast: 0.16s ease-out;
  --transition-med: 0.24s ease-out;
}

/* ===========================================
   RESET
   =========================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at top, var(--bg-gradient-top) 0, var(--bg-gradient-bottom) 48%, #000 100%);
}

/* ===========================================
   SHELL GLOBAL
   =========================================== */

.app-shell {
  max-width: 1400px;
  margin: 24px auto 40px;
  padding: 20px 22px 32px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 0 0, rgba(88, 28, 135, 0.32) 0, transparent 45%),
    radial-gradient(circle at 100% 0, rgba(56, 189, 248, 0.22) 0, transparent 45%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(3, 7, 18, 0.99));
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.85),
    0 0 0 1px rgba(148, 163, 184, 0.22);
}

/* ===========================================
   HEADER
   =========================================== */

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 18px;
  padding: 4px 4px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.32);
}

header h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.35rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f9fafb;
}

.logo-dot {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #facc15 0, #f97316 38%, #fb7185 100%);
  box-shadow: 0 0 20px rgba(248, 250, 252, 0.9);
}

.subtitle {
  margin: 4px 0 0 26px;
  font-size: 0.86rem;
  color: var(--text-soft);
}

.badge-env {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(30, 64, 175, 0.8), rgba(12, 74, 110, 0.96));
  border: 1px solid rgba(191, 219, 254, 0.4);
  backdrop-filter: blur(10px);
}

.badge-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #bbf7d0 0, #22c55e 40%, #16a34a 100%);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.95);
}

.badge-text {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ===========================================
   CARTE GENERIQUE
   =========================================== */

.card {
  margin-top: 14px;
  padding: 18px 20px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.99)),
    radial-gradient(circle at top left, rgba(30, 64, 175, 0.4), transparent 55%);
  box-shadow: var(--shadow-soft);
}

/* ===========================================
   FORMULAIRES / CHAMPS
   =========================================== */

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.field-inline {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft);
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
textarea,
select {
  padding: 8px 10px;
  border-radius: 11px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background:
    radial-gradient(circle at top left, rgba(15, 23, 42, 0.96) 0, rgba(15, 23, 42, 1) 50%, #020617 100%);
  color: var(--text-main);
  font-size: 0.9rem;
  outline: none;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast),
    transform 0.1s ease-out;
}

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

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent-blue);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.6),
    0 0 0 8px rgba(56, 189, 248, 0.15);
  background:
    radial-gradient(circle at 0 0, rgba(30, 64, 175, 0.24), rgba(15, 23, 42, 1));
  transform: translateY(-1px);
}

select,
select option {
  background-color: #020617;
  color: #e5e7eb;
}

.help {
  margin: 4px 0 0;
  font-size: 0.75rem;
  color: var(--text-soft);
}

.help.small {
  font-size: 0.72rem;
}

.status-text,
.small-status {
  font-size: 0.8rem;
  color: var(--text-soft);
}

.small-status {
  margin-left: 8px;
}

.field-hidden {
  display: none;
}

/* ===========================================
   BOUTONS
   =========================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast),
    box-shadow var(--transition-fast),
    transform 0.08s ease-out;
}

.btn-small {
  padding: 4px 10px;
  font-size: 0.76rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-orange), var(--accent-pink));
  border-color: rgba(253, 186, 116, 0.9);
  color: #020617;
  box-shadow:
    0 12px 30px rgba(248, 113, 113, 0.6),
    0 0 0 1px rgba(249, 250, 251, 0.16);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #fb923c, #fb7185);
  transform: translateY(-1px);
  box-shadow:
    0 16px 35px rgba(248, 113, 113, 0.7),
    0 0 0 1px rgba(249, 250, 251, 0.18);
}

.btn-primary:active {
  background: linear-gradient(135deg, #ea580c, #f97373);
  transform: translateY(0);
  box-shadow:
    0 8px 22px rgba(248, 113, 113, 0.6),
    0 0 0 1px rgba(249, 250, 251, 0.2);
}

.btn-ghost {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(148, 163, 184, 0.5);
  color: var(--text-soft);
}

.btn-ghost:hover {
  background: rgba(30, 64, 175, 0.4);
  border-color: rgba(129, 140, 248, 0.7);
  color: #e5e7eb;
}

.footer-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Boutons dans les tableaux */

.table-wrapper button,
#articles-tbody button {
  padding: 6px 14px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background:
    radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.35), transparent 55%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 1));
  color: #e5e7eb;
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.9);
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    transform 0.08s ease-out,
    box-shadow var(--transition-fast);
}

.table-wrapper button:hover,
#articles-tbody button:hover {
  background:
    radial-gradient(circle at 0 0, rgba(236, 72, 153, 0.5), transparent 55%),
    linear-gradient(135deg, #4c1d95, #ec4899);
  color: #f9fafb;
  box-shadow:
    0 0 18px rgba(236, 72, 153, 0.8),
    0 10px 24px rgba(0, 0, 0, 0.9);
  transform: translateY(-1px);
}

.table-wrapper button:active,
#articles-tbody button:active {
  transform: translateY(0);
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(248, 250, 252, 0.15);
}

/* ===========================================
   ONGLET / TABS
   =========================================== */

.admin-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  padding: 4px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(3, 7, 18, 0.98));
  border: 1px solid rgba(148, 163, 184, 0.36);
  box-shadow: 0 15px 35px rgba(15, 23, 42, 0.85);
  overflow-x: auto;
  scrollbar-width: thin;
}

.admin-tabs::-webkit-scrollbar {
  height: 4px;
}
.admin-tabs::-webkit-scrollbar-track {
  background: transparent;
}
.admin-tabs::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.55);
  border-radius: 999px;
}

.tab-button {
  border-radius: var(--radius-pill);
  border: 0;
  padding: 6px 14px;
  font-size: 0.8rem;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast),
    transform 0.08s ease-out,
    box-shadow 0.18s ease-out;
}

.tab-button:hover {
  background: rgba(31, 41, 55, 0.9);
  color: #e5e7eb;
}

.tab-button.active {
  background:
    radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.5), transparent 60%),
    linear-gradient(135deg, rgba(76, 29, 149, 0.98), rgba(236, 72, 153, 0.98));
  color: #f9fafb;
  box-shadow:
    0 0 0 1px rgba(248, 250, 252, 0.16),
    0 0 26px rgba(129, 140, 248, 0.7);
}

/* Panels d’onglet – logique commune */

.tab-panel {
  display: none;
  margin-top: 10px;
}

.tab-panel.active {
  display: block;
}

/* ===========================================
   GRILLES / TABLES / LAYOUT GENERIQUE
   =========================================== */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1.1fr);
  gap: 16px;
}

.table-wrapper {
  padding: 10px 12px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.99));
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

thead tr {
  background: rgba(15, 23, 42, 0.98);
}

th,
td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(31, 41, 55, 0.95);
}

th {
  text-align: left;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft);
}

td {
  color: var(--text-main);
}

tbody tr:nth-child(even) td {
  background: rgba(15, 23, 42, 0.7);
}

tbody tr:hover td {
  background: rgba(30, 64, 175, 0.5);
}

.col-num {
  text-align: right;
}

.sub-table-wrapper {
  max-height: 220px;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.96);
}

.sub-table {
  width: 100%;
  border-collapse: collapse;
}

.sub-table th,
.sub-table td {
  padding: 4px 6px;
  border-bottom: 1px solid rgba(30, 41, 59, 0.98);
}

.form-card {
  padding: 10px 12px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.97), rgba(15, 23, 42, 1));
}

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

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

.metric-card {
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.5);
  background:
    radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.3), transparent 60%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(2, 6, 23, 0.99));
}

.metric-label {
  margin: 0 0 4px;
  font-size: 0.78rem;
  color: var(--text-soft);
}

.metric-value {
  margin: 0 0 4px;
  font-size: 1.3rem;
}

.metric-help {
  margin: 0;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.pill,
.pill-small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  font-size: 0.78rem;
  color: var(--text-soft);
}

.pill-small {
  font-size: 0.72rem;
}
/* ===========================================
   APPARENCE – LAYOUT GÉNÉRAL
   =========================================== */

.appearance-layout {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

/* Colonne gauche : sélection pages / zones */
.appearance-left {
  flex: 0 0 360px;
  max-width: 380px;
}

/* Colonne droite : preview + éditeur */
.appearance-right {
  flex: 1;
  min-width: 0;
}

/* Panneaux colonne gauche (pages / zones) */

.appearance-page-panel {
  margin-bottom: 12px;
}

.appearance-page-panel .appearance-page-panel-inner,
.appearance-page-panel-inner {
  padding: 10px 12px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.5);
  background:
    radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.18), transparent 60%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(2, 6, 23, 0.99));
}

.appearance-page-select-field {
  margin-top: 10px;
}

.appearance-page-select-field label {
  font-weight: 600;
  font-size: 0.85rem;
}

.appearance-page-select-field select {
  width: 100%;
  margin-top: 6px;
}

/* ===========================================
   CARTE D'APERÇU + IFRAME
   =========================================== */

.appearance-preview-card {
  padding: 10px 12px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.6);
  background:
    radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.28), transparent 60%),
    radial-gradient(circle at 100% 0, rgba(236, 72, 153, 0.22), transparent 60%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(2, 6, 23, 0.99));
  box-shadow: var(--shadow-soft);
  overflow: visible;
}

.appearance-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

/* ===========================================
   PREVIEW + PANNEAUX EN COLONNE
   =========================================== */

.preview-css-layout {
  display: block;
}

/* Bloc iframe */

.preview-wrapper {
  margin-bottom: 12px;
}

/* Iframe large et haute */

.appearance-preview-frame {
  width: 100%;
  max-width: 2000px;
  height: 80vh;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: #000;
  box-shadow:
    0 22px 50px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(15, 23, 42, 0.98);
}

/* Desktop : full width */
.appearance-preview-card[data-device="desktop"] .appearance-preview-frame {
  max-width: 100%;
}

/* Tablet / mobile : limites optionnelles */
.appearance-preview-card[data-device="tablet"] .appearance-preview-frame {
  max-width: 900px;
}

.appearance-preview-card[data-device="mobile"] .appearance-preview-frame {
  max-width: 420px;
}

/* ===========================================
   TOOLBAR APPAREILS
   =========================================== */

.device-toolbar {
  display: inline-flex;
  gap: 4px;
  padding: 2px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.6);
}

.device-btn {
  border: 0;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.76rem;
  cursor: pointer;
  background: transparent;
  color: var(--text-soft);
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast),
    transform 0.08s ease-out;
}

.device-btn:hover {
  background: rgba(31, 41, 55, 0.98);
  color: #e5e7eb;
}

.device-btn.active {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.98), rgba(236, 72, 153, 0.96));
  color: #0b1120;
}

/* ===========================================
   PANNEAU DE DROITE (STYLES / CONTENU)
   =========================================== */

.editor-panel {
  padding: 8px 10px 10px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.6);
  background:
    radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.3), transparent 60%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 1));
}

/* Wrapper des deux panneaux (styles / contenu) */
.editor-mode-panels {
  margin-top: 6px;
}

/* Panneaux liés aux modes (Styles / Contenu) */

.editor-mode-panel {
  display: none;
  margin-top: 6px;
  padding: 8px 9px 10px;
  border-radius: 13px;
  border: 1px solid rgba(148, 163, 184, 0.62);
  background:
    radial-gradient(circle at 0 0, rgba(148, 163, 184, 0.22), transparent 60%),
    linear-gradient(135deg, rgba(15, 23, 42, 1), rgba(2, 6, 23, 0.98));
}

.editor-mode-panel.active {
  display: block;
}

/* Contexte (page / zone / élément) */

.editor-context {
  display: grid;
  grid-template-columns: auto 1fr;
  row-gap: 2px;
  column-gap: 6px;
  margin-bottom: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.6);
}

.context-row {
  display: contents;
}

.context-label {
  font-size: 0.78rem;
  color: var(--text-soft);
}

.context-value {
  font-size: 0.8rem;
  font-weight: 600;
  color: #e5e7eb;
  word-break: break-all;
}

/* Switch de mode Styles / Contenu */

.editor-mode-switch {
  display: inline-flex;
  gap: 4px;
  padding: 2px;
  margin: 6px 0 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.7);
}

.mode-btn {
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.8rem;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast);
}

.mode-btn:hover {
  background: rgba(31, 41, 55, 0.98);
  color: #e5e7eb;
}

.mode-btn.active {
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.96), rgba(229, 231, 235, 0.94));
  color: #020617;
}

/* ===========================================
   ONGLET STYLES – CSS EDITOR
   (contenu de #editor-css-panel)
   =========================================== */

.css-panel-title {
  margin-bottom: 4px;
  font-size: 0.86rem;
  font-weight: 600;
  color: #e5e7eb;
}

/* États Normal / Hover / Active */

.state-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 2px;
  margin-bottom: 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.7);
}

.state-btn {
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.78rem;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast);
}

.state-btn:hover {
  background: rgba(31, 41, 55, 0.98);
  color: #e5e7eb;
}

.state-btn.active {
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.96), rgba(229, 231, 235, 0.94));
  color: #020617;
}

/* Corps du panneau CSS structuré en blocs */

.editor-controls {
  margin-top: 6px;
  padding: 8px 9px 10px;
  border-radius: 13px;
  border: 1px solid rgba(148, 163, 184, 0.62);
  background:
    radial-gradient(circle at 0 0, rgba(148, 163, 184, 0.22), transparent 60%),
    linear-gradient(135deg, rgba(15, 23, 42, 1), rgba(2, 6, 23, 0.98));
  transition: opacity var(--transition-med);
}

.editor-controls.disabled,
.editor-controls[data-disabled="true"] {
  opacity: 0.5;
  pointer-events: none;
}

/* Blocs logiques (Couleurs, Typo, Bordures, etc.) */

.design-block {
  padding: 8px 8px 9px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.96);
  margin-bottom: 8px;
}

.design-block-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.design-block-header label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #e5e7eb;
}

.design-block-header .help.small {
  font-size: 0.72rem;
  color: var(--text-soft);
}

/* Palette néon */

.neon-palette {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 6px 0 4px;
}

.btn-neon {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid rgba(15, 23, 42, 0.98);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(248, 250, 252, 0.9);
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.btn-neon:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 0 18px rgba(248, 250, 252, 1);
}

/* Champs du bloc Couleurs / Typo / Effets */

.editor-controls .form-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin-top: 4px;
}

.editor-controls .form-row .field {
  flex: 1;
}

.color-input {
  width: 100%;
  height: 30px;
  padding: 0;
}

/* Sliders d'ombre */

.slider-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.slider-row input[type="range"] {
  flex: 1;
}

.slider-row span {
  min-width: 26px;
  text-align: right;
  font-size: 0.76rem;
  color: var(--text-soft);
}

/* ================================
   Modal édition texte – SBS_TEXT_PANEL
   ================================ */

.sbs-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.sbs-modal.hidden {
  display: none;
}

.sbs-modal-content {
  background: #ffffff;
  color: #111827;
  border-radius: 12px;
  padding: 1.5rem;
  width: 90%;
  max-width: 520px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
}

/* … le reste de tes règles pour #sbs-textarea, .sbs-modal-actions, .sbs-text-item, etc. */


.sbs-modal-content h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
  font-weight: 600;
}

#sbs-textarea {
  width: 100%;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  resize: vertical;
  min-height: 120px;
}

.sbs-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.sbs-modal-actions button {
  border-radius: 999px;
  border: 1px solid #d1d5db;
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
  cursor: pointer;
  background: #f9fafb;
}

.sbs-modal-actions button.primary {
  background: #ec4899;
  border-color: #ec4899;
  color: #ffffff;
}

.sbs-modal-actions button.primary:hover {
  background: #db2777;
}

/* Liste des textes dans le panneau contenu */

#sbs-text-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.sbs-text-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.04);
  font-size: 0.85rem;
}

.sbs-text-item span {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sbs-text-item .sbs-btn-edit {
  border-radius: 999px;
  border: 1px solid #d1d5db;
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
  cursor: pointer;
  background: #f9fafb;
}

/* Panneau images – apparence des slots */
.image-slot-item {
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  padding: 10px 0 14px;
}

.sbs-image-dropzone {
  margin-top: 6px;
  border-radius: 10px;
  border: 1px dashed rgba(148, 163, 184, 0.7);
  background: rgba(15, 23, 42, 0.6);
  cursor: pointer;
  padding: 10px;
  transition: all 0.15s ease;
}

.sbs-image-dropzone-inner {
  text-align: center;
  font-size: 0.8rem;
  line-height: 1.4;
  opacity: 0.9;
}

.sbs-image-dropzone-title {
  font-weight: 600;
}

.sbs-image-dropzone-sub {
  font-size: 0.7rem;
  opacity: 0.8;
}

/* État dragover */
.sbs-image-dropzone.is-dragover {
  border-color: #f97316;
  background: rgba(30, 64, 175, 0.4);
  box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.6);
}

/* Petite pastille */
.badge-small {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 0.65rem;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.5);
}


/* ajuste après, je te renvoie index.html réécrit entièrement */



/* ===========================================
/* ==========================================================================
   SEO – PAGES (UI V2) — SAFE OVERRIDES
   Objectif : plus joli, fonctionnel, intuitif, sans casser le JS
   ========================================================================== */

/* -----------------------------
   Preview Google (plus clean)
------------------------------ */
.seo-preview{
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.92), rgba(2, 6, 23, 0.98));
  box-shadow: 0 10px 28px rgba(0,0,0,0.35);
}

.seo-preview-url{
  margin: 0 0 4px;
  font-size: 0.80rem;
  color: #22c55e;
  opacity: 0.95;
}

.seo-preview-title{
  margin: 0 0 6px;
  font-size: 0.98rem;
  font-weight: 900;
  letter-spacing: 0.2px;
  color: #e5e7eb;
}

.seo-preview-desc{
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-soft);
  opacity: 0.92;
  line-height: 1.35;
}

/* -----------------------------
   Erreurs / messages
------------------------------ */
.error-msg{
  margin-top: 8px;
  font-size: 0.82rem;
  color: #f97373;
  opacity: 0.95;
}

/* -----------------------------
   Suggestions (cards plus “premium”)
------------------------------ */
.seo-suggestions{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 8px;
}

@media (max-width: 900px){
  .seo-suggestions{ grid-template-columns: 1fr; }
}

.seo-suggestion-block{
  position: relative;
  overflow: hidden;
  padding: 10px 10px 12px;
  border-radius: 16px;

  border: 1px solid rgba(129, 140, 248, 0.35);
  background:
    radial-gradient(circle at 10% 0%, rgba(56, 189, 248, 0.18), transparent 60%),
    radial-gradient(circle at 90% 20%, rgba(236, 72, 153, 0.10), transparent 55%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.98));

  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.35);
}

.seo-suggestion-block::before{
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(56, 189, 248, 0.22),
    rgba(236, 72, 153, 0.18),
    rgba(129, 140, 248, 0.22)
  );
  opacity: 0;
  mix-blend-mode: screen;
  pointer-events: none;
  transition: opacity var(--transition-med, 180ms ease);
}

.seo-suggestion-block:hover::before{
  opacity: 0.65;
}

/* Textarea dans les suggestions */
.seo-suggestion-block textarea{
  font-size: 0.86rem;
  min-height: 92px;
  line-height: 1.35;
  border-radius: 12px;
}

/* Focus visible (UX) */
.seo-suggestion-block textarea:focus{
  outline: none;
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

/* -----------------------------
   Séparateur de section (plus léger)
------------------------------ */
.section-separator{
  border: 0;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  margin: 18px 0 14px;
  opacity: 1;
  position: relative;
}

.section-separator::after{
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: -1px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(56, 189, 248, 0.45),
    rgba(236, 72, 153, 0.45),
    transparent
  );
  opacity: 0.65;
}

/* ==========================================================================
   TABLE SEO PAGES — UI V2 (lisible + sticky header + hover)
   ========================================================================== */

.seo-pages-table{
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;

  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(2, 6, 23, 0.35);
}

/* cellules */
.seo-pages-table th,
.seo-pages-table td{
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;

  padding: 10px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  vertical-align: middle;
}

/* sticky header */
.seo-pages-table thead th{
  position: sticky;
  top: 0;
  z-index: 2;

  background: rgba(2, 6, 23, 0.92);
  backdrop-filter: blur(8px);
  font-weight: 900;
  letter-spacing: 0.15px;
}

/* lignes hover */
.seo-pages-table tbody tr:hover td{
  background: rgba(255,255,255,0.03);
}

/* dernière ligne */
.seo-pages-table tbody tr:last-child td{
  border-bottom: none;
}

/* colonnes (tes largeurs inchangées) */
.seo-pages-table th:nth-child(1),
.seo-pages-table td:nth-child(1){ width: 18%; }
.seo-pages-table th:nth-child(2),
.seo-pages-table td:nth-child(2){ width: 22%; }
.seo-pages-table th:nth-child(3),
.seo-pages-table td:nth-child(3){ width: 22%; }
.seo-pages-table th:nth-child(4),
.seo-pages-table td:nth-child(4){ width: 28%; }
.seo-pages-table th:nth-child(5),
.seo-pages-table td:nth-child(5){ width: 10%; }

/* tri (icônes plus propres) */
.seo-pages-table th{
  cursor: pointer;
  position: relative;
  user-select: none;
}

.seo-pages-table th::after{
  content: "⇅";
  font-size: 0.75rem;
  color: rgba(156, 163, 175, 0.70);
  margin-left: 6px;
}

.seo-pages-table th.sorted-asc::after{
  content: "↑";
  color: var(--accent-blue, #38bdf8);
}

.seo-pages-table th.sorted-desc::after{
  content: "↓";
  color: var(--accent-blue, #38bdf8);
}

/* Focus clavier sur header triable */
.seo-pages-table th:focus{
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(56, 189, 248, 0.35);
  border-radius: 8px;
}

/* Responsive : la table reste lisible */
@media (max-width: 860px){
  .seo-pages-table th,
  .seo-pages-table td{
    padding: 9px 8px;
    font-size: 0.92rem;
  }
}
/* ==========================================================================
   SEO IMAGES — UI V2 (SAFE OVERRIDES)
   Objectif : plus clair, plus pro, plus intuitif, sans casser le JS
   ========================================================================== */

/* -----------------------------
   Bloc global
------------------------------ */
.seo-images-block{
  margin-top: 10px;
}

/* -----------------------------
   Sub toolbar (titre + compteur)
------------------------------ */
.sub-toolbar{
  margin-bottom: 12px;
  padding-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sub-toolbar h3{
  margin: 0;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.2px;
  color: #e5e7eb;
  text-shadow: 0 0 6px rgba(236, 72, 153, 0.45);
}

/* Compteur images */
#seo-images-count{
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;

  background:
    radial-gradient(circle at 10% 0%, rgba(56, 189, 248, 0.22), transparent 60%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 1));

  border: 1px solid rgba(129, 140, 248, 0.55);
  color: #e5e7eb;
  box-shadow: 0 6px 18px rgba(0,0,0,0.45);
}

/* ==========================================================================
   TABLE SEO IMAGES — plus lisible
   ========================================================================== */

.seo-images-table{
  table-layout: fixed;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;

  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(2, 6, 23, 0.35);
}

/* Header */
.seo-images-table thead th{
  position: sticky;
  top: 0;
  z-index: 2;

  background: rgba(2, 6, 23, 0.92);
  backdrop-filter: blur(8px);

  font-weight: 900;
  letter-spacing: 0.15px;
  padding: 10px 10px;
}

/* Cellules */
.seo-images-table th,
.seo-images-table td{
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;

  padding: 10px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  vertical-align: middle;
}

/* Dernière ligne */
.seo-images-table tbody tr:last-child td{
  border-bottom: none;
}

/* Hover ligne */
#seo-images-tbody tr{
  cursor: pointer;
  transition:
    background-color var(--transition-fast, 120ms ease),
    box-shadow var(--transition-fast, 120ms ease),
    transform 0.08s ease-out;
}

#seo-images-tbody tr:hover td{
  background: rgba(255,255,255,0.035);
}

/* Ligne sélectionnée */
#seo-images-tbody tr.seo-image-selected td{
  background:
    radial-gradient(circle at 0 0, rgba(59, 130, 246, 0.30), transparent 55%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 1));

  box-shadow:
    inset 0 0 0 1px rgba(248, 250, 252, 0.18),
    0 8px 22px rgba(0,0,0,0.45);

  transform: translateY(-1px);
}

/* Colonnes (inchangées) */
.seo-images-table th:nth-child(1),
.seo-images-table td:nth-child(1){ width: 12%; }
.seo-images-table th:nth-child(2),
.seo-images-table td:nth-child(2){ width: 28%; }
.seo-images-table th:nth-child(3),
.seo-images-table td:nth-child(3){ width: 28%; }
.seo-images-table th:nth-child(4),
.seo-images-table td:nth-child(4){ width: 32%; }

/* ==========================================================================
   THUMBNAILS — plus propres
   ========================================================================== */

#seo-images-tbody td.seo-image-thumb-cell{
  width: 64px;
}

#seo-images-tbody .seo-image-thumb{
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  display: block;

  border: 1px solid rgba(129, 140, 248, 0.55);
  background: radial-gradient(circle at center, #020617 0%, #000 100%);

  box-shadow:
    0 0 10px rgba(56, 189, 248, 0.45),
    0 6px 16px rgba(0, 0, 0, 0.85);
}

/* ==========================================================================
   PREVIEW IMAGE (panneau droit)
   ========================================================================== */

.seo-image-preview{
  width: 100%;
  margin-bottom: 8px;
  padding: 10px;
  border-radius: 16px;

  border: 1px solid rgba(129, 140, 248, 0.55);
  background:
    radial-gradient(circle at 10% 0%, rgba(56, 189, 248, 0.22), transparent 60%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 1));

  display: flex;
  align-items: center;
  justify-content: center;

  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.65);
}

#seo-image-preview-img{
  max-width: 100%;
  max-height: 200px;
  border-radius: 14px;
  object-fit: contain;

  border: 1px solid rgba(15, 23, 42, 0.95);
  background: #020617;
}

/* Placeholder si aucune image sélectionnée */
.seo-image-preview.empty{
  min-height: 200px;
  opacity: 0.75;
  font-size: 0.9rem;
  display: grid;
  place-items: center;
  text-align: center;
}

/* ===========================================
   SEO IMAGES — Bande "images liées" (vignettes)
   Fix: trop grandes -> mini thumbnails + scroll
   =========================================== */

#seo-image-related-strip{
  display: flex;
  gap: 10px;
  align-items: center;

  padding: 10px;
  margin-top: 8px;

  border-radius: 14px;
  border: 1px solid rgba(129, 140, 248, 0.35);
  background: rgba(0,0,0,0.18);

  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scroll-snap-type: x mandatory;
}

#seo-image-related-strip::-webkit-scrollbar{ height: 10px; }
#seo-image-related-strip::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,0.12);
  border-radius: 999px;
}

/* Si le JS injecte des <img> directement */
#seo-image-related-strip img{
  width: 70px !important;
  height: 70px !important;
  object-fit: cover;

  border-radius: 12px;
  border: 1px solid rgba(129, 140, 248, 0.55);
  background: #020617;

  flex: 0 0 auto;
  cursor: pointer;
  scroll-snap-align: start;

  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}

#seo-image-related-strip img:hover{
  transform: translateY(-1px) scale(1.03);
  border-color: rgba(56, 189, 248, 0.85);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.35);
}

/* Si le JS injecte des "items" (div, button, a...) contenant une img */
#seo-image-related-strip > *{
  flex: 0 0 auto;
}

#seo-image-related-strip > * img{
  width: 70px !important;
  height: 70px !important;
}

/* Option : état sélectionné (si ton JS ajoute une classe) */
#seo-image-related-strip .is-active img,
#seo-image-related-strip .active img,
#seo-image-related-strip .selected img{
  border-color: rgba(236, 72, 153, 0.9);
  box-shadow: 0 0 18px rgba(236, 72, 153, 0.35);
}


/* ==========================================================================
   Responsive léger
   ========================================================================== */
@media (max-width: 900px){
  .seo-images-table th,
  .seo-images-table td{
    padding: 9px 8px;
    font-size: 0.92rem;
  }

  #seo-image-preview-img{
    max-height: 160px;
  }
}
/* ==========================================================================
   PRODUITS – UI V2 (LISTE + FICHE) + POPOUT (Vue agrandie)
   - TAB : scoped à #tab-products
   - POPOUT : scoped à #products-popout-overlay (important)
   ========================================================================== */

/* ======================================================================
   1) TAB PRODUITS (dans #tab-products)
   ====================================================================== */

/* -----------------------------
   Base tab
------------------------------ */
#tab-products .tab-header{
  display: flex;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

#tab-products .tab-header-left h2{
  margin: 0;
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 0.2px;
}

#tab-products .tab-description{
  margin: 6px 0 0 0;
  opacity: 0.8;
  line-height: 1.35;
}

#tab-products .tab-header-actions{
  display: flex;
  gap: 10px;
  align-items: center;
}

/* -----------------------------
   Split layout (liste / fiche)
------------------------------ */
#tab-products .tab-products-layout{
  display: grid;
  grid-template-columns: 420px 8px 1fr;
  gap: 0;
  min-height: 560px;
}

#tab-products .sbs-pane-left,
#tab-products .sbs-pane-right{
  min-height: 560px;
}

/* Panneau gauche */
#tab-products .products-list-column{
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255,255,255,0.08);
  padding-right: 10px;
}

/* Panneau droit */
#tab-products .product-detail-column{
  padding-left: 12px;
  overflow: hidden;
}

/* Splitter */
#tab-products .sbs-splitter{
  cursor: col-resize;
  border-radius: 999px;
  margin: 0 6px;
  opacity: 0.9;
  background: rgba(255,255,255,0.08);
}
#tab-products .sbs-splitter:hover{ background: rgba(255,255,255,0.12); }
#tab-products .sbs-splitter:active{ background: rgba(255,255,255,0.16); }

/* Responsive : sur petits écrans, empilement */
@media (max-width: 1100px){
  #tab-products .tab-products-layout{ grid-template-columns: 1fr; }
  #tab-products .sbs-splitter{ display: none; }

  #tab-products .products-list-column{
    border-right: none;
    padding-right: 0;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }

  #tab-products .product-detail-column{
    padding-left: 0;
    padding-top: 12px;
  }
}

/* -----------------------------
   Pane header (mini)
------------------------------ */
#tab-products .sbs-pane-header.products-pane-top{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 8px 8px 0;
}

/* =========================================================
   FIX DÉFINITIF : doublon Agrandir / Réduire (Produits)
   - On garde la barre d’actions du header principal
   - On supprime celle sous le texte "Liste produits"
   ========================================================= */

/* On cache TOUTES les barres d’actions par défaut */
#tab-products .products-pane-actions{
  display: none !important;
}

/* On réactive UNIQUEMENT celle du header principal */
#tab-products .sbs-pane-header.products-pane-top > .products-pane-actions{
  display: flex !important;
  align-items: center;
  gap: 8px;
}

/* Sécurité : si une barre est imbriquée plus bas (sous le texte) */
#tab-products .products-pane-top .status-text + .products-pane-actions{
  display: none !important;
}

/* -----------------------------
   BULK BAR
------------------------------ */
#tab-products #products-bulk-bar{
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  border-radius: 14px;
  padding: 10px;
  margin: 6px 0 10px 0;
}
#tab-products #products-bulk-bar.hidden{ display: none; }

#tab-products .bulk-row{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}
#tab-products .bulk-left{
  display: flex;
  gap: 8px;
  align-items: center;
}
#tab-products .bulk-controls{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}
#tab-products #bulk-status{
  margin-top: 8px;
  opacity: 0.85;
  font-size: 0.95rem;
}

/* -----------------------------
   KPIs
------------------------------ */
#tab-products .products-kpis{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 6px 0 10px 0;
}
#tab-products .products-kpis .kpi{
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  border-radius: 14px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
#tab-products .products-kpis .kpi-label{
  opacity: 0.75;
  font-size: 0.85rem;
}
#tab-products .products-kpis .kpi-value{
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: 0.2px;
}
@media (max-width: 520px){
  #tab-products .products-kpis{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* -----------------------------
   Toolbar (recherche + filtres)
------------------------------ */
#tab-products .products-toolbar{
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  border-radius: 16px;
  padding: 10px;
  margin-bottom: 10px;
}

#tab-products .products-search-group{
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-bottom: 10px;
}
#tab-products .products-search-group label{
  font-weight: 800;
  opacity: 0.85;
  font-size: 0.92rem;
}

#tab-products #products-search{
  width: 100%;
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.25);
  color: inherit;
}
#tab-products #products-search::placeholder{ opacity: 0.65; }

#tab-products .products-filters{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
#tab-products .products-filters select{
  width: 100%;
  border-radius: 12px;
  padding: 9px 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.25);
  color: inherit;
}
@media (max-width: 920px){
  #tab-products .products-filters{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px){
  #tab-products .products-filters{ grid-template-columns: 1fr; }
}

#tab-products .products-toolbar-footer{
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

/* -----------------------------
   Liste produits (compact ligne)
------------------------------ */
#tab-products #products-list{
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 6px 2px 4px 0;
  overflow: auto;
  max-height: calc(100vh - 360px);
  padding-right: 6px;
}

/* Scroll list */
#tab-products #products-list::-webkit-scrollbar{ width: 10px; }
#tab-products #products-list::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,0.12);
  border-radius: 999px;
}
#tab-products #products-list::-webkit-scrollbar-thumb:hover{
  background: rgba(255,255,255,0.18);
}

/* Cartes (markup injecté par JS : on reste générique) */
#tab-products #products-list .product-card,
#tab-products #products-list .card,
#tab-products #products-list .item,
#tab-products #products-list > div{
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
  border-radius: 16px;

  display: flex;
  align-items: center;
  gap: 12px;

  padding: 10px 12px;
  min-height: 78px;
  max-height: 92px;
  overflow: hidden;
}

#tab-products #products-list .product-card:hover,
#tab-products #products-list .card:hover,
#tab-products #products-list .item:hover,
#tab-products #products-list > div:hover{
  background: rgba(255,255,255,0.045);
  border-color: rgba(255,255,255,0.14);
}

#tab-products #products-list .is-active,
#tab-products #products-list .active,
#tab-products #products-list .selected{
  border-color: rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.06);
}

#tab-products #products-list input[type="checkbox"]{
  flex: 0 0 auto;
  transform: scale(1.05);
}

#tab-products #products-list img{
  flex: 0 0 auto;
  width: 64px !important;
  height: 64px !important;
  object-fit: cover;
  border-radius: 14px;
  display: block;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
}

#tab-products #products-list .product-info,
#tab-products #products-list .info,
#tab-products #products-list .content,
#tab-products #products-list .meta,
#tab-products #products-list .details,
#tab-products #products-list > div > div{
  flex: 1 1 auto;
  min-width: 0; /* ellipsis */
}

#tab-products #products-list h1,
#tab-products #products-list h2,
#tab-products #products-list h3,
#tab-products #products-list h4,
#tab-products #products-list p,
#tab-products #products-list span,
#tab-products #products-list small{
  margin: 0;
  line-height: 1.15;
}

#tab-products #products-list h3,
#tab-products #products-list h4,
#tab-products #products-list .name,
#tab-products #products-list .title{
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#tab-products #products-list p,
#tab-products #products-list .desc,
#tab-products #products-list .subtitle,
#tab-products #products-list .muted,
#tab-products #products-list small{
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#tab-products #products-list .badge,
#tab-products #products-list .tag{
  flex: 0 0 auto;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.82rem;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.25);
}

/* -----------------------------
   Fiche produit (form)
------------------------------ */
#tab-products #product-form{
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  overflow: auto;
  padding-right: 2px;
}

#tab-products #product-form::-webkit-scrollbar{ width: 10px; }
#tab-products #product-form::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,0.12);
  border-radius: 999px;
}

#tab-products .product-sticky-top{
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 10px 0;
  backdrop-filter: blur(6px);
  background: rgba(0,0,0,0.35);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

#tab-products .product-top-actions{
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
#tab-products #product-form-status{ opacity: 0.85; }

/* Sections */
#tab-products .product-section{
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
  border-radius: 18px;
  padding: 12px;
}
#tab-products .product-section legend{
  font-weight: 900;
  padding: 0 8px;
  opacity: 0.92;
}

#tab-products .form-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 900px){
  #tab-products .form-grid{ grid-template-columns: 1fr; }
}

#tab-products .form-group{
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#tab-products .form-group label{
  font-weight: 800;
  opacity: 0.9;
  font-size: 0.92rem;
}

#tab-products .form-control,
#tab-products .form-select,
#tab-products textarea,
#tab-products input[type="text"],
#tab-products input[type="number"],
#tab-products select{
  width: 100%;
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.22);
  color: inherit;
}

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

#tab-products .placement-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }

#tab-products .help,
#tab-products .hint{
  opacity: 0.75;
  font-size: 0.9rem;
  margin: 6px 0 0 0;
}

#tab-products .field{
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}
#tab-products .field label{
  font-weight: 800;
  opacity: 0.9;
  font-size: 0.92rem;
}
#tab-products #product-vitrine-file{
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.22);
  color: inherit;
}

/* Image principale */
#tab-products .product-image-grid{
  grid-template-columns: 1fr 180px;
  align-items: end;
}
@media (max-width: 900px){
  #tab-products .product-image-grid{ grid-template-columns: 1fr; }
}

#tab-products #product-main-image-preview{
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
}

/* Utilitaires */
#tab-products .status-text{ opacity: 0.82; }
#tab-products .muted{ opacity: 0.72; }
#tab-products .text-danger{ color: #ff7b7b; }

#tab-products .btn{ border-radius: 12px; }
#tab-products .btn-small{ padding: 8px 10px; }


/* ======================================================================
   2) POPOUT (overlay) — SCOPED À #products-popout-overlay
   ⚠️ ne jamais le mettre sous #tab-products
   ====================================================================== */

#products-popout-overlay{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none; /* JS bascule en flex */
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0,0,0,0.70);
  backdrop-filter: blur(10px);
}

#products-popout-overlay .products-popout-card{
  width: min(1600px, 98vw);
  height: min(92vh, 980px);

  display: grid;
  grid-template-rows: auto auto 1fr;
  overflow: hidden;

  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.10);
  background: radial-gradient(
    1200px 700px at 20% 0%,
    rgba(255,255,255,0.09),
    rgba(255,255,255,0.03) 60%,
    rgba(0,0,0,0.25)
  );
  box-shadow: 0 30px 90px rgba(0,0,0,0.65);
}

#products-popout-overlay .products-popout-header{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

#products-popout-overlay .products-popout-title h3{
  margin: 0;
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 0.2px;
}

#products-popout-overlay .products-popout-subtitle{
  margin-top: 4px;
  font-size: 0.92rem;
  opacity: 0.82;
}

#products-popout-overlay .products-popout-toolbar{
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(0,0,0,0.14);
}

#products-popout-overlay .products-popout-body{
  display: grid;
  grid-template-columns: minmax(520px, 1fr) 460px;
  gap: 16px;
  padding: 16px 20px;
  overflow: hidden;
}

/* LEFT */
#products-popout-overlay .products-popout-left{
  overflow: hidden;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

#products-popout-overlay .products-popout-left-host{
  flex: 1;
  overflow: hidden;
  min-width: 0;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.18);
}

/* Quand on clône #products-pane-left ici */
#products-popout-overlay .products-popout-left-host #products-pane-left{
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 14px;

  border: 0;
  background: transparent;

  display: grid;
  grid-template-rows: auto auto auto 1fr; /* bulk / kpis / toolbar / list */
  gap: 12px;
}

/* On cache le mini header */
#products-popout-overlay .products-popout-left-host #products-pane-left .products-pane-top{
  display: none !important;
}

/* Bulk controls en grille (popout) */
#products-popout-overlay .products-popout-left-host #products-pane-left #products-bulk-bar .bulk-controls{
  display: grid;
  grid-template-columns: 220px 220px 1fr auto auto;
  gap: 10px;
  align-items: center;
}
@media (max-width: 1200px){
  #products-popout-overlay .products-popout-left-host #products-pane-left #products-bulk-bar .bulk-controls{
    grid-template-columns: 1fr 1fr;
  }
}

/* KPIs en grille (popout) */
#products-popout-overlay .products-popout-left-host #products-pane-left .products-kpis{
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 12px;
}
@media (max-width: 980px){
  #products-popout-overlay .products-popout-left-host #products-pane-left .products-kpis{
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
}

/* Filtres en haut (popout) */
#products-popout-overlay .products-popout-left-host #products-pane-left .products-filters{
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

@media (max-width: 1180px){
  #products-popout-overlay .products-popout-left-host #products-pane-left .products-filters{
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }
}

@media (max-width: 680px){
  #products-popout-overlay .products-popout-left-host #products-pane-left .products-filters{
    grid-template-columns: 1fr;
  }
}

/* Recherche : largeur totale (popout) */
#products-popout-overlay .products-popout-left-host #products-pane-left #products-search{
  width: 100%;
}

/* Footer “xxx produits chargés” */
#products-popout-overlay .products-popout-left-host #products-pane-left .products-toolbar-footer{
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.06);
  opacity: 0.92;
}

/* LISTE (zone scroll) — POP-OUT */
#products-popout-overlay .products-popout-left-host #products-pane-left #products-list{
  max-height: none;
  overflow: auto;
  padding-right: 8px;

  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 12px;
  align-content: start;
}

/* Scrollbar liste (popout) */
#products-popout-overlay .products-popout-left-host #products-pane-left #products-list::-webkit-scrollbar{
  width: 10px;
}
#products-popout-overlay .products-popout-left-host #products-pane-left #products-list::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,0.14);
  border-radius: 999px;
}

@media (max-width: 1320px){
  #products-popout-overlay .products-popout-left-host #products-pane-left #products-list{
    grid-template-columns: 1fr;
  }
}

/* Cartes dans le popout */
#products-popout-overlay .products-popout-left-host #products-pane-left #products-list .product-card,
#products-popout-overlay .products-popout-left-host #products-pane-left #products-list .card,
#products-popout-overlay .products-popout-left-host #products-pane-left #products-list .item,
#products-popout-overlay .products-popout-left-host #products-pane-left #products-list > div{
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.035);
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.25);
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}

#products-popout-overlay .products-popout-left-host #products-pane-left #products-list .product-card:hover,
#products-popout-overlay .products-popout-left-host #products-pane-left #products-list .card:hover,
#products-popout-overlay .products-popout-left-host #products-pane-left #products-list .item:hover,
#products-popout-overlay .products-popout-left-host #products-pane-left #products-list > div:hover{
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.05);
}

#products-popout-overlay .products-popout-left-host #products-pane-left #products-list .is-active,
#products-popout-overlay .products-popout-left-host #products-pane-left #products-list .active,
#products-popout-overlay .products-popout-left-host #products-pane-left #products-list .selected{
  border-color: rgba(255,255,255,0.30);
  background: rgba(255,255,255,0.075);
}

/* RIGHT */
#products-popout-overlay .products-popout-right{
  overflow: hidden;
  min-width: 0;
}

#products-popout-overlay #products-popout-detail{
  height: 100%;
  overflow: auto;
  padding: 14px;

  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.18);
}

#products-popout-overlay #products-popout-detail::-webkit-scrollbar{
  width: 10px;
}
#products-popout-overlay #products-popout-detail::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,0.14);
  border-radius: 999px;
}

/* Image principale (si tu injectes une <img>) */
#products-popout-overlay #products-popout-detail .popout-product-image{
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
  display: block;
  margin-bottom: 12px;
}

/* Bloc titre + meta */
#products-popout-overlay #products-popout-detail .popout-product-title{
  margin: 0 0 6px 0;
  font-weight: 900;
  font-size: 1.05rem;
  letter-spacing: 0.2px;
}

#products-popout-overlay #products-popout-detail .popout-product-meta{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 10px 0 12px 0;
}

#products-popout-overlay #products-popout-detail .popout-kv{
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  border-radius: 14px;
  padding: 10px;
}
#products-popout-overlay #products-popout-detail .popout-k{
  font-size: 0.82rem;
  opacity: 0.78;
  margin-bottom: 4px;
  font-weight: 800;
}
#products-popout-overlay #products-popout-detail .popout-v{
  font-weight: 900;
  opacity: 0.95;
}

#products-popout-overlay #products-popout-detail .popout-product-desc{
  opacity: 0.86;
  line-height: 1.4;
  border-top: 1px dashed rgba(255,255,255,0.10);
  padding-top: 10px;
  margin-top: 10px;
}

#products-popout-overlay #products-popout-detail .popout-empty{
  min-height: 240px;
  display: grid;
  place-items: center;
  text-align: center;
  opacity: 0.70;
  padding: 20px;
}
#products-popout-overlay #products-popout-detail .popout-empty strong{
  display: block;
  font-weight: 900;
  opacity: 0.95;
  margin-bottom: 6px;
}

/* RESPONSIVE POPOUT GLOBAL */
@media (max-width: 1200px){
  #products-popout-overlay .products-popout-body{
    grid-template-columns: 1fr;
  }
  #products-popout-overlay .products-popout-right{ order: 2; }
  #products-popout-overlay .products-popout-left{ order: 1; }

  #products-popout-overlay #products-popout-detail{
    height: auto;
    max-height: 45vh;
  }
}
   /* ===========================================
   STRUCTURE WORKSPACE — FULLSCREEN LAYOUT
   =========================================== */

/* Onglet Structure */
#tab-structure {
  background: #0f111a;
  overflow: visible;
  position: relative;
}

/* On force le layout en colonne, sans limiter la hauteur */
#tab-structure.tab-panel.active {
  display: flex;
  flex-direction: column;
}

/* En-tête de l'onglet (Barre d'outils) */
.structure-top-bar {
  flex: 0 0 auto;
  padding: 12px 20px;
  background: #161924;
  border-bottom: 1px solid #2a2e3b;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}

.structure-top-bar h2 {
  font-size: 1rem;
  margin: 0;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Zone principale : Canvas + Sidebar */
.structure-workspace {
  display: flex;
  flex: 1 1 auto;
  overflow: hidden;
  position: relative;
  min-height: 360px;
}

/* Colonne gauche : arbre + preview + export */
.structure-left {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

/* ZONE GAUCHE : LE CANVAS (ARBRE) */
.structure-canvas {
  flex: 1 1 auto;
  background-color: #050712;
  background-image:
    linear-gradient(#1a1d29 1px, transparent 1px),
    linear-gradient(90deg, #1a1d29 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: center top;
  overflow: auto;
  padding: 40px;
  position: relative;
  cursor: grab;
}

.structure-canvas:active {
  cursor: grabbing;
}

/* ZONE DROITE : L'INSPECTEUR (FORMULAIRE) */
.structure-sidebar {
  width: 340px;
  background: #161924;
  border-left: 1px solid #2a2e3b;
  display: flex;
  flex-direction: column;
  box-shadow: -5px 0 20px rgba(0, 0, 0, 0.3);
  z-index: 20;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid #2a2e3b;
  background: #1b1f2e;
}
.sidebar-header h3 {
  margin: 0;
  font-size: 0.95rem;
  color: #e2e8f0;
}
.sidebar-header p {
  margin: 4px 0 0;
  font-size: 0.75rem;
  color: #94a3b8;
}

.sidebar-content {
  padding: 16px;
  overflow-y: auto;
  flex: 1 1 auto;
}

/* ===========================================
   DESIGN DE L'ARBRE (TREE VIEW)
   =========================================== */

.tree-root {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: fit-content;
}

/* Conteneur d'un nœud */
.structure-node {
  position: relative;
  padding-left: 20px;
}

/* Enfants (sous-catégories) */
.structure-node-children {
  margin-left: 20px;
  padding-left: 20px;
  border-left: 2px solid #334155;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

/* Carte du nœud */
.structure-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #1e293b;
  border: 1px solid #334155;
  padding: 8px 12px;
  border-radius: 8px;
  min-width: 220px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

/* Connecteur horizontal */
.structure-node-children .structure-node > .structure-card::before {
  content: "";
  position: absolute;
  left: -42px;
  top: 50%;
  width: 42px;
  height: 2px;
  background: #334155;
}

/* Effets au survol et sélection */
.structure-card:hover {
  background: #283549;
  border-color: #64748b;
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

.structure-card.is-selected {
  background: #1e293b;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.4);
}
.structure-card.is-selected::after {
  content: "EDITING";
  position: absolute;
  top: -8px;
  right: 10px;
  font-size: 0.6rem;
  background: #3b82f6;
  color: #fff;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: bold;
}

/* Style selon le type (bordure gauche colorée) */
.structure-card[data-type="category"] {
  border-left: 4px solid #f59e0b;
}
.structure-card[data-type="subcategory"] {
  border-left: 4px solid #a855f7;
}
.structure-card[data-type="page"] {
  border-left: 4px solid #10b981;
}

/* Contenu de la carte */
.card-icon {
  color: #94a3b8;
  font-size: 1.1rem;
}
.card-info {
  display: flex;
  flex-direction: column;
}
.card-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: #f1f5f9;
}
.card-meta {
  font-size: 0.7rem;
  color: #64748b;
}

/* Badges dans la carte */
.card-badges {
  margin-left: auto;
  display: flex;
  gap: 4px;
}
.mini-badge {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.bg-femme {
  background: #ec4899;
  box-shadow: 0 0 5px #ec4899;
}
.bg-homme {
  background: #06b6d4;
  box-shadow: 0 0 5px #06b6d4;
}

/* Formulaire Sidebar */
.sidebar-form-group {
  margin-bottom: 16px;
}
.sidebar-form-group label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-bottom: 6px;
}
.sidebar-input {
  width: 100%;
  background: #0f111a;
  border: 1px solid #334155;
  padding: 8px 10px;
  border-radius: 6px;
  color: #fff;
  font-size: 0.9rem;
}
.sidebar-input:focus {
  border-color: #3b82f6;
  outline: none;
}

/* ===========================================
   PRÉVISUALISATION DU MENU (STRUCTURE)
   =========================================== */

.menu-preview-wrapper {
  flex: 0 0 auto;
  padding: 16px 20px 20px;
  border-top: 1px solid #1e293b;
  background: #020617;
}

.menu-preview-card {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 16px 16px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background:
    radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.25), transparent 60%),
    radial-gradient(circle at 100% 0, rgba(236, 72, 153, 0.2), transparent 60%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 1));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.85);
}

.menu-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.menu-preview-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-preview-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #22c55e 0, #4ade80 45%, #16a34a 100%);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.9);
}

.menu-preview-header h3 {
  margin: 0;
  font-size: 0.95rem;
  color: #e5e7eb;
}

.menu-preview-header p {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: #9ca3af;
}

.menu-preview-mode {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.5);
}

.menu-preview-mode-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9ca3af;
  margin-right: 4px;
}

.menu-layout-btn {
  border-radius: 999px;
  border: 0;
  padding: 4px 10px;
  font-size: 0.78rem;
  cursor: pointer;
  background: transparent;
  color: #9ca3af;
  transition:
    background-color 0.16s ease-out,
    color 0.16s ease-out,
    transform 0.08s ease-out;
}

.menu-layout-btn:hover {
  background: rgba(31, 41, 55, 0.98);
  color: #e5e7eb;
}

.menu-layout-btn-active {
  background: linear-gradient(135deg, #f97316, #ec4899);
  color: #020617;
}

/* Conteneur de la nav */
.menu-preview-nav-container {
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(2, 6, 23, 0.96);
  border: 1px solid rgba(30, 64, 175, 0.6);
}

/* ===========================================
   NAV LINKS – MINI BIBLIOTHÈQUE
   =========================================== */

.menu-preview {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
}

/* Layouts */
.menu-preview--horizontal {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.menu-preview--pill {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.menu-preview--stacked {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.menu-preview-item {
  display: inline-flex;
}

.menu-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.55);
  background:
    radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.3), transparent 60%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 1));
  color: #e5e7eb;
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.9);
  transition:
    background 0.16s ease-out,
    color 0.16s ease-out,
    transform 0.08s ease-out,
    box-shadow 0.16s ease-out;
}

.menu-link-icon {
  font-size: 0.9rem;
  opacity: 0.9;
}

.menu-link:hover {
  background:
    radial-gradient(circle at 0 0, rgba(236, 72, 153, 0.45), transparent 60%),
    linear-gradient(135deg, #4c1d95, #ec4899);
  color: #f9fafb;
  transform: translateY(-1px);
  box-shadow:
    0 0 18px rgba(236, 72, 153, 0.8),
    0 10px 24px rgba(0, 0, 0, 0.9);
}

.menu-link:active {
  transform: translateY(0);
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(248, 250, 252, 0.15);
}

.menu-link--active {
  border-color: rgba(250, 204, 21, 0.9);
  background:
    radial-gradient(circle at 0 0, rgba(250, 204, 21, 0.5), transparent 60%),
    linear-gradient(135deg, #f97316, #facc15);
  color: #020617;
  box-shadow:
    0 0 18px rgba(250, 204, 21, 0.8),
    0 12px 28px rgba(0, 0, 0, 0.9);
}

/* ===========================================
   PRÉVISUALISATION RÉELLE DU MENU EXPORTÉ
   =========================================== */

.menu-export-live {
  border-radius: 16px;
  background: #020617;
  padding: 18px 20px;
  border: 1px solid rgba(148, 163, 184, 0.5);
}

/* Le nav généré dans la preview */
.menu-export-live .navbar {
  width: 100%;
  background: #fff5fb;
  border-radius: 999px;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Container fluide dans la preview */
.menu-export-live .navbar .container-fluid {
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Libellé "Menu" à gauche */
.menu-export-live .navbar-brand.menu-text {
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ec4899;
}

/* Bloc UL des liens principaux */
.menu-export-live .navbar-nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 24px;
  list-style: none;
  margin: 0 24px;
  padding: 0;
}

/* Liens de menu */
.menu-export-live .nav-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: #111827;
  text-decoration: none;
  position: relative;
  padding-bottom: 2px;
}

.menu-export-live .nav-link:hover {
  color: #be185d;
}

.menu-export-live .nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #ec4899, #f59e0b);
  transition: width 0.18s ease-out;
}

.menu-export-live .nav-link:hover::after {
  width: 100%;
}

/* Boutons Connexion / Panier à droite */
.menu-export-live .btn {
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
}

/* Connexion : gris */
.menu-export-live .btn-primary {
  background: #6b7280;
  color: #f9fafb;
}

/* Panier : doré */
.menu-export-live .btn-secondary {
  background: #facc15;
  color: #111827;
  margin-left: 8px;
}

/* On masque le burger dans la preview desktop */
.menu-export-live .navbar-toggler {
  display: none;
}

/* --- Base pour tous les textes de menu --- */
.menu-export-live .sbs-menu-label {
  position: relative;
  display: inline-block;
  transform: translate(
    var(--sbs-menu-text-offset-x, 0px),
    var(--sbs-menu-text-offset-y, 0px)
  );
}

/* Alignement horizontal du texte à l'intérieur du bouton */
.menu-export-live[data-text-align="left"]  .navbar .nav-link {
  justify-content: flex-start;
  text-align: left;
}

.menu-export-live[data-text-align="center"] .navbar .nav-link {
  justify-content: center;
  text-align: center;
}

.menu-export-live[data-text-align="right"] .navbar .nav-link {
  justify-content: flex-end;
  text-align: right;
}

/* Décalage vertical gros (haut / milieu / bas) */
.menu-export-live[data-text-valign="top"]    .navbar .nav-link {
  align-items: flex-start;
}
.menu-export-live[data-text-valign="middle"] .navbar .nav-link {
  align-items: center;
}
.menu-export-live[data-text-valign="bottom"] .navbar .nav-link {
  align-items: flex-end;
}

/* ===========================================
   PANNEAU DES ZONES PAR PAGE (STRUCTURE / APPARENCE)
   =========================================== */

.page-zones-panel {
  margin-top: 24px;
  padding: 16px 32px;
  border-top: 1px solid #1e293b;
}

.page-zones-section h3 {
  font-size: 0.95rem;
  margin: 0 0 4px;
  color: #e5e7eb;
}

.page-zones-section p {
  margin: 0 0 10px;
  font-size: 0.8rem;
  color: #9ca3af;
}

.page-zones-zone-card {
  background: #020617;
  border-radius: 10px;
  border: 1px solid #1f2937;
  padding: 12px 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

.page-zones-zone-card:hover {
  border-color: #475569;
}

.page-zone-card-selected {
  box-shadow: 0 0 0 1px #f97316;
}

.page-zones-zone-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.page-zones-zone-badge {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 999px;
  background: #111827;
  border: 1px solid #4b5563;
  color: #e5e7eb;
  font-family: monospace;
}

.page-zones-zone-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #e5e7eb;
}

.page-zones-zone-desc {
  font-size: 0.78rem;
  color: #9ca3af;
  margin: 0;
}

/* === Modal publication brouillon (choix parent) === */

.sbs-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.8); /* fond sombre */
  display: none;                      /* caché par défaut */
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.sbs-modal-backdrop.is-open {
  display: flex;
}

.sbs-modal {
  background: #020617;
  border-radius: 16px;
  border: 1px solid #1e293b;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  max-width: 720px;
  width: 100%;
  padding: 16px 20px;
  color: #e5e7eb;
  font-size: 0.9rem;
}

.sbs-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.sbs-modal-header h3 {
  margin: 0;
  font-size: 1rem;
}

.sbs-modal-close {
  background: transparent;
  border: none;
  color: #9ca3af;
  font-size: 1rem;
  cursor: pointer;
}

.sbs-modal-close:hover {
  color: #f97316;
}

.sbs-modal-body {
  margin-top: 4px;
  margin-bottom: 12px;
}

.sbs-modal-intro {
  font-size: 0.8rem;
  color: #9ca3af;
  margin: 0 0 10px 0;
}

.publish-parent-current-draft {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 0.8rem;
  margin-bottom: 8px;
}

.publish-parent-label {
  color: #9ca3af;
}

.publish-parent-value {
  color: #f97316;
  font-weight: 500;
}

.publish-parent-helper {
  font-size: 0.78rem;
  color: #9ca3af;
  margin-bottom: 10px;
}

.publish-parent-list {
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Item de la liste */
.publish-parent-item {
  border-radius: 10px;
  border: 1px solid #1f2937;
  padding: 8px 10px;
  background: #020617;
  cursor: pointer;
  transition: all 0.15s ease-out;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.publish-parent-item:hover {
  border-color: #f97316;
  box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.4);
  background: #030712;
}

.publish-parent-item.is-selected {
  border-color: #f97316;
  background: rgba(249, 115, 22, 0.12);
  box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.7);
}

.publish-parent-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.publish-parent-title {
  font-size: 0.86rem;
  font-weight: 500;
  color: #e5e7eb;
}

.publish-parent-id {
  font-size: 0.7rem;
  color: #9ca3af;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.publish-parent-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 3px;
  font-size: 0.72rem;
}

.publish-parent-file {
  color: #9ca3af;
}

.publish-parent-badge {
  border-radius: 999px;
  padding: 2px 6px;
  font-size: 0.7rem;
  border: 1px solid #374151;
  background: rgba(15, 23, 42, 0.8);
  color: #e5e7eb;
}

/* footer du modal */
.sbs-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}


/* ===========================================
   RESPONSIVE GLOBAL
   =========================================== */


@media (max-width: 960px) {
  .structure-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .seo-suggestions {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: flex-start;
  }

  header h1 {
    font-size: 1.12rem;
  }

  .app-shell {
    margin: 10px auto 20px;
    padding: 14px 12px 24px;
  }

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

  .form-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .structure-page-form {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* =========================
   GATING VISUEL (NO AUTH)
   ========================= */
body.no-auth #admin-wrapper {
  display: none !important;
}

body.no-auth .admin-tabs,
body.no-auth .tab-button,
body.no-auth [data-tab],
body.no-auth .admin-layout,
body.no-auth .admin-content {
  display: none !important;
}

/* === SEO table : ligne sélectionnée === */
#tab-seo table tr.is-selected {
  background: rgba(120, 80, 200, 0.15);
}

#tab-seo table tr.is-selected td {
  font-weight: 600;
}

#tab-seo table tr:hover {
  background: rgba(120, 80, 200, 0.08);
  cursor: pointer;
}


/* ============================================================
   STRUCTURE EN LIGNE — UX V2
   ============================================================ */

#tab-structure.is-online-view .structure-sidebar .sidebar-form-group {
  display: none;
}

#tab-structure.is-online-view #btn-canvas-add-root {
  display: none !important;
}

#tab-structure.is-online-view .structure-canvas {
  cursor: default;
  padding: 24px;
  text-align: left;
}

#tab-structure.is-online-view .structure-canvas:active {
  cursor: default;
}

.structure-online-tools {
  flex: 0 0 auto;
  padding: 16px 20px 0;
  background: #0b1120;
  border-bottom: 1px solid #1e293b;
}

.structure-online-tools[hidden] {
  display: none !important;
}

.structure-online-tools-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.structure-online-eyebrow {
  color: #60a5fa;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .11em;
}

.structure-online-title {
  margin-top: 3px;
  color: #f8fafc;
  font-size: 1rem;
  font-weight: 800;
}

.structure-online-subtitle {
  margin-top: 4px;
  max-width: 680px;
  color: #94a3b8;
  font-size: .78rem;
  line-height: 1.45;
}

.structure-online-stats {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.structure-online-stats span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 30px;
  padding: 5px 9px;
  color: #cbd5e1;
  font-size: .72rem;
  border: 1px solid #334155;
  border-radius: 999px;
  background: #111827;
}

.structure-online-stats span strong {
  color: #fff;
  font-size: .78rem;
}

.structure-online-stats .has-warning {
  color: #fbbf24;
  border-color: rgba(245,158,11,.55);
  background: rgba(120,53,15,.25);
}

.structure-online-stats .is-ok {
  color: #86efac;
  border-color: rgba(34,197,94,.4);
}

.structure-online-tabs {
  display: flex;
  gap: 4px;
  margin-top: 16px;
}

.structure-online-tabs button {
  appearance: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 9px 14px;
  background: transparent;
  color: #94a3b8;
  font: inherit;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
}

.structure-online-tabs button:hover {
  color: #e2e8f0;
}

.structure-online-tabs button.is-active {
  color: #60a5fa;
  border-bottom-color: #3b82f6;
}

.structure-online-view {
  width: min(100%, 1050px);
  margin: 0 auto;
}

.structure-online-view-intro {
  margin-bottom: 18px;
}

.structure-online-view-intro h3 {
  margin: 0;
  color: #f8fafc;
  font-size: 1rem;
}

.structure-online-view-intro p {
  margin: 5px 0 0;
  max-width: 760px;
  color: #94a3b8;
  font-size: .8rem;
  line-height: 1.5;
}


/* Arbre réel */

.structure-online-tree {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.structure-online-tree-item {
  position: relative;
}

.structure-online-tree-row {
  display: flex;
  align-items: stretch;
  min-height: 50px;
  border: 1px solid #243044;
  border-radius: 9px;
  background: rgba(15,23,42,.92);
  overflow: hidden;
  transition: border-color .18s ease, background .18s ease;
}

.structure-online-tree-row:hover {
  border-color: #475569;
  background: #111c30;
}

.structure-online-tree-row.is-selected {
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px rgba(59,130,246,.22);
}

.structure-online-tree-toggle {
  width: 36px;
  flex: 0 0 36px;
  border: 0;
  border-right: 1px solid #243044;
  background: rgba(2,6,23,.42);
  color: #94a3b8;
  cursor: pointer;
  font-size: 1rem;
}

.structure-online-tree-toggle:disabled {
  cursor: default;
  opacity: .45;
}

.structure-online-tree-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.structure-online-tree-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  border-radius: 7px;
  background: #1e293b;
  color: #cbd5e1;
}

.structure-online-tree-info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.structure-online-tree-info strong {
  overflow: hidden;
  color: #f1f5f9;
  font-size: .83rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.structure-online-tree-info > span {
  margin-top: 2px;
  color: #64748b;
  font-size: .68rem;
}

.structure-online-tree-children {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 7px 0 7px 28px;
  padding-left: 16px;
  border-left: 1px solid #334155;
}

.structure-online-tree-children[hidden] {
  display: none;
}

.structure-online-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: .62rem;
  font-weight: 800;
}

.structure-online-badge.product {
  color: #c4b5fd;
  border: 1px solid rgba(139,92,246,.4);
  background: rgba(76,29,149,.22);
}

.structure-online-badge.page {
  color: #93c5fd;
  border: 1px solid rgba(59,130,246,.35);
  background: rgba(30,64,175,.18);
}


/* Navigation */

.structure-online-search {
  width: 100%;
  margin-bottom: 14px;
  padding: 10px 12px;
  color: #f8fafc;
  border: 1px solid #334155;
  border-radius: 8px;
  outline: none;
  background: #0f172a;
  font-size: .8rem;
}

.structure-online-search:focus {
  border-color: #3b82f6;
}

.structure-online-page-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.structure-online-page-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  text-align: left;
  border: 1px solid #243044;
  border-radius: 8px;
  background: rgba(15,23,42,.92);
  cursor: pointer;
}

.structure-online-page-row:hover {
  border-color: #475569;
  background: #111c30;
}

.structure-online-page-name {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.structure-online-page-name strong {
  color: #e2e8f0;
  font-size: .8rem;
}

.structure-online-page-name small {
  margin-top: 2px;
  overflow: hidden;
  color: #64748b;
  font-size: .66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.structure-online-page-counts {
  flex: 0 0 auto;
  color: #94a3b8;
  font-size: .7rem;
}


/* A traiter */

.structure-issue-group {
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid #334155;
  border-radius: 10px;
  background: rgba(15,23,42,.94);
}

.structure-issue-group.danger {
  border-color: rgba(239,68,68,.35);
}

.structure-issue-group.warning {
  border-color: rgba(245,158,11,.35);
}

.structure-issue-group.info {
  border-color: rgba(59,130,246,.3);
}

.structure-issue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(148,163,184,.12);
}

.structure-issue-header h4 {
  margin: 0;
  color: #e2e8f0;
  font-size: .82rem;
}

.structure-issue-header p {
  margin: 3px 0 0;
  color: #94a3b8;
  font-size: .7rem;
}

.structure-issue-header > strong {
  min-width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #fff;
  background: #1e293b;
  font-size: .72rem;
}

.structure-issue-body {
  display: flex;
  flex-direction: column;
}

.structure-issue-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 14px;
  text-align: left;
  border: 0;
  border-bottom: 1px solid rgba(148,163,184,.1);
  background: transparent;
  cursor: pointer;
}

.structure-issue-row:last-child {
  border-bottom: 0;
}

.structure-issue-row:hover {
  background: rgba(30,41,59,.65);
}

.structure-issue-row strong {
  color: #e2e8f0;
  font-size: .78rem;
}

.structure-issue-row span {
  color: #cbd5e1;
  font-size: .72rem;
  line-height: 1.4;
}

.structure-issue-row small {
  color: #64748b;
  font-size: .65rem;
}


/* Sidebar En ligne */

#tab-structure.is-online-view .structure-sidebar {
  width: 370px;
}

.structure-sidebar-empty {
  padding: 8px 2px;
}

.structure-sidebar-empty strong {
  color: #e2e8f0;
  font-size: .82rem;
}

.structure-sidebar-empty p {
  margin: 5px 0 0;
  color: #94a3b8;
  font-size: .74rem;
  line-height: 1.5;
}

.structure-sidebar-summary {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding-bottom: 14px;
  border-bottom: 1px solid #2a2e3b;
}

.structure-sidebar-summary > strong {
  color: #f8fafc;
  font-size: .92rem;
}

.structure-sidebar-summary > small {
  color: #64748b;
  font-size: .67rem;
  word-break: break-all;
}

.structure-sidebar-block {
  margin-top: 15px;
  padding-top: 2px;
}

.structure-sidebar-block h4 {
  margin: 0 0 7px;
  color: #cbd5e1;
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.structure-sidebar-block p {
  margin: 4px 0;
  color: #94a3b8;
  font-size: .72rem;
  line-height: 1.45;
}

.structure-sidebar-relation {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 5px 0;
  padding: 7px 8px;
  border: 1px solid #273449;
  border-radius: 7px;
  background: #0f172a;
}

.structure-sidebar-relation strong {
  color: #e2e8f0;
  font-size: .69rem;
  word-break: break-word;
}

.structure-sidebar-relation span {
  color: #94a3b8;
  font-size: .64rem;
}

.structure-sidebar-block .is-ok {
  color: #86efac;
}

.structure-sidebar-block .has-warning {
  color: #fbbf24;
}

.structure-sidebar-block .has-danger {
  color: #fca5a5;
}

.structure-sidebar-online-actions {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #2a2e3b;
}

.structure-sidebar-online-actions .btn {
  width: 100%;
}


@media (max-width: 980px) {
  .structure-online-tools-main {
    flex-direction: column;
  }

  .structure-online-stats {
    justify-content: flex-start;
  }

  #tab-structure.is-online-view .structure-sidebar {
    width: 320px;
  }
}



/* SBS_STRUCTURE_ORPHAN_ACTIONS_V1 */

.structure-sidebar-online-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.structure-sidebar-online-actions > .btn {
  width: 100%;
}

.structure-orphan-action-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid rgba(249, 115, 22, 0.35);
  border-radius: 10px;
  background: rgba(249, 115, 22, 0.08);
  font-size: 0.82rem;
  line-height: 1.45;
}

.structure-orphan-action-info strong {
  color: #fdba74;
}

.structure-orphan-action-info span {
  color: #cbd5e1;
}

.structure-action-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(3px);
}

.structure-action-modal {
  width: min(560px, 100%);
  max-height: min(720px, 90vh);
  overflow: auto;
  padding: 22px;
  border: 1px solid #334155;
  border-radius: 14px;
  background: #111827;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

.structure-action-modal h3 {
  margin: 0 0 8px;
}

.structure-action-modal-help {
  margin: 0 0 18px;
  color: #cbd5e1;
  line-height: 1.5;
}

.structure-action-modal-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
}

.structure-action-modal-select {
  width: 100%;
  margin-bottom: 14px;
  padding: 10px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #0f172a;
  color: #f8fafc;
}

.structure-action-modal-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 10px 0 14px;
  color: #cbd5e1;
  line-height: 1.4;
}

.structure-action-modal-check input {
  margin-top: 3px;
}

.structure-action-modal-warning {
  padding: 9px 11px;
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.10);
  color: #93c5fd;
  font-size: 0.82rem;
}

.structure-action-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}


/* SBS_STRUCTURE_RELATIONS_UI_V1 */

.structure-relations-open-btn {
  width: 100%;
  margin-top: 8px;
}

.structure-relations-modal {
  width: min(900px, 96vw);
}

.structure-relations-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.structure-relations-header h3 {
  margin: 0 0 6px;
}

.structure-relations-existing,
.structure-relations-editor {
  padding: 16px;
  border: 1px solid #273449;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.55);
}

.structure-relations-editor {
  margin-top: 14px;
}

.structure-relations-existing h4,
.structure-relations-editor h4 {
  margin: 0 0 12px;
}

.structure-relation-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 12px;
  margin-top: 8px;
  border: 1px solid #334155;
  border-radius: 9px;
  background: #0f172a;
}

.structure-relation-card-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.structure-relation-card-main span {
  color: #94a3b8;
  font-size: 0.79rem;
  word-break: break-word;
}

.structure-relation-card-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.structure-relation-delete {
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.45);
}

.structure-relations-empty {
  color: #94a3b8;
  font-size: 0.84rem;
}

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

.structure-relations-editor label {
  display: block;
  margin: 10px 0;
  color: #e2e8f0;
  font-size: 0.84rem;
  font-weight: 700;
}

.structure-relations-editor input[type="text"],
.structure-relations-editor select {
  width: 100%;
  box-sizing: border-box;
  margin-top: 6px;
  padding: 9px 10px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #0b1220;
  color: #f8fafc;
}

.structure-relations-editor select[multiple] {
  min-height: 150px;
}

.structure-relations-editor .help {
  margin: 7px 0 0;
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 400;
}

.structure-relation-preflight {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid #334155;
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.8);
  color: #cbd5e1;
  font-size: 0.82rem;
  line-height: 1.45;
}

.structure-relation-preflight.is-loading {
  color: #93c5fd;
}

.structure-relation-preflight.is-ok {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.08);
  color: #bbf7d0;
}

.structure-relation-preflight.is-error {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.08);
  color: #fecaca;
}

@media (max-width: 760px) {
  .structure-relations-grid {
    grid-template-columns: 1fr;
  }

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

  .structure-relation-card-actions {
    width: 100%;
  }

  .structure-relation-card-actions .btn {
    flex: 1;
  }
}

/* SBS_APPEARANCE_ADD_ZONE_MODULE_V1 */

.appearance-add-zone-launch {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #273449;
}

.appearance-add-zone-launch .btn {
  width: 100%;
}

.appearance-add-zone-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(2, 6, 23, 0.80);
  backdrop-filter: blur(3px);
}

.appearance-add-zone-modal {
  width: min(760px, 96vw);
  max-height: 92vh;
  overflow: auto;
  padding: 22px;
  border: 1px solid #334155;
  border-radius: 14px;
  background: #111827;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}

.appearance-add-zone-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.appearance-add-zone-header h3 {
  margin: 0 0 6px;
}

.appearance-add-zone-field {
  margin: 14px 0;
}

.appearance-add-zone-field label {
  display: block;
  margin-bottom: 6px;
  color: #e2e8f0;
  font-size: 0.85rem;
  font-weight: 700;
}

.appearance-add-zone-field input,
.appearance-add-zone-field select {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 10px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #0b1220;
  color: #f8fafc;
}

.appearance-add-zone-field select[multiple] {
  min-height: 170px;
}

.appearance-add-zone-field .help,
.appearance-add-zone-header .help,
.appearance-add-zone-launch .help {
  margin: 7px 0 0;
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 400;
}

.appearance-add-zone-variant-preview {
  max-height: 220px;
  overflow: auto;
  margin-top: 14px;
  padding: 10px;
  border: 1px solid #1e293b;
  border-radius: 8px;
  background: #020617;
  color: #cbd5e1;
  font-family: monospace;
  font-size: 11px;
}

.appearance-add-zone-variant-preview pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.appearance-add-zone-preflight {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid #334155;
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.8);
  color: #cbd5e1;
  font-size: 0.82rem;
  line-height: 1.45;
}

.appearance-add-zone-preflight.is-loading {
  color: #93c5fd;
}

.appearance-add-zone-preflight.is-ok {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.08);
  color: #bbf7d0;
}

.appearance-add-zone-preflight.is-error {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.08);
  color: #fecaca;
}

.appearance-add-zone-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

@media (max-width: 700px) {
  .appearance-add-zone-footer {
    flex-direction: column;
  }

  .appearance-add-zone-footer .btn {
    width: 100%;
  }
}


/* SBS RELATIONS GUIDED UX V2 */

.structure-relations-guided-v2 {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 14px;
}

.structure-relations-guided-intro {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 14px 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
}

.structure-relations-guided-intro span {
  opacity: 0.76;
  line-height: 1.45;
}

.structure-relation-guide-step {
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
}

.structure-relation-guide-step-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.structure-relation-guide-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  font-weight: 700;
}

.structure-relation-guide-step label,
.structure-relation-guide-optional label,
.structure-relation-guide-advanced label {
  display: block;
}

.structure-relation-guide-step select,
.structure-relation-guide-step input,
.structure-relation-guide-optional input,
.structure-relation-guide-advanced select,
.structure-relation-guide-advanced input {
  width: 100%;
  margin-top: 7px;
}

.structure-relation-page-search {
  width: 100%;
  margin-bottom: 10px;
}

.structure-relation-guide-optional {
  padding: 4px 2px;
}

.structure-relation-guide-advanced {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  overflow: hidden;
}

.structure-relation-guide-advanced > summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 700;
  user-select: none;
}

.structure-relation-guide-advanced[open] > summary {
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.structure-relation-guide-advanced > :not(summary) {
  margin-left: 16px;
  margin-right: 16px;
}

.structure-relation-guide-advanced > :last-child {
  margin-bottom: 16px;
}

.structure-relations-guided-v2 .help {
  margin-top: 7px;
  margin-bottom: 0;
  opacity: 0.72;
  line-height: 1.45;
}

.structure-relation-zone-picker {
  width: 100%;
}


/* ==========================================================
   APPEARANCE_V3_INSPECTOR_STYLES
   ========================================================== */

.appearance-v3-inspector {
  margin-bottom: 16px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background:
    linear-gradient(
      145deg,
      rgba(15, 23, 42, 0.98),
      rgba(2, 6, 23, 0.98)
    );
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.22);
}

.appearance-v3-inspector-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.appearance-v3-inspector-heading {
  min-width: 0;
}

.appearance-v3-inspector-eyebrow {
  display: block;
  margin-bottom: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.95);
}

.appearance-v3-inspector-title {
  margin: 0;
  color: #f8fafc;
  font-size: 1rem;
  font-weight: 700;
}

.appearance-v3-inspector-breadcrumb {
  margin-top: 4px;
  color: #94a3b8;
  font-size: 0.78rem;
  line-height: 1.4;
}

.appearance-v3-inspector-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(125, 211, 252, 0.28);
  background: rgba(14, 165, 233, 0.10);
  color: #bae6fd;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.appearance-v3-inspector-empty {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 14px;
  padding: 14px;
  border-radius: 12px;
  border: 1px dashed rgba(148, 163, 184, 0.35);
  color: #94a3b8;
  font-size: 0.8rem;
}

.appearance-v3-inspector-empty strong {
  color: #e2e8f0;
  font-size: 0.84rem;
}

.appearance-v3-inspector-content {
  margin-top: 14px;
}

.appearance-v3-inspector-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 110px;
  margin-bottom: 14px;
  padding: 12px;
  overflow: hidden;
  border-radius: 13px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  background:
    linear-gradient(
      135deg,
      rgba(30, 41, 59, 0.82),
      rgba(15, 23, 42, 0.92)
    );
}

.appearance-v3-inspector-image {
  display: block;
  max-width: 100%;
  max-height: 150px;
  object-fit: contain;
  border-radius: 8px;
}

.appearance-v3-inspector-text-preview {
  width: 100%;
  color: #f1f5f9;
  font-size: 0.88rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.appearance-v3-inspector-zone-preview {
  color: #cbd5e1;
  font-size: 0.82rem;
  font-weight: 600;
}

.appearance-v3-inspector-properties {
  display: grid;
  gap: 6px;
}

.appearance-v3-property {
  display: grid;
  grid-template-columns: minmax(82px, 0.35fr) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 7px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.appearance-v3-property-label {
  color: #94a3b8;
  font-size: 0.73rem;
  font-weight: 600;
}

.appearance-v3-property-value {
  min-width: 0;
  color: #e2e8f0;
  font-size: 0.76rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.appearance-v3-mono {
  font-family:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    monospace;
  font-size: 0.7rem;
}

.appearance-v3-technical {
  margin-top: 8px;
  padding-top: 4px;
}

.appearance-v3-technical summary {
  cursor: pointer;
  color: #94a3b8;
  font-size: 0.72rem;
  user-select: none;
}

.appearance-v3-technical-body {
  margin-top: 7px;
}

@media (max-width: 760px) {
  .appearance-v3-inspector-head {
    align-items: stretch;
    flex-direction: column;
  }

  .appearance-v3-inspector-badge {
    align-self: flex-start;
  }

  .appearance-v3-property {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}



/* ==========================================================
   APPEARANCE_V3_INSPECTOR_HIDDEN_FIX

   L'attribut HTML hidden doit toujours être prioritaire
   sur les display:flex / grid / block de l'Inspecteur V3.
   ========================================================== */

#appearance-v3-inspector [hidden] {
  display: none !important;
}



/* ==========================================================
   APPEARANCE_V3_TEXT_EDITOR_STYLES
   ========================================================== */

.appearance-v3-text-editor {
  margin: 0 0 16px;
  padding: 14px;
  border: 1px solid rgba(125, 211, 252, 0.22);
  border-radius: 14px;
  background:
    linear-gradient(
      145deg,
      rgba(15, 23, 42, 0.84),
      rgba(30, 41, 59, 0.56)
    );
}

.appearance-v3-text-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.appearance-v3-section-title {
  display: block;
  color: #f8fafc;
  font-size: 0.82rem;
  font-weight: 700;
}

.appearance-v3-section-help {
  margin: 3px 0 0;
  color: #94a3b8;
  font-size: 0.72rem;
  line-height: 1.4;
}

.appearance-v3-text-count {
  flex: 0 0 auto;
  color: #64748b;
  font-size: 0.68rem;
  white-space: nowrap;
}

.appearance-v3-text-input {
  display: block;
  width: 100%;
  min-height: 120px;
  padding: 12px 13px;
  resize: vertical;
  box-sizing: border-box;

  border: 1px solid rgba(148, 163, 184, 0.38);
  border-radius: 11px;

  background: rgba(2, 6, 23, 0.62);
  color: #f8fafc;

  font:
    400 0.88rem/1.55
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  outline: none;

  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease;
}

.appearance-v3-text-input:hover {
  border-color: rgba(148, 163, 184, 0.62);
}

.appearance-v3-text-input:focus {
  border-color: rgba(56, 189, 248, 0.95);
  background: rgba(2, 6, 23, 0.8);

  box-shadow:
    0 0 0 3px
    rgba(56, 189, 248, 0.12);
}

.appearance-v3-text-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.appearance-v3-text-status {
  min-width: 0;
  color: #94a3b8;
  font-size: 0.71rem;
  line-height: 1.4;
}

.appearance-v3-text-status[data-state="changed"] {
  color: #fde68a;
}

.appearance-v3-text-status[data-state="success"] {
  color: #86efac;
}

.appearance-v3-text-status[data-state="error"] {
  color: #fca5a5;
}

.appearance-v3-text-save-note {
  margin-top: 10px;
  padding-top: 9px;

  border-top:
    1px solid
    rgba(148, 163, 184, 0.12);

  color: #64748b;
  font-size: 0.68rem;
  line-height: 1.45;
}

.appearance-v3-text-save-note strong {
  color: #94a3b8;
}

@media (max-width: 760px) {

  .appearance-v3-text-header,
  .appearance-v3-text-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .appearance-v3-text-count {
    white-space: normal;
  }

  #appearance-v3-text-apply {
    width: 100%;
  }
}



/* ==========================================================
   APPEARANCE_V3_LEGACY_UI_REMOVAL

   Apparence V3 devient l'interface principale.

   Les composants historiques restent temporairement dans
   le DOM uniquement pour leurs raccords techniques internes,
   mais ne font plus partie de l'expérience utilisateur.

   Le bouton Enregistrer le brouillon reste accessible.
   ========================================================== */


/* Ancien contexte Page / Zone / Élément */
#field-editor-container > .editor-context {
  display: none !important;
}


/* Ancien bouton global "Modifier contenu + style" */
#appearance-open-edit-modal {
  display: none !important;
}


/* Ancien switch Styles / Contenu / Images */
#field-editor-container > .editor-mode-switch {
  display: none !important;
}


/* Ancienne barre B / I / U / H1 / alignements / lien */
#appearance-inline-toolbar {
  display: none !important;
}


/* Anciens panneaux Styles / Texte / Images */
#field-editor-container > .editor-mode-panels {
  display: none !important;
}


/* Ancienne phrase Workflow */
#field-editor-container > p.help {
  display: none !important;
}


/*
 * Le conteneur d'actions reste présent uniquement pour
 * Enregistrer le brouillon.
 */
#field-editor-container > .appearance-draft-actions {
  margin-top: 14px;
  padding-top: 14px;

  border-top:
    1px solid
    rgba(148, 163, 184, 0.16);
}


/*
 * Le bouton de sauvegarde devient l'action principale
 * persistante de l'Inspecteur V3.
 */
#appearance-save-draft-btn {
  min-height: 38px;
  padding:
    8px
    16px;

  font-weight: 650;
}



/* ==========================================================
   APPEARANCE_V3_IMAGE_EDITOR_STYLES
   ========================================================== */

.appearance-v3-image-editor {
  margin: 0 0 16px;
  padding: 14px;

  border:
    1px solid
    rgba(125, 211, 252, 0.22);

  border-radius: 14px;

  background:
    linear-gradient(
      145deg,
      rgba(15, 23, 42, 0.84),
      rgba(30, 41, 59, 0.56)
    );
}

.appearance-v3-image-editor-head {
  margin-bottom: 11px;
}

.appearance-v3-image-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  min-height: 135px;
  padding: 18px;

  border:
    1px dashed
    rgba(125, 211, 252, 0.48);

  border-radius: 12px;

  background:
    rgba(2, 6, 23, 0.46);

  color: #cbd5e1;

  text-align: center;
  cursor: pointer;

  transition:
    border-color 140ms ease,
    background 140ms ease,
    transform 140ms ease;
}

.appearance-v3-image-dropzone:hover,
.appearance-v3-image-dropzone:focus {
  border-color:
    rgba(56, 189, 248, 0.95);

  background:
    rgba(14, 165, 233, 0.08);

  outline: none;
}

.appearance-v3-image-dropzone.is-dragover {
  border-color: #38bdf8;
  background:
    rgba(56, 189, 248, 0.13);
  transform: scale(1.006);
}

.appearance-v3-image-dropzone.has-file {
  border-style: solid;
  border-color:
    rgba(134, 239, 172, 0.58);

  background:
    rgba(34, 197, 94, 0.07);
}

.appearance-v3-image-drop-icon {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 36px;
  height: 36px;
  margin-bottom: 8px;

  border-radius: 50%;

  background:
    rgba(56, 189, 248, 0.12);

  color: #7dd3fc;

  font-size: 1.15rem;
  font-weight: 700;
}

.appearance-v3-image-dropzone strong {
  color: #f8fafc;
  font-size: 0.82rem;
}

.appearance-v3-image-dropzone > span {
  margin-top: 3px;

  color: #94a3b8;
  font-size: 0.72rem;
}

.appearance-v3-image-dropzone small {
  display: block;

  max-width: 100%;
  margin-top: 9px;

  color: #64748b;
  font-size: 0.67rem;

  overflow-wrap: anywhere;
}

.appearance-v3-image-dropzone.has-file small {
  color: #86efac;
}

.appearance-v3-image-fields {
  display: grid;
  gap: 10px;

  margin-top: 13px;
}

.appearance-v3-field {
  display: grid;
  gap: 6px;
}

.appearance-v3-field > span {
  color: #cbd5e1;
  font-size: 0.73rem;
  font-weight: 650;
}

.appearance-v3-field > span small {
  margin-left: 4px;

  color: #64748b;
  font-size: 0.65rem;
  font-weight: 400;
}

.appearance-v3-field input {
  width: 100%;
  min-height: 38px;

  padding: 8px 10px;
  box-sizing: border-box;

  border:
    1px solid
    rgba(148, 163, 184, 0.35);

  border-radius: 9px;

  background:
    rgba(2, 6, 23, 0.58);

  color: #f8fafc;

  font-size: 0.78rem;

  outline: none;
}

.appearance-v3-field input:focus {
  border-color:
    rgba(56, 189, 248, 0.95);

  box-shadow:
    0 0 0 3px
    rgba(56, 189, 248, 0.11);
}

.appearance-v3-image-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 12px;
  margin-top: 12px;
}

.appearance-v3-image-status {
  min-width: 0;

  color: #94a3b8;

  font-size: 0.71rem;
  line-height: 1.4;
}

.appearance-v3-image-status[data-state="ready"] {
  color: #bae6fd;
}

.appearance-v3-image-status[data-state="uploading"] {
  color: #fde68a;
}

.appearance-v3-image-status[data-state="success"] {
  color: #86efac;
}

.appearance-v3-image-status[data-state="error"] {
  color: #fca5a5;
}

.appearance-v3-image-save-note {
  margin-top: 10px;
  padding-top: 9px;

  border-top:
    1px solid
    rgba(148, 163, 184, 0.12);

  color: #64748b;

  font-size: 0.68rem;
  line-height: 1.45;
}

.appearance-v3-image-save-note strong {
  color: #94a3b8;
}

@media (max-width: 760px) {

  .appearance-v3-image-actions {
    flex-direction: column;
    align-items: stretch;
  }

  #appearance-v3-image-apply {
    width: 100%;
  }
}

/* ===========================================
   APPEARANCE_V3_TEXT_EDITOR_MODAL_UI_V1
   Modal Texte officiel, isolé des anciens modals
   =========================================== */

.sbs-text-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 32px);
  background: rgba(2, 6, 23, 0.82);
  backdrop-filter: blur(8px);
}

.sbs-text-modal-backdrop.hidden {
  display: none;
}

.sbs-text-modal-dialog {
  display: flex;
  flex-direction: column;
  width: min(880px, 96vw);
  max-height: min(88vh, 780px);
  overflow: hidden;
  color: var(--text-main);
  background:
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.10), transparent 36%),
    linear-gradient(145deg, var(--bg-elevated), var(--bg-main));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.sbs-text-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.sbs-text-modal-context {
  display: inline-flex;
  margin-bottom: 7px;
  color: var(--accent-blue);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.sbs-text-modal-title {
  margin: 0;
  color: var(--text-main);
  font-size: 1.18rem;
}

.sbs-text-modal-subtitle {
  margin: 6px 0 0;
  color: var(--text-soft);
  font-size: 0.84rem;
  line-height: 1.45;
}

.sbs-text-modal-close {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--text-soft);
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    color var(--transition-fast),
    border-color var(--transition-fast),
    background var(--transition-fast);
}

.sbs-text-modal-close:hover {
  color: var(--text-main);
  background: rgba(56, 189, 248, 0.12);
  border-color: var(--accent-blue);
}

.sbs-text-editor-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1.25fr) auto minmax(130px, 0.75fr) minmax(110px, 0.6fr);
  gap: 12px;
  align-items: end;
  padding: 14px 22px;
  background: rgba(15, 23, 42, 0.72);
  border-bottom: 1px solid var(--border-subtle);
}

.sbs-text-control {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.sbs-text-control-label {
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 650;
}

.sbs-text-control select,
.sbs-text-control input[type="number"] {
  width: 100%;
  min-height: 38px;
  color: var(--text-main);
  background: rgba(2, 6, 23, 0.72);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.sbs-text-control input[type="color"] {
  width: 100%;
  min-height: 38px;
  padding: 4px;
  background: rgba(2, 6, 23, 0.72);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.sbs-text-toolbar-group {
  display: flex;
  gap: 6px;
}

.sbs-text-toolbar-button {
  min-width: 38px;
  min-height: 38px;
  padding: 7px 10px;
  color: var(--text-main);
  background: rgba(2, 6, 23, 0.72);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-fast);
}

.sbs-text-toolbar-button:hover {
  background: rgba(56, 189, 248, 0.11);
  border-color: var(--accent-blue);
}

.sbs-text-toolbar-button.active,
.sbs-text-toolbar-button[aria-pressed="true"] {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  border-color: transparent;
}

.sbs-text-modal-body {
  overflow-y: auto;
  padding: 20px 22px;
}

.sbs-text-editor-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 700;
}

#sbs-textarea.sbs-text-modal-textarea {
  width: 100%;
  min-height: 230px;
  margin: 0;
  padding: 15px 16px;
  resize: vertical;
  color: var(--text-main);
  background: rgba(2, 6, 23, 0.68);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font: inherit;
  line-height: 1.6;
  outline: none;
}

#sbs-textarea.sbs-text-modal-textarea:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.13);
}

.sbs-text-modal-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 9px;
  color: var(--text-soft);
  font-size: 0.74rem;
}

.sbs-text-modal-note {
  margin: 16px 0 0;
  padding: 11px 13px;
  color: var(--text-soft);
  background: rgba(56, 189, 248, 0.07);
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  line-height: 1.5;
}

.sbs-text-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 14px 22px;
  background: rgba(2, 6, 23, 0.48);
  border-top: 1px solid var(--border-subtle);
}

.sbs-text-modal-status {
  margin-right: auto;
  color: var(--text-soft);
  font-size: 0.76rem;
}

.sbs-text-modal-action {
  min-height: 38px;
  padding: 8px 16px;
  color: var(--text-main);
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.sbs-text-modal-action.primary {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  border-color: transparent;
}

@media (max-width: 760px) {
  .sbs-text-modal-dialog {
    width: 100%;
    max-height: 94vh;
  }

  .sbs-text-editor-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .sbs-text-modal-status {
    display: none;
  }
}

@media (max-width: 480px) {
  .sbs-text-editor-toolbar {
    grid-template-columns: 1fr;
  }

  .sbs-text-modal-header,
  .sbs-text-editor-toolbar,
  .sbs-text-modal-body,
  .sbs-text-modal-footer {
    padding-left: 15px;
    padding-right: 15px;
  }
}

/* ===========================================
   APPEARANCE_V3_RICH_TEXT_EDITOR_CORE_CSS_V1
   Surface contenteditable isolée
   =========================================== */

#sbs-rich-text-editor.sbs-rich-text-editor {
  width: 100%;
  min-height: 230px;
  max-height: 420px;
  overflow: auto;
  padding: 15px 16px;
  color: var(--text-main);
  background: rgba(2, 6, 23, 0.68);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font: inherit;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  outline: none;
  cursor: text;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

#sbs-rich-text-editor.sbs-rich-text-editor:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.13);
}

#sbs-rich-text-editor.sbs-rich-text-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  pointer-events: none;
}

#sbs-rich-text-editor.sbs-rich-text-editor a {
  color: var(--accent-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

#sbs-rich-text-editor.sbs-rich-text-editor mark {
  padding: 0 0.12em;
  border-radius: 0.2em;
}

#sbs-rich-text-editor.sbs-rich-text-editor::selection,
#sbs-rich-text-editor.sbs-rich-text-editor *::selection {
  color: #ffffff;
  background: rgba(37, 99, 235, 0.82);
}

.sbs-text-modal-meta {
  align-items: flex-start;
}

#sbs-text-selection-kind {
  max-width: 72%;
  line-height: 1.4;
}

/* ===========================================
   APPEARANCE_V3_RICH_TOOLS_LINKS_UI_CSS_V2
   Outils complets et gestionnaire de liens large
   =========================================== */

.sbs-text-modal-dialog {
  position: relative;
  width: min(1180px, 97vw);
  max-height: min(94vh, 940px);
  overflow: hidden;
}

.sbs-text-editor-toolbar.sbs-rich-toolbar {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 14px 22px;
}

.sbs-rich-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
}

.sbs-rich-toolbar-row .sbs-text-control {
  flex: 0 1 auto;
}

.sbs-rich-history-control {
  min-width: 86px;
}

.sbs-rich-format-control {
  width: min(240px, 100%);
}

.sbs-rich-font-control {
  width: min(210px, 100%);
}

.sbs-rich-number-control {
  width: 112px;
}

.sbs-rich-color-control {
  width: 92px;
}

.sbs-rich-line-height-control {
  width: 170px;
}

.sbs-rich-link-control {
  flex: 1 1 220px !important;
}

.sbs-rich-tool-wide {
  width: auto;
  min-width: 76px;
  padding-right: 12px;
  padding-left: 12px;
}

.sbs-rich-toolbar .sbs-text-toolbar-group {
  flex-wrap: wrap;
}

.sbs-rich-toolbar select,
.sbs-rich-toolbar input {
  padding-right: 9px;
  padding-left: 9px;
}

.sbs-rich-toolbar select option,
.sbs-text-link-panel select option {
  color: var(--text-main);
  background: var(--bg-main);
}

.sbs-rich-toolbar-help {
  margin: 0;
  padding: 9px 11px;
  color: var(--text-soft);
  background: rgba(56, 189, 248, 0.06);
  border: 1px solid rgba(56, 189, 248, 0.16);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  line-height: 1.45;
}

.sbs-rich-toolbar-help strong {
  color: var(--text-main);
}

.sbs-text-modal-body {
  flex: 1 1 auto;
  min-height: 180px;
}

.sbs-text-link-panel {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  color: var(--text-main);
  background:
    radial-gradient(circle at 90% 0%, rgba(168, 85, 247, 0.14), transparent 38%),
    radial-gradient(circle at 10% 100%, rgba(56, 189, 248, 0.10), transparent 42%),
    #07101f;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: inherit;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.52);
}

.sbs-text-link-panel.hidden,
.sbs-text-link-field.hidden,
.sbs-text-link-native-select {
  display: none !important;
}

.sbs-text-link-panel-header {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.sbs-text-link-eyebrow {
  display: block;
  margin-bottom: 5px;
  color: #7dd3fc;
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.sbs-text-link-panel-header h4 {
  margin: 0;
  color: var(--text-main);
  font-size: 1.12rem;
}

.sbs-text-link-panel-header p {
  margin: 5px 0 0;
  color: var(--text-soft);
  font-size: 0.79rem;
  line-height: 1.45;
}

.sbs-text-link-selection {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  margin: 14px 24px 0;
  padding: 10px 12px;
  background: rgba(56, 189, 248, 0.07);
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: var(--radius-sm);
}

.sbs-text-link-selection span {
  flex: 0 0 auto;
  color: var(--text-soft);
  font-size: 0.73rem;
  font-weight: 700;
}

.sbs-text-link-selection strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text-main);
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sbs-text-link-type-tabs {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 24px 0;
  padding: 5px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
}

.sbs-text-link-type-tabs button,
.sbs-text-link-page-filters button {
  min-height: 38px;
  padding: 8px 12px;
  color: var(--text-soft);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 750;
  cursor: pointer;
}

.sbs-text-link-type-tabs button:hover,
.sbs-text-link-page-filters button:hover {
  color: var(--text-main);
  background: rgba(148, 163, 184, 0.08);
}

.sbs-text-link-type-tabs button.is-active,
.sbs-text-link-page-filters button.is-active {
  color: #e0f2fe;
  background: rgba(14, 165, 233, 0.15);
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.06);
}

.sbs-text-link-workspace {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  padding: 14px 24px;
  overflow: hidden;
}

.sbs-text-link-pages {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.sbs-text-link-page-controls {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.sbs-text-link-search-control {
  min-width: 0;
}

.sbs-text-link-page-filters {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--border-subtle);
  border-radius: 11px;
}

.sbs-text-link-page-filters button {
  min-height: 34px;
  padding: 6px 11px;
  font-size: 0.74rem;
}

.sbs-text-link-panel input[type="search"],
.sbs-text-link-panel input[type="text"],
.sbs-text-link-panel select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  color: var(--text-main);
  background: rgba(2, 6, 23, 0.82);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font: inherit;
  outline: none;
}

.sbs-text-link-panel input:focus,
.sbs-text-link-panel select:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12);
}

.sbs-text-link-page-heading {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 13px 0 9px;
}

.sbs-text-link-page-heading > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sbs-text-link-page-heading strong {
  color: var(--text-main);
  font-size: 0.83rem;
}

.sbs-text-link-page-heading span {
  color: var(--text-soft);
  font-size: 0.71rem;
  line-height: 1.35;
}

#sbs-text-link-page-results-meta {
  flex: 0 0 auto;
  font-weight: 700;
}

.sbs-text-link-page-list {
  display: grid;
  flex: 1 1 auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 9px;
  min-height: 190px;
  padding: 4px 6px 4px 2px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.sbs-text-link-page-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  padding: 12px 13px;
  color: var(--text-main);
  text-align: left;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 11px;
  font: inherit;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.sbs-text-link-page-card:hover:not(:disabled) {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(56, 189, 248, 0.48);
  transform: translateY(-1px);
}

.sbs-text-link-page-card.is-selected {
  background: rgba(14, 116, 144, 0.2);
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.1);
}

.sbs-text-link-page-card.is-disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.sbs-text-link-page-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.sbs-text-link-page-card-top strong {
  min-width: 0;
  overflow: hidden;
  font-size: 0.83rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sbs-text-link-page-badges {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.sbs-text-link-page-badge {
  padding: 3px 6px;
  border: 1px solid;
  border-radius: 999px;
  font-size: 0.61rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.sbs-text-link-page-badge.online {
  color: #bbf7d0;
  background: rgba(22, 101, 52, 0.2);
  border-color: rgba(74, 222, 128, 0.42);
}

.sbs-text-link-page-badge.draft {
  color: #fde68a;
  background: rgba(146, 64, 14, 0.2);
  border-color: rgba(251, 191, 36, 0.42);
}

.sbs-text-link-page-badge.missing-route {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.22);
  border-color: rgba(248, 113, 113, 0.45);
}

.sbs-text-link-page-path,
.sbs-text-link-page-route {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sbs-text-link-page-path {
  color: var(--text-soft);
  font-size: 0.69rem;
}

.sbs-text-link-page-route {
  color: #7dd3fc;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.68rem;
}

.sbs-text-link-page-empty {
  grid-column: 1 / -1;
  padding: 28px 18px;
  color: var(--text-soft);
  text-align: center;
  background: rgba(15, 23, 42, 0.48);
  border: 1px dashed rgba(148, 163, 184, 0.24);
  border-radius: 11px;
  font-size: 0.78rem;
}

.sbs-text-link-single-field {
  width: min(760px, 100%);
  margin: 28px auto 0;
  padding: 20px;
  background: rgba(15, 23, 42, 0.62);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
}

.sbs-text-link-single-field small {
  color: var(--text-soft);
  font-size: 0.71rem;
  line-height: 1.4;
}

.sbs-text-link-target-control {
  flex: 0 0 auto;
  width: min(320px, 100%);
  margin-top: 12px;
}

.sbs-text-link-status {
  flex: 0 0 auto;
  margin: 0;
  padding: 10px 24px;
  color: var(--text-soft);
  background: rgba(15, 23, 42, 0.82);
  border-top: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  line-height: 1.4;
}

.sbs-text-link-status.error {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.25);
  border-color: rgba(248, 113, 113, 0.45);
}

.sbs-text-link-status.warning {
  color: #fde68a;
  background: rgba(120, 53, 15, 0.24);
  border-color: rgba(251, 191, 36, 0.38);
}

.sbs-text-link-status.success {
  color: #bbf7d0;
  background: rgba(20, 83, 45, 0.24);
  border-color: rgba(74, 222, 128, 0.4);
}

.sbs-text-link-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
  padding: 12px 24px 16px;
  background: rgba(2, 6, 23, 0.96);
  border-top: 1px solid var(--border-subtle);
}

@media (max-width: 900px) {
  .sbs-text-modal-dialog {
    width: min(97vw, 860px);
  }

  .sbs-rich-format-control,
  .sbs-rich-font-control {
    flex: 1 1 190px !important;
    width: auto;
  }

  .sbs-rich-link-control {
    flex-basis: 100% !important;
  }

  .sbs-text-link-page-controls {
    grid-template-columns: 1fr;
  }

  .sbs-text-link-page-filters {
    justify-content: stretch;
  }

  .sbs-text-link-page-filters button {
    flex: 1 1 0;
  }
}

@media (max-width: 650px) {
  .sbs-rich-toolbar-row {
    align-items: stretch;
  }

  .sbs-rich-number-control,
  .sbs-rich-color-control {
    flex: 1 1 100px !important;
    width: auto;
  }

  .sbs-rich-line-height-control {
    flex: 1 1 160px !important;
    width: auto;
  }

  .sbs-text-link-panel-header {
    padding: 16px 16px 13px;
  }

  .sbs-text-link-selection,
  .sbs-text-link-type-tabs {
    margin-right: 16px;
    margin-left: 16px;
  }

  .sbs-text-link-selection {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .sbs-text-link-selection strong {
    white-space: normal;
  }

  .sbs-text-link-type-tabs {
    grid-template-columns: 1fr;
  }

  .sbs-text-link-type-tabs button {
    min-height: 34px;
  }

  .sbs-text-link-workspace {
    padding-right: 16px;
    padding-left: 16px;
  }

  .sbs-text-link-page-list {
    grid-template-columns: 1fr;
  }

  .sbs-text-link-status {
    padding-right: 16px;
    padding-left: 16px;
  }

  .sbs-text-link-actions {
    padding-right: 16px;
    padding-left: 16px;
  }
}

@media (max-width: 480px) {
  .sbs-rich-format-control,
  .sbs-rich-font-control,
  .sbs-rich-line-height-control {
    flex-basis: 100% !important;
  }

  .sbs-text-link-page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .sbs-text-link-page-card-top {
    flex-direction: column;
  }

  .sbs-text-link-page-badges {
    justify-content: flex-start;
  }

  .sbs-text-link-actions .sbs-text-modal-action {
    flex: 1 1 auto;
  }
}

/* ===========================================
   APPEARANCE_V3_LINK_TARGET_LAYOUT_FIX_V1
   Sépare la liste des pages du choix d'ouverture
   =========================================== */

.sbs-text-link-pages {
  flex-basis: 0;
  overflow: hidden;
}

.sbs-text-link-page-list {
  flex-basis: 0;
  min-height: 0;
}

.sbs-text-link-target-control {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(220px, 320px);
  align-items: center;
  align-self: stretch;
  justify-content: start;
  gap: 14px;
  width: 100%;
  margin: 12px 0 0;
  padding: 12px 0 0;
  background: #07101f;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

@media (max-width: 650px) {
  .sbs-text-link-target-control {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}


/* ==========================================================
   APPEARANCE_WORKSPACE_V2_PHASE2_CSS
   UX uniquement.
   Vitrine = consultation pleine largeur.
   Brouillon = espace de travail avec outils.
   Aucun comportement moteur n'est modifié.
   ========================================================== */

#tab-appearance.appearance-workspace {
  --appearance-workspace-border:
    rgba(148, 163, 184, 0.30);

  --appearance-workspace-surface:
    rgba(15, 23, 42, 0.72);

  --appearance-workspace-surface-strong:
    rgba(15, 23, 42, 0.94);
}

/* ---------- Entête général ---------- */

#tab-appearance .appearance-workspace-header {
  margin-bottom: 14px;
}

#tab-appearance .appearance-workspace-kicker {
  display: inline-block;
  margin-bottom: 7px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-soft);
}

#tab-appearance .appearance-workspace-header h2 {
  margin-top: 0;
  margin-bottom: 7px;
}

#tab-appearance .appearance-workspace-header
.tab-description {
  margin: 0;
  max-width: 760px;
  color: var(--text-soft);
}

/* ---------- Bandeau Vitrine / Brouillon ---------- */

#tab-appearance .appearance-workspace-commandbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;

  margin: 0 0 18px;
  padding: 13px 15px;

  border: 1px solid
    var(--appearance-workspace-border);

  border-radius: 16px;

  background:
    radial-gradient(
      circle at 0 0,
      rgba(56, 189, 248, 0.13),
      transparent 48%
    ),
    linear-gradient(
      135deg,
      rgba(15, 23, 42, 0.96),
      rgba(2, 6, 23, 0.96)
    );
}

#tab-appearance .appearance-workspace-command-copy {
  display: grid;
  grid-template-columns: auto auto;
  column-gap: 9px;
  row-gap: 3px;
  align-items: baseline;
}

#tab-appearance .appearance-workspace-command-label {
  grid-column: 1 / -1;

  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

#tab-appearance #appearance-workspace-mode-title {
  font-size: 1rem;
  font-weight: 800;
  color: #f8fafc;
}

#tab-appearance #appearance-workspace-mode-help {
  font-size: 0.82rem;
  color: var(--text-soft);
}

/* ---------- Switch ---------- */

#tab-appearance .appearance-workspace-mode-host {
  flex: 0 0 auto;
}

#tab-appearance
.appearance-workspace-mode-host
.appearance-mode-toggle {
  display: inline-flex;
  align-items: center;

  padding: 3px;
  gap: 2px;

  border-radius: 999px;
  border: 1px solid
    rgba(148, 163, 184, 0.45);

  background:
    rgba(2, 6, 23, 0.72);
}

#tab-appearance
.appearance-workspace-mode-btn {
  min-width: 96px;

  padding: 7px 15px;

  border: 0;
  border-radius: 999px;

  background: transparent;
  color: var(--text-soft);

  font-size: 0.8rem;
  font-weight: 700;

  cursor: pointer;
}

#tab-appearance
.appearance-workspace-mode-btn:hover {
  color: #f8fafc;
  background:
    rgba(148, 163, 184, 0.11);
}

#tab-appearance
.appearance-workspace-mode-btn.active {
  color: #07111f;

  background:
    linear-gradient(
      135deg,
      rgba(249, 115, 22, 0.98),
      rgba(236, 72, 153, 0.96)
    );

  box-shadow:
    0 5px 18px rgba(236, 72, 153, 0.20);
}

/*
 * ============================================================
 * APPEARANCE_PUBLICATION_DIFF_V1
 * État Draft ↔ dernière publication
 * ============================================================
 */

#tab-appearance
.appearance-publication-status {
  margin-top: 14px;
  padding: 13px;

  border:
    1px solid
    rgba(148, 163, 184, 0.28);

  border-radius:
    14px;

  background:
    rgba(2, 6, 23, 0.45);
}

#tab-appearance
.appearance-publication-status-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

#tab-appearance
.appearance-publication-status-head
> div {
  display: grid;
  gap: 3px;
}

#tab-appearance
.appearance-publication-status-kicker {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

#tab-appearance
#appearance-publication-status-title {
  color: #f8fafc;
  font-size: 0.91rem;
  line-height: 1.3;
}

#tab-appearance
.appearance-publication-status-dot {
  flex: 0 0 auto;

  width: 10px;
  height: 10px;

  margin-top: 5px;

  border-radius: 50%;

  background:
    rgba(148, 163, 184, 0.8);

  box-shadow:
    0 0 0 4px
    rgba(148, 163, 184, 0.10);
}

#tab-appearance
.appearance-publication-status[data-state="up-to-date"]
.appearance-publication-status-dot {
  background: #22c55e;

  box-shadow:
    0 0 0 4px
    rgba(34, 197, 94, 0.12);
}

#tab-appearance
.appearance-publication-status[data-state="changed"]
.appearance-publication-status-dot {
  background: #f59e0b;

  box-shadow:
    0 0 0 4px
    rgba(245, 158, 11, 0.14);
}

#tab-appearance
.appearance-publication-status[data-state="never-published"]
.appearance-publication-status-dot {
  background: #94a3b8;
}

#tab-appearance
#appearance-publication-status-meta {
  margin:
    8px 0 0;

  color:
    var(--text-soft);

  font-size:
    0.76rem;

  line-height:
    1.45;
}

#tab-appearance
#appearance-publication-summary {
  margin:
    8px 0 0;

  color:
    #e2e8f0;

  font-size:
    0.76rem;

  font-weight:
    700;
}

#tab-appearance
.appearance-publication-details-toggle {
  width: 100%;

  margin-top:
    11px;
}

#tab-appearance
.appearance-publication-details {
  display: grid;
  gap: 12px;

  margin-top: 12px;
  padding-top: 12px;

  border-top:
    1px solid
    rgba(148, 163, 184, 0.22);
}

#tab-appearance
.appearance-publication-details[hidden] {
  display: none;
}

#tab-appearance
.appearance-publication-detail-group {
  display: grid;
  gap: 7px;
}

#tab-appearance
.appearance-publication-detail-group
h5 {
  margin: 0;

  color: #f8fafc;

  font-size:
    0.78rem;
}

#tab-appearance
.appearance-publication-detail-item {
  display: grid;
  gap: 5px;

  padding: 9px;

  border-radius:
    10px;

  background:
    rgba(15, 23, 42, 0.68);
}

#tab-appearance
.appearance-publication-detail-zone {
  color: #f8fafc;

  font-size:
    0.75rem;
}

#tab-appearance
.appearance-publication-detail-item
p {
  margin: 0;

  color:
    var(--text-soft);

  font-size:
    0.73rem;

  line-height:
    1.4;
}

#tab-appearance
.appearance-publication-detail-line {
  display: grid;
  grid-template-columns:
    70px minmax(0, 1fr);

  gap: 7px;

  font-size:
    0.72rem;

  line-height:
    1.4;
}

#tab-appearance
.appearance-publication-detail-line
strong {
  color:
    var(--text-muted);
}

#tab-appearance
.appearance-publication-detail-line
span {
  min-width: 0;

  overflow-wrap:
    anywhere;

  color:
    var(--text-soft);
}


/* ---------- Layout Brouillon ---------- */

#tab-appearance.is-draft-mode
.appearance-layout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

#tab-appearance.is-draft-mode
.appearance-left {
  flex: 0 0 320px;
  max-width: 320px;
}

#tab-appearance.is-draft-mode
.appearance-right {
  flex: 1 1 auto;
  min-width: 0;
}

/* Carte page plus sobre */

#tab-appearance.is-draft-mode
.appearance-page-panel
.appearance-page-panel-inner {
  padding: 12px;

  border-color:
    rgba(148, 163, 184, 0.32);

  background:
    linear-gradient(
      145deg,
      rgba(15, 23, 42, 0.94),
      rgba(2, 6, 23, 0.96)
    );
}

/* ---------- Vitrine : lecture seule ---------- */

#tab-appearance.is-vitrine-mode
.appearance-layout {
  display: block;
}

#tab-appearance.is-vitrine-mode
.appearance-left {
  display: none;
}

#tab-appearance.is-vitrine-mode
.appearance-right {
  width: 100%;
  max-width: none;
}

/*
 * L'éditeur appartient au Brouillon.
 * En Vitrine on conserve uniquement la consultation.
 */
#tab-appearance.is-vitrine-mode
#field-editor-container {
  display: none;
}

#tab-appearance.is-vitrine-mode
.appearance-preview-card {
  width: 100%;
}

/* ---------- Preview commune ---------- */

#tab-appearance
.appearance-preview-card {
  padding: 10px 12px 13px;
}

#tab-appearance
.appearance-preview-header {
  min-height: 38px;
}

#tab-appearance
#appearance-preview-title {
  font-weight: 700;
  color: #f8fafc;
}

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {

  #tab-appearance.is-draft-mode
  .appearance-layout {
    display: block;
  }

  #tab-appearance.is-draft-mode
  .appearance-left {
    width: 100%;
    max-width: none;
    margin-bottom: 14px;
  }

  #tab-appearance
  .appearance-workspace-commandbar {
    align-items: flex-start;
  }
}

@media (max-width: 720px) {

  #tab-appearance
  .appearance-workspace-commandbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  #tab-appearance
  .appearance-workspace-mode-host {
    width: 100%;
  }

  #tab-appearance
  .appearance-workspace-mode-host
  .appearance-mode-toggle {
    display: grid;
    grid-template-columns:
      repeat(2, minmax(0, 1fr));

    width: 100%;
  }

  #tab-appearance
  .appearance-workspace-mode-btn {
    width: 100%;
    min-width: 0;
  }

  #tab-appearance
  .appearance-workspace-command-copy {
    grid-template-columns: 1fr;
  }

  #tab-appearance
  .appearance-workspace-command-label {
    grid-column: auto;
  }
}




/*
 * ============================================================
 * APPEARANCE_VARIANT_VISUAL_PREVIEW_V1
 * Aperçu réel HTML + CSS d'une variante
 * ============================================================
 */

#tab-appearance
.appearance-variant-preview-field {
  margin-top: 14px;
}

#tab-appearance
.appearance-variant-preview-field
> label {
  display: block;

  margin-bottom: 8px;

  color: #f8fafc;

  font-size: 0.78rem;
  font-weight: 700;
}

#tab-appearance
.appearance-variant-preview-shell {
  position: relative;

  width: 100%;
  min-height: 280px;

  overflow: hidden;

  border:
    1px solid
    rgba(148, 163, 184, 0.30);

  border-radius: 14px;

  background:
    #ffffff;

  box-shadow:
    0 12px 28px
    rgba(0, 0, 0, 0.22);
}

#tab-appearance
.appearance-variant-preview-frame {
  display: block;

  width: 100%;
  height: 320px;

  border: 0;

  background: #ffffff;
}

#tab-appearance
.appearance-variant-preview-empty {
  display: grid;

  place-items: center;

  min-height: 280px;

  padding: 24px;

  color: #64748b;

  font-size: 0.78rem;
  line-height: 1.5;

  text-align: center;
}



/*
 * ============================================================
 * APPEARANCE_MODERN_UI_CSS_V1
 * Workspace Apparence modernisé
 * ============================================================
 */


/* ============================================================
   TITRES / HIERARCHIE
   ============================================================ */

#tab-appearance
.appearance-heading-row,
#tab-appearance
.appearance-panel-title-row,
#tab-appearance
.appearance-field-label-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

#tab-appearance
.appearance-heading-row h2,
#tab-appearance
.appearance-panel-title-row h3 {
  margin: 0;
}

#tab-appearance
.appearance-heading-row {
  margin-top: 3px;
}

#tab-appearance
.appearance-panel-title-row {
  justify-content: space-between;
  align-items: flex-start;

  margin-bottom: 14px;
}

#tab-appearance
.appearance-panel-kicker {
  display: block;

  margin-bottom: 4px;

  color: #94a3b8;

  font-size: 0.62rem;
  font-weight: 800;

  letter-spacing: 0.10em;
}


/* ============================================================
   BOUTON D'AIDE ?
   ============================================================ */

#tab-appearance
.appearance-help {
  position: relative;
  z-index: 40;

  display: inline-grid;
  place-items: center;

  flex: 0 0 auto;

  width: 22px;
  height: 22px;

  padding: 0;

  border:
    1px solid
    rgba(148, 163, 184, 0.36);

  border-radius: 999px;

  background:
    rgba(30, 41, 59, 0.90);

  color: #cbd5e1;

  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;

  cursor: help;

  transition:
    border-color 140ms ease,
    background-color 140ms ease,
    color 140ms ease,
    transform 140ms ease;
}

#tab-appearance
.appearance-help:hover,
#tab-appearance
.appearance-help:focus,
#tab-appearance
.appearance-help:focus-visible {
  border-color:
    rgba(56, 189, 248, 0.78);

  background:
    rgba(14, 165, 233, 0.18);

  color: #f8fafc;

  outline: none;

  transform:
    translateY(-1px);
}


/* Bulle d'explication */

#tab-appearance
.appearance-help::after {
  content:
    attr(data-help);

  position: absolute;
  z-index: 9999;

  top:
    calc(100% + 9px);

  left: 50%;

  width:
    min(280px, calc(100vw - 48px));

  padding:
    10px 12px;

  border:
    1px solid
    rgba(148, 163, 184, 0.28);

  border-radius: 11px;

  background:
    rgba(2, 6, 23, 0.98);

  box-shadow:
    0 18px 42px
    rgba(0, 0, 0, 0.44);

  color: #e2e8f0;

  font-size: 0.74rem;
  font-weight: 500;
  line-height: 1.45;

  text-align: left;

  white-space: normal;

  opacity: 0;

  visibility: hidden;

  pointer-events: none;

  transform:
    translate(-50%, -5px);

  transition:
    opacity 130ms ease,
    transform 130ms ease,
    visibility 130ms ease;
}

#tab-appearance
.appearance-help:hover::after,
#tab-appearance
.appearance-help:focus::after,
#tab-appearance
.appearance-help:focus-visible::after {
  opacity: 1;

  visibility: visible;

  transform:
    translate(-50%, 0);
}


/* Dans la colonne gauche :
   alignement vers la droite pour éviter le débordement. */

#tab-appearance
.appearance-left
.appearance-help::after {
  right: 0;
  left: auto;

  transform:
    translateY(-5px);
}

#tab-appearance
.appearance-left
.appearance-help:hover::after,
#tab-appearance
.appearance-left
.appearance-help:focus::after,
#tab-appearance
.appearance-left
.appearance-help:focus-visible::after {
  transform:
    translateY(0);
}


/* ============================================================
   BANDEAU VITRINE / BROUILLON
   ============================================================ */

#tab-appearance
.appearance-workspace-commandbar {
  padding:
    14px 16px;

  border:
    1px solid
    rgba(148, 163, 184, 0.22);

  border-radius: 18px;

  background:
    linear-gradient(
      145deg,
      rgba(15, 23, 42, 0.95),
      rgba(15, 23, 42, 0.76)
    );

  box-shadow:
    0 12px 34px
    rgba(0, 0, 0, 0.16);
}

#tab-appearance
.appearance-workspace-mode-host {
  display: flex;
  align-items: center;
  gap: 8px;
}

#tab-appearance
.appearance-mode-help {
  flex: 0 0 auto;
}


/* ============================================================
   LAYOUT BROUILLON
   ============================================================ */

#tab-appearance.is-draft-mode
.appearance-layout {
  gap: 18px;
}

#tab-appearance.is-draft-mode
.appearance-left {
  position: sticky;

  top: 14px;

  flex: 0 0 350px;

  max-width: 350px;
}


/* ============================================================
   CARTES DE LA COLONNE GAUCHE
   ============================================================ */

#tab-appearance
.appearance-page-panel
.appearance-page-panel-inner {
  padding: 15px;

  border:
    1px solid
    rgba(148, 163, 184, 0.22);

  border-radius: 18px;

  background:
    linear-gradient(
      150deg,
      rgba(15, 23, 42, 0.95),
      rgba(2, 6, 23, 0.94)
    );

  box-shadow:
    0 12px 32px
    rgba(0, 0, 0, 0.16);
}


/* ============================================================
   LABELS
   ============================================================ */

#tab-appearance
.appearance-field-label-row {
  justify-content: space-between;

  margin-bottom: 7px;
}

#tab-appearance
.appearance-field-label-row label,
#tab-appearance
.appearance-field-label-row > span {
  margin: 0;

  color: #f8fafc;

  font-size: 0.79rem;
  font-weight: 700;
}


/* Champ Page */

#tab-appearance
.appearance-page-select-field select {
  width: 100%;

  min-height: 40px;

  border-radius: 10px;
}


/* ============================================================
   ETAT DE PUBLICATION
   ============================================================ */

#tab-appearance
.appearance-publication-status {
  margin-top: 13px;

  border-radius: 14px;

  background:
    rgba(15, 23, 42, 0.60);
}

#tab-appearance
.appearance-publication-status-tools {
  display: inline-flex;
  align-items: center;

  gap: 9px;
}


/* ============================================================
   CONTEXTE DE LA ZONE
   ============================================================ */

#tab-appearance
.appearance-zone-context {
  display: grid;

  grid-template-columns:
    repeat(3, minmax(0, 1fr));

  gap: 7px;

  margin-bottom: 14px;
}

#tab-appearance
.appearance-zone-context > span {
  min-width: 0;

  padding: 9px;

  border:
    1px solid
    rgba(148, 163, 184, 0.18);

  border-radius: 11px;

  background:
    rgba(15, 23, 42, 0.68);
}

#tab-appearance
.appearance-zone-context small {
  display: block;

  margin-bottom: 3px;

  color: #94a3b8;

  font-size: 0.60rem;
  font-weight: 750;

  letter-spacing: 0.05em;

  text-transform: uppercase;
}

#tab-appearance
.appearance-zone-context strong {
  display: block;

  overflow: hidden;

  color: #f8fafc;

  font-size: 0.72rem;
  font-weight: 700;

  text-overflow: ellipsis;

  white-space: nowrap;
}


/* Warning mode */

#tab-appearance
.appearance-mode-warning {
  margin:
    0 0 14px !important;

  padding:
    9px 10px;

  border:
    1px solid
    rgba(245, 158, 11, 0.26);

  border-radius: 10px;

  background:
    rgba(245, 158, 11, 0.08);

  color:
    #fbbf24 !important;
}


/* ============================================================
   VARIANTE
   ============================================================ */

#tab-appearance
.appearance-variant-field {
  margin-top: 4px;
}

#tab-appearance
.appearance-variant-field select {
  width: 100%;

  min-height: 40px;

  border-radius: 10px;
}

#tab-appearance
#appearance-apply-variant-btn {
  width: 100%;

  min-height: 40px;

  border-radius: 11px;

  font-weight: 750;
}

#tab-appearance
.appearance-variant-apply-help {
  margin-top:
    9px !important;

  padding:
    9px 10px;

  border-radius: 10px;

  background:
    rgba(15, 23, 42, 0.56);
}


/* Aperçu de variante déjà fonctionnel :
   harmonisation avec la nouvelle UI. */

#tab-appearance
.appearance-variant-preview-shell {
  border-radius: 14px;

  box-shadow:
    0 12px 28px
    rgba(0, 0, 0, 0.18);
}


/* ============================================================
   GRANDE PREVIEW
   ============================================================ */

#tab-appearance
.appearance-preview-card {
  border:
    1px solid
    rgba(148, 163, 184, 0.24);

  border-radius: 20px;

  background:
    linear-gradient(
      150deg,
      rgba(15, 23, 42, 0.95),
      rgba(2, 6, 23, 0.94)
    );

  box-shadow:
    0 18px 48px
    rgba(0, 0, 0, 0.22);
}

#tab-appearance
.appearance-preview-header {
  padding:
    2px 3px 6px;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1080px) {

  #tab-appearance.is-draft-mode
  .appearance-left {
    position: static;

    width: 100%;
    max-width: none;

    flex-basis: auto;
  }
}

@media (max-width: 720px) {

  #tab-appearance
  .appearance-zone-context {
    grid-template-columns: 1fr;
  }

  #tab-appearance
  .appearance-help::after,
  #tab-appearance
  .appearance-left
  .appearance-help::after {
    right: 0;
    left: auto;

    transform:
      translateY(-5px);
  }

  #tab-appearance
  .appearance-help:hover::after,
  #tab-appearance
  .appearance-help:focus::after,
  #tab-appearance
  .appearance-help:focus-visible::after {
    transform:
      translateY(0);
  }
}

