/* ========================================================
   NOVALYS PHOTOS — Design System v2.0
   Inspiré de Google Photos, redesigné pour 2026
   ======================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap');

/* ── Variables ─────────────────────────────────────────── */
:root {
  /* Palette principale (mode clair) */
  --c-bg:          #f8fafc;
  --c-surface:     #ffffff;
  --c-surface-2:   #f1f5f9;
  --c-surface-3:   #e2e8f0;
  --c-border:      #e2e8f0;
  --c-border-soft: #f1f5f9;
  --c-text:        #0f172a;
  --c-text-2:      #475569;
  --c-text-3:      #94a3b8;
  --c-primary:     #4285f4;
  --c-primary-d:   #3367d6;
  --c-primary-rgb: 66, 133, 244;
  --c-accent:      #ea4335;
  --c-success:     #34a853;
  --c-warning:     #fbbc04;
  --c-overlay:     rgba(0,0,0,0.55);
  --c-glass:       rgba(255,255,255,0.85);

  /* Ombres */
  --shadow-xs: 0 1px 2px rgba(0,0,0,.06);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.10), 0 2px 4px -2px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.10), 0 4px 6px -4px rgba(0,0,0,.06);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,.10), 0 8px 10px -6px rgba(0,0,0,.06);

  /* Rayons */
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-full: 9999px;

  /* Timing */
  --t-fast:   0.15s ease;
  --t-base:   0.25s ease;
  --t-slow:   0.4s ease;

  /* Layout */
  --sidebar-w:  220px;
  --topbar-h:   64px;
  --panel-w:    360px;
}

/* Mode sombre */
[data-theme="dark"] {
  --c-bg:          #0f172a;
  --c-surface:     #1e293b;
  --c-surface-2:   #243046;
  --c-surface-3:   #2e3f55;
  --c-border:      #334155;
  --c-border-soft: #243046;
  --c-text:        #f1f5f9;
  --c-text-2:      #94a3b8;
  --c-text-3:      #64748b;
  --c-glass:       rgba(30,41,59,0.9);
  --shadow-sm:     0 1px 3px rgba(0,0,0,.3), 0 1px 2px rgba(0,0,0,.2);
  --shadow-md:     0 4px 6px -1px rgba(0,0,0,.3), 0 2px 4px rgba(0,0,0,.2);
  --shadow-lg:     0 10px 15px -3px rgba(0,0,0,.4), 0 4px 6px rgba(0,0,0,.2);
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  font-size: 16px;
  margin: 0;
  padding: 0;
  /* Cacher la scrollbar native — remplacée par la timeline */
  scrollbar-width: none;        /* Firefox */
  overflow-y: scroll;           /* maintient le scrollable */
}
html::-webkit-scrollbar { display: none; } /* Chrome / Safari / Edge */
body {
  margin: 0;
  padding: 0;
  min-height: 100dvh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img, video { max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: 14px; }
:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; }

/* ── Icons (Material Symbols) ──────────────────────────── */
.icon {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 22px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'liga';
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-sm { font-size: 18px; }
.icon-lg { font-size: 28px; }
.icon-xl { font-size: 36px; }

/* ── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--c-text-3); }

/* ── Layout Principal ──────────────────────────────────── */
.app-shell {
  display: flex;
  height: 100dvh;
  overflow: hidden;
  margin: 0;
}

/* ── Sidebar ───────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  height: 100%;
  background: var(--c-surface);
  border-right: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width var(--t-base), transform var(--t-base);
  overflow: hidden;
  z-index: 100;
  margin: 0;
}
.sidebar.collapsed { width: 68px; }

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  height: var(--topbar-h);
  border-bottom: 1px solid var(--c-border-soft);
  flex-shrink: 0;
  overflow: hidden;
  white-space: nowrap;
}
.sidebar-logo .logo-img { width: 36px; height: 36px; border-radius: var(--r-md); flex-shrink: 0; }
.sidebar-logo .logo-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--c-text);
  transition: opacity var(--t-base);
}
.sidebar.collapsed .logo-name { opacity: 0; pointer-events: none; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}
.nav-section { margin-bottom: 4px; }
.nav-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-text-3);
  padding: 8px 20px 4px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--t-base);
}
.sidebar.collapsed .nav-section-label { opacity: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: var(--r-full);
  margin: 2px 8px;
  color: var(--c-text-2);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
  white-space: nowrap;
  overflow: hidden;
  user-select: none;
}
.nav-item:hover { background: var(--c-surface-2); color: var(--c-text); }
.nav-item.active {
  background: rgba(var(--c-primary-rgb), 0.12);
  color: var(--c-primary);
}
.nav-item .icon { flex-shrink: 0; font-size: 22px; }
.nav-item .nav-label { transition: opacity var(--t-base); }
.sidebar.collapsed .nav-label { opacity: 0; width: 0; }
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--c-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--r-full);
  flex-shrink: 0;
}
.sidebar.collapsed .nav-badge { opacity: 0; }

.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid var(--c-border-soft);
}

/* ── Page Principale ───────────────────────────────────── */
.page-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ── Topbar ────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px 0 20px;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
  z-index: 50;
  margin: 0;
}
.topbar-menu-btn {
  width: 40px; height: 40px;
  border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  color: var(--c-text-2);
  transition: background var(--t-fast);
  flex-shrink: 0;
}
.topbar-menu-btn:hover { background: var(--c-surface-2); cursor: pointer; }

/* Search */
.search-bar {
  flex: 1;
  max-width: 720px;
  position: relative;
}
.search-bar input {
  width: 100%;
  height: 44px;
  padding: 0 48px 0 48px;
  background: var(--c-surface-2);
  border: 1px solid transparent;
  border-radius: var(--r-full);
  color: var(--c-text);
  font-size: 15px;
  transition: background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
  outline: none;
}
.search-bar input:focus {
  background: var(--c-surface);
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(var(--c-primary-rgb), 0.15);
}
.search-bar input::placeholder { color: var(--c-text-3); }
.search-bar .search-icon {
  position: absolute;
  left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--c-text-3);
  pointer-events: none;
}
.search-bar .search-clear {
  position: absolute;
  right: 12px; top: 50%; transform: translateY(-50%);
  color: var(--c-text-3);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--r-full);
  display: none;
  transition: background var(--t-fast);
}
.search-bar.has-value .search-clear { display: flex; }
.search-bar .search-clear:hover { background: var(--c-surface-3); }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}
.photo-scroll-counter {
  font-size: 13px;
  color: var(--c-text-2);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  padding: 8px 12px;
  min-width: 130px;
  text-align: center;
  white-space: nowrap;
}
.topbar-btn {
  width: 40px; height: 40px;
  border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  color: var(--c-text-2);
  font-size: 22px;
  transition: background var(--t-fast), color var(--t-fast);
  cursor: pointer;
}
.topbar-btn:hover { background: var(--c-surface-2); color: var(--c-text); }

.avatar-btn {
  width: 36px; height: 36px;
  border-radius: var(--r-full);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color var(--t-fast);
  flex-shrink: 0;
}
.avatar-btn:hover { border-color: var(--c-primary); }
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; }

/* ── Main Content ──────────────────────────────────────── */
.main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  scrollbar-width: none;
}
.main-content::-webkit-scrollbar { display: none; width: 0; height: 0; }

/* ── PAGE: Gallery ─────────────────────────────────────── */
.gallery-wrap { padding: 0 16px 40px; }
.gallery-heading {
  position: relative;
  z-index: 30;
  background: var(--c-bg);
}
.gallery-heading-actions {
  position: fixed;
  top: calc(var(--topbar-h) + 27px);
  right: 56px;
  z-index: 45;
  background: var(--c-bg);
  border-radius: var(--r-full);
  flex-shrink: 0;
}
.gallery-section { margin-bottom: 4px; }

.date-header {
  position: sticky;
  top: 0;
  background: var(--c-bg);
  z-index: 10;
  padding: 14px 4px 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text-2);
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}
.date-header .select-day-btn {
  width: 22px; height: 22px;
  border-radius: var(--r-full);
  border: 2px solid var(--c-border);
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--t-fast), border-color var(--t-fast);
  display: flex; align-items: center; justify-content: center;
}
.date-header .select-day-btn.checked {
  background: var(--c-primary);
  border-color: var(--c-primary);
}
.date-header .select-day-btn.checked::after {
  content: '';
  width: 8px; height: 8px;
  background: white;
  border-radius: var(--r-full);
}

/* Photo Grid — CSS Grid auto-fill */
#gallery-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 4px;
  align-items: start;
}
#gallery-container > .year-header,
#gallery-container > .date-header {
  grid-column: 1 / -1;
}

/* Ligne de photos (legacy, non utilisé mais conservé) */
.photo-row {
  display: flex;
  gap: 4px;
  margin-bottom: 4px;
}
.photo-thumb {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-sm);
  background: var(--c-surface-2);
  cursor: pointer;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.photo-thumb::after {
  content: '';
  display: block;
  padding-bottom: var(--ar, 66.67%);
}
.photo-thumb img,
.photo-thumb video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t-base);
  background: var(--c-surface-2);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}
.photo-thumb:hover img,
.photo-thumb:hover video { transform: scale(1.03); }

/* Overlay on hover */
.photo-thumb .photo-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.35) 0%, transparent 40%, transparent 60%, rgba(0,0,0,0.25) 100%);
  opacity: 0;
  transition: opacity var(--t-fast);
  z-index: 2;
}
.photo-thumb:hover .photo-overlay { opacity: 1; }

/* Checkbox sélection */
.photo-thumb .photo-check {
  position: absolute;
  top: 8px; left: 8px;
  z-index: 3;
  width: 26px; height: 26px;
  border-radius: var(--r-full);
  background: rgba(255,255,255,0.9);
  border: 2px solid rgba(255,255,255,0.9);
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity var(--t-fast), background var(--t-fast);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.photo-thumb .photo-check .icon {
  color: rgba(15,23,42,0.62);
  font-size: 16px;
}
.photo-thumb:hover .photo-check { opacity: 1; }
.photo-thumb.selected .photo-check {
  opacity: 1;
  background: var(--c-primary);
  border-color: var(--c-primary);
}
.photo-thumb.selected .photo-check .icon { color: white; font-size: 16px; }
.photo-thumb.selected > img,
.photo-thumb.selected > video { transform: scale(0.95); border-radius: var(--r-md); }
.photo-thumb.selected .photo-overlay { opacity: 1; background: rgba(66,133,244,0.25); }

/* ── Fichier manquant (miniature ou original introuvable) ── */
.photo-thumb.file-missing { cursor: default; }
.photo-thumb.file-missing img,
.photo-thumb.file-missing video { opacity: 0; pointer-events: none; }
.photo-thumb.file-missing .photo-overlay { display: none; }
.photo-thumb.file-missing::before {
  content: 'broken_image';
  font-family: 'Material Symbols Outlined';
  font-size: 28px;
  color: var(--c-text-3);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  font-variation-settings: 'FILL' 0, 'wght' 300;
}
.photo-thumb.file-missing .fav-btn,
.photo-thumb.file-missing .video-play-icon { display: none !important; }

/* ── Erreur lightbox ── */
.lb-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 40px;
  min-width: 200px;
}
.lb-error .icon { font-size: 56px; opacity: 0.5; }
.lb-error p { font-size: 14px; margin: 0; }
.lb-error small { font-size: 12px; opacity: 0.5; }

/* Icône vidéo */
.photo-thumb .video-badge {
  position: absolute;
  bottom: 8px; right: 8px;
  z-index: 3;
  background: rgba(0,0,0,0.65);
  color: white;
  border-radius: var(--r-sm);
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 600;
  display: flex; align-items: center; gap: 4px;
  backdrop-filter: blur(4px);
}
.video-play-icon {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 3;
  opacity: 0.78;
  transition: opacity var(--t-fast);
  pointer-events: none;
}
.photo-thumb:hover .video-play-icon { opacity: 0.95; }
.video-play-icon .icon {
  font-size: 46px;
  color: rgba(255,255,255,0.9);
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.55));
}

/* Favori */
.photo-thumb .fav-btn {
  position: absolute;
  top: 8px; right: 8px;
  z-index: 3;
  width: 28px; height: 28px;
  border-radius: var(--r-full);
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity var(--t-fast), background var(--t-fast), transform var(--t-fast);
  cursor: pointer;
  backdrop-filter: blur(4px);
}
.photo-thumb:hover .fav-btn { opacity: 1; }
.photo-thumb .fav-btn:hover { transform: scale(1.08); }
.photo-thumb.favorited .fav-btn { opacity: 1; background: rgba(234,67,53,0.8); }
.photo-thumb .fav-btn .icon { color: white; font-size: 16px; }

/* Skeleton loading */
.photo-skeleton {
  background: linear-gradient(90deg, var(--c-surface-2) 25%, var(--c-surface-3) 50%, var(--c-surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Timeline sidebar — scrubber de scroll proportionnel */
.timeline-bar {
  position: fixed;
  right: 0;
  top: calc(var(--topbar-h) + 72px);
  width: 48px;
  height: calc(100dvh - var(--topbar-h) - 72px);
  z-index: 20;
  cursor: pointer;
  user-select: none;
}
/* Rail vertical */
.timeline-bar::before {
  content: '';
  position: absolute;
  top: 8px; bottom: 8px;
  left: 50%; transform: translateX(-50%);
  width: 2px;
  background: var(--c-border);
  border-radius: 1px;
}
/* Curseur de scroll */
.tl-cursor {
  position: absolute;
  left: 4px; right: 4px;
  height: 2px;
  background: var(--c-primary);
  border-radius: 2px;
  transform: translateY(-50%);
  pointer-events: none;
  transition: top 80ms linear;
  box-shadow: 0 0 8px rgba(66,133,244,0.4);
}
.tl-cursor::after {
  content: '';
  position: absolute;
  right: 0; top: 50%; transform: translateY(-50%);
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--c-primary);
  box-shadow: 0 0 6px rgba(66,133,244,0.6);
}
/* Étiquettes d'années positionnées absolument */
.timeline-year {
  position: absolute;
  right: 0;
  transform: translateY(-50%);
  font-size: 10px;
  font-weight: 600;
  color: var(--c-text-3);
  cursor: pointer;
  padding: 2px 6px 2px 14px;
  border-radius: 4px 0 0 4px;
  transition: color var(--t-fast), background var(--t-fast);
  white-space: nowrap;
  pointer-events: all;
}
/* Petit point sur le rail */
.timeline-year::before {
  content: '';
  position: absolute;
  left: 5px; top: 50%; transform: translateY(-50%);
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--c-border);
  transition: background var(--t-fast), transform var(--t-fast);
}
.timeline-year:hover, .timeline-year.active {
  color: var(--c-primary);
  background: rgba(66,133,244,0.1);
}
.timeline-year:hover::before, .timeline-year.active::before {
  background: var(--c-primary);
  transform: translateY(-50%) scale(1.4);
}

/* ── Sélection en cours ─────────────────────────────────── */
.selection-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--c-surface);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  z-index: 200;
  transform: translateY(-100%);
  transition: transform var(--t-base);
  border-bottom: 1px solid var(--c-border);
  box-shadow: var(--shadow-md);
}
.selection-bar.visible { transform: translateY(0); }
.selection-count { font-size: 16px; font-weight: 600; color: var(--c-text); }
.selection-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.hidden { display: none !important; }

/* ── PAGE: Albums ──────────────────────────────────────── */
.albums-wrap { padding: 16px 20px 40px; }
.albums-wrap .page-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.albums-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  align-items: start;
}
.album-card {
  display: flex;
  flex-direction: column;
  align-self: start;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--c-surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: box-shadow var(--t-base), transform var(--t-base);
  user-select: none;
}
.album-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.album-cover {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--c-surface-2);
  display: block;
}
.album-info {
  padding: 10px 12px 12px;
  position: relative;
  min-height: 62px;
}
.album-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.album-meta {
  font-size: 12px;
  color: var(--c-text-3);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.album-shared-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(var(--c-primary-rgb), 0.1);
  color: var(--c-primary);
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--r-full);
  margin-top: 4px;
}

/* Add album card */
.album-card-add {
  border: 2px dashed var(--c-border);
  background: transparent;
  display: flex;
  flex-direction: column;
  align-self: start;
  align-items: center;
  justify-content: center;
  gap: 8px;
  aspect-ratio: 1;
  padding: 20px;
  color: var(--c-text-3);
  font-size: 14px;
  font-weight: 500;
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
  border-radius: var(--r-lg);
  cursor: pointer;
}
.album-card-add:hover {
  border-color: var(--c-primary);
  color: var(--c-primary);
  background: rgba(var(--c-primary-rgb), 0.04);
}
.modal-wide { max-width: 680px; }
.album-cover-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 4px;
}
.album-cover-choice {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 2px solid transparent;
  background: var(--c-surface-2);
  cursor: pointer;
}
.album-cover-choice img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.album-cover-choice .icon {
  position: absolute;
  right: 4px;
  bottom: 4px;
  color: white;
  background: var(--c-primary);
  border-radius: var(--r-full);
  font-size: 20px;
  opacity: 0;
}
.album-cover-choice.selected {
  border-color: var(--c-primary);
}
.album-cover-choice.selected .icon {
  opacity: 1;
}
.album-danger-zone {
  border: 1px solid rgba(234,67,53,0.35);
  background: rgba(234,67,53,0.06);
  border-radius: var(--r-lg);
  padding: 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.album-danger-zone strong { color: var(--c-accent); }
.album-danger-zone p {
  margin-top: 4px;
  font-size: 13px;
  color: var(--c-text-3);
}
.album-danger-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.album-settings-subtitle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: 10px;
}
.album-share-zone {
  border: 1px solid var(--c-border-soft);
  background: var(--c-surface-2);
  border-radius: var(--r-lg);
  padding: 14px;
}
.album-shared-users {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.album-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--c-surface);
  border: 1px solid var(--c-border-soft);
  border-radius: var(--r-full);
  padding: 4px 6px 4px 4px;
  font-size: 13px;
}
.album-user-chip img,
.album-share-result img,
.album-shared-avatar {
  width: 26px;
  height: 26px;
  border-radius: var(--r-full);
  object-fit: cover;
}
.album-user-chip button {
  color: var(--c-text-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.album-user-chip button .icon { font-size: 17px; }
.album-share-search { position: relative; }
.album-share-results {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.album-share-result {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px;
  border-radius: var(--r-md);
  background: var(--c-surface);
  color: var(--c-text);
  text-align: left;
  cursor: pointer;
}
.album-link-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  background: var(--c-surface);
  border: 1px solid var(--c-border-soft);
  border-radius: var(--r-md);
  padding: 8px;
  margin: 8px 0;
}
.album-link-row strong {
  display: block;
  font-size: 13px;
  color: var(--c-text);
}
.album-link-row span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--c-text-3);
}
.album-shared-avatars {
  display: flex;
  align-items: center;
  position: absolute;
  top: 34px;
  right: 12px;
  margin-top: 0;
}
.album-shared-avatar {
  border: 2px solid var(--c-surface);
  margin-left: -8px;
  background: var(--c-surface-2);
}
.album-shared-avatar:first-child { margin-left: 0; }
.album-shared-more {
  height: 26px;
  min-width: 26px;
  margin-left: -8px;
  padding: 0 6px;
  border-radius: var(--r-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--c-primary);
  color: white;
  border: 2px solid var(--c-surface);
  font-size: 11px;
  font-weight: 700;
}

/* ── PAGE: Profil ──────────────────────────────────────── */
.profil-wrap { padding: 24px 24px 40px; max-width: 860px; }
.profil-header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 24px;
  background: var(--c-surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}
.profil-avatar-container { position: relative; }
.profil-avatar {
  width: 96px; height: 96px;
  border-radius: var(--r-full);
  object-fit: cover;
  border: 3px solid var(--c-surface);
  box-shadow: var(--shadow-md);
}
.profil-avatar-edit {
  position: absolute;
  bottom: 0; right: 0;
  width: 30px; height: 30px;
  background: var(--c-primary);
  color: white;
  border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  font-size: 16px;
}
.profil-info { flex: 1; }
.profil-name { font-size: 22px; font-weight: 700; color: var(--c-text); }
.profil-role {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(var(--c-primary-rgb), 0.1);
  color: var(--c-primary);
  font-size: 12px; font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--r-full);
  margin-top: 4px;
}

/* Storage bar */
.storage-card {
  background: var(--c-surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  padding: 20px 24px;
  margin-bottom: 20px;
}
.storage-title { font-size: 14px; font-weight: 600; color: var(--c-text-2); margin-bottom: 10px; }
.storage-bar {
  width: 100%;
  height: 8px;
  background: var(--c-surface-2);
  border-radius: var(--r-full);
  overflow: hidden;
  margin-bottom: 8px;
}
.storage-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--c-primary), #34a853);
  border-radius: var(--r-full);
  transition: width 0.6s ease;
}
.storage-fill.warning { background: linear-gradient(90deg, #fbbc04, #ea4335); }
.storage-numbers { font-size: 13px; color: var(--c-text-3); display: flex; justify-content: space-between; }

/* Stats cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--c-surface);
  border-radius: var(--r-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-value { font-size: 24px; font-weight: 700; color: var(--c-text); }
.stat-label { font-size: 12px; color: var(--c-text-3); font-weight: 500; }
.stat-icon { font-size: 32px; color: var(--c-primary); margin-bottom: 4px; }

/* Settings section */
.settings-section {
  background: var(--c-surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xs);
  padding: 0;
  margin-bottom: 20px;
  overflow: hidden;
}
.settings-section-title {
  padding: 16px 20px 12px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-text-3);
  border-bottom: 1px solid var(--c-border-soft);
}
.settings-row {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--c-border-soft);
  gap: 12px;
}
.settings-row:last-child { border-bottom: none; }
.settings-row-label { flex: 1; font-size: 14px; color: var(--c-text); font-weight: 500; }
.settings-row-desc { font-size: 12px; color: var(--c-text-3); margin-top: 2px; }

/* ── PAGE: Admin ───────────────────────────────────────── */
.admin-wrap { padding: 24px; max-width: 1100px; }
.admin-table-wrap {
  background: var(--c-surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
table.admin-table { width: 100%; border-collapse: collapse; }
table.admin-table thead th {
  background: var(--c-surface-2);
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--c-text-3);
  white-space: nowrap;
}
table.admin-table tbody tr { border-bottom: 1px solid var(--c-border-soft); transition: background var(--t-fast); }
table.admin-table tbody tr:last-child { border-bottom: none; }
table.admin-table tbody tr:hover { background: var(--c-surface-2); }
table.admin-table td { padding: 12px 16px; font-size: 14px; color: var(--c-text); }
.rang-badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 11px; font-weight: 700;
}
.rang-5 { background: rgba(234,67,53,.15); color: #ea4335; }
.rang-1 { background: rgba(251,188,4,.15); color: #f59e0b; }
.rang-0 { background: rgba(100,116,139,.1); color: var(--c-text-3); }

/* ── Lightbox / Visionneuse ────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(0,0,0,0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-base);
  touch-action: none;               /* on gère les gestes manuellement */
  user-select: none;
  -webkit-user-select: none;
}
.lightbox.open { opacity: 1; pointer-events: all; }
.lightbox-media-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.lightbox-media-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transform: translateX(0);
  transition: transform 0.28s cubic-bezier(.22,.61,.36,1), opacity 0.28s ease;
}
.lightbox-media-stage.enter-next { transform: translateX(100%); opacity: 0.4; }
.lightbox-media-stage.enter-prev { transform: translateX(-100%); opacity: 0.4; }
.lightbox-media-stage.exit-next { transform: translateX(-100%); opacity: 0.35; }
.lightbox-media-stage.exit-prev { transform: translateX(100%); opacity: 0.35; }
.lightbox-media {
  max-width: calc(100vw - 80px);
  max-height: calc(100dvh - 80px);
  object-fit: contain;
  transform-origin: center center;
  will-change: transform;
  cursor: default;
  display: block;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}
.lightbox-media.zoomed { cursor: grab; }
.lightbox-media.zoomed:active { cursor: grabbing; }
.lightbox-media {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--r-sm);
  user-select: none;
  transition: none;
}
.lightbox-btn {
  position: absolute;
  top: 12px;
  z-index: 4;
  width: 44px; height: 44px;
  border-radius: var(--r-full);
  background: rgba(0,0,0,0.5);
  color: white;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background var(--t-fast);
  backdrop-filter: blur(8px);
}
.lightbox-btn:hover { background: rgba(0,0,0,0.75); }
.lightbox-fav-btn.active { background: rgba(234,67,53,0.82); }
.lightbox-close { right: 12px; }
.lightbox-info-btn { right: 64px; }
.lightbox-more-btn { right: 116px; }
.lightbox-restore-btn { right: 168px; }
.lightbox-download-btn { right: 220px; }
.lightbox-fav-btn { right: 272px; }

.lightbox-nav {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  z-index: 4;
  width: 52px; height: 52px;
  border-radius: var(--r-full);
  background: rgba(0,0,0,0.5);
  color: white;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background var(--t-fast), opacity var(--t-fast);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity var(--t-base);
}
.lightbox:hover .lightbox-nav { opacity: 1; }
.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }
.lightbox-nav:hover { background: rgba(0,0,0,0.75); }

/* Info panel */
.lightbox-info-panel {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  z-index: 5;
  width: var(--panel-w);
  background: var(--c-surface);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--t-base);
  overflow-y: auto;
  touch-action: pan-y;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.lightbox-info-panel.open { transform: translateX(0); }
.info-panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--c-border);
  font-size: 15px;
  font-weight: 600;
  color: var(--c-text);
  display: flex; align-items: center; justify-content: space-between;
}
.info-row {
  padding: 12px 20px;
  border-bottom: 1px solid var(--c-border-soft);
  display: flex; gap: 12px; align-items: flex-start;
}
.info-row .icon { color: var(--c-text-3); margin-top: 2px; font-size: 20px; flex-shrink: 0; }
.info-row-content { flex: 1; }
.info-label { font-size: 11px; color: var(--c-text-3); font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }
.info-value { font-size: 14px; color: var(--c-text); margin-top: 2px; word-break: break-all; }
.info-edit-line {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.info-title-input {
  min-width: 0;
  flex: 1;
}
.info-edit-line .btn {
  flex-shrink: 0;
}

/* Map dans le panel info */
#info-map { height: 200px; border-radius: var(--r-md); overflow: hidden; }

/* ── Upload Panel ──────────────────────────────────────── */
.upload-panel {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 320px;
  background: var(--c-surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  z-index: 500;
  overflow: hidden;
  transform: translateY(calc(100% + 30px));
  transition: transform var(--t-slow);
  max-height: 80dvh;
}
.upload-panel.visible { transform: translateY(0); }

.upload-panel-header {
  padding: 14px 16px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--c-border-soft);
}
.upload-panel-title { font-size: 14px; font-weight: 600; color: var(--c-text); flex: 1; }
.upload-panel-close { cursor: pointer; color: var(--c-text-3); }

.upload-progress-bar {
  height: 3px;
  background: var(--c-surface-2);
  position: relative;
  overflow: hidden;
}
.upload-progress-fill {
  height: 100%;
  background: var(--c-primary);
  transition: width 0.3s ease;
  border-radius: var(--r-full);
}
.upload-progress-fill.indeterminate {
  width: 30%;
  animation: indeterminate 1.2s ease infinite;
}
@keyframes indeterminate {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

.upload-item {
  padding: 10px 16px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--c-border-soft);
}
.upload-item:last-child { border-bottom: none; }
.upload-item-thumb {
  width: 44px; height: 44px;
  border-radius: var(--r-sm);
  object-fit: cover;
  background: var(--c-surface-2);
  flex-shrink: 0;
}
.upload-item-info { flex: 1; min-width: 0; }
.upload-item-name { font-size: 13px; color: var(--c-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upload-item-status { font-size: 11px; color: var(--c-text-3); margin-top: 2px; }
.upload-item-icon { color: var(--c-success); }
.upload-item-icon.error { color: var(--c-accent); }

/* Zone de drop */
.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 800;
  background: rgba(var(--c-primary-rgb), 0.12);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  gap: 16px;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--t-base);
  border: 3px dashed var(--c-primary);
}
.drop-overlay.active { opacity: 1; pointer-events: all; }
.drop-overlay .icon { font-size: 64px; color: var(--c-primary); }
.drop-overlay-text { font-size: 22px; font-weight: 600; color: var(--c-primary); }

/* ── Boutons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--r-full);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
  border: none;
  white-space: nowrap;
  user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--c-primary);
  color: white;
}
.btn-primary:hover { background: var(--c-primary-d); box-shadow: var(--shadow-md); }
.btn-secondary {
  background: var(--c-surface-2);
  color: var(--c-text);
}
.btn-secondary:hover { background: var(--c-surface-3); }
.btn-ghost {
  background: transparent;
  color: var(--c-text-2);
}
.btn-ghost:hover { background: var(--c-surface-2); color: var(--c-text); }
.btn-danger {
  background: var(--c-accent);
  color: white;
}
.btn-danger:hover { background: #d32f2f; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 13px 28px; font-size: 15px; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: var(--r-full); }
.btn-icon.btn-sm { width: 32px; height: 32px; }

/* ── Inputs ────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; font-weight: 600; color: var(--c-text-2); }
.input, .select, .textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-surface);
  color: var(--c-text);
  font-size: 14px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  outline: none;
  appearance: none;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(var(--c-primary-rgb), 0.15);
}
.input::placeholder { color: var(--c-text-3); }
.textarea { resize: vertical; min-height: 80px; }
.input-icon-wrap { position: relative; }
.input-icon-wrap .icon {
  position: absolute;
  left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--c-text-3);
  font-size: 18px;
  pointer-events: none;
}
.input-icon-wrap .input { padding-left: 40px; }

/* Toggle switch */
.toggle-switch {
  width: 44px; height: 24px;
  position: relative;
  cursor: pointer;
}
.toggle-switch input { display: none; }
.toggle-track {
  width: 100%; height: 100%;
  background: var(--c-border);
  border-radius: var(--r-full);
  transition: background var(--t-fast);
  position: absolute;
}
.toggle-thumb {
  width: 18px; height: 18px;
  background: white;
  border-radius: var(--r-full);
  position: absolute;
  top: 3px; left: 3px;
  transition: transform var(--t-fast);
  box-shadow: var(--shadow-xs);
}
.toggle-switch input:checked ~ .toggle-track { background: var(--c-primary); }
.toggle-switch input:checked ~ .toggle-thumb { transform: translateX(20px); }

/* ── Modals ─────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--c-overlay);
  z-index: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-base);
  backdrop-filter: blur(4px);
}
.modal-backdrop.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--c-surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 460px;
  max-height: 90dvh;
  overflow-y: auto;
  transform: scale(0.95) translateY(8px);
  transition: transform var(--t-base);
}
.modal-backdrop.open .modal { transform: scale(1) translateY(0); }
.modal-header {
  padding: 20px 24px 16px;
  display: flex; align-items: center;
  border-bottom: 1px solid var(--c-border-soft);
  gap: 12px;
}
.modal-title { font-size: 17px; font-weight: 700; color: var(--c-text); flex: 1; }
.modal-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-footer {
  padding: 16px 24px 20px;
  display: flex; justify-content: flex-end; gap: 10px;
  border-top: 1px solid var(--c-border-soft);
}

/* ── Toast notifications ────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px; left: 50%; transform: translateX(-50%);
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  z-index: 1000;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: #323232;
  color: white;
  border-radius: var(--r-full);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  white-space: nowrap;
  transform: translateY(10px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast .icon { font-size: 18px; }
.toast.success .icon { color: #66bb6a; }
.toast.error .icon { color: #ef5350; }
.toast.warning .icon { color: #ffa726; }
.toast-action {
  margin-left: 8px;
  color: #90caf9;
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  font-size: 13px;
  pointer-events: all;
}
.toast-action:hover { text-decoration: underline; }

/* ── Page Connexion ─────────────────────────────────────── */
.login-page {
  min-height: 100dvh;
  background: var(--c-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  background: var(--c-surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  padding: 40px;
  width: 100%;
  max-width: 400px;
}
.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
}
.login-logo-img { width: 56px; height: 56px; border-radius: var(--r-lg); }
.login-logo-name { font-size: 22px; font-weight: 700; color: var(--c-text); }
.login-logo-tagline { font-size: 14px; color: var(--c-text-3); }
.login-card .form-group { margin-bottom: 14px; }
.login-card .btn-primary { width: 100%; margin-top: 8px; padding: 12px; font-size: 15px; }
.login-error {
  background: rgba(234,67,53,0.1);
  color: var(--c-accent);
  border: 1px solid rgba(234,67,53,0.25);
  padding: 10px 14px;
  border-radius: var(--r-md);
  font-size: 13px;
  display: none;
}
.login-error.visible { display: block; }
.login-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
  font-size: 13px;
}
.login-links a { color: var(--c-primary); }
.login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--c-text-2);
  cursor: pointer;
  margin-top: 4px;
}

/* ── Page Partage public ────────────────────────────────── */
.share-page { padding: 24px; max-width: 1200px; margin: 0 auto; }
.share-header {
  text-align: center;
  padding: 40px 0 20px;
}
.share-header h1 { font-size: 26px; font-weight: 700; color: var(--c-text); margin-bottom: 8px; }
.share-header p { color: var(--c-text-3); font-size: 14px; }
.share-header .btn { margin-top: 16px; }

/* ── Menu flottant contextuel ───────────────────────────── */
.context-menu {
  position: fixed;
  background: var(--c-surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--c-border);
  padding: 8px 0;
  min-width: 200px;
  z-index: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-fast);
  transform-origin: top left;
}
.context-menu.open { opacity: 1; pointer-events: all; }
#sort-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
}
.context-menu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  font-size: 14px; color: var(--c-text);
  cursor: pointer;
  transition: background var(--t-fast);
}
.context-menu-item:hover { background: var(--c-surface-2); }
.context-menu-item .icon { font-size: 20px; color: var(--c-text-3); }
.context-menu-item.danger { color: var(--c-accent); }
.context-menu-item.danger .icon { color: var(--c-accent); }
.context-menu-sep { height: 1px; background: var(--c-border-soft); margin: 4px 0; }

/* ── Chargement / Spinner ───────────────────────────────── */
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--c-border);
  border-top-color: var(--c-primary);
  border-radius: var(--r-full);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spinner-sm { width: 18px; height: 18px; border-width: 2px; }
.loading-center {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 0;
  flex-direction: column;
  gap: 16px;
  color: var(--c-text-3);
}

/* ── Empty states ───────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
  gap: 12px;
}
.empty-state .icon { font-size: 72px; color: var(--c-text-3); opacity: 0.5; }
.empty-state-title { font-size: 18px; font-weight: 600; color: var(--c-text-2); }
.empty-state-desc { font-size: 14px; color: var(--c-text-3); max-width: 320px; line-height: 1.6; }
.empty-state .btn { margin-top: 8px; }

/* ── Chip / Tag ─────────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: var(--r-full);
  background: var(--c-surface-2);
  color: var(--c-text-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all var(--t-fast);
}
.chip:hover { border-color: var(--c-border); }
.chip.active { background: rgba(var(--c-primary-rgb), 0.1); color: var(--c-primary); border-color: var(--c-primary); }

/* ── FAB (Floating Action Button) ──────────────────────── */
.fab {
  position: fixed;
  bottom: 28px; right: 28px;
  width: 56px; height: 56px;
  border-radius: var(--r-full);
  background: var(--c-primary);
  color: white;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--t-base);
  z-index: 100;
  font-size: 28px;
}
.fab:hover { box-shadow: var(--shadow-xl); transform: scale(1.05); background: var(--c-primary-d); }

/* ── Responsive ─────────────────────────────────────────── */
/* ═══════════════════════════════════════════════════════
   RESPONSIVE MOBILE — breakpoint 768px
   ═══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  :root {
    --sidebar-w: 0px;
    --topbar-h:  56px;
    --bottom-nav-h: 60px;
  }

  /* ── Body / scroll ── */
  body { padding-bottom: var(--bottom-nav-h); }

  /* ── Topbar simplifié ── */
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar-logo { display: none; }                    /* masqué, logo dans bottom nav */
  .topbar #upload-btn { display: none; }              /* doublon avec "Ajouter" dans la bottom nav */
  .search-bar { flex: 1; }

  /* ── Sidebar → drawer latéral ── */
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    width: 280px !important;
    z-index: 400;
    box-shadow: var(--shadow-xl);
    transition: transform var(--t-base);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .sidebar-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
    z-index: 399;
    display: none;
  }
  .sidebar-overlay.active { display: block; }

  /* ── Contenu principal ── */
  .main-content {
    padding: 0 0 8px;
    min-height: calc(100dvh - var(--topbar-h) - var(--bottom-nav-h));
  }
  .gallery-heading-actions {
    top: calc(var(--topbar-h) + 23px);
    right: 14px;
  }
  /* ── Galerie photo ── */
  .photo-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
  }
  .photo-thumb { border-radius: 0; }           /* bords à ras sur mobile */
  .photo-thumb:hover img,
  .photo-thumb:hover video { transform: none; }
  .photo-thumb:hover .photo-overlay,
  .photo-thumb:hover .photo-check { opacity: 0; }
  .photo-thumb.selected > img,
  .photo-thumb.selected > video {
    transform: scale(0.95);
    border-radius: var(--r-md);
  }
  .photo-thumb.selected .photo-overlay { opacity: 1; }
  .photo-thumb.selected .photo-check {
    opacity: 1;
    top: 5px;
    left: 5px;
    width: 24px;
    height: 24px;
    pointer-events: none;
  }
  .photo-thumb .photo-check .icon { font-size: 15px; }
  .photo-thumb .fav-btn {
    top: 5px;
    right: 5px;
    width: 26px;
    height: 26px;
    opacity: 0;
    pointer-events: none;
  }
  .photo-thumb:hover .fav-btn { opacity: 0; }
  .photo-thumb.favorited .fav-btn {
    opacity: 1;
    pointer-events: auto;
    background: rgba(234,67,53,0.72);
  }
  .photo-thumb.favorited:hover .fav-btn { opacity: 1; }
  .photo-thumb .fav-btn .icon { font-size: 15px; }
  .video-play-icon { opacity: 0.82; }
  .video-play-icon .icon { font-size: 38px; }

  /* ── Timeline bar: version compacte mobile ── */
  .timeline-bar {
    display: block;
    width: 28px;
    top: calc(var(--topbar-h) + 72px);
    height: calc(100dvh - var(--topbar-h) - var(--bottom-nav-h) - 92px);
  }
  /* Rail plus fin */
  .timeline-bar::before { width: 2px; }
  /* Curseur plus fin */
  .tl-cursor { left: 8px; right: 8px; }
  .tl-cursor::after { width: 8px; height: 8px; right: -3px; }
  /* Masquer le texte des années, garder seulement le point */
  .timeline-year {
    font-size: 0;
    padding: 0;
    width: 28px;
    height: 18px;
    border-radius: 0;
    background: transparent !important;
  }
  /* Agrandir le point pour le tap */
  .timeline-year::before {
    left: 50%; transform: translate(-50%, -50%);
    width: 7px; height: 7px;
  }
  .timeline-year.active::before,
  .timeline-year:hover::before {
    transform: translate(-50%, -50%) scale(1.5);
  }
  /* Étiquette flottante au survol/tap */
  .timeline-year.active::after {
    content: attr(data-year);
    position: absolute;
    right: 100%;
    top: 50%; transform: translateY(-50%);
    font-size: 11px;
    font-weight: 700;
    color: white;
    background: var(--c-primary);
    padding: 2px 7px;
    border-radius: 4px;
    white-space: nowrap;
    margin-right: 4px;
    pointer-events: none;
  }

  /* ── Albums ── */
  .albums-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }

  /* ── Profil ── */
  .profil-header { flex-direction: column; text-align: center; align-items: center; gap: 12px; }
  .profil-wrap { padding: 12px 12px 24px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }

  /* ── Upload panel → bottom sheet ── */
  .upload-panel {
    position: fixed !important;
    left: 0; right: 0; bottom: 0;
    width: 100% !important;
    max-height: 75dvh;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    border-bottom: none;
    padding-bottom: env(safe-area-inset-bottom, 16px);
    transform: translateY(100%);
    transition: transform var(--t-base);
  }
  .upload-panel.visible { transform: translateY(0); }

  /* ── Lightbox mobile (plein écran, gestes uniquement) ── */
  .lightbox-nav { display: none; }              /* pas de boutons ← → sur mobile */
  .lightbox-btn { width: 40px; height: 40px; top: 8px; }
  .lightbox-close  { right: 8px; }
  .lightbox-info-btn { right: 54px; }
  .lightbox-more-btn { right: 100px; }
  .lightbox-restore-btn { right: 146px; }
  .lightbox-download-btn { right: 192px; }
  .lightbox-fav-btn { right: 238px; }
  .lightbox-media {
    max-width: 100vw !important;
    max-height: 100dvh !important;
    transform-origin: center center;    /* pour le pinch-zoom */
  }
  .lightbox-info-panel {
    position: fixed;
    left: 0; right: 0;
    bottom: 0; top: auto;
    width: 100%;
    height: auto;
    max-height: 80dvh;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    transform: translateY(100%);
    padding-bottom: env(safe-area-inset-bottom, 16px);
  }
  .lightbox-info-panel.open { transform: translateY(0); }

  /* Indicateur de swipe bas pour fermer */
  .lightbox::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px; height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: var(--r-full);
    z-index: 5;
  }

  /* ── Selection bar ── */
  .selection-bar {
    left: 0; right: 0;
    bottom: var(--bottom-nav-h);
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    padding-bottom: 8px;
  }

  /* ── FAB → positionné au-dessus de la bottom nav ── */
  .fab { bottom: calc(var(--bottom-nav-h) + 16px); right: 16px; }

  /* ── Modals → bottom sheet ── */
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal {
    max-width: 100%;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    padding-bottom: env(safe-area-inset-bottom, 16px);
  }

  /* ── Auth pages ── */
  .auth-card { padding: 32px 20px; border-radius: var(--r-xl) var(--r-xl) 0 0; }
  .auth-container { align-items: flex-end; padding: 0; background: var(--c-bg); }

  /* ── Admin table ── */
  .admin-wrap { padding: 12px; }
  .admin-section { padding: 12px; }
  table.admin-table thead { display: none; }
  table.admin-table td { display: block; padding: 4px 12px; }
  table.admin-table td:first-child { padding-top: 12px; font-weight: 600; }
  table.admin-table td:last-child { padding-bottom: 12px; }

  /* ── Partages ── */
  .share-link-url { font-size: 11px; }

  /* ── Zone tactile minimum 44px ── */
  .btn, .nav-item { min-height: 44px; min-width: 44px; }
}

/* ── Bottom navigation (mobile uniquement) ────────────── */
.bottom-nav {
  display: none;
}
@media (max-width: 768px) {
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--bottom-nav-h, 60px);
    background: var(--c-surface);
    border-top: 1px solid var(--c-border);
    z-index: 200;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  .bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 4px;
    color: var(--c-text-3);
    cursor: pointer;
    border: none;
    background: none;
    transition: color var(--t-fast);
    font-size: 10px;
    font-weight: 500;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }
  .bottom-nav-item .icon { font-size: 22px; }
  .bottom-nav-item.active { color: var(--c-primary); }
  .bottom-nav-item.active .icon { font-variation-settings: 'FILL' 1; }
}

/* ── Très petit écran (≤ 480px) ─────────────────────────── */
@media (max-width: 480px) {
  #gallery-container { grid-template-columns: repeat(3, 1fr); gap: 2px; }
  .topbar { padding: 0 8px; }
  .search-bar input { font-size: 15px; }        /* évite le zoom auto iOS */
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .albums-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Tablette ── */
@media (min-width: 481px) and (max-width: 1024px) {
  #gallery-container { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

/* ── Grand écran (tablette/desktop) ─────────────────────── */
@media (min-width: 769px) {
  .bottom-nav { display: none; }
}

/* ── Animations d'entrée ────────────────────────────────── */
.fade-in { animation: fadeIn 0.3s ease forwards; }
.slide-up { animation: slideUp 0.3s ease forwards; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* ── Utilitaires ─────────────────────────────────────────── */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.text-muted { color: var(--c-text-3); }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hidden { display: none !important; }
.w-full { width: 100%; }

/* ── Diaporama (slideshow) ──────────────────────────────── */
.slideshow-toolbar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 16px 20px;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: opacity var(--t-base);
}
.slideshow-title { flex: 1; color: white; font-size: 14px; font-weight: 500; }
.slideshow-time { color: rgba(255,255,255,0.7); font-size: 13px; }
.slideshow-progress {
  position: absolute;
  bottom: 0; left: 0;
  height: 3px;
  background: var(--c-primary);
  transition: width linear;
}

/* ── Header titre des années ────────────────────────────── */
.year-header {
  font-size: 22px;
  font-weight: 700;
  color: var(--c-text);
  padding: 20px 4px 6px;
}
.month-header {
  font-size: 15px;
  font-weight: 600;
  color: var(--c-text-2);
  padding: 14px 4px 6px;
}

/* ── Partages / Liens ───────────────────────────────────── */
.share-link-card {
  background: var(--c-surface);
  border: 1px solid rgba(66, 133, 244, .32);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  transition: box-shadow var(--t-fast);
  box-shadow: 0 10px 30px rgba(66, 133, 244, .10);
}
.share-link-card:hover { box-shadow: 0 14px 36px rgba(66, 133, 244, .18); }
.share-link-info { flex: 1; min-width: 0; }
.share-link-name { font-size: 15px; font-weight: 700; color: var(--c-text); }
.share-link-meta { font-size: 12px; color: var(--c-text-3); margin-top: 3px; }
.share-link-url {
  width: 100%;
  padding: 8px 12px;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  font-size: 12px;
  color: var(--c-text-2);
  cursor: pointer;
  margin-top: 8px;
  overflow-wrap: anywhere;
}

/* ── Search dropdown ────────────────────────────────────── */
/* Page autonome des albums transmis */
.albums-transmis-page {
  padding: 28px;
  max-width: 1120px;
  margin: 0 auto;
}
.albums-transmis-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  border-radius: 28px;
  background:
    radial-gradient(circle at top left, rgba(var(--c-primary-rgb), .22), transparent 34%),
    linear-gradient(135deg, var(--c-surface), var(--c-surface-2));
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}
.albums-transmis-kicker {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--c-primary);
  margin-bottom: 8px;
}
.albums-transmis-hero h1 {
  font-size: clamp(28px, 5vw, 46px);
  line-height: 1;
  margin-bottom: 10px;
  color: var(--c-text);
}
.albums-transmis-hero p {
  max-width: 650px;
  color: var(--c-text-2);
  font-size: 15px;
}
.albums-transmis-account {
  display: inline-flex;
  margin-top: 14px;
  padding: 7px 12px;
  border-radius: var(--r-full);
  background: rgba(var(--c-primary-rgb), .12);
  color: var(--c-primary);
  font-size: 12px;
  font-weight: 700;
}
.albums-transmis-count {
  min-width: 118px;
  height: 118px;
  border-radius: 30px;
  display: grid;
  place-items: center;
  align-content: center;
  background: var(--c-primary);
  color: #fff;
  box-shadow: 0 18px 42px rgba(var(--c-primary-rgb), .28);
}
.albums-transmis-count strong {
  font-size: 42px;
  line-height: 1;
}
.albums-transmis-count span {
  font-size: 13px;
  font-weight: 700;
}
.albums-transmis-list {
  display: grid;
  gap: 12px;
}
.album-transmis-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border-radius: 22px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-xs);
}
.album-transmis-icon {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: var(--c-primary);
  background: rgba(var(--c-primary-rgb), .12);
}
.album-transmis-title {
  color: var(--c-text);
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 5px;
}
.album-transmis-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--c-text-3);
  font-size: 12px;
}
.album-transmis-meta span {
  width: 4px;
  height: 4px;
  border-radius: 99px;
  background: var(--c-text-3);
}
.album-transmis-url {
  width: 100%;
  margin-top: 10px;
  border: 1px solid var(--c-border);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--c-surface-2);
  color: var(--c-text-2);
}
.album-transmis-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.albums-transmis-empty {
  text-align: center;
  padding: 56px 20px;
  border: 1px dashed var(--c-border);
  border-radius: 24px;
  background: var(--c-surface);
  color: var(--c-text-2);
}

@media (max-width: 768px) {
  .albums-transmis-page { padding: 14px; }
  .albums-transmis-hero { padding: 20px; flex-direction: column; }
  .albums-transmis-count { width: 100%; height: auto; min-height: 88px; }
  .album-transmis-card { grid-template-columns: 1fr; }
  .album-transmis-icon { display: none; }
  .album-transmis-actions { flex-wrap: wrap; }
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: var(--c-surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--c-border);
  z-index: 200;
  overflow: hidden;
  display: none;
}
.search-bar.focused .search-dropdown { display: block; }
.search-suggest {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background var(--t-fast);
  font-size: 14px;
  color: var(--c-text);
}
.search-suggest:hover { background: var(--c-surface-2); }
.search-suggest .icon { color: var(--c-text-3); font-size: 20px; }

/* ── Filtres ────────────────────────────────────────────── */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
  border-bottom: 1px solid var(--c-border-soft);
}
.filters-bar::-webkit-scrollbar { display: none; }

/* Drag & drop (tri des albums) */
.drag-over { opacity: 0.5; transform: scale(0.97); }

/* ── Dropdown profil ────────────────────────────────────── */
.profile-dropdown {
  position: absolute;
  top: calc(var(--topbar-h) + 4px);
  right: 12px;
  background: var(--c-surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--c-border);
  min-width: 260px;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) scale(0.97);
  transition: all var(--t-fast);
  overflow: hidden;
}
.profile-dropdown.open { opacity: 1; pointer-events: all; transform: none; }
.profile-dropdown-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--c-border-soft);
  display: flex; align-items: center; gap: 12px;
}
.profile-dropdown-header img { width: 44px; height: 44px; border-radius: var(--r-full); object-fit: cover; }
.profile-dropdown-body { padding: 8px 0; }
.profile-dropdown-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px;
  font-size: 14px; color: var(--c-text);
  cursor: pointer;
  transition: background var(--t-fast);
}
.profile-dropdown-item:hover { background: var(--c-surface-2); }
.profile-dropdown-item .icon { color: var(--c-text-3); }


/* ── Auth pages (loggin / createaccount) ──────────────── */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--c-bg);
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  padding: 40px 36px;
  box-shadow: var(--shadow-lg);
}
.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}
.auth-logo-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--c-text);
}
.auth-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--c-text);
  margin-bottom: 8px;
}
.auth-subtitle {
  font-size: 14px;
  color: var(--c-text-3);
  margin-bottom: 24px;
}
.auth-error {
  background: rgba(234,67,53,0.1);
  border: 1px solid rgba(234,67,53,0.3);
  color: #ea4335;
  padding: 10px 14px;
  border-radius: var(--r-md);
  font-size: 14px;
  margin-bottom: 16px;
}
.auth-success {
  background: rgba(52,168,83,0.1);
  border: 1px solid rgba(52,168,83,0.3);
  color: #34a853;
  padding: 10px 14px;
  border-radius: var(--r-md);
  font-size: 14px;
  margin-bottom: 16px;
}
.auth-switch {
  margin-top: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--c-text-3);
}
.auth-switch a { color: var(--c-primary); text-decoration: none; font-weight: 500; }
.auth-switch a:hover { text-decoration: underline; }

/* ── Badge ────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: var(--c-surface-2);
  color: var(--c-text-2);
  border: 1px solid var(--c-border);
}
.badge-admin {
  background: rgba(66,133,244,0.12);
  color: var(--c-primary);
  border-color: rgba(66,133,244,0.3);
}

/* ── Input helpers ────────────────────────────────────── */
.input-wrap { position: relative; }
.input-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--c-text-3); font-size: 18px; pointer-events: none; }
.input-icon-left { padding-left: 40px !important; }
.input-btn-right { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.input-feedback { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); }
.form-hint { font-size: 11px; color: var(--c-text-3); margin-top: 4px; }
.btn-full { width: 100%; justify-content: center; margin-top: 4px; }

/* ── Admin section card ───────────────────────────────── */
.admin-section {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  padding: 20px 24px;
  margin-bottom: 16px;
}
