/* ═══════════════════════════════════════════════════════════════════════════
   Espérance de Vionnaz — Sorties
   Design system calqué sur esperancevionnaz.ch
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Variables ─────────────────────────────────────────────────────────── */
:root {
  --red:      #e02020;
  --red-dark: #c01818;
  --gold:     #ffc005;
  --rust:     #be574b;
  --dark:     #121212;
  --text:     #272626;
  --muted:    #919191;
  --bg:       #ffffff;
  --bg-light: #f4f5f7;
  --border:   #e8e8e8;

  --font: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius: 3px;
  --shadow: 0 2px 8px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.12);
  --transition: 0.2s ease;
  --container: 1100px;
}

/* ─── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; display: block; }
a { color: var(--red); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--red-dark); }
ul { list-style: none; }

/* ─── Container ─────────────────────────────────────────────────────────── */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ─── Navbar ────────────────────────────────────────────────────────────── */
.navbar {
  background: #fff;
  border-bottom: 1px solid var(--bg-light);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 1rem;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
}
.navbar-brand strong { color: var(--red); }
.brand-icon { width: 28px; height: 28px; color: var(--red); flex-shrink: 0; }
.navbar-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  transition: background var(--transition), color var(--transition);
}
.nav-link:hover, .nav-link.active {
  background: var(--bg-light);
  color: var(--red);
}
.nav-separator { width: 1px; height: 24px; background: var(--border); margin: 0 0.5rem; }
.nav-username {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}
.badge-admin {
  background: var(--red);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  vertical-align: middle;
}
.navbar-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.navbar-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--transition);
}

/* ─── Main content ──────────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  padding: 2rem 0 3rem;
}

/* ─── Footer ────────────────────────────────────────────────────────────── */
.footer {
  background: linear-gradient(135deg, #c01818 0%, #e02020 100%);
  color: rgba(255,255,255,0.9);
  padding: 1.5rem 0;
  margin-top: auto;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.footer p { font-size: 0.82rem; font-weight: 500; }
.footer-sub { opacity: 0.7; font-size: 0.75rem; }

/* ─── Flash messages ────────────────────────────────────────────────────── */
.flash-messages { margin-bottom: 1.5rem; }
.alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  border-left: 3px solid transparent;
}
.alert-success  { background: #f0faf0; color: #2d7a2d; border-color: #2d7a2d; }
.alert-danger   { background: #fff5f5; color: #c01818; border-color: var(--red); }
.alert-warning  { background: #fffbf0; color: #a07000; border-color: var(--gold); }
.alert-info     { background: #f0f7ff; color: #1a5a9a; border-color: #1a5a9a; }
.alert-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  opacity: 0.6;
  padding: 0 0.25rem;
  color: inherit;
}
.alert-close:hover { opacity: 1; }

/* ─── Boutons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-primary   { background: var(--red); color: #fff; border-color: var(--red); }
.btn-primary:hover { background: var(--red-dark); border-color: var(--red-dark); color: #fff; box-shadow: 0 2px 8px rgba(224,32,32,.3); }
.btn-secondary { background: var(--bg-light); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--border); color: var(--text); }
.btn-outline   { background: transparent; color: var(--red); border-color: var(--red); }
.btn-outline:hover { background: var(--red); color: #fff; }
.btn-ghost     { background: transparent; color: var(--muted); border-color: transparent; }
.btn-ghost:hover { background: var(--bg-light); color: var(--text); }
.btn-danger    { background: transparent; color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-sm  { padding: 0.4rem 0.85rem; font-size: 0.82rem; }
.btn-xs  { padding: 0.25rem 0.6rem; font-size: 0.78rem; }
.btn-block { width: 100%; justify-content: center; }

/* ─── Page header ───────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}
.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.page-subtitle {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.25rem;
}
.breadcrumb {
  display: inline-block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
  font-weight: 500;
}
.breadcrumb:hover { color: var(--red); }
.action-group { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.inline-form { display: inline; }

/* ─── Filter bar ────────────────────────────────────────────────────────── */
.filter-bar {
  background: var(--bg-light);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.filter-form {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: flex-end;
}
.filter-group { flex: 1; min-width: 160px; }
.filter-search { max-width: 280px; }

/* ─── Sorties grid ──────────────────────────────────────────────────────── */
.sorties-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}
.sortie-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition), transform var(--transition);
  overflow: hidden;
}
.sortie-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.sortie-card-img {
  width: 100%;
  height: 180px;
  overflow: hidden;
  flex-shrink: 0;
}
.sortie-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.sortie-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--bg-light);
  border-bottom: 1px solid var(--border);
}
.sortie-type {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--red);
  color: #fff;
  padding: 2px 8px;
  border-radius: 2px;
}
.sortie-date {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
}
.sortie-card-body {
  padding: 1rem;
  flex: 1;
}
.sortie-lieu {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text);
}
.sortie-excerpt {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.55;
}
.sortie-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
}
.sortie-meta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.meta-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}
.meta-item svg { width: 13px; height: 13px; }

/* ─── Empty state ───────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--muted);
}
.empty-state svg {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  color: var(--border);
}
.empty-state p { font-size: 1rem; margin-bottom: 1.25rem; }

/* ─── Detail layout ─────────────────────────────────────────────────────── */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2rem;
  align-items: start;
}
.detail-meta-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}
.sortie-type-badge {
  background: var(--red);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 2px;
}
.detail-date {
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 500;
}
.detail-section {
  margin-bottom: 2.5rem;
}
.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--bg-light);
}
.detail-text {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text);
  white-space: pre-wrap;
}

/* ─── Sidebar cards ─────────────────────────────────────────────────────── */
.sidebar-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.sidebar-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.count-badge {
  background: var(--red);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}
.info-list dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  font-weight: 600;
  margin-top: 0.75rem;
}
.info-list dt:first-child { margin-top: 0; }
.info-list dd {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 0.15rem;
}
.personnes-list { display: flex; flex-direction: column; gap: 0.4rem; }
.personne-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--bg-light);
}
.personne-item:last-child { border-bottom: none; }
.personne-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}
.personne-name { font-weight: 600; flex: 1; }
.personne-instrument { font-size: 0.75rem; color: var(--muted); }
.empty-text { font-size: 0.85rem; color: var(--muted); font-style: italic; }

/* ─── Photo gallery ─────────────────────────────────────────────────────── */
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}
.photo-item {
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  aspect-ratio: 4/3;
  background: var(--bg-light);
  transition: opacity var(--transition);
}
.photo-item:hover { opacity: 0.9; }
.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-legende {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.7));
  color: #fff;
  font-size: 0.72rem;
  padding: 0.5rem 0.5rem 0.35rem;
}

/* ─── Lightbox ──────────────────────────────────────────────────────────── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.92);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 2rem;
}
.lightbox.open { display: flex; }
.lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}
.lightbox img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 2px;
}
.lightbox p {
  color: rgba(255,255,255,.8);
  font-size: 0.85rem;
  margin-top: 0.75rem;
  text-align: center;
}
.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  font-size: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}
.lightbox-prev { left: 1.5rem; }
.lightbox-next { right: 1.5rem; }
.lightbox-prev:hover,
.lightbox-next:hover { background: rgba(255,255,255,.35); }
.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  font-size: 1.1rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-close:hover { background: var(--red); }

/* ─── Form ──────────────────────────────────────────────────────────────── */
.form-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1.5rem;
  align-items: start;
}
.form-narrow { max-width: 560px; }
.form-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.form-section-title {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text);
  margin-bottom: 1.25rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--bg-light);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.form-group { margin-bottom: 1rem; }
.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text);
}
.required { color: var(--red); }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.55rem 0.8rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--text);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(224,32,32,.1);
}
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23919191' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}
.form-textarea { resize: vertical; min-height: 160px; line-height: 1.6; }
.form-hint { font-size: 0.75rem; color: var(--muted); margin-top: 0.25rem; }
.form-check { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; }
.check-input {
  width: 16px;
  height: 16px;
  accent-color: var(--red);
  cursor: pointer;
  flex-shrink: 0;
}
.check-label { font-size: 0.875rem; font-weight: 500; cursor: pointer; }
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

/* ─── Personnes checklist (dans formulaire) ───────────────────────────────── */
.personnes-search { margin-bottom: 0.75rem; font-size: 0.82rem; }
.personnes-checklist {
  max-height: 380px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  border-bottom: 1px solid var(--bg-light);
  transition: background var(--transition);
}
.check-row:last-child { border-bottom: none; }
.check-row:hover { background: var(--bg-light); }
.check-row input[type="checkbox"] { accent-color: var(--red); flex-shrink: 0; }
.check-row-info { display: flex; flex-direction: column; min-width: 0; }
.check-row-name { font-size: 0.85rem; font-weight: 600; line-height: 1.3; }
.check-row-detail { font-size: 0.72rem; color: var(--muted); }
.badge-inactif {
  font-size: 0.65rem;
  background: var(--bg-light);
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 2px;
  margin-left: 0.25rem;
  vertical-align: middle;
}
.badge-instrument {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(255,192,5,.15);
  color: #7a5800;
  border: 1px solid rgba(255,192,5,.4);
  padding: 1px 7px;
  border-radius: 2px;
}
.badge-fonction {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(190,87,75,.1);
  color: var(--rust);
  border: 1px solid rgba(190,87,75,.3);
  padding: 1px 7px;
  border-radius: 2px;
}
.personnes-actions {
  display: flex;
  gap: 0.5rem;
}
.sticky-card { position: sticky; top: 80px; }

/* ─── Upload zone ───────────────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 4px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  color: var(--muted);
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--red);
  background: rgba(224,32,32,.03);
}
.upload-zone svg {
  width: 40px;
  height: 40px;
  margin: 0 auto 0.75rem;
  color: var(--border);
}
.upload-zone p { font-size: 0.875rem; margin-bottom: 0.25rem; }
.upload-hint { font-size: 0.75rem; color: var(--muted); }
.upload-label { color: var(--red); font-weight: 600; cursor: pointer; text-decoration: underline; }
.hidden-input { display: none; }

/* ─── Photo preview ─────────────────────────────────────────────────────── */
.photo-preview-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}
.preview-item {
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.preview-item img {
  width: 100%;
  height: 100px;
  object-fit: cover;
}
.preview-info { padding: 0.5rem; }
.preview-name {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.preview-legende { font-size: 0.78rem; padding: 0.3rem 0.5rem; }

/* ─── Photos existantes ─────────────────────────────────────────────────── */
.existing-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}
.existing-photo {
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.existing-photo img {
  width: 100%;
  height: 100px;
  object-fit: cover;
}
.existing-photo form { padding: 0.5rem; }
.photo-legende-small {
  font-size: 0.72rem;
  color: var(--muted);
  padding: 0.25rem 0.5rem 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── Tables ────────────────────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.data-table thead { background: var(--bg-light); }
.data-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  white-space: nowrap;
}
.data-table td {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--bg-light);
  vertical-align: middle;
}
.data-table tbody tr:hover { background: var(--bg-light); }
.row-inactive td { opacity: 0.55; }
.row-current { background: rgba(224,32,32,.03); }
.actions-cell { white-space: nowrap; display: flex; gap: 0.4rem; align-items: center; padding: 0.5rem 1rem; }

/* ─── Badges ────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 2px;
}
.badge-actif   { background: #e6f7e6; color: #2d7a2d; }
.badge-inactif { background: var(--bg-light); color: var(--muted); border: 1px solid var(--border); }
.badge-admin   { background: rgba(224,32,32,.12); color: var(--red); }
.badge-viewer  { background: var(--bg-light); color: var(--muted); }

/* ─── Import CSV ─────────────────────────────────────────────────────────── */
.import-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
  align-items: start;
}
.import-summary {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.summary-card {
  flex: 1;
  min-width: 140px;
  padding: .9rem 1.25rem;
  border-radius: 4px;
  font-size: .875rem;
  font-weight: 500;
}
.summary-card strong {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: .15rem;
}
.summary-ok   { background: #f0faf0; color: #2d7a2d; }
.summary-warn { background: #fff5f5; color: var(--red); }
.summary-info { background: #fffbf0; color: #a07000; }
.csv-header-list { display: flex; flex-direction: column; gap: .6rem; }
.csv-col-item {
  background: var(--bg-light);
  border-radius: 3px;
  padding: .5rem .75rem;
}
.csv-col-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .2rem;
}
.csv-col-name { font-size: .82rem; font-weight: 700; font-family: monospace; color: var(--red); }
.csv-col-ex   { font-size: .75rem; color: var(--muted); }
@media (max-width: 768px) {
  .import-layout { grid-template-columns: 1fr; }
}

/* ─── Error pages ───────────────────────────────────────────────────────── */
.error-page {
  text-align: center;
  padding: 5rem 1rem;
}
.error-code {
  font-size: 5rem;
  font-weight: 700;
  color: var(--red);
  line-height: 1;
  margin-bottom: 0.5rem;
}
.error-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}
.error-page p {
  color: var(--muted);
  margin-bottom: 2rem;
}

/* ─── Login ─────────────────────────────────────────────────────────────── */
.login-body {
  background: var(--bg-light);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-wrapper { width: 100%; max-width: 420px; padding: 1.5rem; }
.login-card {
  background: #fff;
  border-radius: 6px;
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
}
.login-header {
  text-align: center;
  margin-bottom: 2rem;
}
.login-icon {
  width: 48px;
  height: 48px;
  color: var(--red);
  margin: 0 auto 0.75rem;
}
.login-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}
.login-subtitle {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ─── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .detail-layout  { grid-template-columns: 1fr; }
  .form-layout    { grid-template-columns: 1fr; }
  .sticky-card    { position: static; }
  .form-row       { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .navbar-toggle { display: flex; }
  .navbar-nav {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 0.75rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    box-shadow: var(--shadow);
    z-index: 40;
  }
  .navbar-nav.open { display: flex; }
  .navbar-inner { position: relative; }
  .nav-separator { display: none; }
  .nav-username { padding: 0.4rem 0.75rem; }
  .sorties-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .photo-gallery { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .filter-form { flex-direction: column; }
  .filter-group { min-width: auto; }
}

@media (max-width: 480px) {
  .container { padding: 0 1rem; }
  .main-content { padding: 1.25rem 0 2rem; }
  .page-title { font-size: 1.4rem; }
  .members-pdf-grid { grid-template-columns: repeat(2, 1fr); }
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Photo passeport — agrandissement au survol ────────────────────────── */

/* overflow:visible permet à la photo zoomée de déborder hors du tableau */
.table-wrapper--photos {
  overflow: visible;
  border: none;
}
.table-wrapper--photos .data-table {
  border: 1px solid var(--border);
  border-radius: 4px;
}

.photo-passeport-thumb {
  display: block;
  width: 40px;
  min-width: 40px;
  max-width: none;
  height: 60px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid var(--border);
  cursor: zoom-in;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  z-index: 1;
}
.photo-passeport-thumb:hover {
  transform: scale(3);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  z-index: 200;
}

/* ─── Pagination ────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}
.pagination-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  background: var(--bg-light);
  color: var(--text);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.pagination-btn:hover { background: var(--border); color: var(--text); }
.pagination-btn--disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
.pagination-pages {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.pagination-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  background: var(--bg-light);
  color: var(--text);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.pagination-page:hover { background: var(--border); color: var(--text); }
.pagination-page--active {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.pagination-page--active:hover { background: var(--red-dark); color: #fff; }
.pagination-ellipsis {
  padding: 0 0.25rem;
  color: var(--muted);
  font-size: 0.875rem;
}
