* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background:
    radial-gradient(circle at top, rgba(59, 130, 246, 0.16), transparent 30%),
    radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.12), transparent 24%),
    linear-gradient(180deg, #050816 0%, #0b1020 48%, #0f172a 100%);
  color: #e5e7eb;
}

#map { position: absolute; top: 0; left: 0; right: 0; bottom: 0; }

.topbar {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  z-index: 1000;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  padding: 12px 14px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(6, 11, 26, 0.84), rgba(15, 23, 42, 0.78));
  backdrop-filter: blur(18px);
  box-shadow:
    0 18px 50px rgba(2, 6, 23, 0.42),
    0 0 0 1px rgba(148, 163, 184, 0.12),
    0 0 28px rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.18);
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.topbar > * { pointer-events: auto; }

.brand { flex: 0 0 auto; }

.search-box {
  flex: 1 1 220px;
  min-width: 0;
  max-width: 560px;
  position: relative;
}

.topbar-actions {
  flex: 0 0 auto;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-box { flex: 0 0 auto; }

.brand {
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
  padding: 8px 14px;
  border-radius: 18px;
  font-weight: 700;
  font-size: 16px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 12px 24px rgba(2, 6, 23, 0.24),
    0 0 20px rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.14);
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.01em;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;


  overflow: hidden;
}
.brand-logo {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.22));
}

.user-box {
  background: rgba(255, 255, 255, 0.06);
  padding: 8px 12px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #e5e7eb;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 12px 24px rgba(2, 6, 23, 0.24);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.user-profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #e5e7eb;
  border: 1px solid rgba(148, 163, 184, 0.14);
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 24px rgba(2, 6, 23, 0.24);
}

.user-profile-chip:hover {
  background: rgba(255, 255, 255, 0.10);
}

.user-avatar-mini {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  object-fit: cover;
  display: block;
  flex: 0 0 auto;
}

.user-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.35), rgba(37, 99, 235, 0.70));
  color: #f8fafc;
  font-weight: 700;
}

.user-menu-wrap { position: relative; }
.user-menu-caret { font-size: 11px; color: #94a3b8; transition: transform 0.15s ease; }
.user-profile-chip[aria-expanded="true"] .user-menu-caret { transform: rotate(180deg); }
.user-profile-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: #1e293b;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
  z-index: 2500;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: none;
  border: none;
  color: #e5e7eb;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.user-dropdown-item:hover { background: rgba(255,255,255,0.06); }
.user-dropdown-item i { width: 16px; text-align: center; color: #94a3b8; }
.user-dropdown-item-danger { color: #f87171; }
.user-dropdown-item-danger i { color: #f87171; }

@media (max-width: 480px) {
  .user-profile-name { max-width: 72px; }
}

.search-box {
  background: rgba(255, 255, 255, 0.08);
  padding: 7px 8px 7px 12px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 12px 24px rgba(2, 6, 23, 0.24),
    0 0 18px rgba(59, 130, 246, 0.10);
  border: 1px solid rgba(148, 163, 184, 0.14);
}
.search-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #f8fafc;
  font-size: 16px;
  min-width: 0;
}
.search-box input::placeholder { color: #94a3b8; }
.search-box .btn { padding: 6px 11px; }

.search-suggestions {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  display: none;
  flex-direction: column;
  background: rgba(7, 11, 20, 0.96);
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: 0 20px 40px rgba(2, 6, 23, 0.48), 0 0 20px rgba(59, 130, 246, 0.10);
  overflow: hidden;
  z-index: 1100;
}
.search-suggestions.open { display: flex; }
.search-suggestion {
  width: 100%;
  background: transparent;
  color: #e5e7eb;
  border: none;
  text-align: left;
  padding: 12px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.search-suggestion:hover,
.search-suggestion.active {
  background: rgba(255, 255, 255, 0.06);
}
.search-suggestion strong {
  color: #f8fafc;
  font-size: 14px;
}
.search-suggestion span {
  color: #94a3b8;
  font-size: 12px;
}

.filter-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  padding: 6px 8px;
  border-radius: 18px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 12px 24px rgba(2, 6, 23, 0.24);
  border: 1px solid rgba(148, 163, 184, 0.14);
}
.filter-select {
  background: rgba(15, 23, 42, 0.78);
  color: #e5e7eb;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 14px;
  padding: 6px 10px;
  font-size: 13px;
  outline: none;
}
.filter-select:disabled {
  opacity: 0.7;
}

/* Visionneuse plein écran */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 3000;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
.lightbox-overlay.open { display: flex; }
.lightbox-overlay img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.lightbox-close {
  position: absolute;
  top: 18px;
  right: 26px;
  color: #e2e8f0;
  font-size: 34px;
  cursor: pointer;
  line-height: 1;
}
.photo-popup img { cursor: zoom-in; }

.leaflet-popup-pane {
  z-index: 2600 !important;
}

/* Leaflet popup chrome */
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: rgba(7, 11, 20, 0.96);
  color: #e5e7eb;
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.44), 0 0 24px rgba(59, 130, 246, 0.10);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.leaflet-popup-content-wrapper {
  border-radius: 22px;
}

.leaflet-popup-content {
  margin: 0;
  width: auto !important;
  max-height: calc(100vh - 220px);
  overflow: auto;
}

.leaflet-popup-content p {
  margin: 0;
}

.leaflet-popup-close-button {
  color: #94a3b8 !important;
  font-size: 20px !important;
  top: 8px !important;
  right: 10px !important;
}

.leaflet-popup-close-button:hover {
  color: #f8fafc !important;
}

.btn {
  background: linear-gradient(180deg, #1f2937, #0f172a);
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.26);
}
.btn:hover { background: linear-gradient(180deg, #273244, #111827); transform: translateY(-1px); }
.btn.secondary { background: rgba(255, 255, 255, 0.08); color: #f8fafc; text-decoration: none; box-shadow: none; border: 1px solid rgba(148, 163, 184, 0.14); }
.btn.secondary:hover { background: rgba(255, 255, 255, 0.14); }
.btn.danger { background: #dc2626; }
.btn.danger:hover { background: #b91c1c; }
.btn.success { background: #16a34a; }
.btn.success:hover { background: #15803d; }

.hint-banner {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(7, 11, 20, 0.82);
  color: #e5e7eb;
  padding: 10px 18px;
  border-radius: 999px;
  z-index: 1000;
  font-size: 14px;
  box-shadow: 0 14px 30px rgba(2, 6, 23, 0.34);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.map-controls {
  position: absolute;
  top: 126px;
  left: 14px;
  z-index: 950;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 22px;
  background: rgba(7, 11, 20, 0.78);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.38), 0 0 22px rgba(59, 130, 246, 0.12);
}
.controls-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #94a3b8;
}
.map-controls .filter-box {
  background: rgba(255, 255, 255, 0.04);
  box-shadow: none;
  padding: 0;
  border: none;
}

.move-indicator {
  position: absolute;
  top: 76px;
  left: 50%;
  transform: translate(-50%, -8px);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 8px 12px;
  border-radius: 999px;
  color: #111827;
  font-size: 13px;
  z-index: 1200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.move-indicator.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.move-indicator .btn {
  padding: 4px 10px;
  font-size: 12px;
}

/* Modale */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.68);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}
.overlay.open { display: flex; }

.modal {
  background: rgba(10, 15, 28, 0.94);
  border-radius: 18px;
  padding: 24px;
  width: 90%;
  max-width: 420px;
  box-shadow: 0 24px 58px rgba(2, 6, 23, 0.5), 0 0 24px rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.16);
}
.modal h2 { margin-bottom: 16px; font-size: 20px; color: #f8fafc; }
.modal-help {
  color: #94a3b8;
  font-size: 13px;
  margin-bottom: 12px;
  line-height: 1.5;
}
.modal label { display: block; margin-top: 12px; margin-bottom: 4px; font-size: 13px; color: #94a3b8; }
.modal input[type=text],
.modal input[type=email],
.modal input[type=password],
.modal textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
  font-size: 16px;
}
.modal textarea { resize: vertical; min-height: 70px; }
.modal-actions { margin-top: 18px; display: flex; gap: 10px; justify-content: flex-end; }
.modal .error { color: #dc2626; font-size: 13px; margin-top: 8px; min-height: 16px; }
.modal .close-x { float: right; cursor: pointer; color: #94a3b8; font-size: 20px; }

.modal-small {
  max-width: 360px;
}

/* Popup photo sur la carte */
.photo-popup {
  padding: 6px 6px 4px;
  width: min(360px, 78vw);
  max-height: calc(100vh - 240px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.photo-popup img {
  width: 100%;
  max-width: none;
  border-radius: 18px;
  display: block;
  margin-bottom: 0;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid rgba(148, 163, 184, 0.10);
}
.photo-hero {
  position: relative;
}
.photo-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.author-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}
.author-badge strong {
  display: block;
  font-size: 14px;
  color: #f8fafc;
}
.author-badge span {
  display: block;
  font-size: 12px;
  color: #94a3b8;
}
.author-avatar,
.comment-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.30), rgba(37, 99, 235, 0.70));
  color: #f8fafc;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 10px 20px rgba(2, 6, 23, 0.24);
  flex: 0 0 auto;
}
.photo-popup .caption {
  font-size: 14px;
  color: #e5e7eb;
  line-height: 1.5;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 14px;
  padding: 10px 12px;
}
.photo-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.photo-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(148, 163, 184, 0.10);
  color: #cbd5e1;
  font-size: 12px;
}
.photo-stat strong {
  color: #f8fafc;
  font-size: 13px;
}

.engagement-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  min-width: 104px;
}
.like-btn.active {
  background: linear-gradient(180deg, #ef4444, #b91c1c);
  box-shadow: 0 12px 26px rgba(220, 38, 38, 0.24);
}
.like-btn.active:hover {
  background: linear-gradient(180deg, #f87171, #dc2626);
}

.engagement-counts {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
  font-size: 12px;
  color: #94a3b8;
  text-align: right;
}
.engagement-counts strong {
  color: #f8fafc;
  font-weight: 700;
}

.mini-meta {
  color: #94a3b8;
  font-size: 12px;
}

.comments-shell {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 260px;
  overflow: hidden;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  padding-right: 4px;
  max-height: 140px;
}

.comments-empty {
  color: #94a3b8;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 14px;
  padding: 12px;
}

.comment-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 16px;
  padding: 11px 12px;
}

.comment-reply {
  margin-left: calc(var(--reply-depth, 1) * 14px);
  border-left: 2px solid rgba(96, 165, 250, 0.26);
}

.comment-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 6px;
}

.comment-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.comment-head strong {
  color: #f8fafc;
  font-size: 13px;
}

.comment-body {
  color: #e5e7eb;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.comment-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.comment-action {
  background: transparent;
  border: none;
  color: #93c5fd;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  padding: 0;
}

.comment-delete {
  color: #fca5a5;
}

.comment-delete:hover {
  color: #fecaca;
}

.comment-replies {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.comment-form,
.reply-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 14px;
  padding: 10px;
}

.comment-input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
  padding: 10px 12px;
  resize: vertical;
  outline: none;
  min-height: 44px;
}

.comment-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.comment-form .btn,
.reply-form .btn {
  padding: 7px 12px;
}

.photo-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-top: 2px;
}

.photo-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.photo-action i {
  font-size: 12px;
}

/* Page login/register centrée */
.center-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card {
  background: rgba(10, 15, 28, 0.92);
  padding: 32px;
  border-radius: 16px;
  width: 90%;
  max-width: 380px;
  box-shadow: 0 24px 48px rgba(2, 6, 23, 0.45), 0 0 24px rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.14);
}
.card h1 { font-size: 22px; margin-bottom: 20px; text-align: center; color: #f8fafc; }
.card a { color: #93c5fd; text-decoration: none; }
.card .switch { text-align: center; margin-top: 16px; font-size: 14px; color: #94a3b8; }

/* Admin */
.admin-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 20px 40px;
}
.admin-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 22px;
  padding: 22px 24px;
  border-radius: 24px;
  background: rgba(10, 15, 28, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: 0 22px 52px rgba(2, 6, 23, 0.42), 0 0 22px rgba(59, 130, 246, 0.12);
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 8px;
}
.admin-hero h1 {
  font-size: 28px;
  color: #f8fafc;
  margin-bottom: 6px;
}
.hero-copy {
  max-width: 720px;
  color: #cbd5e1;
  line-height: 1.5;
}
.admin-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
  align-items: start;
}
.panel {
  background: rgba(10, 15, 28, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 24px;
  box-shadow: 0 22px 52px rgba(2, 6, 23, 0.38);
  padding: 20px;
}
.panel-wide {
  min-height: 320px;
}
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.panel-kicker {
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 6px;
}
.panel h2 {
  font-size: 18px;
  color: #f8fafc;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.stat-card {
  background: rgba(10, 15, 28, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.28);
}
.stat-card span {
  display: block;
  color: #94a3b8;
  font-size: 13px;
  margin-bottom: 8px;
}
.stat-card strong {
  display: block;
  color: #f8fafc;
  font-size: 26px;
  font-weight: 700;
}
.admin-search {
  min-width: 240px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 999px;
  padding: 10px 14px;
  color: #f8fafc;
  outline: none;
}
.pending-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 14px;
  display: flex;
  gap: 14px;
  box-shadow: 0 14px 30px rgba(2, 6, 23, 0.18);
}
.pending-card img { width: 164px; height: 164px; object-fit: cover; border-radius: 14px; }
.pending-card .info { flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.pending-card .info .meta { color: #94a3b8; font-size: 13px; margin: 6px 0 12px; }
.pending-card .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.card-topline,
.user-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(59, 130, 246, 0.18);
  color: #bfdbfe;
}
.badge-muted { background: rgba(148, 163, 184, 0.14); color: #cbd5e1; }
.badge-soft { background: rgba(20, 184, 166, 0.16); color: #99f6e4; }
.badge-warn { background: rgba(245, 158, 11, 0.18); color: #fde68a; }
.user-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}
.user-row:first-child { border-top: none; padding-top: 0; }
.user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0f172a, #334155);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex: 0 0 auto;
}
.user-main { flex: 1; min-width: 0; }
.user-main .meta { color: #94a3b8; font-size: 13px; margin-top: 4px; }
.user-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.role-select {
  background: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 999px;
  padding: 9px 12px;
}
.empty-state { text-align: center; color: #94a3b8; padding: 42px 0; }
.hidden { display: none; }

@media (max-width: 1100px) {
  .search-box { flex-basis: 180px; }
  .map-controls { top: 192px; left: 14px; }
  .admin-layout { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .topbar { top: 10px; left: 10px; right: 10px; }
  .brand, .search-box, .filter-box { border-radius: 16px; }
  .admin-hero, .panel, .stat-card { border-radius: 18px; }
  .admin-hero { align-items: flex-start; flex-direction: column; }
  .pending-card { flex-direction: column; }
  .pending-card img { width: 100%; height: 220px; }
  .stats-grid { grid-template-columns: 1fr; }
  .panel-header { flex-direction: column; align-items: stretch; }
  .admin-search { width: 100%; }
  .map-controls { top: auto; bottom: 82px; left: 10px; right: 10px; }
  .search-box { flex-basis: 100%; order: 3; }
  .brand { flex: 1 1 auto; }
  .topbar-actions { order: 2; }
}

/* --- Cloche de notifications --- */
.notif-bell-wrap { position: relative; }
.notif-bell-btn {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.16);
  color: #e2e8f0;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 16px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.notif-bell-btn:hover { background: rgba(30, 41, 59, 0.95); }
.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #dc2626;
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  max-width: 90vw;
  max-height: 70vh;
  overflow-y: auto;
  background: #1e293b;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
  z-index: 2500;
}
.notif-dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  font-weight: 600;
  font-size: 14px;
}
.notif-mark-all {
  background: none;
  border: none;
  color: #818cf8;
  font-size: 12px;
  cursor: pointer;
}
.notif-list { display: flex; flex-direction: column; }
.notif-item {
  display: block;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  text-decoration: none;
  color: #e2e8f0;
}
.notif-item:hover { background: rgba(255,255,255,0.04); }
.notif-item-unread { background: rgba(99, 102, 241, 0.08); }
.notif-item-text { font-size: 13px; }
.notif-item-time { font-size: 11px; color: #64748b; margin-top: 4px; }
.notif-empty { padding: 24px 14px; text-align: center; color: #64748b; font-size: 13px; }

@media (max-width: 720px) {
  .notif-dropdown { right: -10px; width: 92vw; }
}

.admin-hero-actions { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }

/* --- Renforts responsive / PWA mobile --- */
html, body { overflow-x: hidden; max-width: 100vw; }

/* Respecte l'encoche/le bas arrondi (mode standalone iOS) */
.topbar {
  padding-top: max(12px, env(safe-area-inset-top));
}
.lightbox-close {
  top: max(18px, env(safe-area-inset-top));
}

/* Cible tactile minimale confortable */
.btn, .carousel-btn, .notif-bell-btn, .close-x {
  min-height: 38px;
}

@media (max-width: 480px) {
  .brand span:not(.brand-mark) { display: none; }
  .search-box input { font-size: 16px; }
  .notif-dropdown { width: 94vw; right: -6px; }
  .modal { padding: 18px; }
  .hint-banner { font-size: 12px; padding: 8px 14px; max-width: 90vw; text-align: center; }
}

/* --- Masquer/afficher la barre du haut --- */
.topbar.topbar-hidden {
  transform: translateY(calc(-100% - 24px));
  opacity: 0;
  pointer-events: none;
}
.map-controls.controls-hidden {
  transform: translateY(-140%);
  opacity: 0;
  pointer-events: none;
}
.map-controls {
  transition: transform 0.25s ease, opacity 0.2s ease, top 0.15s ease;
}

.header-toggle-btn {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1001;
  width: 34px;
  height: 22px;
  border-radius: 0 0 12px 12px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-top: none;
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}
.header-toggle-btn:hover { color: #e2e8f0; }
.header-toggle-btn.is-collapsed {
  top: max(0px, env(safe-area-inset-top));
  border-radius: 0 0 12px 12px;
}
.header-toggle-btn.is-collapsed i { transform: rotate(180deg); }

@media (max-width: 480px) {
  .header-toggle-btn { top: 8px; }
}

/* --- Toggle de visibilité (upload) --- */
.visibility-toggle {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.visibility-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.visibility-option:hover { background: rgba(255, 255, 255, 0.08); }
.visibility-option.active {
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.22), rgba(21, 128, 61, 0.14));
  border-color: rgba(34, 197, 94, 0.4);
  color: #f8fafc;
}
.visibility-option.active i { color: #22c55e; }

/* --- Badge "Amis proches" sur une photo --- */
.visibility-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(7, 11, 20, 0.82);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #f8fafc;
  font-size: 11px;
  font-weight: 700;
  backdrop-filter: blur(6px);
}
.visibility-badge i { color: #22c55e; }

/* --- Liste des amis proches (modale) --- */
.close-friends-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 50vh;
  overflow-y: auto;
  margin-top: 12px;
}
.close-friend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
}
.close-friend-row:hover { background: rgba(255, 255, 255, 0.05); }
.close-friend-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #e5e7eb;
}
.close-friend-checkbox {
  width: 20px;
  height: 20px;
  accent-color: #22c55e;
  cursor: pointer;
}

/* --- État de chargement des commentaires --- */
.comments-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 12px;
  color: #94a3b8;
  font-size: 13px;
}
.spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(148, 163, 184, 0.25);
  border-top-color: #818cf8;
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.comments-retry {
  display: block;
  margin: 10px auto 0;
  font-size: 12px;
  padding: 6px 14px;
}

/* --- Marqueur vert pour les photos "Amis proches" --- */
.marker-close-friends {
  filter: hue-rotate(100deg) saturate(1.3) brightness(0.95);
}

/* --- Liens pseudo → profil --- */
.author-badge-link,
.comment-user-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 10px;
  transition: opacity 0.15s ease;
}
.author-badge-link:hover,
.comment-user-link:hover { opacity: 0.8; }
.comment-user-link { gap: 8px; }

/* --- Badges de certification --- */
.user-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 5px;

  width: 15px;
  height: 15px;
}
.user-badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 3px var(--badge-color, currentColor));
}

/* --- Vignette d'icône dans la liste des badges (admin) --- */
.badge-type-icon {
  background: rgba(255, 255, 255, 0.06);
  padding: 8px;
}
.badge-type-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 4px var(--badge-color, transparent));
}

.notif-prompt-banner {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translate(-50%, 140%);
  z-index: 3500;
  display: flex;
  align-items: center;
  gap: 14px; 
  max-width: min(420px, calc(100vw - 24px));
  background: rgba(10, 15, 28, 0.96);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  transition: transform 0.3s ease;
}
.notif-prompt-banner.open {
  transform: translate(-50%, 0);
}

.notif-prompt-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #818cf8;
  font-size: 15px; 
}


.notif-prompt-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.notif-prompt-text strong { font-size: 13.5px; color: #f8fafc; }
.notif-prompt-text span { font-size: 12px; color: #94a3b8; line-height: 1.4; }
.notif-prompt-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}
.notif-prompt-actions .btn { padding: 7px 14px; font-size: 12px; white-space: nowrap; }
.notif-prompt-dismiss {
  flex-shrink: 0;
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
}
.notif-prompt-dismiss:hover { color: #94a3b8; }

@media (max-width: 480px) {
  .notif-prompt-banner { flex-wrap: wrap; }
  .notif-prompt-actions { flex-direction: row; width: 100%; }
  .notif-prompt-actions .btn { flex: 1; }
}


.photo-cluster-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.55);
  border: 2px solid rgba(75, 249, 255, 0.5);
}
.photo-cluster-icon span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 78%;
  height: 78%;
  border-radius: 50%;
  background: linear-gradient(135deg, #4BF9FF, #1E6FE0);
  color: #051025;
  font-weight: 800;
  font-size: 13px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
}