/* ====================================================
   PLATEFORME PDEC — Design System (Stitch Mockup Match)
   ==================================================== */

@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0&display=block');

.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  user-select: none;
  line-height: 1;
  vertical-align: middle;
  display: inline-flex;
  align-items: center;
}
.mico { font-size: 18px; }

:root {
  /* Colors */
  --primary: #00D668;
  --primary-light: #33EB8B;
  --primary-dark: #112F20;
  --hero-bg: #1a7a45;
  /* Footer background */
  --primary-50: rgba(0, 214, 104, 0.1);

  --secondary: #1F2937;
  /* Dark grayish text */
  --accent: #FFED4A;

  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --info: #3B82F6;
  --purple: #8B5CF6;
  /* For scolarisation */

  /* Neutrals */
  --bg-body: #F9FAFB;
  --bg-surface: #FFFFFF;
  --bg-surface-alt: #F3F4F6;

  --text-primary: #111827;
  --text-secondary: #4B5563;
  --text-muted: #9CA3AF;

  --border: #E5E7EB;
  --border-light: #F3F4F6;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-float: 0 10px 40px rgba(0, 0, 0, 0.08);

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Inter', sans-serif;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  --transition: 200ms ease;
}

/* ── Base Reset ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.5;
}

a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--primary);
}

img {
  max-width: 100%;
  display: block;
  border-radius: var(--radius-md);
}

/* ── Typography ── */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-primary);
}

h1 {
  font-size: 2.5rem;
  line-height: 1.2;
}

h2 {
  font-size: 1.8rem;
}

h3 {
  font-size: 1.25rem;
}

.text-green {
  color: var(--primary);
}

.text-muted {
  color: var(--text-muted);
}

/* ── Header ── */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 72px;
  background: white;
  z-index: 1000;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-xl);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 800;
  font-size: 1.25rem;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-text span:first-child {
  font-weight: 800;
}

.logo-text span:last-child {
  font-size: 0.65rem;
  color: var(--primary);
  font-weight: 600;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: var(--space-xl);
  align-items: center;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color 0.2s;
  padding-bottom: 22px;
  margin-bottom: -24px;
  border-bottom: 2px solid transparent;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Dropdown Navbar */
.dropdown {
  position: relative;
}

.dropdown-content {
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  position: absolute;
  top: calc(100% + 24px);
  left: 0;
  min-width: 260px;
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 8px 0;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
  transform: translateY(10px);
  z-index: 1000;
}

.dropdown:hover .dropdown-content {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  padding: 10px 20px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s;
  display: block;
}

.dropdown-item:hover {
  background: var(--primary-50);
  color: var(--primary);
  padding-left: 24px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--bg-surface-alt);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #ccc;
}

.search-input-header {
  background: var(--bg-surface-alt);
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  outline: none;
  width: 250px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-light);
  color: white;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.btn-outline:hover {
  background: var(--bg-surface-alt);
}

.btn-pill {
  border-radius: var(--radius-full);
}

/* ── Homepage Map Hero ── */
.hero-wrapper {
  position: relative;
  height: 60vh;
  min-height: 500px;
  margin-top: 72px;
}

#map {
  width: 100%;
  height: 100%;
  z-index: 1;
}

.floating-card {
  position: absolute;
  top: var(--space-xl);
  left: var(--space-xl);
  background: white;
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  box-shadow: var(--shadow-float);
  z-index: 500;
  width: 440px;
}

.floating-card h1 {
  font-size: 2rem;
  margin-bottom: var(--space-md);
}

.floating-card p {
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  font-size: 0.95rem;
}

.search-bar {
  display: flex;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px;
  padding-left: 16px;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.95rem;
  background: transparent;
}

.search-bar .btn {
  border-radius: var(--radius-sm);
  padding: 8px 16px;
}

/* Croix de réinitialisation de la recherche carte (affichée via JS quand des résultats sont posés) */
.search-clear {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 8px;
  margin-right: 4px;
}
.search-clear:hover { color: var(--text); }

.map-controls {
  position: absolute;
  right: var(--space-xl);
  bottom: var(--space-xl);
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.map-control-btn {
  width: 44px;
  height: 44px;
  background: white;
  border: none;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--text-primary);
  transition: all 0.2s;
}

.map-control-btn:hover {
  background: var(--bg-surface-alt);
}

.map-control-btn.primary {
  background: var(--primary);
  color: white;
}

.map-control-btn.primary:hover {
  background: var(--primary-light);
}

.floating-filters {
  position: absolute;
  bottom: calc(var(--space-xl) * -1);
  left: 50%;
  transform: translateX(-50%);
  background: white;
  padding: 12px 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float);
  z-index: 500;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  justify-content: center;
  max-width: calc(100vw - 40px);
}

.filter-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--bg-surface-alt);
  color: var(--text-secondary);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.filter-pill:hover {
  background: #e5e7eb;
}

.filter-pill.active {
  background: var(--primary-50);
  color: var(--primary);
  border-color: var(--primary-50);
}

.filter-link {
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  margin-left: 12px;
}

/* ── Publications Section ── */
.section-pubs {
  max-width: 1400px;
  margin: 100px auto var(--space-3xl);
  padding: 0 var(--space-xl);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: var(--space-xl);
}

.section-header h2 {
  font-size: 1.8rem;
}

.section-header .subtitle {
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.section-header a {
  font-weight: 600;
  font-size: 0.9rem;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

.pub-card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}

.pub-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.pub-img-wrap {
  position: relative;
  height: 200px;
  background: var(--bg-surface-alt);
}

.pub-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

.pub-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: var(--info);
  color: white;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pub-badge.orange {
  background: var(--warning);
}

.pub-badge.green {
  background: var(--primary);
}

.pub-content {
  padding: var(--space-lg);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.pub-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.pub-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.4;
}

.pub-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  flex: 1;
}

.pub-btn {
  background: var(--bg-surface-alt);
  color: var(--text-primary);
  font-weight: 600;
  text-align: center;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

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

/* ── Footer ── */
.footer {
  background: var(--primary-dark);
  color: white;
  padding: var(--space-3xl) var(--space-xl) var(--space-lg);
}

.footer-grid {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-2xl);
}

.footer-brand .logo-text span:last-child {
  color: white;
  opacity: 0.8;
}

.footer-brand p {
  margin-top: var(--space-md);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  max-width: 300px;
  line-height: 1.6;
}

.footer h4 {
  color: white;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-md);
}

.footer ul {
  list-style: none;
}

.footer ul li {
  margin-bottom: 12px;
}

.footer ul a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

.footer ul a:hover {
  color: white;
}

.footer-contact li {
  display: flex;
  gap: 12px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  align-items: flex-start;
}

.footer-bottom {
  max-width: 1400px;
  margin: var(--space-2xl) auto 0;
  padding-top: var(--space-xl);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
}

.footer-bottom-links {
  display: flex;
  gap: var(--space-lg);
}

/* ── Fiche Communale Layout ── */
.page-layout {
  background: var(--bg-body);
  min-height: 100vh;
  padding-top: 72px;
}

.breadcrumb-bar {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb a {
  color: var(--text-muted);
}

.breadcrumb a:hover {
  color: var(--text-primary);
}

.page-actions {
  display: flex;
  gap: var(--space-sm);
}

.btn-icon {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: white;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dashboard-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-xl) var(--space-xl);
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-xl);
}

.left-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.right-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.card-white {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: var(--space-lg);
}

.admin-profile {
  position: relative;
  padding: var(--space-xl);
}

.badge-soft {
  display: inline-block;
  background: var(--primary-50);
  color: var(--primary);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.admin-profile h1 {
  font-size: 2.2rem;
  margin-bottom: 8px;
}

.admin-profile .location {
  color: var(--text-secondary);
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--space-xl);
}

.admin-meta {
  display: flex;
  gap: var(--space-3xl);
}

.meta-item .label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 4px;
}

.meta-item .value {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
}

.mini-map-card {
  position: relative;
  height: 300px;
  width: 100%;
  background: #E5E9E6;
  border-radius: var(--radius-lg);
  overflow: hidden;
  padding: 0;
}

.mini-map-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  opacity: 0.8;
}

.mini-map-floating {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  background: white;
  padding: 12px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.mini-map-icon {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  background: white;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  color: var(--primary);
  font-size: 1.2rem;
}

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}

.kpi-box {
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
}

.kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.kpi-icon {
  width: 32px;
  height: 32px;
  background: var(--primary-50);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.kpi-trend {
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 2px;
}

.kpi-trend.up {
  color: var(--success);
}

.kpi-trend.neutral {
  color: var(--text-muted);
  font-weight: 500;
}

.kpi-box .label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.kpi-box .value {
  font-size: 1.8rem;
  font-weight: 800;
  font-family: var(--font-display);
  line-height: 1.1;
  margin-bottom: 16px;
}

.kpi-bar {
  height: 6px;
  background: var(--bg-surface-alt);
  border-radius: 3px;
  overflow: hidden;
  width: 100%;
}

.kpi-bar-fill {
  height: 100%;
  border-radius: 3px;
}

.kpi-bar-fill.blue {
  background: var(--info);
}

.kpi-bar-fill.orange {
  background: var(--warning);
}

.kpi-bar-fill.green {
  background: var(--success);
}

.kpi-bar-fill.purple {
  background: var(--purple);
}

/* Projects Status */
.projects-status {
  padding: var(--space-xl);
}

.card-title-rows {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xl);
}

.card-title-rows h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.2rem;
}

.card-title-rows a {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
}

.status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
}

.status-item .status-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}

.status-item .title {
  font-weight: 600;
  font-size: 0.95rem;
}

.status-item .num {
  font-size: 1.8rem;
  font-weight: 800;
  font-family: var(--font-display);
}

.status-bar-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.status-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-surface-alt);
  border-radius: 4px;
  overflow: hidden;
}

.status-bar-fill {
  height: 100%;
  border-radius: 4px;
}

.status-item .pct {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  width: 40px;
  text-align: right;
}

.status-item .subtext {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Tabs section */
.tabs-card {
  padding: 0;
  overflow: hidden;
}

.tabs-header {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 var(--space-lg);
}

.tab-link {
  padding: 16px 24px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-muted);
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-link:hover {
  color: var(--text-primary);
}

.tab-link.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tabs-body {
  padding: var(--space-xl);
}

.tabs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.tab-box {
  background: var(--bg-body);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  border: 1px solid var(--border-light);
}

.tab-box h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
  margin-bottom: 16px;
}

.tab-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tab-list-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.tab-list-item span:last-child {
  font-weight: 700;
  color: var(--text-primary);
}

.tab-info-msg {
  padding: 16px;
  background: #F0FBDF;
  color: #3A6915;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-style: italic;
}

/* Right Column Widgets */
.widget {
  padding: var(--space-lg);
}

.widget h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.1rem;
  margin-bottom: var(--space-lg);
}

.gallery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.gallery-img {
  width: 100%;
  height: 120px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.gallery-more {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface-alt);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px dashed var(--border);
}

.doc-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.doc-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.doc-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.doc-icon {
  width: 40px;
  height: 40px;
  background: #FFF5F5;
  color: var(--danger);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.doc-icon.word {
  background: #EEF2FF;
  color: var(--info);
}

.doc-icon.yellow {
  background: #FFFBEB;
  color: var(--warning);
}

.doc-info {
  flex: 1;
}

.doc-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.doc-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.doc-download {
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
}

.doc-download:hover {
  color: var(--primary);
}

/* ─────────────────────────────────────────────────────────────
   UTILITAIRES GLOBAUX
───────────────────────────────────────────────────────────── */

/* Gradient text (dashboard admin) */
.text-gradient {
  background: linear-gradient(135deg, var(--primary) 0%, #00B8D9 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Header glassmorphism on scroll */
.header.scrolled {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-md);
}

/* Bouton hamburger mobile (caché par défaut) */
.menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: var(--space-sm);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  line-height: 1;
  flex-shrink: 0;
}

.menu-btn:hover {
  background: var(--bg-surface-alt);
}

/* Nav mobile open state */
.nav-links.open {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 72px;
  left: 0;
  right: 0;
  background: white;
  padding: var(--space-md);
  box-shadow: var(--shadow-lg);
  border-top: 1px solid var(--border);
  z-index: 999;
  gap: 0;
  max-height: calc(100vh - 72px);
  overflow-y: auto;
}

.nav-links.open .nav-link {
  padding: 14px var(--space-md);
  border-bottom: 1px solid var(--border-light);
  margin: 0;
  border-bottom-width: 1px;
  border-bottom-style: solid;
}

.nav-links.open .dropdown-content {
  position: static;
  opacity: 1;
  visibility: visible;
  transform: none;
  box-shadow: none;
  border: none;
  background: var(--bg-surface-alt);
  border-radius: var(--radius-sm);
  margin: 4px 0 8px 0;
  padding: 4px 0;
}

/* Search results dropdown */
.search-results {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0,0,0,.14);
  z-index: 600;
  max-height: 420px;
  overflow-y: auto;
}
.search-results.visible { display: block; }

/* Group header */
.srg-header {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px 4px;
  font-size: .68rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-muted);
  background: #f9fafb;
  border-bottom: 1px solid var(--border-light);
  position: sticky; top: 0; z-index: 1;
}

.search-result-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: #f0faf4; }

.sri-icon {
  width: 30px; height: 30px; border-radius: 8px;
  background: #f0f7f2;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sri-icon .material-symbols-outlined { font-size: 16px; color: var(--primary); }

.sri-text { flex: 1; min-width: 0; }

.sri-main {
  font-size: .875rem; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sri-main mark {
  background: #d4f5e4; color: #0a5c2a; border-radius: 2px; padding: 0 1px;
}

.sri-sub {
  font-size: .75rem; color: var(--text-muted); margin-top: 2px;
}

.sri-empty {
  padding: 16px; text-align: center; color: var(--text-muted); font-size: .875rem;
}

/* Leaflet popup styles */
.commune-popup h3 {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.popup-dept {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.popup-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: var(--space-md);
}

.popup-stat {
  text-align: center;
}

.popup-stat-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary);
}

.popup-stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.popup-btn {
  display: block;
  background: var(--primary);
  color: white;
  text-align: center;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
}

.popup-btn:hover {
  background: var(--primary-light);
  color: white;
}

/* Animate-in utility */
.animate-in {
  animation: fadeUp 0.4s ease both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─────────────────────────────────────────────────────────────
   RESPONSIVE — 1280px (Large tablet / small laptop)
───────────────────────────────────────────────────────────── */
@media (max-width: 1280px) {
  .floating-card {
    width: 380px;
  }

  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: var(--space-xl);
  }
}

/* ─────────────────────────────────────────────────────────────
   RESPONSIVE — 1024px (Tablette)
───────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {

  /* Header */
  .nav-links {
    display: none;
  }

  .menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .lang-toggle {
    display: none;
  }

  /* Commune page — stack columns */
  .dashboard-container {
    grid-template-columns: 1fr;
  }

  .right-col {
    order: -1;
  }

  .mini-map-card {
    min-height: 200px;
    height: 200px;
  }

  /* KPI grid — 2 cols */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Section pubs */
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
  }

  /* Admin meta */
  .admin-meta {
    gap: var(--space-xl);
  }
}

/* ─────────────────────────────────────────────────────────────
   RESPONSIVE — 768px (Mobile paysage / tablette portrait)
───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {

  /* Typographie */
  h1 {
    font-size: 1.8rem;
  }

  h2 {
    font-size: 1.4rem;
  }

  /* Header */
  .header {
    padding: 0 var(--space-md);
  }

  /* Hero map — layout vertical */
  .hero-wrapper {
    display: flex;
    flex-direction: column;
    height: auto;
    margin-top: 72px;
  }

  #map {
    height: 55vw;
    min-height: 280px;
    max-height: 420px;
  }

  /* Floating card — descend sous la carte */
  .floating-card {
    position: static;
    width: 100%;
    border-radius: 0;
    box-shadow: none;
    border-bottom: 1px solid var(--border);
    padding: var(--space-lg) var(--space-md);
  }

  .floating-card h1 {
    font-size: 1.5rem;
  }

  /* Filtres thématiques — scrollable horizontal */
  .floating-filters {
    position: static;
    transform: none;
    border-radius: 0;
    box-shadow: none;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 10px var(--space-md);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    justify-content: flex-start;
  }

  /* Map controls — repositionner */
  .map-controls {
    right: var(--space-md);
    bottom: var(--space-md);
  }

  /* Publications — 1 colonne */
  .section-pubs {
    margin-top: var(--space-3xl);
    padding: 0 var(--space-md);
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  /* Footer — 1 colonne */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .footer-bottom {
    flex-direction: column;
    gap: var(--space-md);
    text-align: center;
  }

  .footer-bottom-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-md);
  }

  /* Commune page */
  .breadcrumb-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-md);
  }

  .page-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .dashboard-container {
    padding: 0 var(--space-md) var(--space-xl);
  }

  .admin-profile h1 {
    font-size: 1.6rem;
  }

  .admin-meta {
    flex-direction: column;
    gap: var(--space-md);
  }

  /* KPI — 2 cols */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Status bars */
  .status-grid {
    grid-template-columns: 1fr;
  }

  /* Tabs */
  .tabs-grid {
    grid-template-columns: 1fr;
  }

  .tabs-header {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tab-link {
    white-space: nowrap;
    padding: 14px 16px;
    font-size: 0.85rem;
  }

  /* Gallery */
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Search bar */
  .search-bar {
    flex-wrap: wrap;
  }
}

/* ─────────────────────────────────────────────────────────────
   RESPONSIVE — 480px (Mobile portrait)
───────────────────────────────────────────────────────────── */
@media (max-width: 480px) {

  /* Typographie */
  h1 {
    font-size: 1.5rem;
  }

  /* Header */
  .header {
    height: 60px;
  }

  .hero-wrapper {
    margin-top: 60px;
  }

  .logo-text span:last-child {
    display: none;
  }

  /* Floating card */
  .floating-card {
    padding: var(--space-md);
  }

  .floating-card h1 {
    font-size: 1.3rem;
  }

  .floating-card p {
    font-size: 0.85rem;
  }

  /* KPI — 1 colonne sur très petit écran */
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .kpi-box .value {
    font-size: 1.5rem;
  }

  /* Search bar — pleine largeur */
  .search-bar {
    gap: var(--space-sm);
  }

  .search-bar .btn {
    width: 100%;
    margin-top: 4px;
  }

  /* Section pubs */
  .section-pubs {
    margin-top: var(--space-2xl);
  }

  .pub-img-wrap {
    height: 160px;
  }

  /* Breadcrumb */
  .page-actions .btn-icon {
    display: none;
  }

  /* Admin profile */
  .admin-profile {
    padding: var(--space-md);
  }

  .admin-profile h1 {
    font-size: 1.3rem;
  }

  /* Tabs body */
  .tabs-body {
    padding: var(--space-md);
  }

  /* Footer */
  .footer {
    padding: var(--space-xl) var(--space-md) var(--space-md);
  }

  /* Commune page */
  .dashboard-container {
    padding: 0 var(--space-sm) var(--space-xl);
  }

  .card-white {
    border-radius: var(--radius-md);
  }

  /* Widget galerie */
  .gallery-img {
    height: 90px;
  }

  /* Map controls — taille réduite */
  .map-control-btn {
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }

  /* Filtres cachés sur très petits écrans */
  .filter-label {
    display: none;
  }
}
}