:root {
  --cr-primary: #bc0a7f;
  --cr-primary-600: #a6066e;
  --cr-primary-700: #8a0459;
  --cr-primary-soft: #f4abb6;
  --cr-primary-tint: #fde5ec;
  --cr-primary-faint: #fff5f8;
  --cr-accent: #f4abb6;
  --cr-accent-soft: #ffd2db;

  --cr-ink: #1b0d18;
  --cr-ink-soft: #4a3b45;
  --cr-ink-mute: #7a6a72;
  --cr-line: #ecd9e1;
  --cr-line-soft: #f7e6ec;
  --cr-bg: #fff9fb;
  --cr-surface: #ffffff;
  --cr-surface-muted: #fff3f6;

  --cr-success: #2b7a4b;
  --cr-success-bg: #dff3e7;
  --cr-warning: #b87d00;
  --cr-warning-bg: #fff2cf;
  --cr-danger: #b61e4b;
  --cr-danger-bg: #ffe3ec;
  --cr-info: #1f6fa6;
  --cr-info-bg: #d9ecf8;

  --cr-shadow-sm: 0 1px 2px rgba(60, 7, 40, 0.06), 0 1px 1px rgba(60, 7, 40, 0.04);
  --cr-shadow-md: 0 8px 24px -12px rgba(188, 10, 127, 0.28), 0 3px 8px rgba(60, 7, 40, 0.06);
  --cr-shadow-lg: 0 24px 48px -16px rgba(188, 10, 127, 0.35), 0 8px 24px rgba(60, 7, 40, 0.08);

  --cr-radius-xs: 6px;
  --cr-radius-sm: 10px;
  --cr-radius: 14px;
  --cr-radius-lg: 20px;
  --cr-radius-xl: 28px;

  --cr-gradient: linear-gradient(135deg, #bc0a7f 0%, #e43e99 50%, #f4abb6 100%);
  --cr-gradient-soft: linear-gradient(135deg, #fde5ec 0%, #fff5f8 100%);
}
/* ---------- Admin Shell ---------- */
.admin-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  background: #fafafa;
}

.admin-sidebar {
  background: #ffffff;
  border-right: 1px solid #e5e7eb;
  display: flex; flex-direction: column;
  position: sticky; top: 0;
  height: 100vh;
  overflow-y: auto;
}

/* Brand header */
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 16px;
  border-bottom: 1px solid #e5e7eb;
  min-height: 77px;
}
.brand-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  flex-shrink: 0;
}
.brand-name {
  display: flex; flex-direction: column; line-height: 1.1; min-width: 0;
}
.brand-name .title {
  font-family: "Inter", sans-serif;
  font-weight: 600;
  color: #e60076;
  font-size: 16px;
  letter-spacing: -0.4px;
  white-space: nowrap;
}
.brand-name .subtitle {
  font-size: 11px;
  color: #9ca3af;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Nav sections */
.sidebar-nav {
  flex: 1 1 auto;
  padding: 16px 12px;
  display: flex; flex-direction: column; gap: 20px;
  overflow-y: auto;
}
.nav-section {
  display: flex; flex-direction: column; gap: 4px;
}

.nav-section-label {
  font-size: 11px;
  text-transform: uppercase;
  color: #6b7280;
  letter-spacing: 0.1em;
  padding: 4px 12px 6px;
  font-weight: 400;
}

.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  color: #6b7280;
  font-weight: 400;
  font-size: 14px;
  line-height: 21px;
  transition: background .15s ease, color .15s ease;
}
.nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-link:hover { background: #fdf2f8; color: #e60076; }
.nav-link.is-active {
  background: linear-gradient(90deg, #f6339a 0%, #e60076 100%);
  color: #ffffff;
  font-weight: 500;
  box-shadow: 0 4px 6px 0 #fccee8, 0 2px 4px 0 #fccee8;
}
.nav-link.is-active:hover { color: #ffffff; }
.nav-link.is-active svg { color: #ffffff; }

.nav-link .spacer { flex: 1 1 auto; }
.nav-link .badge {
  background: #fce7f3;
  color: #e60076;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0;
}
.nav-link.is-active .badge {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

/* Footer (user + logout) */
.sidebar-footer {
  border-top: 1px solid #e5e7eb;
  padding: 12px;
  display: flex; align-items: center; gap: 10px;
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #fb64b6 0%, #ad46ff 100%);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 500; font-size: 12px;
  flex-shrink: 0;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; flex: 1; }
.user-meta .name {
  font-weight: 400; font-size: 13px; color: #1a1a2e;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-meta .role {
  font-size: 11px; color: #6b7280; text-transform: capitalize;
}
.sign-out-btn {
  background: transparent; border: none; cursor: pointer;
  padding: 8px; border-radius: 10px;
  color: #6b7280;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s ease, color .15s ease;
}
.sign-out-btn:hover { background: #fdf2f8; color: #e60076; }

/* ---------- Main ---------- */
.admin-main {
  padding: 32px;
  min-width: 0;
  background: #fafafa;
}

/* ---------- Entrance animation ---------- */
@keyframes cr-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.admin-main .page-header,
.admin-main .filter-bar,
.admin-main .table-wrap {
  animation: cr-fade-up 0.35s ease-out both;
}
.admin-main .page-header { animation-delay: 0ms; }
.admin-main .filter-bar  { animation-delay: 80ms; }
.admin-main .table-wrap  { animation-delay: 160ms; }

@media (prefers-reduced-motion: reduce) {
  .admin-main .page-header,
  .admin-main .filter-bar,
  .admin-main .table-wrap { animation: none; }
}

/* ---------- Mobile topbar + sidebar drawer ---------- */
.mobile-topbar { display: none; }
.sidebar-backdrop { display: none; }
.sidebar-close-btn { display: none; }

@media (max-width: 900px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  /* Sidebar devient un drawer qui glisse depuis la gauche */
  .admin-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 280px; max-width: 85vw;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform .28s ease;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
    height: 100vh;
  }
  .admin-sidebar.is-open { transform: translateX(0); }

  /* Backdrop au dessus du contenu quand le drawer est ouvert */
  .sidebar-backdrop {
    display: block;
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.35);
    z-index: 99;
    opacity: 0; pointer-events: none;
    transition: opacity .2s ease;
  }
  body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  body.sidebar-open { overflow: hidden; }

  /* Bouton fermer dans le drawer */
  .sidebar-close-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #6b7280;
    cursor: pointer;
    margin-left: auto;
    transition: background .15s ease, color .15s ease;
  }
  .sidebar-close-btn:hover { background: #fdf2f8; color: #e60076; }

  /* Barre supérieure mobile avec le bouton hamburger */
  .mobile-topbar {
    display: flex; align-items: center; gap: 14px;
    position: sticky; top: 0; z-index: 50;
    background: #ffffff;
    padding: 10px 16px;
    border-bottom: 1px solid #e5e7eb;
    min-height: 60px;
  }
  .mobile-menu-btn {
    width: 40px; height: 40px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    color: #1a1a2e;
    flex-shrink: 0;
    transition: background .15s ease, color .15s ease;
  }
  .mobile-menu-btn:hover { background: #fdf2f8; color: #e60076; }
  .mobile-brand {
    height: 36px; width: auto; object-fit: contain; display: block;
  }

  /* Espacement main plus compact */
  .admin-main { padding: 18px 16px 48px; }

  /* Header de page empilé */
  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .page-header h1 { font-size: 22px; line-height: 30px; }
  .page-header .subtitle { font-size: 14px; line-height: 20px; }
  .page-header .actions { width: 100%; }
  .page-header .actions .btn,
  .page-header .actions .btn-primary { width: 100%; justify-content: center; }

  /* Grids empilés */
  .stats-grid { grid-template-columns: 1fr; gap: 12px; }
  .stat-card { padding: 18px; min-height: 0; }

  .chart-grid { grid-template-columns: 1fr !important; gap: 12px; }
  .chart-card { padding: 18px; }
  .chart-card.is-fill { min-height: 460px; }
  .chart-card-tall { min-height: 520px; }

  .detail-grid { grid-template-columns: 1fr !important; gap: 16px; }

  /* Filter bar */
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .filter-bar .search-box,
  .filter-bar .filter-dropdown,
  .filter-bar select { width: 100%; max-width: none; flex: none; }

  /* Table scrolle horizontalement au besoin */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.data-table { min-width: 640px; }

  /* Pagination */
  .pagination { flex-direction: column; align-items: stretch; gap: 12px; }

  /* ---------- Map ---------- */
  .map-wrap {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
    gap: 12px;
  }
  .map-sidebar {
    order: 2;
    max-height: none;
  }
  .map-sidebar .list { max-height: 300px; }
  .map-container {
    order: 1;
    height: 56vh;
    min-height: 360px;
  }

  /* ---------- Auth ---------- */
  .auth-shell { grid-template-columns: 1fr; }
  .auth-hero { padding: 28px 24px; }
  .auth-form-panel { padding: 28px 24px; }

  /* ---------- Detail (show structure) ---------- */
  .detail-head {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .detail-actions { flex-wrap: wrap; }
  .detail-actions > * { flex: 1 1 140px; justify-content: center; }
}

/* Tout petit écran : typographie et espacement encore plus compacts */
@media (max-width: 480px) {
  .admin-main { padding: 14px 12px 40px; }
  .stat-card .value { font-size: 26px; line-height: 28px; }
  .page-header h1 { font-size: 20px; line-height: 28px; }
  .map-container { height: 52vh; min-height: 320px; }
}

.page-header {
  display: flex; justify-content: space-between; align-items: center;
  gap: 20px; margin-bottom: 24px;
}
.page-header h1 {
  margin: 0;
  font-family: "Inter", sans-serif;
  font-weight: 500;
  font-size: 28px;
  line-height: 42px;
  color: #1a1a2e;
  letter-spacing: 0;
}
.page-header .subtitle {
  color: #6b7280;
  font-size: 15px;
  line-height: 22.5px;
  margin-top: 2px;
}
.page-header .actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Pink gradient CTA aligned on the figma design */
.page-header .btn-primary {
  background: linear-gradient(90deg, #f6339a 0%, #ec003f 100%);
  border-radius: 16px;
  padding: 10px 20px;
  font-weight: 500;
  font-size: 16px;
  line-height: 24px;
  color: #ffffff;
  box-shadow: 0 10px 15px 0 #fccee8, 0 4px 6px 0 #fccee8;
}
.page-header .btn-primary:hover { filter: brightness(1.04); }

/* ---------- Stat grid ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 21px;
  border: 1px solid #f3f4f6;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px;
  min-height: 122px;
}
.stat-card .content {
  display: flex; flex-direction: column;
  flex: 1; min-width: 0;
}
.stat-card .label {
  font-size: 12px;
  color: #6b7280;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  line-height: 18px;
  font-weight: 400;
  margin: 0;
}
.stat-card .value {
  font-family: "Inter", sans-serif;
  font-size: 32px;
  line-height: 32px;
  font-weight: 400;
  color: #1a1a2e;
  margin: 12px 0 10px;
}
.stat-card .trend {
  font-size: 12px;
  line-height: 18px;
  color: #6b7280;
}
.stat-card .icon {
  width: 40px; height: 40px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.1);
  background: linear-gradient(135deg, #f6339a 0%, #ff2056 100%);
}
.stat-card .icon svg { width: 20px; height: 20px; }
.stat-card.coral  .icon { background: linear-gradient(135deg, #00bc7d 0%, #00c950 100%); }
.stat-card.purple .icon { background: linear-gradient(135deg, #fe9a00 0%, #ff6900 100%); }
.stat-card.teal   .icon { background: linear-gradient(135deg, #2b7fff 0%, #615fff 100%); }

/* ---------- Chart blocks ---------- */
.chart-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 1000px) { .chart-grid { grid-template-columns: 1fr; } }
.chart-card {
  background: #ffffff;
  border: 1px solid #f3f4f6;
  border-radius: 16px;
  padding: 25px;
  box-shadow: none;
}
.chart-card .card-title {
  font-family: "Inter", sans-serif;
  font-weight: 500;
  font-size: 16px;
  line-height: 24px;
  color: #1a1a2e;
}
.chart-card canvas { max-width: 100%; }
.chart-card.is-fill { display: flex; flex-direction: column; }
.chart-card.is-fill > [data-controller="chart"] { flex: 1; position: relative; min-height: 0; }
.chart-card.is-fill > [data-controller="chart"] > canvas { width: 100% !important; height: 100% !important; max-height: none !important; }

/* Taller card for charts that need to show every label (e.g. all regions). */
.chart-card-tall { min-height: 520px; }

/* ---------- Recent structures list ---------- */
.recent-list {
  list-style: none;
  padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 4px;
}
.recent-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  transition: background .15s ease;
}
.recent-item:hover { background: #fdf2f8; }
.recent-item .thumb {
  width: 36px; height: 36px;
  background: #fdf2f8;
  color: #e60076;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.recent-item .thumb svg { width: 16px; height: 16px; }
.recent-item .body { flex: 1; min-width: 0; }
.recent-item .name {
  font-size: 14px; line-height: 21px; color: #1a1a2e;
  font-weight: 400; text-decoration: none;
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.recent-item .meta {
  font-size: 12px; line-height: 18px; color: #6b7280;
  display: flex; align-items: center; gap: 6px;
  margin-top: 1px;
}
.recent-item .meta svg { width: 12px; height: 12px; flex-shrink: 0; }
.recent-item .pill {
  padding: 4px 10px;
  font-size: 12px;
  line-height: 18px;
  border-radius: 999px;
  flex-shrink: 0;
}

/* Pills tuned to Figma (neutral backgrounds) */
.pill-status-to_recall  { background: #eff6ff; color: #155dfc; }
.pill-status-verified   { background: #ecfdf5; color: #009966; }
.pill-status-pending    { background: #fff7ed; color: #d97706; }
.pill-status-incomplete { background: #f3e8ff; color: #7c3aed; }
.pill-status-unverified { background: #fef2f2; color: #dc2626; }

/* Activity empty state (pink icon tile) */
.activity-empty {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px;
  padding: 60px 0;
  color: #6b7280;
}
.activity-empty .tile {
  width: 64px; height: 64px;
  background: #fdf2f8;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  color: #e60076;
}
.activity-empty .tile svg { width: 28px; height: 28px; }
.activity-empty p {
  margin: 0;
  font-size: 14px; line-height: 21px;
  color: #6b7280;
  text-align: center;
}

.activity-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 12px;
}
.activity-list li { padding: 10px 0; border-bottom: 1px solid #f3f4f6; }
.activity-list li:last-child { border-bottom: 0; }

/* ---------- Structures list ---------- */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  background: #ffffff;
  border: 1px solid #f3f4f6;
  border-radius: 16px;
  padding: 17px;
  margin-bottom: 24px;
  box-shadow: none;
}
.filter-bar .search-box,
.filter-bar .filter-dropdown { position: relative; display: block; }
.filter-bar .search-box { flex: 1 1 300px; }
.filter-bar .filter-dropdown { flex: 0 0 auto; min-width: 190px; }
.filter-bar .filter-dropdown:nth-of-type(2) { min-width: 210px; }
.filter-bar .filter-dropdown:nth-of-type(3) { min-width: 170px; }
.filter-bar .search-box input,
.filter-bar .filter-dropdown select { width: 100%; }

.filter-bar .search-box > svg,
.filter-bar .filter-dropdown > svg {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: #6b7280;
  width: 16px; height: 16px;
  pointer-events: none;
}

.filter-bar input[type="search"],
.filter-bar input[type="text"],
.filter-bar select {
  height: 43px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 10px 16px 10px 44px;
  font-size: 14px;
  color: #1a1a2e;
  box-shadow: none;
  line-height: 1.3;
}
.filter-bar input::placeholder { color: rgba(26, 26, 46, 0.5); }
.filter-bar select {
  appearance: none;
  -webkit-appearance: none;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}
.filter-bar input:focus,
.filter-bar select:focus {
  border-color: var(--cr-primary);
  box-shadow: 0 0 0 3px var(--cr-primary-tint);
}

/* ---------- Status pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 400;
  line-height: 18px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.pill::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.pill-verified   { background: #ecfdf5; color: #009966; border-color: #d0fae5; }
.pill-pending    { background: #faf5ff; color: #9810fa; border-color: #f3e8ff; }
.pill-to_recall  { background: #eff6ff; color: #155dfc; border-color: #dbeafe; }
.pill-incomplete { background: #fef3c7; color: #e17100; border-color: #fde68a; }
.pill-unverified { background: #fef2f2; color: #dc2626; border-color: #fecaca; }

/* Alias with `pill-status-*` prefix (dashboard / other consumers). */
.pill-status-verified   { background: #ecfdf5; color: #009966; border: 1px solid #d0fae5; }
.pill-status-pending    { background: #faf5ff; color: #9810fa; border: 1px solid #f3e8ff; }
.pill-status-to_recall  { background: #eff6ff; color: #155dfc; border: 1px solid #dbeafe; }
.pill-status-incomplete { background: #fef3c7; color: #e17100; border: 1px solid #fde68a; }
.pill-status-unverified { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }

/* ---------- Show page ---------- */
.detail-back {
  display: inline-flex; align-items: center; gap: 6px;
  color: #e60076;
  font-size: 14px;
  font-weight: 500;
  line-height: 21px;
  padding: 4px 0;
  margin-bottom: 24px;
  background: none;
  border: 0;
  text-decoration: none;
}
.detail-back:hover { color: #be185d; }
.detail-back svg { width: 16px; height: 16px; }

.detail-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
.detail-head .title {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 500;
  line-height: 32.5px;
  color: #1a1a2e;
  letter-spacing: -0.2px;
}
.detail-head .meta {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 10px;
  font-size: 14px;
  line-height: 21px;
  color: #6b7280;
}
.detail-head .meta .location {
  display: inline-flex; align-items: center; gap: 6px;
}
.detail-head .meta .location svg { width: 14px; height: 14px; color: #6b7280; }
.detail-head .meta .muted { color: #9ca3af; }

.detail-actions {
  display: flex; gap: 8px; align-items: stretch;
  flex-shrink: 0;
}
.detail-actions form { display: inline-flex; margin: 0; }
.detail-actions form .btn-danger-soft { width: 100%; justify-content: center; }

.btn-outline-soft {
  display: inline-flex; align-items: center; gap: 8px;
  background: #ffffff;
  color: #1a1a2e;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  line-height: 21px;
  box-shadow: none;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
  cursor: pointer;
}
.btn-outline-soft:hover { background: #fafafa; border-color: #d1d5db; color: #1a1a2e; }
.btn-outline-soft svg { width: 16px; height: 16px; }

.btn-danger-soft {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fef2f2;
  color: #e7000b;
  border: 1px solid #ffe2e2;
  border-radius: 16px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  line-height: 21px;
  box-shadow: none;
  transition: background .15s ease, border-color .15s ease;
  cursor: pointer;
}
.btn-danger-soft:hover { background: #fee2e2; border-color: #fca5a5; color: #e7000b; }
.btn-danger-soft svg { width: 16px; height: 16px; }

/* Layout */
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  align-items: start;
}
@media (max-width: 1100px) { .detail-grid { grid-template-columns: 1fr; } }

.detail-stack {
  display: flex; flex-direction: column; gap: 20px;
  min-width: 0;
}

/* Card */
.detail-card {
  background: #ffffff;
  border: 1px solid #f3f4f6;
  border-radius: 16px;
  padding: 21px;
  box-shadow: none;
}
.detail-card-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px;
}
.detail-icon-badge {
  width: 36px; height: 36px;
  border-radius: 16px;
  background: #f9fafb;
  display: inline-flex; align-items: center; justify-content: center;
  color: #1a1a2e;
  flex-shrink: 0;
}
.detail-icon-badge svg { width: 20px; height: 20px; }
.detail-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  color: #1a1a2e;
}

.detail-card p {
  margin: 0;
  font-size: 14px;
  line-height: 22.75px;
  color: #6b7280;
}
.detail-card .description {
  white-space: pre-wrap;
  margin-bottom: 16px;
}

/* Info rows (label + value) */
.info-list {
  display: flex; flex-direction: column; gap: 12px;
}
.info-row {
  display: flex; gap: 12px; align-items: flex-start;
}
.info-row .label {
  flex-shrink: 0;
  width: 144px;
  padding-top: 2px;
  font-size: 13px;
  line-height: 19.5px;
  color: #6b7280;
  display: inline-flex; align-items: center; gap: 6px;
}
.info-row .label svg { width: 16px; height: 16px; color: #6b7280; }
.info-row .value {
  flex: 1; min-width: 0;
  font-size: 14px;
  line-height: 22.75px;
  color: #1a1a2e;
  word-break: break-word;
}

/* Category chips (pink) */
.chip-row {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.chip-category {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: #fdf2f8;
  border: 1px solid #fce7f3;
  color: #e60076;
  font-size: 12px;
  line-height: 18px;
  border-radius: 999px;
  white-space: nowrap;
}
.chip-category svg { width: 14px; height: 14px; }

/* Contact / Localisation rows with icon box */
.contact-list {
  display: flex; flex-direction: column; gap: 12px;
}
.contact-row {
  display: flex; gap: 12px; align-items: flex-start;
}
.contact-row .icon-box {
  flex-shrink: 0;
  width: 32px; height: 32px;
  margin-top: 2px;
  background: #f9fafb;
  border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #1a1a2e;
}
.contact-row .icon-box svg { width: 16px; height: 16px; }
.contact-row .body {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 1px;
}
.contact-row .body .label {
  font-size: 11px;
  line-height: 16.5px;
  color: #6b7280;
}
.contact-row .body .value {
  font-size: 14px;
  line-height: 21px;
  color: #1a1a2e;
  word-break: break-word;
}
.contact-row .body .value a { color: #1a1a2e; text-decoration: none; }
.contact-row .body .value a:hover { color: #e60076; }
.contact-row .body .value.link { color: #e60076; }
.contact-row .body .value.link a { color: #e60076; }

/* Footer sub-row inside a card (Contact référent / Coordonnées / Régions d'intervention) */
.detail-subrow {
  border-top: 1px solid #f3f4f6;
  padding-top: 13px;
  margin-top: 4px;
  display: flex; flex-direction: column; gap: 4px;
}
.detail-subrow .label {
  font-size: 12px;
  line-height: 18px;
  color: #6b7280;
}
.detail-subrow .value {
  font-size: 14px;
  line-height: 21px;
  color: #1a1a2e;
}
.detail-subrow .coords {
  font-size: 13px;
  line-height: 19.5px;
  color: #1a1a2e;
}

.maps-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: #e60076;
  font-size: 13px;
  line-height: 19.5px;
  text-decoration: none;
  margin-top: 2px;
}
.maps-link:hover { color: #be185d; }
.maps-link svg { width: 14px; height: 14px; }

/* Day chips (opening) */
.day-row {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.day-chip {
  display: inline-flex; align-items: center;
  padding: 4.5px 10px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 18px;
  font-weight: 400;
  background: #f9fafb;
  border: 1px solid #f3f4f6;
  color: #6b7280;
  white-space: nowrap;
}
.day-chip.is-open {
  background: #ecfdf5;
  border-color: #d0fae5;
  color: #009966;
}

/* Region pill (intervention) */
.pill-region {
  display: inline-flex; align-items: center;
  padding: 2.5px 10px;
  background: #eff6ff;
  color: #155dfc;
  border-radius: 999px;
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
}

/* Activity list on detail page */
.activity-log-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.activity-log-list li {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: 14px;
  line-height: 21px;
  color: #1a1a2e;
}
.activity-log-list li:last-child { border-bottom: 0; }
.activity-log-list li .time {
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Pill inside detail header (inherit status colors from .pill-*) */
.detail-head .pill {
  padding: 5px 10px;
  font-size: 12px;
  line-height: 18px;
}

/* Fallback for old .kv utility still used elsewhere */
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 10px 16px; font-size: 0.9rem; }
.kv dt { color: var(--cr-ink-mute); font-weight: 500; }
.kv dd { margin: 0; color: var(--cr-ink); word-break: break-word; }

/* ---------- Map ---------- */
.map-wrap {
  display: grid;
  grid-template-columns: 471px 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 1100px) { .map-wrap { grid-template-columns: 1fr; } }

.map-sidebar {
  display: flex; flex-direction: column; gap: 16px;
  min-width: 0;
}

.map-sidebar .filters {
  background: #ffffff;
  border: 1px solid #f3f4f6;
  border-radius: 16px;
  padding: 17px;
  display: flex; flex-direction: column; gap: 12px;
}

.map-sidebar .filters .search-box,
.map-sidebar .filters .filter-dropdown {
  position: relative; display: block;
}
.map-sidebar .filters .search-box > svg,
.map-sidebar .filters .filter-dropdown > svg {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: #6b7280;
  width: 16px; height: 16px;
  pointer-events: none;
}
.map-sidebar .filters input[type="search"],
.map-sidebar .filters select {
  width: 100%;
  height: 43px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 10px 16px 10px 40px;
  font-size: 14px;
  color: #1a1a2e;
  box-shadow: none;
  line-height: 1.3;
}
.map-sidebar .filters input::placeholder { color: rgba(26, 26, 46, 0.5); }
.map-sidebar .filters select {
  appearance: none;
  -webkit-appearance: none;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 34px;
  cursor: pointer;
}
.map-sidebar .filters input:focus,
.map-sidebar .filters select:focus {
  border-color: var(--cr-primary);
  box-shadow: 0 0 0 3px var(--cr-primary-tint);
  outline: none;
}
.map-sidebar .filters .filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.map-sidebar .results-count {
  padding-left: 4px;
  font-size: 13px;
  color: #6b7280;
  line-height: 1.5;
}

.map-sidebar .list {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 560px;
  overflow-y: auto;
  padding-right: 4px;
  margin: 0;
}

.map-sidebar .list-item {
  background: #ffffff;
  border: 1px solid #f3f4f6;
  border-radius: 16px;
  padding: 16px 17px;
  cursor: pointer;
  display: flex; gap: 12px; align-items: flex-start;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.map-sidebar .list-item:hover {
  border-color: #fbcfe8;
  box-shadow: 0 1px 3px rgba(230, 0, 118, 0.06);
}
.map-sidebar .list-item.is-active {
  border-color: #f6339a;
  background: #fdf2f8;
}

.map-sidebar .list-item .list-item-dot {
  flex-shrink: 0;
  width: 12px; height: 12px;
  margin-top: 5px;
  border-radius: 50%;
}

.map-sidebar .list-item .list-item-body {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
}

.map-sidebar .list-item .list-item-title {
  font-size: 14px;
  line-height: 21px;
  color: #1a1a2e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-sidebar .list-item .list-item-meta {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px;
  line-height: 18px;
  color: #6b7280;
}
.map-sidebar .list-item .list-item-meta svg {
  width: 12px; height: 12px;
  flex-shrink: 0;
}
.map-sidebar .list-item .list-item-meta .meta-chunk {
  display: inline-flex; align-items: center; gap: 4px;
  min-width: 0;
}
.map-sidebar .list-item .list-item-meta .sep { color: #6b7280; }

.map-column {
  display: flex; flex-direction: column; gap: 16px;
  min-width: 0;
}

.map-container {
  position: relative;
  border-radius: var(--cr-radius-lg);
  border: 1px solid var(--cr-line-soft);
  overflow: hidden;
  box-shadow: var(--cr-shadow-sm);
  background: linear-gradient(180deg, #f6f8fc 0%, #e9edf6 100%);
  min-height: 520px;
}

/* D3 map canvas */
.cr-map-svg {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  user-select: none;
}
.cr-map-svg:active { cursor: grabbing; }

.cr-region {
  stroke: #c97aa8;
  stroke-width: 0.9;
  stroke-linejoin: round;
  transition: fill 0.18s ease, filter 0.18s ease;
  cursor: pointer;
}
.cr-region.is-hover { fill: #ffd6ea !important; filter: brightness(1.02); }
.cr-region.is-active {
  fill: #f9b3d4 !important;
  stroke: var(--cr-primary);
  stroke-width: 1.8;
}

.cr-region-label {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  fill: #6b0c4e;
  paint-order: stroke fill;
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 3;
  stroke-linejoin: round;
  letter-spacing: 0.2px;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.cr-marker {
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.cr-marker:hover { opacity: 1 !important; }

/* Tooltip */
.cr-tip {
  position: absolute;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(6px);
  padding: 8px 11px;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14);
  border: 1px solid rgba(188, 10, 127, 0.12);
  font-size: 12px;
  z-index: 5;
  max-width: 220px;
  line-height: 1.35;
  transform: translateZ(0);
}
.cr-tip-title {
  font-weight: 600;
  color: var(--cr-ink);
  font-size: 13px;
  margin-bottom: 2px;
}
.cr-tip-sub {
  color: var(--cr-ink-mute);
  font-size: 11px;
}

/* Zoom controls */
.map-zoom-controls {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 4;
}
.map-zoom-btn {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff;
  color: var(--cr-primary);
  border: 1px solid var(--cr-line-soft);
  border-radius: 10px;
  cursor: pointer;
  box-shadow: var(--cr-shadow-sm);
  transition: transform 0.12s ease, background 0.15s ease, color 0.15s ease;
}
.map-zoom-btn:hover {
  background: var(--cr-primary-tint);
  transform: translateY(-1px);
}
.map-zoom-btn:active { transform: translateY(0); }

/* ---------- Map legend ---------- */
.map-legend {
  margin: 0;
  padding: 17px;
  background: #ffffff;
  border: 1px solid #f3f4f6;
  border-radius: 16px;
  box-shadow: none;
}
.map-legend-title {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 400;
  color: #6b7280;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  line-height: 18px;
}
.map-legend-items {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 16px;
}
@media (max-width: 900px) {
  .map-legend-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.map-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  line-height: 18px;
  color: #6b7280;
}
.map-legend-swatch {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.map-legend-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Map modal: structure card (harmonisé avec /admin/structures/show) ---------- */
.mc {
  display: flex; flex-direction: column;
  gap: 20px;
  line-height: 1.5;
  color: #1a1a2e;
}

.mc > .description {
  margin: 0;
  font-size: 14px;
  line-height: 21px;
  color: #4b5563;
}

.mc-section {
  padding-top: 18px;
  border-top: 1px solid #f3f4f6;
}
.mc-section:first-of-type { padding-top: 0; border-top: 0; }

.mc .detail-card-header { margin-bottom: 12px; }

/* Modal body */
.modal-body {
  padding: 22px 26px;
  line-height: 1.5;
  scroll-behavior: smooth;
  color: #1a1a2e;
}
.modal-body.is-loading { opacity: .5; pointer-events: none; }

/* Modal body itself: give content more room + improve scroll feel */
.modal-body {
  padding: 22px 26px;
  line-height: 1.6;
  scroll-behavior: smooth;
}
.modal-body.is-loading { opacity: .5; pointer-events: none; }

/* ---------- Login page ---------- */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--cr-bg);
}
@media (max-width: 900px) { .auth-shell { grid-template-columns: 1fr; } }

.auth-hero {
  background: var(--cr-gradient);
  color: white;
  padding: 48px;
  display: flex; flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.auth-hero::before {
  content: ""; position: absolute;
  width: 520px; height: 520px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  top: -200px; right: -200px;
}
.auth-hero::after {
  content: ""; position: absolute;
  width: 360px; height: 360px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 50%;
  bottom: -160px; left: -140px;
}
.auth-hero .hero-brand {
  display: flex; gap: 14px; align-items: center; position: relative; margin-bottom: 20px;
}
.auth-hero .hero-brand .brand-mark {
  background: white; color: var(--cr-primary); box-shadow: none;
}
.auth-logo { width: 156px; object-fit: contain; display: block; }
.auth-hero .hero-body { position: relative; max-width: 480px; }
.auth-hero h1 { color: white; font-size: 2.4rem; line-height: 1.15; margin-bottom: 12px; }
.auth-hero p { opacity: 0.9; margin-bottom: 18px; }
.auth-hero .illus { position: relative; max-width: 360px; margin-top: auto; }
.auth-hero .illus svg { width: 100%; height: auto; }
.auth-form-panel {
  display: flex; align-items: center; justify-content: center;
  padding: 48px;
}
.auth-form {
  width: 100%; max-width: 380px;
}
.auth-form h2 { margin-bottom: 8px; }
.auth-form p.lede { color: var(--cr-ink-mute); margin-bottom: 28px; }

/* ---------- Structure form wizard (new / edit) ---------- */
.form-page-header {
  margin: 0 auto 24px;
  max-width: 940px;
}
.admin-main > .detail-back {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  max-width: 940px;
  margin-left: auto;
  margin-right: auto;
}
.form-page-header .title {
  margin: 0 0 4px;
  font-size: 28px;
  font-weight: 500;
  line-height: 42px;
  color: #1a1a2e;
  letter-spacing: -0.2px;
}
.form-page-header .subtitle {
  margin: 0;
  font-size: 15px;
  line-height: 22.5px;
  color: #6b7280;
}

.form-wizard {
  display: flex; flex-direction: column; gap: 20px;
  max-width: 940px;
  margin: 0 auto;
  width: 100%;
}

/* Tab bar card */
.wizard-tabbar {
  background: #ffffff;
  border: 1px solid #f3f4f6;
  border-radius: 16px;
  padding: 17px;
  display: flex; flex-direction: column; gap: 12px;
}
.wizard-tabs {
  display: flex; gap: 4px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin: -4px;
  padding: 4px;
  scrollbar-width: thin;
}
.wizard-tab {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 16px;
  font-family: inherit;
  font-size: 13px;
  line-height: 19.5px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
  white-space: nowrap;
  appearance: none;
  -webkit-appearance: none;
}
.wizard-tab:hover { color: #1a1a2e; }
.wizard-tab .tab-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: 12px;
  background: #f3f4f6;
  color: #6b7280;
  flex-shrink: 0;
  transition: background .15s ease, color .15s ease;
}
.wizard-tab .tab-icon svg { width: 14px; height: 14px; }
.wizard-tab.is-active {
  background: #fdf2f8;
  border-color: #fccee8;
  color: #e60076;
  padding: 8px 13px;
}
.wizard-tab.is-active .tab-icon {
  background: #f6339a;
  color: #ffffff;
}
.wizard-tab.is-complete .tab-icon {
  background: #fdf2f8;
  color: #e60076;
}

/* Progress bar */
.wizard-progress {
  position: relative;
  width: 100%;
  height: 6px;
  background: #f3f4f6;
  border-radius: 999px;
  overflow: hidden;
}
.wizard-progress-fill {
  position: absolute; inset: 0 auto 0 0;
  height: 100%;
  background: linear-gradient(90deg, #f6339a 0%, #ff2056 100%);
  border-radius: 999px;
  transition: width .25s ease;
}

/* Content card */
.wizard-card {
  background: #ffffff;
  border: 1px solid #f3f4f6;
  border-radius: 16px;
  padding: 25px;
}

.wizard-step { display: none; flex-direction: column; gap: 20px; }
.wizard-step.is-active { display: flex; }

.wizard-step-header {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 17px;
  border-bottom: 1px solid #f3f4f6;
}
.wizard-step-header .icon-badge {
  width: 40px; height: 40px;
  background: #f9fafb;
  border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #1a1a2e;
  flex-shrink: 0;
}
.wizard-step-header .icon-badge svg { width: 20px; height: 20px; }
.wizard-step-header .title {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  line-height: 25.5px;
  color: #1a1a2e;
}
.wizard-step-header .subtitle {
  margin: 0;
  font-size: 13px;
  line-height: 19.5px;
  color: #6b7280;
}

/* Fields */
.wizard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.wizard-grid .full { grid-column: 1 / -1; }
@media (max-width: 720px) { .wizard-grid { grid-template-columns: 1fr; } }

.wizard-field {
  display: flex; flex-direction: column; gap: 6px;
  min-width: 0;
}
.wizard-field > label,
.wizard-field .field-label {
  display: inline-flex; align-items: center; gap: 4px;
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  line-height: 19.5px;
  color: #1a1a2e;
}
.wizard-field .required { color: #f6339a; }
.wizard-field .help {
  font-size: 12px;
  line-height: 18px;
  color: #6b7280;
}

.wizard-field input[type="text"],
.wizard-field input[type="email"],
.wizard-field input[type="tel"],
.wizard-field input[type="url"],
.wizard-field input[type="number"],
.wizard-field input[type="search"],
.wizard-field select,
.wizard-field textarea {
  width: 100%;
  height: 43px;
  padding: 10px 14px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  font-size: 14px;
  line-height: 21px;
  color: #1a1a2e;
  box-shadow: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.wizard-field textarea {
  height: auto;
  min-height: 106px;
  line-height: 21px;
  resize: vertical;
}
.wizard-field input::placeholder,
.wizard-field textarea::placeholder { color: rgba(26, 26, 46, 0.5); }
.wizard-field input:focus,
.wizard-field select:focus,
.wizard-field textarea:focus {
  outline: none;
  background: #ffffff;
  border-color: #f6339a;
  box-shadow: 0 0 0 3px #fce7f3;
}

.wizard-field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}

/* Chip selector */
.wizard-chip-row {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.wizard-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6.5px 12px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
  color: #6b7280;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
  user-select: none;
  white-space: nowrap;
}
.wizard-chip:hover { border-color: #fccee8; color: #be185d; }
.wizard-chip input[type="checkbox"] { display: none; }
.wizard-chip.is-active {
  background: #fdf2f8;
  border-color: #fccee8;
  color: #e60076;
}
.wizard-chip svg { width: 14px; height: 14px; }

/* Checkbox (single boolean) */
.wizard-switch {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 14px;
  line-height: 21px;
  color: #1a1a2e;
  cursor: pointer;
}
.wizard-switch input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: #e60076;
  cursor: pointer;
}

/* Wizard actions */
.wizard-actions {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 4px;
}
.wizard-actions form { margin: 0; display: inline-flex; }

.btn-step-prev,
.btn-step-next,
.btn-step-submit {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  border-radius: 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 21px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
  appearance: none;
  -webkit-appearance: none;
}

.btn-step-prev {
  background: #ffffff;
  color: #1a1a2e;
  border: 1px solid #f3f4f6;
}
.btn-step-prev:hover { border-color: #e5e7eb; background: #fafafa; }
.btn-step-prev:disabled,
.btn-step-prev[aria-disabled="true"] {
  color: #d1d5dc;
  border-color: #f3f4f6;
  background: #ffffff;
  cursor: not-allowed;
}
.btn-step-prev svg { width: 16px; height: 16px; }

.btn-step-next {
  background: #f3f4f6;
  color: #99a1af;
  border: 1px solid #f3f4f6;
}
.btn-step-next.is-ready,
.btn-step-next:hover {
  background: linear-gradient(90deg, #f6339a 0%, #ff2056 100%);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 6px 0 #fccee8, 0 2px 4px 0 #fccee8;
}
.btn-step-next svg { width: 16px; height: 16px; }

.btn-step-submit {
  background: linear-gradient(90deg, #f6339a 0%, #ff2056 100%);
  color: #ffffff;
  border: 0;
  box-shadow: 0 4px 6px 0 #fccee8, 0 2px 4px 0 #fccee8;
}
.btn-step-submit:hover { filter: brightness(1.04); }
.btn-step-submit svg { width: 16px; height: 16px; }

/* Error banner tuned for wizard */
.form-wizard .error-banner {
  border-left: 4px solid #e7000b;
  border-radius: 12px;
  background: #fef2f2;
  color: #b91c1c;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--cr-ink);
  background: var(--cr-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5 {
  font-family: "Poppins", "Inter", sans-serif;
  color: var(--cr-ink);
  margin: 0 0 0.4em;
  letter-spacing: -0.01em;
  font-weight: 600;
}

h1 { font-size: 1.9rem; line-height: 1.2; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }

a {
  color: var(--cr-primary);
  text-decoration: none;
  transition: color .15s ease;
}
a:hover { color: var(--cr-primary-700); }

p { margin: 0 0 0.9em; }

::selection { background: var(--cr-primary-tint); color: var(--cr-primary-700); }

/* Utility */
.text-mute { color: var(--cr-ink-mute); }
.text-sm { font-size: 0.86rem; }
.text-xs { font-size: 0.76rem; }
.mono { font-family: "JetBrains Mono", "SF Mono", Menlo, monospace; }
.center { display: flex; align-items: center; justify-content: center; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.spacer { flex: 1 1 auto; }
.hidden { display: none !important; }

.flash {
  position: fixed; top: 18px; right: 18px; z-index: 50;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.flash > div {
  padding: 12px 18px;
  border-radius: var(--cr-radius);
  background: var(--cr-surface);
  box-shadow: var(--cr-shadow-lg);
  pointer-events: auto;
  min-width: 260px;
}
.flash .notice { border-left-color: var(--cr-success); color: var(--cr-success); }
.flash .alert  { color: var(--cr-danger);  }
/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--cr-surface);
  color: var(--cr-ink);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
  text-decoration: none;
  line-height: 1.1;
  white-space: nowrap;
}
.btn:hover { box-shadow: var(--cr-shadow-md); }
.btn:active { transform: translateY(1px); }

.btn svg { width: 18px; height: 18px; }

.btn-primary {
  background: var(--cr-gradient);
  color: white;
  border: none;
  box-shadow: 0 10px 24px -12px rgba(188, 10, 127, 0.6);
}
.btn-primary:hover { color: white; filter: brightness(1.05); }

.btn-ghost {
  background: transparent;
  color: var(--cr-primary);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--cr-primary-tint); color: var(--cr-primary-700); }

.btn-secondary {
  background: var(--cr-primary-tint);
  color: var(--cr-primary-700);
  border: none;
}
.btn-secondary:hover { background: var(--cr-primary-faint); color: var(--cr-primary-700); }

.btn-outline {
  background: var(--cr-surface);
  color: var(--cr-ink);
  border-color: var(--cr-line);
}
.btn-outline:hover { border-color: var(--cr-primary); color: var(--cr-primary); }

.btn-danger {
  background: var(--cr-danger-bg);
  color: var(--cr-danger);
  border: none;
}
.btn-danger:hover { background: var(--cr-danger); color: white; }

.btn-icon {
  width: 38px; height: 38px; padding: 0;
  justify-content: center;
  border-radius: 12px;
}

.btn-sm { padding: 7px 12px; font-size: 0.86rem; }

/* ---------- Cards ---------- */
.card {
  background: var(--cr-surface);
  border-radius: var(--cr-radius-lg);
  box-shadow: var(--cr-shadow-sm);
  border: 1px solid var(--cr-line-soft);
  padding: 22px;
}
.card-pad-lg { padding: 28px; }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 16px;
}
.card-title { font-size: 1.05rem; font-weight: 600; color: var(--cr-ink); margin: 0; }

/* ---------- Badges / Chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  font-size: 0.75rem; font-weight: 500;
  border-radius: 999px;
  background: var(--cr-primary-tint);
  color: var(--cr-primary-700);
  letter-spacing: 0.02em;
}
.badge-success { background: var(--cr-success-bg); color: var(--cr-success); }
.badge-warning { background: var(--cr-warning-bg); color: var(--cr-warning); }
.badge-danger  { background: var(--cr-danger-bg);  color: var(--cr-danger); }
.badge-info    { background: var(--cr-info-bg);    color: var(--cr-info); }
.badge-muted   { background: #f1e7ec; color: var(--cr-ink-soft); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  font-size: 0.78rem;
  border-radius: 10px;
  background: #f3f4f6;
  color: var(--cr-ink-soft);
  border: 1px solid #e5e7eb;
}
.chip-primary {
  background: var(--cr-primary-tint); color: var(--cr-primary-700); border-color: transparent;
}

/* ---------- Forms ---------- */
.form-row { margin-bottom: 18px; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px 20px;
}
.form-row-full { grid-column: 1 / -1; }

label.field-label, .field-label {
  display: block; font-size: 0.82rem; font-weight: 500;
  color: var(--cr-ink-soft); margin-bottom: 6px;
}
.field-hint { display: block; font-size: 0.76rem; color: var(--cr-ink-mute); margin-top: 4px; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="url"], input[type="tel"], input[type="search"], select, textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--cr-line);
  border-radius: 12px;
  background: var(--cr-surface);
  color: var(--cr-ink);
  font: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--cr-primary);
  box-shadow: 0 0 0 4px var(--cr-primary-tint);
}

textarea { min-height: 90px; resize: vertical; }

input[type="checkbox"] {
  accent-color: var(--cr-primary);
  width: 16px; height: 16px;
}

.check-item {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--cr-line);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--cr-ink-soft);
  background: var(--cr-surface);
  transition: all .15s ease;
  user-select: none;
}
.check-item:hover { border-color: var(--cr-primary); color: var(--cr-primary); }
.check-item input { display: none; }
.check-item.is-active {
  background: var(--cr-primary);
  color: white; border-color: var(--cr-primary);
  box-shadow: var(--cr-shadow-md);
}

.field-error { color: var(--cr-danger); font-size: 0.78rem; margin-top: 4px; }
.error-banner {
  background: var(--cr-danger-bg); color: var(--cr-danger);
  border-left: 4px solid var(--cr-danger);
  padding: 12px 16px; border-radius: var(--cr-radius-sm);
  margin-bottom: 16px; font-size: 0.9rem;
}

/* ---------- Table ---------- */
.table-wrap {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: none;
  border: 1px solid #f3f4f6;
  overflow: hidden;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.data-table th, table.data-table td {
  text-align: left;
  padding: 16px 20px;
  vertical-align: middle;
}
table.data-table thead th {
  background: #ffffff;
  font-weight: 700; font-size: 12px;
  color: #6b7280;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  border-bottom: 1px solid #f3f4f6;
  padding: 14px 20px;
  line-height: 18px;
}
table.data-table tbody tr { border-top: 1px solid #f9fafb; }
table.data-table tbody tr:first-child { border-top: 0; }
table.data-table tbody tr:hover { background: #fdf2f8; }
table.data-table tbody tr.is-clickable { cursor: pointer; }

.table-cell-strong { font-weight: 500; color: #1a1a2e; }

/* Cells tuned for the structures index (matches Figma). */
.cell-structure {
  display: flex; align-items: center; gap: 12px;
  min-width: 260px;
}
.cell-structure .thumb {
  width: 36px; height: 36px;
  background: #fdf2f8;
  color: #e60076;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.cell-structure .thumb svg { width: 16px; height: 16px; }
.cell-structure .info { min-width: 0; }
.cell-structure .info .name {
  font-size: 14px; color: #1a1a2e;
  text-decoration: none; display: block;
  line-height: 21px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 320px;
}
.cell-structure .info .sub {
  font-size: 12px; color: #6b7280; line-height: 18px;
}

.cell-region .line {
  display: flex; align-items: center; gap: 6px;
  color: #6b7280; font-size: 13px; line-height: 19.5px;
}
.cell-region .line svg { width: 14px; height: 14px; flex-shrink: 0; color: #6b7280; }
.cell-region .sub {
  font-size: 11px; color: rgba(107, 114, 128, 0.6);
  line-height: 16.5px; margin-top: 2px;
}

.cell-categories {
  display: flex; flex-direction: column; gap: 6px;
  align-items: flex-start;
}
.cell-categories .cat-chip {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  background: #f9fafb;
  border: 1px solid #f3f4f6;
  color: #6b7280;
  border-radius: 999px;
  font-size: 11px; line-height: 16.5px;
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden; text-overflow: ellipsis;
}

.cell-contact {
  display: flex; flex-direction: column; gap: 4px;
}
.cell-contact .line {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: #6b7280; line-height: 18px;
  max-width: 220px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cell-contact .line svg { width: 12px; height: 12px; flex-shrink: 0; color: #6b7280; }
.cell-contact .line a { color: #6b7280; text-decoration: none; }
.cell-contact .line a:hover { color: #e60076; }

/* ---------- Pagination / Empty ---------- */
.empty-state {
  padding: 48px 24px; text-align: center; color: var(--cr-ink-mute);
}
.empty-state svg { width: 96px; height: 96px; margin: 0 auto 16px; display: block; }

.pagination {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px;
  border-top: 1px solid #f3f4f6;
  background: #ffffff;
  font-size: 13px; color: #6b7280;
}
.pagination .summary { line-height: 19.5px; }
.pagination .pages {
  display: inline-flex; gap: 4px; align-items: center;
}
.pagination .page-btn {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: transparent;
  color: #6b7280;
  font-size: 13px; font-weight: 500;
  text-decoration: none;
  border: none; cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.pagination .page-btn:hover { background: #fdf2f8; color: #e60076; }
.pagination .page-btn.is-active {
  background: #f6339a;
  color: #ffffff;
}
.pagination .page-btn.is-active:hover { background: #e60076; color: #ffffff; }
.pagination .page-btn.is-disabled {
  color: #d1d5db; pointer-events: none;
}
.pagination .page-ellipsis {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #9ca3af; font-size: 13px;
}

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(27, 13, 24, 0.4);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  /* Must outrank Leaflet's panes (up to 700) and controls (~1000). */
  z-index: 9999;
  animation: fadeIn .2s ease;
}

.modal {
  background: var(--cr-surface);
  border-radius: var(--cr-radius-xl);
  width: min(720px, 100%);
  max-height: calc(100vh - 48px);
  box-shadow: var(--cr-shadow-lg);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: slideUp .25s cubic-bezier(.2,.9,.3,1);
}
.modal-header {
  padding: 20px 24px;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--cr-line-soft);
  background: var(--cr-gradient-soft);
}
.modal-body {
  padding: 22px 24px;
  overflow: auto;
}
.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--cr-line-soft);
  background: var(--cr-surface-muted);
  display: flex; justify-content: flex-end; gap: 10px;
}
.modal-close {
  background: transparent; border: none; cursor: pointer;
  padding: 6px; border-radius: 10px; color: var(--cr-ink-soft);
}
.modal-close:hover { background: var(--cr-primary-tint); color: var(--cr-primary); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (max-width: 900px) {
  .modal-backdrop { padding: 0; align-items: stretch; }
  .modal {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
  .modal-header, .modal-body, .modal-footer { padding-left: 18px; padding-right: 18px; }
  .modal-footer {
    flex-direction: column-reverse;
    gap: 8px;
  }
  .modal-footer > * { width: 100%; justify-content: center; }
}
/*
 * Carte Rose Admin stylesheet.
 *


 */
