/* ══════════════════════════════════════════════════════════
   Back office Insijem — thème « shadcn »
   Chargé APRÈS admin.css et admin-extra.css : il ne fait que
   redéfinir les couleurs et la forme des composants.
   Pour revenir à l'ancien thème, retirez ce fichier dans
   admin/inc/layout.php (une seule ligne <link>).
   ══════════════════════════════════════════════════════════ */

/* ── Couleurs (palette « zinc ») ─────────────────────────── */
:root {
  /* Jetons propres au thème */
  --primary: #18181b;
  --primary-fg: #fafafa;
  --accent: #f4f4f5;
  --input: #e4e4e7;
  --ring: #a1a1aa;
  --destructive: #dc2626;

  /* Jetons d'origine, redirigés vers la palette */
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-2: #ffffff;
  --line: #e4e4e7;
  --line-strong: #e4e4e7;
  --text: #09090b;
  --soft: #52525b;
  --faint: #71717a;

  --ink: #fafafa; /* barre latérale claire */
  --ink-2: #f4f4f5;
  --ink-text: #18181b;
  --ink-soft: #71717a;

  --violet: #18181b;
  --violet-soft: #f4f4f5;
  --red: #dc2626;

  --radius: 0.5rem;
  --radius-sm: 0.375rem;
  --shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --sidebar: 16rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --primary: #fafafa;
    --primary-fg: #18181b;
    --accent: #27272a;
    --input: #27272a;
    --ring: #52525b;
    --destructive: #f87171;

    --bg: #09090b;
    --surface: #0f0f11;
    --surface-2: #09090b;
    --line: #27272a;
    --line-strong: #27272a;
    --text: #fafafa;
    --soft: #a1a1aa;
    --faint: #a1a1aa;

    --ink: #18181b;
    --ink-2: #27272a;
    --ink-text: #f4f4f5;
    --ink-soft: #a1a1aa;

    --violet: #fafafa;
    --violet-soft: #27272a;
    --red: #f87171;

    --shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.5);
  }
}

body {
  font-size: 15px;
}

/* ── Barre latérale ──────────────────────────────────────── */
.adm-sidebar {
  gap: 0.5rem;
  padding: 0.5rem;
  border-right: 1px solid var(--line);
}
.adm-brand {
  gap: 0.5rem;
  padding: 0.375rem 0.5rem;
  border-radius: var(--radius-sm);
}
.adm-logo {
  place-content: center;
  grid-template-columns: repeat(3, 5px);
  gap: 2px;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: var(--radius-sm);
  background: var(--accent);
}
.adm-logo span {
  height: 5px;
}
.adm-brand-text {
  font-size: 0.875rem;
  font-weight: 600;
}
.adm-brand-text small {
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.adm-nav {
  gap: 0.25rem;
  padding: 0 0.5rem;
}
.adm-nav-label {
  display: flex;
  align-items: center;
  height: 2rem;
  margin-top: 0.5rem;
  padding: 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-soft);
}
.adm-nav-label:first-child {
  margin-top: 0;
}
.adm-nav a {
  gap: 0.5rem;
  min-height: 2rem;
  padding: 0 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--ink-text);
  font-size: 0.875rem;
  font-weight: 400;
  transition: background 0.15s, color 0.15s;
}
.adm-nav a .adm-icon {
  width: 1rem;
  height: 1rem;
  flex: none;
}
.adm-nav a:hover {
  background: var(--ink-2);
  color: var(--ink-text);
}
.adm-nav a[aria-current="page"] {
  background: var(--ink-2);
  color: var(--ink-text);
  font-weight: 500;
}
.adm-nav a[aria-current="page"]::before {
  content: none;
}
.adm-nav a[aria-current="page"] .adm-icon {
  color: inherit;
}

.adm-sidebar-foot {
  gap: 0.25rem;
  padding: 0.5rem 0.5rem 0;
  border-top: 1px solid var(--line);
}
.adm-side-link {
  gap: 0.5rem;
  min-height: 2rem;
  padding: 0 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--ink-text);
  font: 400 0.875rem "Inter", system-ui, sans-serif;
}
.adm-side-link .adm-icon {
  width: 1rem;
  height: 1rem;
}
.adm-side-link:hover {
  background: var(--ink-2);
  color: var(--ink-text);
}

/* ── Barre du haut et en-tête de page ───────────────────── */
.adm-topbar {
  min-height: 3.5rem;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
}
.adm-crumbs {
  font-size: 0.875rem;
}
.adm-crumbs span {
  font-weight: 500;
}
.adm-pill {
  min-height: 2.25rem;
  min-width: 2.25rem;
  border-color: var(--input);
  border-radius: var(--radius-sm);
  font: 500 0.875rem "Inter", system-ui, sans-serif;
}
.adm-pill:hover {
  background: var(--accent);
}

.adm-page-head {
  margin: 0.25rem 0 1.5rem;
}
.adm-page-head h1 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
}
.adm-eyebrow {
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--faint);
}
.adm-lead {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--faint);
}

/* ── Cartes (panneaux) ───────────────────────────────────── */
.adm-panel {
  padding: 1.5rem;
  border-color: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.adm-panel legend {
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.adm-panel-icon {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--text);
}
.adm-panel-icon .adm-icon {
  width: 1rem;
  height: 1rem;
}

/* Éléments répétés (membres, photos, témoignages…) */
.adm-item {
  padding: 1rem 1rem 0.75rem;
  border-radius: var(--radius);
  background: var(--surface);
}
.adm-item + .adm-item {
  margin-top: 0;
}
.adm-add {
  min-height: 2.5rem;
  border: 1px dashed var(--input);
  border-radius: var(--radius-sm);
  color: var(--soft);
  font: 500 0.875rem "Inter", system-ui, sans-serif;
}
.adm-add:hover {
  border-color: var(--ring);
  background: var(--accent);
  color: var(--text);
}

/* ── Champs ──────────────────────────────────────────────── */
.adm-field {
  gap: 0.375rem;
}
.adm-field label,
.adm-label {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25;
}
.adm-field input,
.adm-field textarea,
.adm-field select {
  min-height: 2.5rem;
  padding: 0.5rem 0.75rem;
  border-color: var(--input);
  border-radius: var(--radius-sm);
  background-color: var(--surface-2);
  font-size: 0.875rem;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.adm-field textarea {
  min-height: 5rem;
}
.adm-field input::placeholder,
.adm-field textarea::placeholder {
  color: var(--faint);
}
.adm-field input:hover,
.adm-field textarea:hover,
.adm-field select:hover {
  border-color: var(--input);
}
/* Anneau de focus façon shadcn : 2 px d'écart puis 2 px d'anneau */
.adm-field input:focus,
.adm-field textarea:focus,
.adm-field select:focus {
  border-color: var(--input);
  background-color: var(--surface-2);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ring);
}
.adm-field select {
  padding-right: 2.25rem;
  background-position: right 0.75rem center;
}
.adm-hint {
  font-size: 0.8125rem;
  color: var(--faint);
}

/* Cases à cocher → interrupteurs (restent des <input type="checkbox">) */
.adm-check {
  gap: 0.75rem;
  min-height: 2.5rem;
  font-size: 0.875rem;
  font-weight: 500;
}
.adm-check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 2.75rem;
  height: 1.5rem;
  margin: 0;
  border: 2px solid transparent;
  border-radius: 999px;
  background-color: var(--input);
  background-image: radial-gradient(circle, var(--surface) 0 9px, transparent 9.5px);
  background-size: 1.25rem 1.25rem;
  background-repeat: no-repeat;
  background-position: left center;
  cursor: pointer;
  transition: background-color 0.15s, background-position 0.15s;
}
.adm-check input[type="checkbox"]:checked {
  background-color: var(--primary);
  background-image: radial-gradient(circle, var(--primary-fg) 0 9px, transparent 9.5px);
  background-position: right center;
}
.adm-check-danger input[type="checkbox"]:checked {
  background-color: var(--destructive);
}
.adm-check input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ring);
}
.adm-check-danger {
  color: var(--destructive);
}

/* Zone de dépôt d'image */
.adm-drop {
  border: 1px dashed var(--input);
  border-radius: var(--radius);
  background: var(--bg);
}
.adm-drop:hover,
.adm-drop.is-over {
  border-color: var(--ring);
  background: var(--accent);
}

/* ── Boutons ─────────────────────────────────────────────── */
.adm-btn {
  min-height: 2.5rem;
  padding: 0 1rem;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: var(--primary-fg);
  font: 500 0.875rem "Inter", system-ui, sans-serif;
  box-shadow: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.adm-btn:hover {
  background: color-mix(in srgb, var(--primary) 90%, var(--surface));
  transform: none;
}
.adm-btn:active {
  transform: none;
}
.adm-btn:focus-visible,
.adm-pill:focus-visible,
.adm-add:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ring);
}
/* « Outline » : bouton secondaire */
.adm-btn-ghost {
  background: var(--surface);
  border-color: var(--input);
  color: var(--text);
}
.adm-btn-ghost:hover {
  background: var(--accent);
  border-color: var(--input);
}
/* Destructif discret : rouge au survol seulement */
.adm-btn-danger {
  background: transparent;
  border-color: var(--input);
  color: var(--destructive);
}
.adm-btn-danger:hover {
  background: color-mix(in srgb, var(--destructive) 10%, transparent);
  border-color: color-mix(in srgb, var(--destructive) 40%, var(--input));
  color: var(--destructive);
}
.adm-btn-small {
  min-height: 2.25rem;
  padding: 0 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}
.adm-btn-icon {
  width: 2.25rem;
  min-height: 2.25rem;
}

/* ── Barre d'enregistrement, notifications, badges ──────── */
.adm-savebar {
  padding: 0.5rem 0.5rem 0.5rem 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.adm-save-state {
  font-size: 0.875rem;
  color: var(--faint);
}
.adm-toast {
  border-radius: var(--radius);
  font-size: 0.875rem;
}
.adm-badge {
  padding: 0.125rem 0.625rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
}

/* ── Mobile : la barre latérale devient une barre d'onglets ─ */
@media (max-width: 900px) {
  .adm-sidebar {
    padding: 0 0.25rem env(safe-area-inset-bottom);
    border-right: 0;
    border-top: 1px solid var(--line);
  }
  .adm-nav {
    padding: 0;
  }
  .adm-nav-label {
    display: none;
  }
  .adm-nav a {
    min-height: var(--tabbar);
    color: var(--ink-soft);
    font-size: 0.7rem;
    font-weight: 500;
  }
  .adm-nav a[aria-current="page"] {
    background: none;
    color: var(--ink-text);
    font-weight: 600;
  }
  .adm-nav a .adm-icon {
    width: 1.25rem;
    height: 1.25rem;
  }
  /* 16 px dans les champs : évite le zoom automatique sur iPhone */
  .adm-field input,
  .adm-field textarea,
  .adm-field select {
    font-size: 16px;
  }
}
