.admin-body { background: var(--color-bg-alt); min-height: 100vh; }
.admin-layout { display: flex; min-height: 100vh; }

.admin-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--color-primary-dark);
  color: rgba(255,255,255,0.85);
  padding: 20px 0;
}
.admin-sidebar .brand {
  padding: 0 20px 20px;
  font-family: var(--font-heading);
  font-weight: 700;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  margin-bottom: 12px;
}
.admin-sidebar .brand small { display: block; font-weight: 400; color: rgba(255,255,255,0.6); font-size: 0.78rem; }
.admin-sidebar ul { list-style: none; margin: 0; padding: 0; }
.admin-sidebar a {
  display: block;
  padding: 10px 20px;
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.94rem;
}
.admin-sidebar a:hover, .admin-sidebar a.active {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.admin-sidebar .logout-link { margin-top: 20px; border-top: 1px solid rgba(255,255,255,0.12); padding-top: 12px; }

.admin-main { flex: 1; padding: 28px 32px; }
.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.admin-topbar h1 { margin: 0; }
.admin-user { font-size: 0.9rem; color: var(--color-text-light); }

.admin-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
}

.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td {
  text-align: left;
  padding: 10px 16px;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.92rem;
  vertical-align: middle;
}
.admin-table th:first-child, .admin-table td:first-child { padding-left: 20px; }
.admin-table th:last-child, .admin-table td:last-child { padding-right: 20px; }
.admin-table th { color: var(--color-primary); font-family: var(--font-heading); }
/* PAS de display:flex ici : posé directement sur un <td>, il lui ferait
   perdre son type de boîte "table-cell" et donc ignorer le vertical-align:
   middle hérité de la règle générale ci-dessus — les boutons remontaient
   alors en haut de la cellule dès qu'une ligne était plus haute que les
   autres (texte qui passe à la ligne ailleurs dans la même ligne du
   tableau : email, date sur 2 lignes...). text-align + des boutons
   inline-block (voir .btn) donnent le même alignement à droite sans ce
   problème, et restent bien centrés verticalement comme le reste de la ligne. */
.admin-actions { text-align: right; }
.admin-actions .btn + .btn { margin-left: 8px; }

/* Ligne "détail" (description) : repliée par défaut, dépliée dès qu'un
   champ de SA PROPRE ligne OU de la ligne de champs juste au-dessus reçoit
   le focus. Les deux <tr> (champs + description) sont groupées dans un même
   <tbody> par item (plusieurs <tbody> par <table> est valide en HTML) pour
   que :focus-within puisse porter sur les deux lignes à la fois — impossible
   à obtenir avec de simples <tr> frères, qui ne partagent pas d'ancêtre commun
   plus proche que la <table> entière. */
/* .is-open est ajoutée en JS pour les lignes avec éditeur TinyMCE (voir
   admin.js) : :focus-within seul est trop fragile là où l'édition passe par
   un <iframe> (TinyMCE) et des menus/dialogues qui peuvent se détacher du
   DOM de la ligne — la classe manuelle, pilotée par les évènements focus/blur
   propres à l'éditeur, prend le relais dans ce cas. Pour les descriptions
   simples (Tarifs, Options), :focus-within seul suffit. */
.admin-row-group:focus-within, .admin-row-group.is-open { background: var(--color-bg-alt); }
.admin-row-group tr:not(.desc-row) { cursor: pointer; }
.desc-row td { padding: 0 20px; }
.desc-cell {
  max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height 0.25s ease, opacity 0.2s ease, padding 0.25s ease;
}
.admin-row-group:focus-within .desc-cell, .admin-row-group.is-open .desc-cell { max-height: 160px; opacity: 1; padding: 10px 0 16px; }
.desc-cell label { display: block; font-weight: 400; font-size: 0.85rem; color: var(--color-text-light); margin-bottom: 4px; }
.desc-cell textarea { margin: 0; min-height: 50px; width: 100%; }
/* Éditeur riche (TinyMCE, "Textes du site") : nettement plus haut qu'une
   simple description courte, il lui faut plus de place une fois déplié. */
.desc-cell.desc-cell-rich { max-height: 0; }
.admin-row-group:focus-within .desc-cell.desc-cell-rich,
.admin-row-group.is-open .desc-cell.desc-cell-rich { max-height: 420px; }

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-alt);
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 36px;
}
.login-card .site-logo { display: block; margin: 0 auto 20px; text-align: center; }
.login-card .site-logo img { height: 44px; margin: 0 auto; }

.thumb-preview { width: 90px; height: 60px; object-fit: cover; border-radius: 6px; }

.tag-role {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}
.tag-role.superadmin { background: rgba(11,79,108,0.12); color: var(--color-primary); }
.tag-role.admin { background: rgba(20,184,166,0.12); color: var(--color-secondary); }

.tag-status { font-size: 0.78rem; font-weight: 700; }
.tag-status.inactive { color: var(--color-danger); }
.tag-status.active { color: var(--color-success); }

/* --- Sélecteur d'icône (modale) --- */
.icon-picker-trigger {
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 1.1rem;
  line-height: 1;
  vertical-align: middle;
}
.icon-picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 43, 58, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.icon-picker-modal {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 420px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 20px;
}
.icon-picker-modal h4 { margin-top: 0; }
.icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin: 16px 0;
}
.icon-picker-grid button {
  font-size: 1.4rem;
  padding: 10px 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.icon-picker-grid button:hover {
  background: var(--color-bg-alt);
  border-color: var(--color-secondary);
  transform: scale(1.08);
}
.icon-picker-modal .icon-picker-close {
  width: 100%;
}

@media (max-width: 860px) {
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; }
  .admin-sidebar ul { display: flex; flex-wrap: wrap; }
  .admin-sidebar .logout-link { margin-top: 0; }
}
