/* ==========================================================================
   SEN OUVRIER - Thème Moderne & Élégant
   Annuaire des Artisans et Ouvriers du Sénégal
   ========================================================================== */

[hidden] { display: none !important; }

:root {
  /* Mode Clair */
  --bg: #F5F7F4;
  --surface: #FFFFFF;
  --surface-2: #EEF3EC;
  --surface-3: #E2EAE0;
  --fg: #0D1C13;
  --fg-heading: #06140B;
  --muted: #54685A;
  --muted-light: #7E9385;
  --line: #DCE5DA;
  --line-subtle: #EDF3EC;
  
  /* Couleurs identitaires Sénégal */
  --accent: #0B733D;
  --accent-hover: #085A30;
  --accent-soft: #E3F4EA;
  --on-accent: #FFFFFF;
  
  --yellow: #E5A800;
  --yellow-hover: #CC9400;
  --yellow-soft: #FEF7E6;
  --on-yellow: #1F1500;
  
  --red: #C53030;
  --red-soft: #FDE8E8;
  
  --wa-green: #25D366;
  --wa-dark: #128C7E;
  --wa-hover: #20BA5A;
  
  /* Typographie */
  --font-display: "Bricolage Grotesque", -apple-system, system-ui, sans-serif;
  --font-body: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  
  /* Ombres & Effets */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 3px rgba(13, 28, 19, 0.05);
  --shadow-md: 0 6px 18px -3px rgba(13, 28, 19, 0.07), 0 2px 6px -1px rgba(13, 28, 19, 0.04);
  --shadow-lg: 0 16px 36px -6px rgba(13, 28, 19, 0.1), 0 4px 12px -2px rgba(13, 28, 19, 0.05);
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Mode Sombre */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #09100B;
    --surface: #111B14;
    --surface-2: #17241C;
    --surface-3: #1E2F25;
    --fg: #EDF5EE;
    --fg-heading: #FFFFFF;
    --muted: #8FA495;
    --muted-light: #687B6E;
    --line: #223528;
    --line-subtle: #19271E;
    --accent: #2ECC71;
    --accent-hover: #27AE60;
    --accent-soft: #123721;
    --on-accent: #05140A;
    --yellow: #F5B014;
    --yellow-hover: #E09E0D;
    --yellow-soft: #2E2204;
    --on-yellow: #1F1500;
    --red: #F87171;
    --red-soft: #381A1A;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 18px 40px -6px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #09100B;
  --surface: #111B14;
  --surface-2: #17241C;
  --surface-3: #1E2F25;
  --fg: #EDF5EE;
  --fg-heading: #FFFFFF;
  --muted: #8FA495;
  --muted-light: #687B6E;
  --line: #223528;
  --line-subtle: #19271E;
  --accent: #2ECC71;
  --accent-hover: #27AE60;
  --accent-soft: #123721;
  --on-accent: #05140A;
  --yellow: #F5B014;
  --yellow-hover: #E09E0D;
  --yellow-soft: #2E2204;
  --on-yellow: #1F1500;
  --red: #F87171;
  --red-soft: #381A1A;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 18px 40px -6px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #F5F7F4;
  --surface: #FFFFFF;
  --surface-2: #EEF3EC;
  --surface-3: #E2EAE0;
  --fg: #0D1C13;
  --fg-heading: #06140B;
  --muted: #54685A;
  --muted-light: #7E9385;
  --line: #DCE5DA;
  --line-subtle: #EDF3EC;
  --accent: #0B733D;
  --accent-hover: #085A30;
  --accent-soft: #E3F4EA;
  --on-accent: #FFFFFF;
  --yellow: #E5A800;
  --yellow-hover: #CC9400;
  --yellow-soft: #FEF7E6;
  --on-yellow: #1F1500;
  --red: #C53030;
  --red-soft: #FDE8E8;
  --shadow-sm: 0 1px 3px rgba(13, 28, 19, 0.05);
  --shadow-md: 0 6px 18px -3px rgba(13, 28, 19, 0.07);
  --shadow-lg: 0 16px 36px -6px rgba(13, 28, 19, 0.1);
  color-scheme: light;
}

/* Base */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.top {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.top .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.28rem;
  letter-spacing: -0.01em;
  color: var(--fg-heading);
}

.brand-logo {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
}

.brand-logo svg {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(11, 115, 61, 0.2);
}

.brand span b {
  color: var(--accent);
  font-weight: 800;
}

nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

nav a {
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--muted);
  transition: var(--transition);
}

nav a:hover {
  background: var(--surface-2);
  color: var(--fg);
}

nav a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Bouton Thème */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--fg);
  cursor: pointer;
  transition: var(--transition);
}

.theme-toggle:hover {
  background: var(--surface-3);
  border-color: var(--accent);
  transform: scale(1.05);
}

.theme-icon-sun, .theme-icon-moon { font-size: 1.15rem; line-height: 1; }
:root:not([data-theme="dark"]) .theme-icon-sun { display: none; }
:root:not([data-theme="dark"]) .theme-icon-moon { display: block; }
:root[data-theme="dark"] .theme-icon-sun { display: block; }
:root[data-theme="dark"] .theme-icon-moon { display: none; }

.header-cta {
  font-weight: 700;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  padding-block: 42px 36px;
  align-items: center;
}

@media (min-width: 960px) {
  .hero-grid {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 48px;
    padding-block: 54px 44px;
  }
}

.hero-content {
  display: grid;
  gap: 18px;
}

.eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  width: fit-content;
}

.star-badge {
  color: var(--yellow);
  font-size: 0.95rem;
}

h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.3rem, 5vw, 3.8rem);
  line-height: 1.05;
  margin: 0;
  color: var(--fg-heading);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 em {
  font-style: normal;
  position: relative;
  color: var(--accent);
  background: linear-gradient(120deg, var(--yellow-soft) 0%, transparent 100%);
  padding: 0 4px;
  border-radius: 4px;
}

.lead {
  max-width: 54ch;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
  margin: 0;
}

/* Barre de recherche dans le Hero */
.search {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  background: var(--surface-2);
  padding: 12px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  margin-top: 4px;
}

@media (min-width: 640px) {
  .search {
    grid-template-columns: 1fr 1fr auto;
    align-items: end;
  }
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field label, .lbl {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.select-wrap {
  position: relative;
}

select, input[type=text], input[type=tel], input[type=number], input[type=search], input[type=password], textarea {
  width: 100%;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  min-height: 46px;
  color: var(--fg);
  font-size: 0.95rem;
  transition: var(--transition);
}

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

select:focus, input:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}

/* Boutons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

.btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn.ghost {
  background: var(--surface);
  color: var(--fg);
  border-color: var(--line);
  box-shadow: none;
}

.btn.ghost:hover {
  background: var(--surface-2);
  border-color: var(--accent);
}

.btn.yellow {
  background: var(--yellow);
  border-color: var(--yellow);
  color: var(--on-yellow);
}

.btn.yellow:hover {
  background: var(--yellow-hover);
  border-color: var(--yellow-hover);
}

.btn.danger {
  background: var(--red);
  border-color: var(--red);
  color: #FFFFFF;
}

.btn.small {
  min-height: 38px;
  padding: 6px 14px;
  font-size: 0.88rem;
  border-radius: var(--radius-sm);
}

.btn-search {
  padding-inline: 22px;
}

/* Chips métiers fréquents */
.chips-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.chips-label {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 13px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.chip:hover {
  background: var(--surface-3);
  color: var(--fg);
  border-color: var(--muted-light);
}

.chip[aria-pressed="true"] {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
  box-shadow: 0 2px 6px rgba(11, 115, 61, 0.25);
}

/* Trust Strip */
.trust-strip {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 10px;
  border-top: 1px solid var(--line-subtle);
  flex-wrap: wrap;
}

.trust-item {
  display: grid;
  gap: 2px;
}

.trust-item b {
  font-size: 0.95rem;
  color: var(--fg-heading);
  font-weight: 700;
}

.trust-item span {
  font-size: 0.8rem;
  color: var(--muted);
}

.trust-sep {
  width: 1px;
  height: 28px;
  background: var(--line);
}

/* Hero Visual Showcase */
.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
}

.hero-image-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  aspect-ratio: 16 / 10;
  background: var(--surface-2);
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.hero-image-card:hover .hero-img {
  transform: scale(1.02);
}

.hero-overlay-card {
  position: absolute;
  bottom: 14px;
  left: 14px;
  right: 14px;
  background: rgba(17, 27, 20, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #FFFFFF;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.overlay-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.overlay-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #FFFFFF;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.95rem;
  flex: none;
}

.overlay-row strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
}

.overlay-row p {
  margin: 0;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.75);
}

/* Ruban Décoratif Sénégal */
.senegal-stripe {
  height: 5px;
  background: linear-gradient(90deg, #0B733D 0%, #0B733D 33.3%, #E5A800 33.3%, #E5A800 66.6%, #C53030 66.6%, #C53030 100%);
}

/* ==========================================================================
   Section Annuaire & Cartes Ouvriers
   ========================================================================== */
main {
  padding-block: 36px 64px;
}

.status {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  margin-bottom: 20px;
  font-size: 0.92rem;
  color: var(--muted);
  box-shadow: var(--shadow-sm);
}

.bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.count {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.45rem;
  margin: 0;
  color: var(--fg-heading);
}

.tools {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--muted);
  user-select: none;
}

.toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.tools select {
  width: auto;
  min-height: 40px;
  padding: 6px 12px;
  font-size: 0.88rem;
  border-radius: var(--radius-md);
}

/* Grille des Cartes */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 18px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
  position: relative;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.card-verified {
  border-color: var(--line);
}

.card-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.avatar {
  width: 58px;
  height: 58px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--surface-3) 100%);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  flex: none;
  overflow: hidden;
  border: 1px solid var(--line);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar.sm {
  width: 44px;
  height: 44px;
  font-size: 1rem;
}

.who {
  min-width: 0;
  flex: 1;
}

.who-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 3px;
}

.trade-kicker {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
}

.verified-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #0B6B3A;
  background: #E6F5ED;
  padding: 2px 7px;
  border-radius: 4px;
}

:root[data-theme="dark"] .verified-tag {
  background: #143722;
  color: #4ADE80;
}

.who h3 {
  margin: 0 0 3px;
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--fg-heading);
  overflow-wrap: anywhere;
}

.location-line {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-wrap: anywhere;
}

.fav {
  border: none;
  background: var(--surface-2);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  display: grid;
  place-items: center;
  transition: var(--transition);
  flex: none;
}

.fav:hover {
  background: var(--surface-3);
  color: var(--yellow);
  transform: scale(1.1);
}

.fav[aria-pressed="true"] {
  color: var(--yellow);
  background: var(--yellow-soft);
}

/* Badges de carte */
.card-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.avail-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.avail-badge.is-avail {
  background: var(--accent-soft);
  color: var(--accent);
}

.avail-badge.is-busy {
  background: var(--surface-2);
  color: var(--muted);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.avail-badge.is-avail .status-dot {
  box-shadow: 0 0 6px var(--accent);
}

.exp-tag {
  font-size: 0.8rem;
  color: var(--muted);
}

.exp-tag b {
  color: var(--fg);
}

.mine-tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--fg);
  color: var(--bg);
}

.bio {
  margin: 0;
  font-size: 0.92rem;
  color: var(--fg);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 2px;
}

.price-wrap {
  display: flex;
  flex-direction: column;
}

.price-val {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--fg-heading);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.price-unit {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-action:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-action.btn-active {
  background: var(--surface-2);
  color: var(--fg);
  border-color: var(--line);
}

/* Boîte de contact ouvrier */
.contact-box {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px;
  display: grid;
  gap: 12px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.contact-number {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--fg-heading);
  user-select: all;
}

.contact-number svg {
  color: var(--accent);
}

.contact-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-wa {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--wa-green);
  color: #FFFFFF;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.88rem;
  transition: var(--transition);
  box-shadow: 0 2px 6px rgba(37, 211, 102, 0.3);
}

.btn-wa:hover {
  background: var(--wa-hover);
  transform: translateY(-1px);
}

.btn-tel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--fg);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  transition: var(--transition);
}

.btn-tel:hover {
  background: var(--surface-3);
  border-color: var(--accent);
}

.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px dashed var(--line);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-copy:hover {
  border-color: var(--fg);
  color: var(--fg);
}

/* État vide */
.empty {
  background: var(--surface);
  border: 2px dashed var(--line);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  display: grid;
  gap: 12px;
  justify-items: center;
}

.empty h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0;
  color: var(--fg-heading);
}

.empty p {
  margin: 0;
  color: var(--muted);
  max-width: 44ch;
  line-height: 1.6;
}

/* ==========================================================================
   Formulaires (Besoin, Inscription, Admin)
   ========================================================================== */
.panel {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: grid;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.form h2, .side h2, .adm-head h2 {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 800;
  margin: 0;
  line-height: 1.15;
  color: var(--fg-heading);
  letter-spacing: -0.01em;
}

.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.hint {
  font-size: 0.86rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

.err {
  color: var(--red);
  font-size: 0.88rem;
  font-weight: 600;
  margin: 0;
  min-height: 1.2em;
}

.side {
  display: grid;
  gap: 16px;
}

.note {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
}

.note b {
  font-family: var(--font-display);
  color: var(--fg-heading);
}

.preview {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.95rem;
  font-family: var(--font-body);
  line-height: 1.6;
}

.req {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}

.req p {
  margin: 0;
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.req strong {
  font-family: var(--font-display);
  color: var(--accent);
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
  counter-reset: s;
}

.steps li {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  align-items: start;
  counter-increment: s;
}

.steps li::before {
  content: counter(s);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.9rem;
}

.photo-field {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.photo-field .avatar {
  width: 88px;
  height: 88px;
  font-size: 1.8rem;
  border-radius: var(--radius-lg);
}

.photo-field .acts {
  display: grid;
  gap: 8px;
  justify-items: start;
}

.photo-field input[type=file] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.free {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 4px;
  width: fit-content;
}

/* ==========================================================================
   Espace Administrateur
   ========================================================================== */
.adm-head {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}

.stat b {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.85rem;
  line-height: 1.1;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--fg-heading);
}

.stat span {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

.adm-tools {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.adm-tools input[type=search] {
  flex: 1 1 240px;
}

.adm-tools select {
  flex: 0 1 200px;
}

.adm-list {
  display: grid;
  gap: 10px;
}

.adm-row {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.adm-row.hidden-row {
  opacity: 0.65;
  border-style: dashed;
}

.adm-info {
  min-width: 0;
}

.adm-info strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--fg-heading);
  overflow-wrap: anywhere;
}

.adm-info p {
  margin: 3px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.adm-acts {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line-subtle);
  margin-top: 4px;
}

/* ==========================================================================
   Footer & Toast
   ========================================================================== */
footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

footer .wrap {
  padding-block: 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  color: var(--muted);
  font-size: 0.9rem;
}

footer a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

footer a:hover {
  color: var(--accent);
}

.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  background: var(--fg);
  color: var(--bg);
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.92rem;
  z-index: 50;
  box-shadow: var(--shadow-lg);
  max-width: calc(100% - 32px);
  animation: slideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.codebox {
  display: grid;
  gap: 10px;
}

.codebox .code {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.15rem;
  background: var(--surface-2);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  overflow-wrap: anywhere;
  user-select: all;
  border: 1px solid var(--line);
  color: var(--accent);
}

.adm-login {
  max-width: 440px;
  margin: 0 auto;
}

.legal {
  max-width: 780px;
  margin: 0 auto;
  padding-block: 36px 64px;
  display: grid;
  gap: 16px;
}

.legal h1 {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  margin: 0;
  color: var(--fg-heading);
}

.legal h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 16px 0 0;
  color: var(--fg-heading);
}

.legal p, .legal li { margin: 0; line-height: 1.6; }
.legal ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.legal mark { background: var(--yellow-soft); color: var(--on-yellow); padding: 0 4px; border-radius: 3px; font-weight: 700; }
/* ==========================================================================
   Pills d'état Administrateur
   ========================================================================== */
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
}

.pill.ok {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(11, 115, 61, 0.25);
}

.pill.busy {
  background: var(--yellow-soft);
  color: var(--yellow-hover);
  border-color: rgba(229, 168, 0, 0.25);
}

.pill.danger {
  background: var(--red-soft);
  color: var(--red);
  border-color: rgba(197, 48, 48, 0.25);
}

.pill.new {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

/* ==========================================================================
   Section CNI (Carte Nationale d'Identité)
   ========================================================================== */
.cni-section {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: grid;
  gap: 14px;
}

.cni-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.cni-header .lbl {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--fg-heading);
  margin-bottom: 2px;
}

.cni-badge-lock {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}

.cni-upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.cni-card {
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: var(--transition);
}

.cni-card:hover {
  border-color: var(--accent);
}

.cni-slot-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--fg-heading);
}

.cni-preview-box {
  min-height: 120px;
  max-height: 160px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--muted);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-subtle);
}

.cni-preview-box.has-file {
  background: #000;
  border-color: var(--accent);
}

.cni-preview-box img {
  width: 100%;
  height: 100%;
  max-height: 160px;
  object-fit: contain;
  display: block;
}

.cni-check-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.cni-prev-text {
  font-size: 0.8rem;
  font-weight: 600;
}

.cni-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.text-danger {
  color: var(--red) !important;
}

/* ==========================================================================
   Modale d'Inspection CNI (Admin)
   ========================================================================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal[hidden] {
  display: none !important;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 101;
}

.modal-dialog {
  position: relative;
  z-index: 102;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: slideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.modal-header h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--fg-heading);
}

.btn-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.btn-close:hover {
  color: var(--fg);
  background: var(--surface-2);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cni-inspect-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.cni-inspect-col h4 {
  margin: 0 0 8px 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--fg-heading);
}

.cni-img-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cni-img-wrap img {
  width: 100%;
  height: auto;
  max-height: 380px;
  object-fit: contain;
  display: block;
}

.cni-no-doc {
  color: var(--muted);
  font-size: 0.88rem;
  padding: 24px;
  text-align: center;
}

.cni-loading {
  color: var(--muted);
  font-size: 0.88rem;
  padding: 24px;
  text-align: center;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  background: var(--surface-2);
}

/* Responsive Media Queries */
@media (max-width: 768px) {
  .panel { grid-template-columns: 1fr; }
  .two { grid-template-columns: 1fr; }
  .cni-upload-grid { grid-template-columns: 1fr; }
  .cni-inspect-grid { grid-template-columns: 1fr; }
  nav a { padding: 6px 10px; font-size: 0.85rem; }
  .brand span { font-size: 1.15rem; }
  .header-cta { display: none; }
}
