/* ══════════════════════════════════════════════════════════
   Back office Insijem — interface « application »
   Barre latérale (ordinateur) · barre d'onglets (mobile)
   Thème clair / sombre automatique · couleurs du logo
   ══════════════════════════════════════════════════════════ */

:root {
  --bg: #f4f3ef;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --line: #e6e3dc;
  --line-strong: #d6d2c8;
  --text: #17161c;
  --soft: #5f5d66;
  --faint: #8a8791;

  --ink: #14131a; /* barre latérale */
  --ink-2: #1f1d27;
  --ink-text: #f2f0ea;
  --ink-soft: rgba(242, 240, 234, 0.6);

  --yellow: #e6b020;
  --violet: #6130a0;
  --violet-soft: rgba(97, 48, 160, 0.1);
  --turquoise: #3dbfb8;
  --turquoise-text: #176a66;
  --green: #2e7d36;
  --red: #b42323;
  --bordeaux: #852020;

  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 1px 2px rgba(20, 19, 26, 0.04), 0 8px 24px -12px rgba(20, 19, 26, 0.12);
  --shadow-lg: 0 24px 60px -20px rgba(20, 19, 26, 0.28);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --sidebar: 264px;
  --tabbar: 68px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0d12;
    --surface: #18171e;
    --surface-2: #1d1c24;
    --line: #2a2833;
    --line-strong: #3a3845;
    --text: #f2f0ea;
    --soft: #b4b0bd;
    --faint: #8b8796;
    --ink: #0a090d;
    --ink-2: #16151c;
    --violet: #b994ea;
    --violet-soft: rgba(185, 148, 234, 0.14);
    --turquoise-text: #5fd3cc;
    --green: #72c27a;
    --red: #ff8a8a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px -14px rgba(0, 0, 0, 0.7);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 "Inter", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1,
h2,
h3,
legend {
  font-family: "Inter", system-ui, sans-serif;
  letter-spacing: -0.02em;
}
a {
  color: var(--turquoise-text);
}
code {
  padding: 0.12rem 0.4rem;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 0.88em;
}
:focus-visible {
  outline: 3px solid var(--violet);
  outline-offset: 2px;
  border-radius: 8px;
}

.adm-icon {
  width: 20px;
  height: 20px;
  flex: none;
}
.adm-icon-sm { width: 16px; height: 16px; }
.adm-icon-lg { width: 30px; height: 30px; }

.adm-skip {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  background: var(--yellow);
  color: var(--ink);
  font-weight: 700;
}
.adm-skip:focus {
  left: 0.5rem;
}

/* ══════════════ STRUCTURE ══════════════ */
.adm-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem 1rem;
  background: var(--ink);
  color: var(--ink-text);
  overflow-y: auto;
}
.adm-shell {
  margin-left: var(--sidebar);
  min-height: 100vh;
}
.adm-main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.75rem 2rem 7rem;
}

/* Marque : 5 pastilles aux couleurs du logo */
.adm-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.25rem 0.6rem;
  color: inherit;
  text-decoration: none;
}
.adm-logo {
  display: grid;
  grid-template-columns: repeat(3, 9px);
  gap: 3px;
  width: 33px;
}
.adm-logo span {
  height: 9px;
  border-radius: 50%;
}
.adm-logo span:nth-child(1) { background: var(--turquoise); }
.adm-logo span:nth-child(2) { background: #2e7d36; }
.adm-logo span:nth-child(3) { background: var(--yellow); }
.adm-logo span:nth-child(4) { background: #852020; grid-column: 2; }
.adm-logo span:nth-child(5) { background: #6130a0; }
.adm-brand-text {
  display: grid;
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  line-height: 1.1;
}
.adm-brand-text small {
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.adm-nav {
  display: grid;
  gap: 0.25rem;
}
.adm-nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-height: 46px;
  padding: 0 0.9rem;
  border-radius: 12px;
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}
.adm-nav a:hover {
  background: var(--ink-2);
  color: var(--ink-text);
}
.adm-nav a[aria-current="page"] {
  background: linear-gradient(90deg, rgba(230, 176, 32, 0.18), rgba(230, 176, 32, 0.04));
  color: #fff;
}
.adm-nav a[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -1rem;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--yellow);
}
.adm-nav a[aria-current="page"] .adm-icon {
  color: var(--yellow);
}
.adm-nav-short {
  display: none;
}

.adm-sidebar-foot {
  margin-top: auto;
  display: grid;
  gap: 0.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.adm-sidebar-foot form {
  margin: 0;
}
.adm-side-link {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  min-height: 44px;
  padding: 0 0.9rem;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--ink-soft);
  font: 500 0.95rem "Inter", system-ui, sans-serif;
  text-decoration: none;
  cursor: pointer;
}
.adm-side-link:hover {
  background: var(--ink-2);
  color: var(--ink-text);
}

/* Barre du haut */
.adm-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 60px;
  padding: 0.5rem 2rem;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.adm-crumbs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  font-size: 0.9rem;
  color: var(--faint);
}
.adm-crumbs a {
  color: var(--soft);
  text-decoration: none;
}
.adm-crumbs a:hover {
  color: var(--text);
}
.adm-crumbs span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-weight: 600;
}
.adm-topbar-actions {
  display: none;
  gap: 0.5rem;
}
.adm-topbar-actions form {
  margin: 0;
}
.adm-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 40px;
  min-width: 40px;
  justify-content: center;
  padding: 0 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: 600 0.85rem "Inter", system-ui, sans-serif;
  text-decoration: none;
  cursor: pointer;
}

/* En-tête de page */
.adm-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin: 0.5rem 0 1.75rem;
}
.adm-page-head h1 {
  margin: 0;
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  line-height: 1.1;
}
.adm-eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--violet);
}
.adm-lead {
  margin: 0.5rem 0 0;
  max-width: 60ch;
  color: var(--soft);
}
.adm-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ══════════════ NOTIFICATIONS ══════════════ */
.adm-toasts {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 50;
  display: grid;
  gap: 0.5rem;
  max-width: min(420px, calc(100vw - 2rem));
}
.adm-toast {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 0.9rem 0.9rem 1rem;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  font-weight: 500;
  animation: toast-in 0.5s var(--ease);
}
.adm-toast > .adm-icon {
  margin-top: 1px;
}
.adm-toast span {
  flex: 1;
}
.adm-toast-success > .adm-icon { color: var(--green); }
.adm-toast-error { border-color: color-mix(in srgb, var(--red) 40%, var(--line)); }
.adm-toast-error > .adm-icon { color: var(--red); }
.adm-toast-info > .adm-icon { color: var(--turquoise-text); }
.adm-toast-close {
  display: inline-flex;
  padding: 2px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--faint);
  cursor: pointer;
}
.adm-toast.is-leaving {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.3s, transform 0.3s;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.98);
  }
}

/* Message dans une page (formulaires) */
.adm-flash {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.9rem 1rem;
  margin-bottom: 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-weight: 500;
}
.adm-flash-error {
  border-color: color-mix(in srgb, var(--red) 45%, var(--line));
  color: var(--red);
  background: color-mix(in srgb, var(--red) 6%, var(--surface));
}
.adm-flash-info {
  border-color: color-mix(in srgb, var(--turquoise) 45%, var(--line));
  background: color-mix(in srgb, var(--turquoise) 7%, var(--surface));
}
.adm-flash-success {
  border-color: color-mix(in srgb, var(--green) 45%, var(--line));
}

/* ══════════════ BOUTONS ══════════════ */
.adm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0 1.2rem;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--yellow);
  color: #17161c;
  font: 700 0.93rem "Inter", system-ui, sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s var(--ease), background 0.2s, box-shadow 0.2s, border-color 0.2s, color 0.2s;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset, 0 6px 14px -8px rgba(230, 176, 32, 0.8);
}
.adm-btn:hover {
  background: #f0bd2e;
  transform: translateY(-1px);
}
.adm-btn:active {
  transform: translateY(0) scale(0.98);
}
.adm-btn:disabled {
  opacity: 0.4;
  pointer-events: none;
}
.adm-btn-ghost {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--text);
  box-shadow: none;
}
.adm-btn-ghost:hover {
  background: var(--surface-2);
  border-color: var(--text);
}
.adm-btn-danger {
  background: transparent;
  border-color: color-mix(in srgb, var(--red) 35%, var(--line));
  color: var(--red);
  box-shadow: none;
}
.adm-btn-danger:hover {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.adm-btn-small {
  min-height: 38px;
  padding: 0 0.8rem;
  font-size: 0.85rem;
  border-radius: 10px;
}
/* Bouton carré à icône */
.adm-btn-icon {
  width: 38px;
  min-height: 38px;
  padding: 0;
}

/* ══════════════ CARTES & PANNEAUX ══════════════ */
.adm-panel {
  position: relative;
  min-width: 0;
  margin: 0 0 1.25rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  scroll-margin-top: 80px;
}
.adm-panel legend {
  float: left;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 1.25rem;
  padding: 0;
  font-size: 1.1rem;
  font-weight: 800;
}
.adm-panel legend + * {
  clear: both;
}
.adm-panel-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--violet-soft);
  color: var(--violet);
}
.adm-panel > summary {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}
.adm-panel > summary::-webkit-details-marker {
  display: none;
}
.adm-panel > summary::after {
  content: "";
  margin-left: auto;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--faint);
  border-bottom: 2px solid var(--faint);
  transform: rotate(45deg);
  transition: transform 0.25s;
}
details[open].adm-panel > summary::after {
  transform: rotate(225deg);
}
details[open].adm-panel > summary {
  margin-bottom: 1.25rem;
}
.adm-panel h3 {
  margin: 1.5rem 0 0.9rem;
  font-size: 1rem;
}

/* ══════════════ CHAMPS ══════════════ */
.adm-form {
  display: grid;
  gap: 0.25rem;
}
.adm-field {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 1rem;
  min-width: 0;
}
.adm-field label,
.adm-label {
  font-weight: 600;
  font-size: 0.88rem;
}
.adm-field input,
.adm-field textarea,
.adm-field select {
  width: 100%;
  min-height: 46px;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font: 16px/1.5 "Inter", system-ui, sans-serif; /* 16 px : pas de zoom sur iPhone */
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.adm-field textarea {
  resize: vertical;
  min-height: 110px;
}
.adm-field input:hover,
.adm-field textarea:hover,
.adm-field select:hover {
  border-color: var(--faint);
}
.adm-field input:focus,
.adm-field textarea:focus,
.adm-field select:focus {
  outline: none;
  border-color: var(--violet);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--violet-soft);
}
.adm-field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238a8791' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
}
.adm-hint {
  display: block;
  font-size: 0.83rem;
  color: var(--faint);
}
/* Compteur de caractères (ajouté par admin.js) */
.adm-count {
  justify-self: end;
  margin-top: -0.2rem;
  font-size: 0.75rem;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.adm-count.is-near {
  color: #b7791f;
}
.adm-check {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  font-weight: 500;
  cursor: pointer;
}
.adm-check input {
  width: 20px;
  height: 20px;
  accent-color: var(--violet);
}
.adm-check-danger {
  color: var(--red);
  font-size: 0.9rem;
}
.adm-grid-2,
.adm-grid-3,
.adm-grid-4 {
  display: grid;
  gap: 0 1rem;
}
@media (min-width: 720px) {
  .adm-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .adm-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .adm-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Zone de dépôt d'image (glisser-déposer + aperçu) */
.adm-drop {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem;
  border: 1.5px dashed var(--line-strong);
  border-radius: 14px;
  background: var(--surface-2);
  transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease);
}
.adm-drop:hover,
.adm-drop.is-over {
  border-color: var(--violet);
  background: var(--violet-soft);
}
.adm-drop.is-over {
  transform: scale(1.01);
}
.adm-drop-preview {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--faint);
}
.adm-drop-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.adm-drop-body {
  display: grid;
  gap: 0.1rem;
  font-size: 0.9rem;
  color: var(--soft);
}
.adm-drop-body strong {
  color: var(--text);
  font-size: 0.95rem;
}
.adm-drop-link {
  color: var(--violet);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.adm-drop-body small {
  color: var(--faint);
  font-size: 0.78rem;
}
.adm-drop-input {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  cursor: pointer;
}
.adm-drop.is-ready {
  border-style: solid;
  border-color: var(--green);
}
.adm-drop:focus-within {
  outline: 3px solid var(--violet);
  outline-offset: 2px;
}

/* Fichier (PDF) */
.adm-file {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 48px;
  padding: 0 1.1rem;
  border: 1.5px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--surface-2);
  font-weight: 600;
  cursor: pointer;
}
.adm-file:hover {
  border-color: var(--violet);
}
.adm-file input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.adm-file.has-file {
  border-style: solid;
  border-color: var(--green);
  color: var(--green);
}

/* Éléments répétables (témoignages, membres) */
.adm-item {
  position: relative;
  padding: 1.1rem 1.1rem 0.75rem;
  margin-bottom: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  transition: box-shadow 0.25s, border-color 0.25s, transform 0.25s var(--ease);
}
.adm-item:hover {
  border-color: var(--line-strong);
}
.adm-item.is-new {
  animation: item-in 0.5s var(--ease);
  border-color: var(--violet);
}
@keyframes item-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}
.adm-item-tools {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
  padding-top: 0.25rem;
  border-top: 1px dashed var(--line);
}
.adm-item-tools .adm-btn {
  margin-top: 0.6rem;
}
.adm-add {
  width: 100%;
  min-height: 52px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 14px;
  background: transparent;
  color: var(--soft);
  font: 600 0.95rem "Inter", system-ui, sans-serif;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.adm-add:hover {
  border-color: var(--violet);
  color: var(--violet);
  background: var(--violet-soft);
}
.adm-row {
  padding-bottom: 0.25rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px dashed var(--line);
}

/* Aide de mise en forme */
.adm-help {
  margin: -0.25rem 0 1.25rem;
  padding: 0.25rem 1rem;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--soft);
}
.adm-help summary {
  display: flex;
  align-items: center;
  min-height: 42px;
  font-weight: 700;
  color: var(--turquoise-text);
  cursor: pointer;
}
.adm-help ul {
  margin: 0 0 0.75rem;
  padding-left: 1.2rem;
}
.adm-help li {
  margin: 0.3rem 0;
}

/* Éditeur long : sommaire collant à gauche */
.adm-editor {
  display: grid;
  gap: 1.5rem;
}
.adm-toc {
  display: none;
}
@media (min-width: 1180px) {
  .adm-editor {
    grid-template-columns: 210px minmax(0, 1fr);
    align-items: start;
  }
  .adm-toc {
    position: sticky;
    top: 84px;
    display: grid;
    gap: 0.15rem;
    padding: 0.5rem;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
  }
  .adm-toc a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 40px;
    padding: 0 0.75rem;
    border-radius: 10px;
    color: var(--soft);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
  }
  .adm-toc a:hover {
    background: var(--surface-2);
    color: var(--text);
  }
  .adm-toc a.is-active {
    background: var(--violet-soft);
    color: var(--violet);
    font-weight: 700;
  }
  .adm-toc .adm-icon {
    width: 17px;
    height: 17px;
  }
}

/* Barre d'enregistrement */
.adm-savebar {
  position: sticky;
  bottom: 1rem;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.5rem;
  padding: 0.7rem 0.7rem 0.7rem 1.1rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-lg);
}
.adm-save-state {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.9rem;
  color: var(--soft);
}
.adm-save-state::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
}
.adm-savebar.is-dirty .adm-save-state {
  color: var(--text);
  font-weight: 600;
}
.adm-savebar.is-dirty .adm-save-state::before {
  background: var(--yellow);
  box-shadow: 0 0 0 0 rgba(230, 176, 32, 0.6);
  animation: dirty-pulse 1.8s infinite;
}
@keyframes dirty-pulse {
  70% {
    box-shadow: 0 0 0 8px rgba(230, 176, 32, 0);
  }
}

/* ══════════════ TABLEAU DE BORD ══════════════ */
.adm-hello {
  position: relative;
  overflow: hidden;
  margin-bottom: 1.5rem;
  padding: 1.75rem 1.75rem 1.6rem;
  border-radius: 22px;
  background: var(--ink);
  color: var(--ink-text);
  box-shadow: var(--shadow-lg);
}
.adm-hello::before,
.adm-hello::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.55;
  pointer-events: none;
}
.adm-hello::before {
  width: 260px;
  height: 260px;
  right: -60px;
  top: -90px;
  background: #6130a0;
}
.adm-hello::after {
  width: 220px;
  height: 220px;
  right: 140px;
  bottom: -120px;
  background: var(--turquoise);
}
.adm-hello > * {
  position: relative;
}
.adm-hello p {
  margin: 0;
  color: var(--ink-soft);
}
.adm-hello h1 {
  margin: 0.3rem 0 0.4rem;
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
}
.adm-hello-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}
.adm-hello .adm-btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff;
}
.adm-hello .adm-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
}

.adm-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.adm-stat {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 0.9rem;
  align-items: center;
  padding: 1.1rem 1.2rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  transition: transform 0.25s var(--ease), border-color 0.25s;
}
.adm-stat:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
}
.adm-stat-icon {
  grid-row: span 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
}
.adm-stat-icon.c-turquoise { background: rgba(61, 191, 184, 0.14); color: var(--turquoise-text); }
.adm-stat-icon.c-violet { background: var(--violet-soft); color: var(--violet); }
.adm-stat-icon.c-yellow { background: rgba(230, 176, 32, 0.16); color: #9a6f00; }
.adm-stat-icon.c-green { background: rgba(46, 125, 54, 0.13); color: var(--green); }
@media (prefers-color-scheme: dark) {
  .adm-stat-icon.c-yellow { color: var(--yellow); }
}
.adm-stat strong {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 1.6rem;
  line-height: 1.1;
}
.adm-stat span {
  font-size: 0.85rem;
  color: var(--soft);
}

.adm-dash-grid {
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 980px) {
  .adm-dash-grid {
    grid-template-columns: 1.4fr 1fr;
    align-items: start;
  }
}
.adm-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 1rem;
  font-size: 1.05rem;
}
.adm-card-title a {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0;
}

/* Historique */
.adm-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
}
.adm-timeline li {
  position: relative;
  display: grid;
  gap: 0.1rem;
  padding: 0 0 1rem 1.5rem;
}
.adm-timeline li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 7px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--violet);
  box-shadow: 0 0 0 4px var(--violet-soft);
}
.adm-timeline li::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 20px;
  bottom: 0;
  width: 1px;
  background: var(--line);
}
.adm-timeline li:last-child::after {
  display: none;
}
.adm-timeline small {
  color: var(--faint);
}

/* ══════════════ LISTES ══════════════ */
.adm-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.6rem;
}
.adm-list-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.85rem 0.9rem 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: border-color 0.2s, transform 0.25s var(--ease);
}
.adm-list-item:hover {
  border-color: var(--line-strong);
}
.adm-type-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
}
.adm-type-article { background: var(--violet-soft); color: var(--violet); }
.adm-type-document { background: rgba(230, 176, 32, 0.16); color: #9a6f00; }
.adm-type-video { background: rgba(133, 32, 32, 0.12); color: var(--bordeaux); }
@media (prefers-color-scheme: dark) {
  .adm-type-document { color: var(--yellow); }
  .adm-type-video { color: #e88a8a; }
}
.adm-list-text {
  flex: 1 1 220px;
  display: grid;
  min-width: 0;
}
.adm-list-text strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.adm-list-text small {
  color: var(--faint);
}
.adm-list-tools {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.adm-list-tools form {
  margin: 0;
}
.adm-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--soft);
}
.adm-badge-star {
  background: rgba(230, 176, 32, 0.15);
  border-color: rgba(230, 176, 32, 0.4);
  color: #8a6400;
}
.adm-badge-used {
  background: rgba(46, 125, 54, 0.12);
  border-color: rgba(46, 125, 54, 0.3);
  color: var(--green);
}
@media (prefers-color-scheme: dark) {
  .adm-badge-star { color: var(--yellow); }
}
.adm-empty {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  padding: 2.5rem 1.5rem;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--soft);
  text-align: center;
}
.adm-empty .adm-icon {
  color: var(--faint);
}

/* Choix du type de publication */
.adm-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}
.adm-choice {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.25s var(--ease), border-color 0.25s;
}
.adm-choice:hover {
  transform: translateY(-3px);
  border-color: var(--violet);
}
.adm-choice small {
  display: block;
  font-weight: 400;
  color: var(--faint);
  font-size: 0.82rem;
}

/* ══════════════ IMAGES ══════════════ */
.adm-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 1rem;
}
.adm-media {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.adm-media img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--surface-2);
  transition: transform 0.5s var(--ease);
}
.adm-media:hover img {
  transform: scale(1.04);
}
.adm-media figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.6rem 0.65rem;
}
.adm-media form {
  margin: 0;
}
.adm-uploader {
  margin-bottom: 1.5rem;
}
.adm-uploader .adm-drop {
  min-height: 120px;
  justify-content: center;
  text-align: center;
  flex-direction: column;
}

/* ══════════════ CONNEXION / INSTALLATION ══════════════ */
.adm-guest-main {
  min-height: 100vh;
  display: grid;
}
@media (min-width: 900px) {
  .adm-guest-main {
    grid-template-columns: 1.05fr 1fr;
  }
}
.adm-auth-art {
  position: relative;
  overflow: hidden;
  display: none;
  padding: 3rem;
  background: var(--ink);
  color: var(--ink-text);
}
@media (min-width: 900px) {
  .adm-auth-art {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
}
.adm-auth-art .adm-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(50px);
  opacity: 0.7;
  animation: orb 14s ease-in-out infinite alternate;
}
.adm-orb-1 { width: 340px; height: 340px; left: -80px; top: -60px; background: #6130a0; }
.adm-orb-2 { width: 280px; height: 280px; right: -60px; top: 30%; background: var(--turquoise); animation-delay: -4s !important; }
.adm-orb-3 { width: 240px; height: 240px; left: 25%; bottom: -80px; background: var(--yellow); opacity: 0.45 !important; animation-delay: -8s !important; }
@keyframes orb {
  to {
    transform: translate(30px, 40px) scale(1.12);
  }
}
.adm-auth-art > * {
  position: relative;
}
.adm-auth-art h2 {
  max-width: 14ch;
  margin: 0;
  font-size: clamp(2rem, 3.5vw, 3rem);
  line-height: 1.05;
}
.adm-auth-art p {
  max-width: 38ch;
  color: var(--ink-soft);
}
.adm-auth-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem calc(2rem + env(safe-area-inset-bottom));
}
.adm-auth {
  width: 100%;
  max-width: 420px;
}
.adm-auth .adm-brand {
  padding: 0;
  margin-bottom: 2rem;
  color: var(--text);
}
.adm-auth .adm-brand-text small {
  color: var(--faint);
}
.adm-auth h1 {
  margin: 0 0 0.5rem;
  font-size: 1.9rem;
}
.adm-auth > p {
  margin: 0 0 1.5rem;
  color: var(--soft);
}
.adm-auth .adm-btn {
  width: 100%;
  min-height: 50px;
  margin-top: 0.5rem;
}
.adm-auth-note {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--faint);
}
.adm-steps {
  margin: 0 0 1.5rem;
  padding: 1rem 1rem 1rem 2.4rem;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 0.92rem;
  color: var(--soft);
}
.adm-steps li {
  margin: 0.25rem 0;
}

/* ══════════════ MOBILE ══════════════ */
@media (max-width: 900px) {
  /* La barre latérale devient une barre d'onglets en bas */
  .adm-sidebar {
    inset: auto 0 0 0;
    width: auto;
    height: calc(var(--tabbar) + env(safe-area-inset-bottom));
    flex-direction: row;
    padding: 0 0.25rem env(safe-area-inset-bottom);
    gap: 0;
    overflow: visible;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
  .adm-brand,
  .adm-sidebar-foot {
    display: none;
  }
  .adm-nav {
    flex: 1;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 0;
  }
  .adm-nav a {
    flex-direction: column;
    justify-content: center;
    gap: 0.2rem;
    min-height: var(--tabbar);
    padding: 0.25rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
  }
  .adm-nav a[aria-current="page"] {
    background: none;
  }
  .adm-nav a[aria-current="page"]::before {
    left: 30%;
    right: 30%;
    top: 0;
    bottom: auto;
    width: auto;
    height: 3px;
    border-radius: 0 0 3px 3px;
  }
  .adm-nav-long {
    display: none;
  }
  .adm-nav-short {
    display: block;
  }
  .adm-shell {
    margin-left: 0;
  }
  .adm-topbar {
    padding: 0.5rem 1rem;
    padding-top: calc(0.5rem + env(safe-area-inset-top));
  }
  .adm-topbar-actions {
    display: flex;
  }
  .adm-main {
    padding: 1.25rem 1rem calc(var(--tabbar) + 6rem + env(safe-area-inset-bottom));
  }
  .adm-savebar {
    bottom: calc(var(--tabbar) + 0.75rem + env(safe-area-inset-bottom));
  }
  .adm-toasts {
    top: auto;
    bottom: calc(var(--tabbar) + 1rem + env(safe-area-inset-bottom));
    left: 1rem;
    right: 1rem;
    max-width: none;
  }
}
@media (max-width: 600px) {
  .adm-panel {
    padding: 1.15rem;
  }
  .adm-drop {
    padding: 0.7rem;
  }
  .adm-drop-preview {
    width: 64px;
    height: 64px;
  }
  .adm-savebar .adm-save-state {
    font-size: 0.82rem;
  }
  .adm-list-tools {
    width: 100%;
    justify-content: flex-end;
  }
  .adm-hello {
    padding: 1.4rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
