/* =========================================================
   Stylographe — Module SG_Editorial
   assets/css/editorial.css
   @since 2.0.9
   ========================================================= */

/* ── Variables ─────────────────────────────────────────── */
:root {
  --sg-ed-green:   #4CAF50;
  --sg-ed-red:     #E53935;
  --sg-ed-blue:    #1E88E5;
  --sg-ed-gray:    #9E9E9E;
  --sg-ed-orange:  #FB8C00;
  --sg-ed-rust:    #c0392b;
  --sg-ed-border:  #e0e0e0;
  --sg-ed-bg:      #fafafa;
  --sg-ed-white:   #ffffff;
  --sg-ed-text:    #222222;
  --sg-ed-muted:   #777777;
}

/* ── Wrap ──────────────────────────────────────────────── */
.sg-ed-wrap {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: var(--sg-ed-text);
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 8px;
  box-sizing: border-box;
}

.sg-ed-notice {
  padding: 16px 20px;
  background: var(--sg-ed-bg);
  border: 1px solid var(--sg-ed-border);
  border-radius: 6px;
  color: var(--sg-ed-muted);
  margin: 16px 0;
}

/* ─────────────────────────────────────────────────────── */
/* DASHBOARD                                               */
/* ─────────────────────────────────────────────────────── */

.sg-ed-dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 16px;
  border-bottom: 1px solid var(--sg-ed-border);
  margin-bottom: 24px;
}
.sg-ed-dash-header h2 { margin: 0; font-size: 1.15rem; font-weight: 600; }

.sg-ed-projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.sg-ed-project-card {
  background: var(--sg-ed-white);
  border: 1px solid var(--sg-ed-border);
  border-radius: 8px;
  padding: 18px 20px;
  cursor: pointer;
  transition: box-shadow .2s, border-color .2s;
  text-decoration: none;
  display: block;
  color: var(--sg-ed-text);
}
.sg-ed-project-card:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,.09);
  border-color: #bdbdbd;
  color: var(--sg-ed-text);
  text-decoration: none;
}

.sg-ed-card-title { font-weight: 600; font-size: .95rem; margin: 0 0 8px; }
.sg-ed-card-meta {
  font-size: 12px;
  color: var(--sg-ed-muted);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.sg-ed-card-progress { margin-top: 14px; }
.sg-ed-card-progress-label { font-size: 12px; color: var(--sg-ed-muted); margin-bottom: 4px; }
.sg-ed-progress-bar { height: 4px; background: #eee; border-radius: 2px; overflow: hidden; }
.sg-ed-progress-fill { height: 100%; background: var(--sg-ed-green); border-radius: 2px; transition: width .3s; }

.sg-ed-empty { grid-column: 1/-1; text-align: center; padding: 48px 24px; color: var(--sg-ed-muted); }
.sg-ed-empty-icon { font-size: 2rem; margin-bottom: 12px; }
.sg-ed-loading-msg { padding: 24px; color: var(--sg-ed-muted); }

/* ─────────────────────────────────────────────────────── */
/* STATUS BADGES                                           */
/* ─────────────────────────────────────────────────────── */

.sg-ed-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.sg-ed-badge-diagnostic { background: #eee; color: #666; }
.sg-ed-badge-quoted      { background: #fef3e2; color: #e67e22; }
.sg-ed-badge-quoted-accepted { background: #e8f5e9; color: #2e7d32; }
.sg-ed-badge-active      { background: #e3f2fd; color: #1565c0; }
.sg-ed-badge-closed      { background: #e8f5e9; color: #2e7d32; }
.sg-ed-badge-dormant     { background: #fff3e0; color: #bf360c; }

/* Carte dormante — grisée */
.sg-ed-card-dormant {
  opacity: .55; pointer-events: none; cursor: default;
}
.sg-ed-card-dormant .sg-ed-card-title { color: #999; }
.sg-ed-dormant-msg {
  font-size: 12px; color: #bf360c; font-style: italic;
  margin: 8px 0 0; padding: 0;
}

/* ─────────────────────────────────────────────────────── */
/* MODAL                                                   */
/* ─────────────────────────────────────────────────────── */

.sg-ed-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sg-ed-modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.sg-ed-modal-box {
  position: relative;
  background: var(--sg-ed-white);
  border-radius: 10px;
  width: 520px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 40px rgba(0,0,0,.2);
}
.sg-ed-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--sg-ed-border);
}
.sg-ed-modal-header h3 { margin: 0; font-size: .95rem; font-weight: 600; }
.sg-ed-modal-close {
  background: none; border: none; font-size: 1.4rem; cursor: pointer;
  color: var(--sg-ed-muted); line-height: 1; padding: 0;
}
.sg-ed-modal-body  { padding: 22px 24px; }
.sg-ed-modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 24px; border-top: 1px solid var(--sg-ed-border);
}

/* ─────────────────────────────────────────────────────── */
/* FORMS                                                   */
/* ─────────────────────────────────────────────────────── */

.sg-ed-field { margin-bottom: 16px; }
.sg-ed-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.sg-ed-field input[type="text"],
.sg-ed-field textarea {
  width: 100%; padding: 8px 12px; border: 1px solid var(--sg-ed-border);
  border-radius: 5px; font-size: 14px; font-family: inherit;
  box-sizing: border-box; color: var(--sg-ed-text);
}
.sg-ed-field textarea { resize: vertical; }
.sg-ed-field input:focus, .sg-ed-field textarea:focus {
  outline: none; border-color: #90caf9;
  box-shadow: 0 0 0 2px rgba(30,136,229,.15);
}

/* ─────────────────────────────────────────────────────── */
/* BUTTONS                                                 */
/* ─────────────────────────────────────────────────────── */

.sg-ed-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px; border-radius: 6px; font-size: 13px; font-weight: 600;
  cursor: pointer; border: 1px solid transparent;
  transition: opacity .15s, background .15s; font-family: inherit;
  line-height: 1.4; text-decoration: none;
}
.sg-ed-btn:disabled { opacity: .5; cursor: not-allowed; }

.sg-ed-btn-primary { background: var(--sg-ed-red); color: #fff; border-color: var(--sg-ed-red); }
.sg-ed-btn-primary:hover:not(:disabled) { background: #c62828; color: #fff; text-decoration: none; }

.sg-ed-btn-secondary { background: #f5f5f5; color: var(--sg-ed-text); border-color: #ddd; }
.sg-ed-btn-secondary:hover:not(:disabled) { background: #ebebeb; }

.sg-ed-btn-ghost { background: transparent; color: var(--sg-ed-text); border-color: var(--sg-ed-border); }
.sg-ed-btn-ghost:hover:not(:disabled) { background: #f5f5f5; }

.sg-ed-btn-full { width: 100%; justify-content: center; }
.sg-ed-btn-sm   { padding: 5px 12px; font-size: 12px; }

/* ─────────────────────────────────────────────────────── */
/* FILE PILL                                               */
/* ─────────────────────────────────────────────────────── */

.sg-ed-pill {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; background: var(--sg-ed-white);
  border: 1px solid var(--sg-ed-border); border-radius: 8px; margin-bottom: 12px;
}
.sg-ed-pill-icon { font-size: 1.5rem; flex-shrink: 0; }
.sg-ed-pill-info { flex: 1; min-width: 0; }
.sg-ed-pill-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-ed-pill-meta { font-size: 11px; color: var(--sg-ed-muted); margin-top: 2px; }
.sg-ed-pill-dl {
  flex-shrink: 0; background: none; border: none; cursor: pointer;
  font-size: 1.1rem; color: var(--sg-ed-muted); padding: 4px;
  text-decoration: none;
}
.sg-ed-pill-dl:hover { color: var(--sg-ed-text); }

/* ─────────────────────────────────────────────────────── */
/* DROP ZONE                                               */
/* ─────────────────────────────────────────────────────── */

.sg-ed-dropzone {
  border: 2px dashed #ccc; border-radius: 8px; padding: 22px 16px;
  text-align: center; background: #f9f9f9; cursor: pointer;
  transition: border-color .2s, background .2s;
}
.sg-ed-dropzone:hover, .sg-ed-dropzone.drag-over { border-color: var(--sg-ed-blue); background: #e3f2fd; }
.sg-ed-dropzone-main { display: block; font-size: 14px; color: var(--sg-ed-text); }
.sg-ed-dropzone-sub  { display: block; font-size: 12px; color: var(--sg-ed-muted); margin-top: 4px; }

/* Variante compacte (sidebar) */
.sg-ed-dropzone.sg-ed-dropzone-sm {
  padding: 14px 12px; margin-top: 10px;
}
.sg-ed-dropzone-sm .sg-ed-dropzone-main { font-size: 13px; font-weight: 600; }
.sg-ed-dropzone-sm .sg-ed-dropzone-sub  { font-size: 11px; }

/* ─────────────────────────────────────────────────────── */
/* 3-COLUMN LAYOUT                                         */
/* ─────────────────────────────────────────────────────── */

.sg-ed-page-header {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 20px; background: var(--sg-ed-white);
  border: 1px solid var(--sg-ed-border);
  border-radius: 8px 8px 0 0;
}
.sg-ed-page-header-left  { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--sg-ed-muted); min-width: 80px; }
.sg-ed-page-header-center { flex: 1; text-align: center; }
.sg-ed-votre-tour { color: var(--sg-ed-rust); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.sg-ed-page-header-right { display: flex; align-items: center; gap: 10px; }
.sg-ed-page-header-date  { font-size: 12px; color: var(--sg-ed-muted); text-align: right; line-height: 1.4; }

.sg-ed-columns {
  display: grid;
  grid-template-columns: 220px 1fr 260px;
  border: 1px solid var(--sg-ed-border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  overflow: hidden;
  min-height: 60vh;
}

.sg-ed-col-left  { background: #f8f8f8; border-right: 1px solid var(--sg-ed-border); overflow-y: auto; }
.sg-ed-col-center { background: var(--sg-ed-white); padding: 20px; overflow-y: auto; }
.sg-ed-col-right  { background: #f8f8f8; border-left: 1px solid var(--sg-ed-border); padding: 16px; overflow-y: auto; }

.sg-ed-col-heading {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--sg-ed-muted); padding: 14px 16px 10px;
  border-bottom: 1px solid var(--sg-ed-border); margin-bottom: 4px;
}

/* ─────────────────────────────────────────────────────── */
/* SEGMENT LIST (LEFT COLUMN)                              */
/* ─────────────────────────────────────────────────────── */

.sg-ed-seg-list { list-style: none; margin: 0; padding: 8px 0; }

.sg-ed-seg-item {
  display: flex; align-items: flex-start; gap: 7px;
  padding: 4px 14px; cursor: pointer; transition: background .15s;
  border-left: 3px solid transparent;
}
.sg-ed-seg-item:hover   { background: rgba(0,0,0,.04); }
.sg-ed-seg-item.selected { background: rgba(30,136,229,.07); border-left-color: var(--sg-ed-blue); }
.sg-ed-seg-item.no-click { cursor: default; }
.sg-ed-seg-item.no-click:hover { background: none; }

.sg-ed-seg-dot-col { display: flex; flex-direction: column; align-items: center; padding-top: 3px; }
.sg-ed-seg-circle {
  width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid var(--sg-ed-gray); flex-shrink: 0;
}
.sg-ed-seg-circle.s-pending      { border-color: var(--sg-ed-gray);   background: transparent; }
.sg-ed-seg-circle.s-active       { border-color: var(--sg-ed-red);    background: transparent; }
.sg-ed-seg-circle.s-waiting      { background: var(--sg-ed-blue);     border-color: var(--sg-ed-blue); }

/* Analyse en cours — spinner rotatif */
.sg-ed-seg-circle.s-analysing {
  border-color: var(--sg-ed-orange);
  border-top-color: transparent;
  background: transparent;
  animation: sg-spin 0.8s linear infinite;
}
@keyframes sg-spin { to { transform: rotate(360deg); } }

/* Analysé — rapport disponible, action éditeur requise */
.sg-ed-seg-circle.s-analysed {
  background: var(--sg-ed-orange);
  border-color: var(--sg-ed-orange);
}

/* Terminé — checkmark */
.sg-ed-seg-circle.s-done {
  background: var(--sg-ed-green);
  border-color: var(--sg-ed-green);
  position: relative;
}
.sg-ed-seg-circle.s-done::after {
  content: '✓';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 8px;
  line-height: 1;
  font-weight: 700;
}

/* En suspens (négociation) — point d'exclamation */
.sg-ed-seg-circle.s-negotiating {
  background: var(--sg-ed-orange);
  border-color: var(--sg-ed-orange);
  position: relative;
}
.sg-ed-seg-circle.s-negotiating::after {
  content: '!';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 9px;
  line-height: 1;
  font-weight: 700;
}
.sg-ed-seg-name.struck        { text-decoration: line-through; }
.sg-ed-seg-item.suspended     { opacity: .5; }
.sg-ed-seg-item.suspended .sg-ed-seg-sub { color: var(--sg-ed-gray); }
.sg-ed-seg-line { width: 2px; flex: 1; min-height: 4px; background: var(--sg-ed-border); margin-top: 2px; }

.sg-ed-seg-info { flex: 1; min-width: 0; padding-bottom: 2px; }
.sg-ed-seg-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-ed-seg-name.s-current { color: var(--sg-ed-red); font-weight: 700; }
.sg-ed-seg-sub  { font-size: 11px; color: var(--sg-ed-muted); margin-top: 0; }
.sg-ed-seg-sub.votre-tour { color: var(--sg-ed-red); }

.sg-ed-seg-legend {
  padding: 12px 16px;
  border-top: 1px solid var(--sg-ed-border);
  margin-top: 8px;
}
.sg-ed-seg-legend-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--sg-ed-muted); margin-bottom: 6px;
}
.sg-ed-seg-legend-item:last-child { margin-bottom: 0; }
.sg-ed-seg-legend-circle { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ─────────────────────────────────────────────────────── */
/* RIGHT SIDEBAR                                           */
/* ─────────────────────────────────────────────────────── */

.sg-ed-sidebar-project-title { font-weight: 600; font-size: .9rem; margin-bottom: 3px; }
.sg-ed-sidebar-project-author { font-size: 12px; color: var(--sg-ed-muted); }

.sg-ed-sidebar-section { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--sg-ed-border); }
.sg-ed-sidebar-section:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.sg-ed-sidebar-heading {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--sg-ed-muted); margin-bottom: 8px;
}
.sg-ed-sidebar-meta-row {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12px; padding: 2px 0;
}
.sg-ed-sidebar-meta-label { color: var(--sg-ed-muted); }
.sg-ed-sidebar-meta-value { font-weight: 600; text-align: right; }

.sg-ed-sidebar-text { font-size: 12px; color: var(--sg-ed-text); line-height: 1.55; }

.sg-ed-sidebar-textarea {
  font-size: 12px; width: 100%; padding: 6px 8px;
  border: 1px solid var(--sg-ed-border); border-radius: 4px;
  font-family: inherit; resize: vertical; box-sizing: border-box;
  background: var(--sg-ed-white); min-height: 80px;
}
.sg-ed-sidebar-textarea:focus { outline: none; border-color: #90caf9; }

.sg-ed-sidebar-save-row { text-align: right; margin-top: 6px; }

/* ─────────────────────────────────────────────────────── */
/* CENTER — ANALYSIS REPORT                                */
/* ─────────────────────────────────────────────────────── */

.sg-ed-section-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--sg-ed-muted); margin: 18px 0 8px;
}
.sg-ed-section-label:first-child { margin-top: 0; }

.sg-ed-report-iteration {
  font-size: 12px; color: var(--sg-ed-muted);
  margin-bottom: 10px; font-style: italic;
}
.sg-ed-report-box {
  border: 1px solid var(--sg-ed-border); border-radius: 6px;
  padding: 16px; margin-bottom: 16px; background: #fdfdfd;
  max-height: 500px; overflow-y: auto;

  /* Variables Stylographe disponibles dans le scope du rapport */
  --sg-rouille: #8b3a1a;
  --sg-ardoise: #4a5568;
  --sg-ligne:   #d4c9b4;
  --sg-encre:   #1a1410;
}

/* ── Rapport Stylographe — styles du moteur d'analyse ────── */
/* Classes générées par Claude via class-prompts.php,         */
/* répliquées ici pour le contexte éditorial.                 */
/* Source de vérité : frontend.css (.sg-analyse-*)            */

.sg-ed-report-box .sg-analyse-result { font-family: Georgia, 'Times New Roman', serif; }

.sg-ed-report-box .sg-analyse-texte {
  font-size: .95rem; line-height: 1.7; margin-bottom: 20px;
  padding: 14px 16px; background: #fafafa;
  border-left: 3px solid var(--sg-rouille); border-radius: 0 6px 6px 0;
}

.sg-ed-report-box .sg-analyse-texte .sg-mark-weak,
.sg-ed-report-box .sg-analyse-texte .sg-flag {
  text-decoration: underline !important;
  color: #c0392b !important;
  font-style: italic !important;
  background: transparent !important;
}

.sg-ed-report-box .sg-analyse-notes { margin-bottom: 20px; }
.sg-ed-report-box .sg-note {
  display: grid; grid-template-columns: 140px 1fr;
  gap: 8px 16px; padding: 10px 0;
  border-bottom: 1px solid var(--sg-ligne); font-size: .88rem;
}
.sg-ed-report-box .sg-note-type       { color: #c0392b; font-weight: bold; font-size: .82rem; }
.sg-ed-report-box .sg-note-original   { font-style: italic; }
.sg-ed-report-box .sg-note-suggestions { color: var(--sg-rouille); }
.sg-ed-report-box .sg-note-explication { color: var(--sg-ardoise); font-size: .82rem; grid-column: 2; }

/* Versions corrigées (texte_court uniquement) */
.sg-ed-report-box .sg-analyse-versions { margin-bottom: 16px; }
.sg-ed-report-box .sg-version-label {
  font-size: .78rem; font-family: monospace; letter-spacing: .04em;
  text-transform: uppercase; color: var(--sg-ardoise); margin: 12px 0 4px;
}
.sg-ed-report-box .sg-version {
  padding: 12px 16px; background: #f0f8f0;
  border-left: 3px solid #27ae60; border-radius: 0 6px 6px 0;
  margin-bottom: 10px; font-size: .93rem; line-height: 1.6;
}

/* Section Nommage */
.sg-ed-report-box .sg-analyse-nommage    { margin-bottom: 20px; }
.sg-ed-report-box .sg-analyse-nommage:empty { display: none; }
.sg-ed-report-box .sg-nommage-titre {
  font-size: .78rem; font-family: monospace;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--sg-ardoise); margin-bottom: 10px;
  padding-bottom: 6px; border-bottom: 2px solid var(--sg-rouille);
}
.sg-ed-report-box .sg-nommage-item {
  padding: 10px 0; border-bottom: 1px solid var(--sg-ligne);
}
.sg-ed-report-box .sg-nommage-original {
  font-style: italic; font-size: .88rem; display: block; margin-bottom: 8px;
}
.sg-ed-report-box .sg-nommage-strategies { display: flex; flex-direction: column; gap: 5px; }
.sg-ed-report-box .sg-nommage-strategy   { display: flex; gap: 10px; font-size: .86rem; align-items: baseline; }
.sg-ed-report-box .sg-strategy-type {
  color: #c0392b; font-weight: bold; font-size: .78rem;
  min-width: 110px; text-transform: uppercase;
  letter-spacing: .03em; flex-shrink: 0;
}
.sg-ed-report-box .sg-strategy-signal { color: var(--sg-ardoise); line-height: 1.5; }

/* ── Bilan = zone de commentaire éditorial ───────────────── */
/* Visuellement séparée du corps des annotations.             */
/* C'est la zone que l'éditeur enrichit de ses commentaires   */
/* personnels avant transmission à l'auteur.                  */
.sg-ed-report-box .sg-analyse-bilan {
  font-size: .88rem; color: var(--sg-ardoise); line-height: 1.65;
  padding: 14px 16px; margin-top: 16px;
  background: #f8f6f0; border: 1px solid #e0dac8;
  border-left: 3px solid var(--sg-rouille); border-radius: 0 6px 6px 0;
}
.sg-ed-report-box .sg-analyse-bilan::before {
  content: 'BILAN STYLISTIQUE';
  display: block; font-family: monospace;
  font-size: .7rem; font-weight: 700; letter-spacing: .08em;
  color: var(--sg-rouille); margin-bottom: 8px;
}

.sg-ed-prompt-textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--sg-ed-border);
  border-radius: 6px; font-size: 13px; font-family: inherit;
  resize: vertical; box-sizing: border-box; color: var(--sg-ed-text);
  min-height: 60px;
}
.sg-ed-prompt-textarea::placeholder { color: #bbb; }
.sg-ed-prompt-textarea:focus { outline: none; border-color: #90caf9; }

/* ─────────────────────────────────────────────────────── */
/* DIAGNOSTIC                                              */
/* ─────────────────────────────────────────────────────── */

.sg-ed-diag-result {
  background: var(--sg-ed-white); border: 1px solid var(--sg-ed-border);
  border-radius: 8px; padding: 18px 20px; margin-bottom: 16px;
}
.sg-ed-diag-summary { font-size: 13px; line-height: 1.6; margin-bottom: 14px; }
.sg-ed-diag-complexity {
  display: inline-block; padding: 3px 10px; border-radius: 12px;
  font-size: 12px; font-weight: 600; margin-bottom: 14px;
}
.sg-ed-diag-complexity.Simple   { background: #e8f5e9; color: #2e7d32; }
.sg-ed-diag-complexity.Moyen    { background: #fff3e0; color: #e65100; }
.sg-ed-diag-complexity.Complexe { background: #fce4ec; color: #c62828; }

.sg-ed-diag-seg-list { border-top: 1px solid var(--sg-ed-border); padding-top: 12px; }
.sg-ed-diag-seg-row {
  display: flex; align-items: baseline; gap: 8px;
  padding: 5px 0; border-bottom: 1px solid #f5f5f5; font-size: 13px;
}
.sg-ed-diag-seg-row:last-child { border-bottom: none; }
.sg-ed-diag-seg-pos  { color: var(--sg-ed-muted); font-size: 11px; min-width: 20px; }
.sg-ed-diag-seg-name { flex: 1; }
.sg-ed-diag-seg-wc   { color: var(--sg-ed-muted); font-size: 11px; }

/* ─────────────────────────────────────────────────────── */
/* SPINNER / LOADING                                       */
/* ─────────────────────────────────────────────────────── */

.sg-ed-spinner {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 0; color: var(--sg-ed-muted); font-size: 13px;
}
.sg-ed-spinner::before {
  content: ''; display: inline-block; width: 18px; height: 18px;
  border: 2px solid var(--sg-ed-border); border-top-color: var(--sg-ed-blue);
  border-radius: 50%; animation: sg-ed-spin .8s linear infinite; flex-shrink: 0;
}
@keyframes sg-ed-spin { to { transform: rotate(360deg); } }

/* ─────────────────────────────────────────────────────── */
/* ALERTS                                                  */
/* ─────────────────────────────────────────────────────── */

.sg-ed-alert {
  font-size: 13px; padding: 9px 12px; border-radius: 5px;
  border: 1px solid; margin: 8px 0;
}
.sg-ed-alert-error   { color: #c62828; background: #fce4ec; border-color: #f48fb1; }
.sg-ed-alert-success { color: #2e7d32; background: #e8f5e9; border-color: #a5d6a7; }
.sg-ed-alert-info    { color: #1565c0; background: #e3f2fd; border-color: #90caf9; }

/* ─────────────────────────────────────────────────────── */
/* MISC                                                    */
/* ─────────────────────────────────────────────────────── */

.sg-ed-back-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--sg-ed-muted); text-decoration: none;
  padding: 4px 0; margin-bottom: 6px;
}
.sg-ed-back-link:hover { color: var(--sg-ed-text); text-decoration: none; }

.sg-ed-credit-note { font-size: 12px; color: var(--sg-ed-muted); margin-top: 12px; }

.sg-ed-divider { height: 1px; background: var(--sg-ed-border); margin: 16px 0; }

.sg-ed-actions-row { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }

.sg-ed-timeline-slot {
  border-top: 1px solid var(--sg-ed-border);
  padding: 16px 20px;
  font-size: 12px; color: #bbb; font-style: italic; text-align: center;
  letter-spacing: .03em;
}

.sg-ed-waiting-wrap {
  display: flex; justify-content: center; padding: 48px 16px;
}
.sg-ed-waiting-card {
  background: var(--sg-ed-white);
  border: 1px solid var(--sg-ed-border);
  border-radius: 10px;
  padding: 32px 36px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0,0,0,.05);
}
.sg-ed-waiting-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 14px;
}
.sg-ed-waiting-badge-diagnostic { background: #e3f2fd; color: #1565c0; }
.sg-ed-waiting-badge-quoted     { background: #fef3e2; color: #e67e22; }
.sg-ed-waiting-badge-quoted-accepted { background: #e8f5e9; color: #2e7d32; }
.sg-ed-waiting-badge-suspended  { background: #f5f5f5; color: #666; }
.sg-ed-waiting-badge-dormant    { background: #fff3e0; color: #bf360c; }
.sg-ed-waiting-badge-closed     { background: #e8f5e9; color: #2e7d32; }

.sg-ed-waiting-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--sg-ed-text);
}
.sg-ed-waiting-meta {
  font-size: 12px;
  color: var(--sg-ed-muted);
  margin-bottom: 0;
}
.sg-ed-waiting-divider {
  height: 1px;
  background: var(--sg-ed-border);
  margin: 20px 0;
}
.sg-ed-waiting-icon { font-size: 2rem; margin-bottom: 10px; }
.sg-ed-waiting-msg  {
  max-width: 340px;
  margin: 0 auto;
  line-height: 1.65;
  font-size: 13px;
  color: var(--sg-ed-muted);
}

/* État d'attente inline (segment non accessible) */
.sg-ed-waiting {
  text-align: center; padding: 48px 32px; color: var(--sg-ed-muted);
}
.sg-ed-waiting p { max-width: 360px; margin: 0 auto; line-height: 1.65; }

/* ─────────────────────────────────────────────────────── */
/* SPINNER INLINE (boutons en cours d'analyse)            */
/* ─────────────────────────────────────────────────────── */

@keyframes sg-ed-spin {
  to { transform: rotate(360deg); }
}

.sg-ed-btn.loading::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 8px;
  border: 3px solid #e2d9ce;
  border-top-color: #8B3A1A;
  border-radius: 50%;
  animation: sg-ed-spin 0.9s linear infinite;
  vertical-align: middle;
}
