/* Éditeur d'activités Copilotr@ce — habillage (barre, panneaux, aides repliables, formulaires) */
:root {
  --ed-bg: #f6f7f9; --ed-surface: #fff; --ed-ink: #111827; --ed-ink2: #374151; --ed-muted: #6b7280;
  --ed-line: #e5e7eb; --ed-accent: #F59E0B; --ed-accent-h: #D48809; --ed-accent-soft: #FEF3C7; --ed-accent-ink: #B45309; --ed-accent-active: #F97316; --ed-on-accent: #1F1300;
  --ed-danger: #b91c1c; --ed-radius: 16px;
  --ed-shadow: 0 1px 2px rgba(17,24,39,.06), 0 4px 14px rgba(17,24,39,.05);
  --ed-shadow-h: 0 2px 4px rgba(17,24,39,.08), 0 12px 28px rgba(17,24,39,.12);
}
html, body { min-height: 100%; }
body { margin: 0; background: var(--ed-bg); color: var(--ed-ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
.ed-page { min-height: 100vh; padding-bottom: 64px; }
.ed-page :focus-visible { outline: 3px solid rgba(180,83,9,.6); outline-offset: 2px; border-radius: 8px; }

/* ---------- barre supérieure ---------- */
.ed-bar { position: sticky; top: 0; z-index: 900; background: rgba(255,255,255,.95);
  -webkit-backdrop-filter: saturate(160%) blur(10px); backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--ed-line); }
.ed-bar-in { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; max-width: 1400px; margin: 0 auto; padding: 10px 20px; }
.ed-brand { display: flex; align-items: center; gap: 10px; color: var(--ed-ink); text-decoration: none; flex: 0 0 auto; }
.ed-brand:hover { color: var(--ed-ink); }
.ed-brand img { width: 38px; height: 38px; border-radius: 10px; }
.ed-brand-t { display: flex; flex-direction: column; line-height: 1.15; }
.ed-brand-t b { font-size: 17px; letter-spacing: -.01em; }
.ed-brand-t small { font-size: 12px; color: var(--ed-muted); }
.ed-doc { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; padding-left: 16px; border-left: 1px solid var(--ed-line); }
.ed-doc-t { font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-doc-e { font-size: 12px; color: var(--ed-muted); }
.ed-doc-e.ed-ok { color: var(--ed-accent-ink); }
.ed-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.ed-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 18px;
  border: 1px solid transparent; border-radius: 999px; font-size: 15px; font-weight: 600; line-height: 1.2; cursor: pointer;
  background: var(--ed-accent); color: var(--ed-on-accent); text-decoration: none; transition: background .15s, box-shadow .15s; }
.ed-btn:hover { background: var(--ed-accent-h); color: var(--ed-on-accent); box-shadow: 0 4px 12px rgba(245,158,11,.28); }
.ed-btn:active { box-shadow: 0 0 0 3px var(--ed-accent-active); }
.ed-btn[disabled] { opacity: .55; cursor: progress; box-shadow: none; }
.ed-btn.ed-ghost { background: #fff; color: var(--ed-ink); border-color: var(--ed-line); }
.ed-btn.ed-ghost:hover { background: #f3f4f6; color: var(--ed-ink); box-shadow: none; }
.ed-btn.ed-soft { background: var(--ed-accent-soft); color: var(--ed-accent-ink); }
.ed-btn.ed-soft:hover { background: #FDE68A; color: var(--ed-accent-ink); box-shadow: none; }
.ed-btn.ed-sm { min-height: 34px; padding: 0 14px; font-size: 14px; }
.ed-pastille { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: #f59e0b; color: var(--ed-on-accent); font-size: 12px; }

.ed-menu { position: relative; }
.ed-menu > summary { list-style: none; }
.ed-menu > summary::-webkit-details-marker { display: none; }
.ed-menu > summary.ed-btn::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); }
.ed-menu-l { position: absolute; right: 0; top: calc(100% + 8px); min-width: 250px; padding: 8px; z-index: 950;
  background: #fff; border: 1px solid var(--ed-line); border-radius: 14px; box-shadow: var(--ed-shadow-h); }
.ed-menu-l button, .ed-menu-l a { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; border-radius: 10px;
  background: transparent; color: var(--ed-ink); font-size: 15px; text-decoration: none; cursor: pointer; }
.ed-menu-l button:hover, .ed-menu-l a:hover { background: #f3f4f6; }
.ed-menu-l hr { margin: 6px 4px; border-color: var(--ed-line); opacity: 1; }
.ed-menu-n { display: block; padding: 8px 12px 2px; font-weight: 700; }
.ed-compte { cursor: pointer; border-radius: 50%; }
.ed-avatar { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--ed-accent); color: var(--ed-on-accent); font-weight: 700; text-transform: uppercase; }

.ed-onglets { display: flex; gap: 4px; max-width: 1400px; margin: 0 auto; padding: 0 20px; overflow-x: auto; scrollbar-width: none; }
.ed-onglets::-webkit-scrollbar { display: none; }
.ed-onglet { flex: 0 0 auto; padding: 11px 14px; color: var(--ed-muted); font-size: 15px; font-weight: 600; white-space: nowrap; text-decoration: none; border-bottom: 3px solid transparent; }
.ed-onglet:hover { color: var(--ed-ink); }
.ed-onglet.ed-on { color: var(--ed-accent-ink); border-bottom-color: var(--ed-accent); }

/* ---------- panneaux ---------- */
.ed-panneau { max-width: 1400px; margin: 16px auto 0; padding: 0 20px; }
.ed-carte { background: var(--ed-surface); border: 1px solid var(--ed-line); border-radius: var(--ed-radius); padding: 18px 20px; box-shadow: var(--ed-shadow); }
.ed-carte h2 { font-size: 18px; font-weight: 700; margin: 0; }
.ed-carte-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.ed-carte-h h2 { margin-right: auto; }
.ed-carte.ed-alerte { border-color: #fcd34d; background: #fffbeb; }
.ed-carte ul { margin: 8px 0 0; padding-left: 20px; font-size: 14px; color: var(--ed-ink2); }
.ed-note { font-size: 14px; color: var(--ed-muted); margin: 0 0 10px; }
.ed-connexion { max-width: 440px; }
.ed-connexion label { display: block; font-size: 14px; font-weight: 600; margin: 10px 0 6px; color: var(--ed-ink2); }
.ed-input { width: 100%; min-height: 42px; padding: 8px 14px; font-size: 15px; color: var(--ed-ink); background: #fff; border: 1px solid #d1d5db; border-radius: 12px; outline: 0; }
.ed-input:focus { border-color: var(--ed-accent); box-shadow: 0 0 0 4px rgba(245,158,11,.25); }
.ed-recherche { width: auto; flex: 1 1 180px; max-width: 320px; min-height: 36px; }
.ed-ligne { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.ed-ligne a { margin-left: auto; color: var(--ed-accent-ink); font-weight: 600; font-size: 14px; text-decoration: none; }
.ed-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; max-height: 46vh; overflow-y: auto; padding: 2px; }
.ed-item { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px 14px; text-align: left;
  background: #fff; border: 1px solid var(--ed-line); border-radius: 14px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.ed-item:hover { border-color: var(--ed-accent); box-shadow: var(--ed-shadow); }
.ed-item.ed-on { border-color: var(--ed-accent); background: var(--ed-accent-soft); }
.ed-item-t { font-weight: 700; font-size: 15px; color: var(--ed-ink); overflow-wrap: anywhere; }
.ed-item-s { font-size: 13px; color: var(--ed-muted); }
.ed-tag { display: inline-flex; align-items: center; height: 22px; padding: 0 10px; border-radius: 999px; background: #f3f4f6; color: var(--ed-ink2); font-size: 12px; font-weight: 600; }
.ed-tag.ed-ok { background: #dcfce7; color: #166534; }
.ed-tag.ed-off { background: #fee2e2; color: #991b1b; }
.ed-controle { list-style: none; padding: 0 !important; max-height: 40vh; overflow-y: auto; }
.ed-controle li { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border-left: 4px solid #f59e0b; background: #fffbeb; border-radius: 8px; margin-bottom: 6px; }
.ed-controle li.ed-err { border-left-color: var(--ed-danger); background: #fef2f2; }
.ed-controle code { font-size: 12px; color: var(--ed-muted); overflow-wrap: anywhere; }
.ed-controle em { color: var(--ed-accent-ink); font-style: normal; }

/* ---------- zones d'aide repliables ---------- */
.ed-aide { margin: 14px 0; background: #f0f7ff; border: 1px solid #cfe3fb; border-radius: 12px; }
.ed-aide > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; padding: 10px 14px; font-size: 14px; font-weight: 700; color: #1e3a5f; }
.ed-aide > summary::-webkit-details-marker { display: none; }
.ed-aide > summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid #1e3a5f; border-bottom: 2px solid #1e3a5f; transform: rotate(45deg); transition: transform .15s; }
.ed-aide[open] > summary::after { transform: rotate(-135deg); }
.ed-aide-i { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #1e3a5f; color: #fff; font-size: 13px; }
.ed-aide-c { padding: 0 14px 12px 46px; font-size: 14px; line-height: 1.6; color: #24384f; }
.ed-apercu-aide { max-width: 827px; margin: 16px auto 0; padding: 0 12px; }

/* ---------- formulaire de création (habillage des éléments Bootstrap existants) ---------- */
.ed-corps { padding: 8px 20px 0; max-width: 1400px; }
.ed-page .accordion { --bs-accordion-border-color: var(--ed-line); }
.ed-page .accordion-item { border: 1px solid var(--ed-line); border-radius: var(--ed-radius) !important; overflow: hidden; box-shadow: var(--ed-shadow); background: #fff; }
.ed-page .accordion-button { background: #fff !important; color: var(--ed-ink) !important; font-size: 17px; font-weight: 700; padding: 16px 20px; box-shadow: none !important; border-left: 5px solid var(--ed-accent); }
.ed-page .accordion-button::after { filter: none; }
.ed-page .accordion-button:not(.collapsed) { border-bottom: 1px solid var(--ed-line); }
.ed-page .accordion-body { padding: 8px 20px 22px; }
.ed-page .accordion-body .fs-4 { font-size: 17px !important; font-weight: 700; margin-top: 26px !important; }
.ed-page hr.hr { margin: 6px 0 12px; border-color: var(--ed-line); opacity: 1; }
.ed-page .form-control, .ed-page .form-select { border-radius: 12px; border-color: #d1d5db; min-height: 42px; }
.ed-page .form-control:focus, .ed-page .form-select:focus { border-color: var(--ed-accent); box-shadow: 0 0 0 4px rgba(245,158,11,.25); }
.ed-page .form-control-color { min-height: 42px; width: 64px; padding: 4px; }
.ed-page .form-check-input:checked { background-color: var(--ed-accent-ink); border-color: var(--ed-accent-ink); }
.ed-page .form-label, .ed-page label { font-size: 14px; font-weight: 600; color: var(--ed-ink2); }
.ed-page .form-check-label { font-weight: 500; }
.ed-page .btn { border-radius: 999px; font-weight: 600; padding: 8px 16px; }
.ed-page .btn-group > .btn { border-radius: 0; }
.ed-page .btn-group > .btn:first-child { border-radius: 999px 0 0 999px; }
.ed-page .btn-group > .btn:last-child { border-radius: 0 999px 999px 0; }
.ed-page .btn-group > .btn:only-child { border-radius: 999px; }
.ed-page .btn-success, .ed-page .btn-primary { background: var(--ed-accent); border-color: var(--ed-accent); color: var(--ed-on-accent); }
.ed-page .btn-success:hover, .ed-page .btn-primary:hover { background: var(--ed-accent-h); border-color: var(--ed-accent-h); }
.ed-page .btn-light { background: #fff; border-color: var(--ed-line); color: var(--ed-ink) !important; }
.ed-page .btn-light:hover { background: #f3f4f6; }
.ed-page .btn-outline-secondary, .ed-page .btn-outline-primary { border-color: var(--ed-line); color: var(--ed-ink); background: #fff; }
.ed-page .btn-outline-secondary:hover, .ed-page .btn-outline-primary:hover { background: #f3f4f6; color: var(--ed-ink); }
.ed-page .nav-tabs { border-bottom: 1px solid var(--ed-line); gap: 2px; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.ed-page .nav-tabs .nav-link { border: 0; border-bottom: 3px solid transparent; border-radius: 0; color: var(--ed-muted); font-weight: 600; white-space: nowrap; background: transparent; }
.ed-page .nav-tabs .nav-link:hover { color: var(--ed-ink); }
.ed-page .nav-tabs .nav-link.active { color: var(--ed-accent-ink); border-bottom-color: var(--ed-accent); background: transparent; }
.ed-page img { max-width: 100%; }

/* aperçu : défilement horizontal sur les petits écrans, le support garde sa taille réelle */
.ed-page #manipulation { overflow-x: auto; padding: 0 12px 12px; }
.ed-page [ng-show="interface==2"][style] { max-width: 100%; padding: 0 12px; flex-wrap: wrap; gap: 8px; }

/* messages */
#InformationBulle { position: fixed; left: 50%; right: auto; top: auto; bottom: 24px; transform: translateX(-50%); z-index: 2000; display: none;
  max-width: calc(100vw - 32px); margin: 0; padding: 12px 20px; border-radius: 14px; box-shadow: var(--ed-shadow-h); font-size: 15px; font-weight: 600; text-align: center; }

/* mot de passe oublié */
.ed-auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.ed-auth .ed-carte { width: 100%; max-width: 420px; text-align: center; padding: 30px 26px; }
.ed-auth img { width: 84px; height: 84px; border-radius: 20px; margin-bottom: 12px; }
.ed-auth label { display: block; text-align: left; font-size: 14px; font-weight: 600; margin: 14px 0 6px; }
.ed-auth .ed-btn { width: 100%; margin-top: 16px; min-height: 46px; }
.ed-auth a { display: inline-block; margin-top: 16px; color: var(--ed-accent-ink); font-weight: 600; font-size: 14px; text-decoration: none; }

/* ---------- enchaînement (graphe humain) ---------- */
.ed-pastille.ed-pastille-ok { background: var(--ed-accent-ink); color: #fff; }
.ed-palier { border: 1px solid var(--ed-line); border-radius: 14px; padding: 14px 16px; margin: 12px 0; background: #fff; }
.ed-palier-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 15px; color: var(--ed-ink2); }
.ed-palier-h label { margin: 0; }
.ed-palier-n { font-weight: 700; color: var(--ed-ink); margin-right: 6px; }
.ed-palier-x { margin-left: auto; }
.ed-borne { width: 96px; min-height: 40px; text-align: center; }
.ed-palier-r { margin: 10px 0 0; padding: 8px 12px; font-size: 14px; color: #7c2d12; background: #fffbeb; border-left: 4px solid #f59e0b; border-radius: 8px; }
.ed-palier-vide { margin: 12px 0 0; padding: 12px 14px; font-size: 14px; color: var(--ed-ink2); border: 1px dashed #94a3b8; border-radius: 12px; }
.ed-palier .ed-note { margin: 10px 0 0; }
.ed-palier-a { margin-top: 12px; }
.ed-palier-m { margin-top: 14px; }
.ed-lien { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; padding: 10px 12px; border: 1px solid var(--ed-line); border-radius: 12px; background: var(--ed-bg); }
.ed-lien-t { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ed-lien-t b { font-size: 15px; color: var(--ed-ink); overflow-wrap: anywhere; }
.ed-lien-t span { font-size: 13px; color: var(--ed-muted); }
.ed-choix { margin-top: 12px; padding: 14px; border: 1px solid var(--ed-accent); border-radius: 14px; background: #FFFDF7; }
.ed-choix h3 { font-size: 16px; font-weight: 700; margin: 0 auto 0 0; }
.ed-item.ed-coche { cursor: pointer; position: relative; padding-left: 44px; margin: 0; }
.ed-item.ed-coche input { position: absolute; left: 14px; top: 14px; width: 18px; height: 18px; accent-color: var(--ed-accent); }
.ed-apercu-json { margin: 0 0 8px; padding: 10px 12px; max-height: 260px; overflow: auto; font-size: 13px; background: #fff; border: 1px solid var(--ed-line); border-radius: 10px; white-space: pre; }

@media (max-width: 900px) {
  .ed-bar-in { padding: 10px 14px; }
  .ed-brand-t small { display: none; }
  .ed-doc { order: 3; flex: 1 1 100%; padding-left: 0; border-left: 0; }
  .ed-actions { margin-left: auto; }
  .ed-onglets, .ed-panneau { padding: 0 14px; }
  .ed-corps { padding: 8px 6px 0; }
  .ed-page .accordion-body { padding: 6px 12px 18px; }
  .ed-aide-c { padding-left: 14px; }
}
@media (max-width: 560px) {
  .ed-btn { min-height: 38px; padding: 0 13px; font-size: 14px; }
  .ed-menu-l { right: auto; left: 0; }
  .ed-actions .ed-menu:last-child .ed-menu-l { left: auto; right: 0; }
  .ed-liste { grid-template-columns: 1fr; }
}
