/* ═══════════════════════════════════════════
   Variables globales
═══════════════════════════════════════════ */
:root {
   --petrol:        #2c3e50;
   --petrol-mid:    #34495e;
   --petrol-light:  #e8edf2;
   --emerald:       #4FB09B;
   --emerald-dark:  #3a8c7a;
   --emerald-pale:  #eaf6f3;
   --amber:         #f39c12;
   --cream:         #f9f9f9;
   --cream-dark:    #f0f0f0;
   --border:        #ddd;
   --muted:         #7f8c8d;
   --white:         #ffffff;
   --danger:        #e74c3c;
   --shadow-sm:     0 2px 4px rgba(0,0,0,0.1);
   --shadow-md:     0 4px 12px rgba(0,0,0,0.12);
   --r-sm:          8px;
   --r-md:          12px;
   --r-lg:          16px;
   --gradient:      linear-gradient(90deg, var(--emerald), var(--emerald-dark));
   --font-body:     'Segoe UI', sans-serif;
   --font-title:    'Segoe UI', sans-serif;
 }
 
 /* ═══════════════════════════════════════════
    Base
 ═══════════════════════════════════════════ */
 * { box-sizing: border-box; }
 body { font-family: var(--font-body); background: var(--cream); margin: 0; color: var(--petrol); }
 
 /* ═══════════════════════════════════════════
    Navigation principale
 ═══════════════════════════════════════════ */
 .nav {
   display: flex; justify-content: space-between; align-items: center;
   padding: 1rem 5%; background: var(--white);
   box-shadow: var(--shadow-sm); position: sticky; top: 0; z-index: 100;
 }
 .nav-brand {
   display: flex; align-items: center; text-decoration: none;
   color: var(--petrol); gap: 10px; font-weight: bold;
 }
 .nav-actions { display: flex; align-items: center; gap: 10px; }
 .nav-user    { font-size: 14px; color: var(--muted); }
 
 /* ═══════════════════════════════════════════
    Barre de tabs
 ═══════════════════════════════════════════ */
 .main-tabs-bar {
   display: flex; justify-content: center; gap: 12px;
   padding: 18px 5%; background: var(--white);
   border-bottom: 1px solid var(--border);
 }
 .main-tab {
   display: inline-flex; align-items: center; gap: 8px;
   padding: 12px 28px; border-radius: var(--r-md);
   font-size: 15px; font-weight: 700; text-decoration: none;
   color: var(--muted); background: var(--cream);
   border: 2px solid transparent; transition: all 0.18s;
 }
 .main-tab:hover  { color: var(--emerald); border-color: var(--emerald); background: var(--white); }
 .main-tab.active { background: var(--emerald); color: var(--white); border-color: var(--emerald); }
 
 /* ═══════════════════════════════════════════
    Layout
 ═══════════════════════════════════════════ */
 .page-wide { padding: 2rem 5%; max-width: 1200px; margin: 0 auto; }
 .page      { padding: 2rem 5%; max-width: 780px;  margin: 0 auto; }
 .panel     { background: var(--white); padding: 25px; border-radius: var(--r-md); box-shadow: var(--shadow-sm); }
 .section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; gap: 12px; flex-wrap: wrap; }
 .section-header-actions { display: flex; gap: 8px; align-items: center; }
 
 /* ═══════════════════════════════════════════
    Boutons
 ═══════════════════════════════════════════ */
 .btn {
   border: none; padding: 10px 20px; border-radius: var(--r-sm);
   cursor: pointer; font-weight: 600; text-decoration: none;
   display: inline-flex; align-items: center; justify-content: center;
   gap: 6px; font-family: var(--font-body); font-size: 14px; transition: opacity 0.15s;
 }
 .btn:hover     { opacity: 0.88; }
 .btn-primary   { background: var(--emerald); color: var(--white); }
 .btn-secondary { background: var(--cream-dark); color: var(--petrol); }
 .btn-danger    { background: var(--danger); color: var(--white); }
 .btn-sm        { padding: 7px 14px; font-size: 13px; }
 .btn-icon      { padding: 6px 10px; font-size: 16px; }
 .btn-full      { width: 100%; justify-content: center; padding: 15px; margin-top: 20px; }
 
 /* ═══════════════════════════════════════════
    Formulaires
 ═══════════════════════════════════════════ */
 .form-group { margin-bottom: 15px; }
 .form-group label { display: block; margin-bottom: 5px; font-weight: 600; font-size: 14px; }
 .form-group input,
 .form-group select,
 .form-group textarea {
   width: 100%; padding: 10px; border: 1px solid var(--border);
   border-radius: var(--r-sm); box-sizing: border-box;
   font-family: var(--font-body); font-size: 14px; color: var(--petrol);
 }
 .form-group input:focus,
 .form-group select:focus,
 .form-group textarea:focus {
   outline: none; border-color: var(--emerald);
   box-shadow: 0 0 0 3px rgba(79,176,155,.12);
 }
 .form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
 
 .drop-zone {
   border: 2px dashed var(--border); border-radius: var(--r-md);
   padding: 20px; text-align: center; background: var(--cream); cursor: pointer; transition: 0.2s;
 }
 .drop-zone:hover { border-color: var(--emerald); background: var(--white); }
 .preview-img { width: 100%; height: 180px; object-fit: cover; border-radius: var(--r-sm); display: none; margin-bottom: 10px; }
 
 /* ═══════════════════════════════════════════
    Filtres
 ═══════════════════════════════════════════ */
 .filters-bar {
   display: flex; gap: 20px; background: var(--white); padding: 20px;
   border-radius: var(--r-md); margin-bottom: 25px; box-shadow: var(--shadow-sm);
   flex-wrap: wrap; align-items: flex-end;
 }
 .filter-item { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 180px; }
 .filter-item label { font-size: 13px; font-weight: 700; color: var(--muted); }
 .filter-item input[type="range"] { accent-color: var(--emerald); cursor: pointer; }
 .filter-item input[type="text"]  { padding: 8px; border: 1px solid var(--border); border-radius: var(--r-sm); }
 
 /* ═══════════════════════════════════════════
    Cartes traces
 ═══════════════════════════════════════════ */
 .grid-traces { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
 .card {
   position: relative; background: var(--white); border-radius: var(--r-md);
   overflow: hidden; box-shadow: var(--shadow-sm); transition: transform 0.2s; cursor: pointer;
 }
 .card:hover { transform: translateY(-5px); }
.card-img-placeholder {
  width: 100%; height: 180px;
  background-size: cover; background-position: center; background-repeat: no-repeat;
  background-color: var(--cream-dark);
}
.card-top-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  z-index: 9;
  pointer-events: none;
}
.card-corner-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--white);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  box-shadow: 0 4px 10px rgba(0,0,0,0.18);
  background: rgba(44, 62, 80, 0.92);
}
.card-corner-heart {
  width: 30px;
  min-width: 30px;
  min-height: 30px;
  height: 30px;
  padding: 0;
  border-radius: 999px;
  background: rgba(231, 76, 60, 0.9);
  font-size: 15px;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
}
.card-corner-new {
  min-height: 24px;
  padding: 4px 8px;
  background: rgba(79, 176, 155, 0.88);
  font-size: 10px;
  letter-spacing: 0.08em;
  box-shadow: 0 3px 8px rgba(0,0,0,0.14);
}
.card-body  { padding: 15px; }
 .card-title { margin: 0 0 5px 0; font-size: 18px; }
 .card-lieu  { margin: 0 0 10px 0; color: var(--muted); font-size: 13px; }
 
 .btn-admin-float {
   position: absolute; top: 10px; width: 34px; height: 34px; border: none;
   border-radius: var(--r-sm); color: var(--white); cursor: pointer; z-index: 10;
   display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,0.2);
 }
 .btn-delete-float { right: 10px; background: var(--danger); }
 .btn-edit-float   { right: 50px; background: var(--petrol); }
 
 /* ═══════════════════════════════════════════
    Pills & stats
 ═══════════════════════════════════════════ */
 .stat-pills { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
 .stat-pill  { background: var(--cream); padding: 4px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; }
 .gauge-dots { display: flex; gap: 4px; }
 .gauge-dot  { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
 .gauge-dot.on-amber { background: var(--amber); }
 
 /* ═══════════════════════════════════════════
    Actualités
 ═══════════════════════════════════════════ */
 .news-item {
   background: var(--white); padding: 20px; border-radius: var(--r-md);
   margin-bottom: 15px; box-shadow: var(--shadow-sm);
   border-left: 5px solid var(--emerald);
   display: flex; justify-content: space-between; align-items: center; gap: 16px;
 }
 .news-item-body    { flex: 1; }
 .news-item-date    { color: var(--emerald); font-weight: bold; text-transform: uppercase; font-size: 11px; display: block; margin-bottom: 6px; }
 .news-item-content { margin: 0; line-height: 1.5; font-size: 1.05rem; }
 .news-item-del     { background: var(--danger); color: var(--white); border: none; padding: 8px; border-radius: 6px; cursor: pointer; flex-shrink: 0; }
 
 /* ═══════════════════════════════════════════
    Blog
 ═══════════════════════════════════════════ */
 .grid-articles { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
 .article-card  { background: var(--white); border-radius: var(--r-md); box-shadow: var(--shadow-sm); cursor: pointer; overflow: hidden; transition: transform 0.2s; }
 .article-card:hover   { transform: translateY(-4px); }
 .article-card.archived { opacity: 0.65; }
 .article-card-cover   { height: 100px; display: flex; align-items: center; justify-content: center; font-size: 48px; background: linear-gradient(135deg, var(--petrol), var(--petrol-mid)); }
 .article-card-body    { padding: 16px; }
 .article-card-meta    { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 12px; color: var(--muted); }
 .article-card-title   { font-size: 16px; font-weight: 700; margin-bottom: 8px; line-height: 1.3; }
 .article-card-excerpt { font-size: 13px; color: var(--muted); line-height: 1.5; margin-bottom: 12px; }
 .article-card-footer  { display: flex; justify-content: space-between; align-items: center; }
 
 .article-content            { line-height: 1.75; font-size: 15px; }
 .article-content h2         { font-size: 20px; margin: 24px 0 10px; }
 .article-content h3         { font-size: 16px; margin: 20px 0 8px; color: var(--emerald-dark); }
 .article-content blockquote { border-left: 3px solid var(--emerald); padding: 10px 16px; background: var(--emerald-pale); border-radius: 0 var(--r-sm) var(--r-sm) 0; font-style: italic; margin: 16px 0; }
 
 /* ═══════════════════════════════════════════
    Badges
 ═══════════════════════════════════════════ */
 .badge          { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
 .badge-blog     { background: var(--emerald-pale); color: var(--emerald-dark); }
 .badge-public   { background: #eafaf1; color: #27ae60; }
 .badge-archived { background: var(--cream-dark); color: var(--muted); }
 .badge-muted    { background: var(--cream-dark); color: var(--muted); }
 
 /* ═══════════════════════════════════════════
    Toggle
 ═══════════════════════════════════════════ */
 .toggle-wrap  { display: flex; align-items: center; gap: 10px; }
 .toggle-label { font-size: 14px; color: var(--petrol); }
 .toggle       { position: relative; display: inline-block; width: 42px; height: 24px; }
 .toggle input { opacity: 0; width: 0; height: 0; }
 .toggle-slider { position: absolute; cursor: pointer; inset: 0; background: var(--border); border-radius: 24px; transition: 0.2s; }
 .toggle-slider:before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; bottom: 3px; background: var(--white); border-radius: 50%; transition: 0.2s; }
 .toggle input:checked + .toggle-slider { background: var(--emerald); }
 .toggle input:checked + .toggle-slider:before { transform: translateX(18px); }
 
 /* ═══════════════════════════════════════════
    Barre admin article
 ═══════════════════════════════════════════ */
 .admin-bar       { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--petrol-light); border-radius: var(--r-md); padding: 12px 16px; margin-bottom: 20px; }
 .admin-bar-label { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); }
 
 /* ═══════════════════════════════════════════
    Admin layout
 ═══════════════════════════════════════════ */
 .admin-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
 @media (max-width: 900px) { .admin-layout { grid-template-columns: 1fr; } }
 
 .trace-item-name    { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
 .trace-item-meta    { font-size: 12px; color: var(--muted); margin-top: 2px; }
 .trace-item-actions { display: flex; gap: 4px; flex-shrink: 0; }
 
 .article-list-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); gap: 10px; }
 .article-list-item:last-child { border-bottom: none; }
 
 /* ═══════════════════════════════════════════
    Éditeur rich text
 ═══════════════════════════════════════════ */
 .editor-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; background: var(--cream-dark); border: 1.5px solid var(--border); border-bottom: none; border-radius: var(--r-md) var(--r-md) 0 0; }
 .editor-toolbar button { padding: 5px 10px; border-radius: var(--r-sm); background: var(--white); border: 1px solid var(--border); font-family: var(--font-body); font-size: 13px; cursor: pointer; color: var(--petrol); transition: all .12s; }
 .editor-toolbar button:hover { background: var(--petrol-light); }
 .editor-toolbar .sep { width: 1px; background: var(--border); margin: 4px 2px; align-self: stretch; }
 
 #editor { min-height: 240px; padding: 16px; border: 1.5px solid var(--border); border-radius: 0 0 var(--r-md) var(--r-md); background: var(--white); font-family: var(--font-body); font-size: 15px; line-height: 1.75; color: var(--petrol); outline: none; }
 #editor:focus { border-color: var(--emerald); box-shadow: 0 0 0 3px rgba(79,176,155,.12); }
 #editor h2 { font-size: 20px; margin: 16px 0 8px; }
 #editor h3 { font-size: 16px; margin: 14px 0 6px; color: var(--emerald-dark); }
 #editor blockquote { border-left: 3px solid var(--emerald); padding: 10px 16px; background: var(--emerald-pale); border-radius: 0 var(--r-sm) var(--r-sm) 0; font-style: italic; margin: 16px 0; }
 
 /* ═══════════════════════════════════════════
    Emoji grid
 ═══════════════════════════════════════════ */
 .emoji-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 8px; }
 .emoji-btn  { font-size: 22px; padding: 8px; border-radius: var(--r-sm); background: var(--cream); border: 1.5px solid transparent; cursor: pointer; text-align: center; transition: all .12s; }
 .emoji-btn:hover, .emoji-btn.selected { background: var(--emerald-pale); border-color: var(--emerald); }
 
 /* ═══════════════════════════════════════════
    Téléchargement GPX
 ═══════════════════════════════════════════ */
 .download-area   { margin-top: 30px; text-align: center; padding: 20px; background: var(--white); border-radius: var(--r-md); box-shadow: var(--shadow-sm); }
 .download-area p { margin-bottom: 15px; font-weight: bold; }
 
 /* ═══════════════════════════════════════════
    Alertes & états
 ═══════════════════════════════════════════ */
 .alert         { padding: 12px 16px; border-radius: var(--r-sm); margin-bottom: 16px; font-size: 14px; }
 .alert-success { background: #eafaf1; color: #27ae60; border: 1px solid #a9dfbf; }
 .alert-error   { background: #fdedec; color: var(--danger); border: 1px solid #f5b7b1; }
 
 .spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--emerald); border-radius: 50%; animation: spin 0.7s linear infinite; }
 @keyframes spin { to { transform: rotate(360deg); } }
 
 .empty-state      { text-align: center; padding: 40px 20px; color: var(--muted); }
 .empty-state .icon { font-size: 48px; margin-bottom: 12px; }
 .empty-state h3   { margin: 0 0 8px; color: var(--petrol); }
 
 /* ═══════════════════════════════════════════
    Login
 ═══════════════════════════════════════════ */
 .login-wrap         { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
 .login-card         { background: var(--white); padding: 40px; border-radius: var(--r-lg); box-shadow: var(--shadow-md); width: 100%; max-width: 420px; }
 .login-logo-icon    { font-size: 48px; text-align: center; margin-bottom: 8px; }
 .login-logo-name    { font-size: 22px; font-weight: 700; text-align: center; color: var(--petrol); margin-bottom: 4px; }
 .login-logo-tagline { font-size: 13px; color: var(--muted); text-align: center; margin-bottom: 28px; }
 
 /* ═══════════════════════════════════════════
    Actualités — vignettes verticales
 ═══════════════════════════════════════════ */
.actu-card {
  display: flex; align-items: center; gap: 20px;
  background: var(--white); border-radius: var(--r-md);
  box-shadow: var(--shadow-sm); padding: 20px;
  margin-bottom: 14px; position: relative;
  transition: transform 0.18s;
  cursor: pointer;
}
 .actu-card:hover { transform: translateX(4px); }
 
 .actu-card-cover {
   flex-shrink: 0;
   width: 64px; height: 64px;
   border-radius: var(--r-md);
   background: linear-gradient(135deg, var(--petrol), var(--petrol-mid));
   display: flex; align-items: center; justify-content: center;
   font-size: 30px;
 }
 .actu-card-body   { flex: 1; }
 .actu-card-content { margin: 6px 0 0 0; line-height: 1.55; font-size: 1rem; color: var(--petrol); }
 .actu-del-btn     { flex-shrink: 0; }
 
 /* Photo de couverture sur les cards articles/actus */
.article-card-cover-img,
.actu-card-cover-img {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.is-hidden { display: none !important; }
.text-muted { color: var(--muted); }
.nav-user-inline { margin-right: 15px; font-size: 14px; color: var(--muted); }
.stack-16 { display: flex; flex-direction: column; gap: 16px; }
.row-gap-10 { display: flex; gap: 10px; }
.row-gap-6 { display: flex; gap: 6px; }
.row-gap-8-center { display: flex; gap: 8px; align-items: center; }
.row-space-20 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.mb-0 { margin: 0; }
.mt-32 { margin-top: 32px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mb-16 { margin-bottom: 16px; }
.mb-10 { margin-bottom: 10px; }
.flex-1 { flex: 1; }
.btn-flex-1-center { flex: 1; justify-content: center; }
.spinner-centered { margin: 20px auto; }
.spinner-centered-lg { margin: 40px auto; }
.empty-state-compact { padding: 30px 0; }
.page-wide-narrow { max-width: 800px; }
.page-article { max-width: 780px; }
.back-button { margin-bottom: 20px; }
.blog-subtitle {
  font-size: 14px;
  color: var(--muted);
  margin-top: 4px;
  font-weight: 300;
}
.archives-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.archives-divider-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}
.archives-divider-label {
  font-family: var(--font-title);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .07em;
}
.admin-form-type-hidden { display: none; }
.admin-inline-heading { margin: 0; }
.admin-article-panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.article-cover-frame {
  height: 220px;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg,var(--petrol),var(--petrol-mid));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 60px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.article-cover-fill {
  position: absolute;
  inset: 0;
}
.article-cover-accent {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: var(--gradient);
}
.article-title-large {
  font-size: clamp(22px,5vw,34px);
  margin-bottom: 10px;
}
.article-date-meta {
  font-size: 13px;
  color: var(--muted);
  font-family: var(--font-title);
  font-weight: 600;
  margin-bottom: 32px;
}
.article-footer-link {
  font-size: 12px;
  color: var(--emerald);
  font-family: var(--font-title);
  font-weight: 700;
}
.archived-empty-text {
  font-size: 14px;
  color: var(--muted);
}

/* Auth */
.auth-card { max-width: 520px; }
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 22px;
}
.auth-tab {
  border: 1px solid var(--border);
  background: var(--cream);
  color: var(--petrol);
}
.auth-tab.active {
  background: var(--emerald);
  color: var(--white);
}
.auth-panel.is-hidden { display: none; }
.auth-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.auth-legal {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.auth-link {
  color: var(--emerald-dark);
  text-decoration: none;
  font-weight: 600;
}
.auth-link:hover { text-decoration: underline; }
.auth-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--petrol);
}
.auth-checkbox-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.auth-checkbox input {
  width: auto;
  padding: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
  flex-shrink: 0;
}
.auth-terms-link {
  font-size: 13px;
}
.legal-body p,
.legal-body li {
  color: var(--petrol);
  line-height: 1.65;
}
.legal-body ul {
  margin: 8px 0 16px 18px;
  padding: 0;
}
.auth-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-muted-center {
  text-align: center;
  margin-top: 15px;
}
.login-notice {
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 15px;
  font-size: 14px;
}
.login-error {
  color: #e74c3c;
  background: #fdeaea;
}
.login-success {
  color: #27ae60;
  background: #eafaf1;
}
.legal-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(20, 28, 36, 0.72);
  z-index: 1100;
}
.legal-modal.open { display: flex; }
.legal-dialog {
  width: min(92vw, 760px);
  max-height: 86vh;
  overflow: hidden;
  border-radius: var(--r-lg);
  background: var(--white);
  box-shadow: var(--shadow-md);
}
.legal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.legal-body {
  max-height: calc(86vh - 72px);
  overflow: auto;
  padding: 20px;
}
.legal-body h3 {
  margin-top: 20px;
  margin-bottom: 8px;
}
.legal-close {
  border: none;
  background: var(--cream-dark);
  color: var(--petrol);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 22px;
}

/* Admin users */
.admin-user-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.admin-user-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.admin-user-item:last-child { border-bottom: none; }
.admin-user-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--petrol);
}
.admin-user-meta {
  font-size: 13px;
  color: var(--muted);
  margin-top: 3px;
}
.admin-user-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.admin-users-page { max-width: 1180px; }
.admin-users-toolbar { margin-bottom: 20px; }
.admin-users-subtitle { margin: 6px 0 0; }
.admin-user-card {
  align-items: flex-start;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--white);
}
.admin-user-main { flex: 1; min-width: 0; }
.admin-user-header-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.admin-user-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.admin-user-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
  font-size: 14px;
  color: var(--petrol);
}
.admin-user-last-login { grid-column: 1 / -1; }
.admin-user-actions-wrap {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 220px;
}
.admin-user-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
}

@media (max-width: 720px) {
  .auth-grid-2 { grid-template-columns: 1fr; }
  .admin-user-item {
    flex-direction: column;
    align-items: flex-start;
  }
  .admin-user-actions {
    width: 100%;
  }
  .admin-user-header-row {
    flex-direction: column;
  }
  .admin-user-grid {
    grid-template-columns: 1fr;
  }
  .admin-user-badges {
    justify-content: flex-start;
  }
  .admin-user-actions-wrap {
    min-width: 0;
  }
}

/* Admin parcours */
.trace-admin-page { max-width: 980px; }
.trace-form-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
  align-items: start;
}
.trace-form-layout .form-group { margin-bottom: 0; }
.form-group-full,
.trace-form-layout .btn-full { grid-column: 1 / -1; }
.gallery-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.gallery-preview-grid.is-hidden { display: none; }
.gallery-preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--cream);
}
.gallery-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gallery-preview-badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(44, 62, 80, 0.82);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
}
.gallery-remove-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 999px;
  background: rgba(231, 76, 60, 0.92);
  color: var(--white);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

/* Détail parcours */
.trace-detail-page { max-width: 800px; }
.trace-detail-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: -4px 0 10px;
}
.trace-map {
  height: 400px;
  width: 100%;
  border-radius: var(--r-md);
  margin: 20px 0;
  border: 1px solid var(--border);
  z-index: 1;
}
.trace-gallery { margin: 20px 0; }
.trace-gallery.is-hidden { display: none; }
.trace-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.trace-gallery-item {
  display: block;
  aspect-ratio: 1;
  border: none;
  padding: 0;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--cream-dark);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.trace-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.18s ease;
}
.trace-gallery-item:hover img { transform: scale(1.04); }
.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(20, 28, 36, 0.78);
  z-index: 1000;
}
.lightbox.open { display: flex; }
.lightbox-dialog {
  position: relative;
  width: min(92vw, 980px);
  max-height: 88vh;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow-md);
}
.lightbox-image {
  width: 100%;
  max-height: 88vh;
  object-fit: contain;
  display: block;
  background: #111;
}
.lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 999px;
  background: rgba(20, 28, 36, 0.74);
  color: var(--white);
  font-size: 24px;
  cursor: pointer;
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 999px;
  background: rgba(20, 28, 36, 0.74);
  color: var(--white);
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-prev { left: 10px; }
.lightbox-next { right: 10px; }

@media (max-width: 720px) {
  .trace-admin-page { padding: 1rem 4%; }
  .trace-form-layout,
  .form-grid-2 { grid-template-columns: 1fr; }
  .panel { padding: 18px; }
  .main-tabs-bar {
    justify-content: flex-start;
    overflow-x: auto;
    padding: 12px 4%;
  }
  .main-tab { white-space: nowrap; }
  .editor-toolbar button { flex: 1 1 calc(33.333% - 4px); }
  #editor {
    min-height: 180px;
    padding: 12px;
  }
}

@media (max-width: 640px) {
  .trace-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .lightbox { padding: 12px; }
  .lightbox-nav {
    width: 42px;
    height: 42px;
    font-size: 24px;
  }
}
