/* =====================================================
   ACTUMDEV DESIGN SYSTEM — MISSION VIEWER
   Charte graphique ActumDev (Identique à SIGA / Présence)
   Support bimodal complet : Mode Clair (défaut) & Mode Sombre
   ===================================================== */

/* ── DESIGN TOKENS (CHARTE ACTUM-DEV.CI) ────────────── */
:root, html[data-theme="light"] {
  /* Jetons de la charte actum-dev.ci */
  --ink:            #1d2a29;
  --ink-soft:       #5d6766;
  --ink-mute:       #8a9291;
  --line:           #e3e0da;
  --line-soft:      #efece7;
  --inset:          #f5f3ef;
  --teal:           #1f5654;
  --teal-deep:      #123f3d;
  --ok:             #2f7d32;
  --amber:          #c27400;

  --primary:        #123f3d;
  --primary-dark:   #0d2f2d;
  --primary-light:  #1f5654;
  --primary-glow:   rgba(31, 86, 84, 0.12);
  --accent:         #2f7d32;
  --accent-glow:    rgba(47, 125, 50, 0.12);
  --danger:         #b8432f;
  --warning:        #c27400;
  --info:           #1f5654;

  --bg-base:        #faf9f6;
  --bg-surface:     #f5f3ef;
  --bg-card:        #ffffff;
  --bg-card-hover:  #f8f7f4;
  --bg-input:       #ffffff;
  --border:         #e3e0da;
  --border-active:  #8a9291;

  --text-primary:   #1d2a29;
  --text-secondary: #5d6766;
  --text-muted:     #8a9291;

  --navbar-bg:      #123f3d;
  --navbar-border:  #0d2f2d;

  --shadow-sm:      0 1px 3px rgba(18,63,61,.06), 0 1px 2px rgba(18,63,61,.04);
  --shadow-md:      0 8px 24px rgba(18,63,61,.08), 0 3px 8px rgba(18,63,61,.04);
  --shadow-lg:      0 16px 36px rgba(18,63,61,.12);

  --badge-success-bg: #e6f1e6;
  --badge-success-tx: #2f7d32;
  --badge-primary-bg: #e3eeed;
  --badge-primary-tx: #123f3d;
  --badge-warning-bg: #f8ecd6;
  --badge-warning-tx: #8f5600;
  --badge-info-bg:    #e3eeed;
  --badge-info-tx:    #1f5654;
  --badge-sec-bg:     #f5f3ef;
  --badge-sec-tx:     #5d6766;

  /* Livrables accents */
  --c-ortho:  #123f3d;
  --c-cog:    #1f5654;
  --c-webp:   #0e6f6a;
  --c-mns:    #c27400;
  --c-mnt:    #8f5600;
  --c-mnh:    #5b3e8e;
  --c-laz:    #1f6475;
  --c-pdf:    #b8432f;
  --c-obj:    #34495e;
  /* Ajouts du 25/10/2026 (menus déroulants, statuts), dans les tons de la charte sarcelle */
  --nav-text:         #cfe0de;
  --nav-text-strong:  #ffffff;
  --calc:             #5b3e8e;
  --badge-calc-bg:    #ece6f5;
  --badge-calc-tx:    #5b3e8e;
  --badge-danger-bg:  #f6e3df;
  --badge-danger-tx:  #b8432f;
  --st-done:  #2f7d32;
  --st-wait:  #c27400;
  --st-calc:  #c27400;   /* comme l'attente QC (décision du 25/10/2026) */
  --st-fail:  #b8432f;
  --st-todo:  #8a9291;
}

html[data-theme="dark"] {
  --ink:            #ececec;
  --ink-soft:       #a8a8a8;
  --ink-mute:       #808080;
  --line:           #2e2e2e;
  --line-soft:      #262626;
  --inset:          #1f1f1f;
  --teal:           #5fb0aa;
  --teal-deep:      #2f7d78;
  --ok:             #6fbf73;
  --amber:          #e0a030;

  --primary:        #2f7d78;
  --primary-dark:   #3b928c;
  --primary-light:  #5fb0aa;
  --primary-glow:   rgba(95, 176, 170, 0.16);
  --accent:         #6fbf73;
  --accent-glow:    rgba(111, 191, 115, 0.18);
  --danger:         #e07a66;
  --warning:        #e0a030;
  --info:           #5fb0aa;
/* #4b4949 */
/* #292929 */
  --bg-base:        #4b4949;
  --bg-surface:     #151515;
  --bg-card:        #292929;
  --bg-card-hover:  #222222;
  --bg-input:       #151515;
  --border:         #2e2e2e;
  --border-active:  #5a5a5a;

  --text-primary:   #ececec;
  --text-secondary: #a8a8a8;
  --text-muted:     #808080;

  --navbar-bg:      #292929;
  --navbar-border:  #262626;

  --shadow-sm:      0 1px 3px rgba(0, 0, 0, 0.40);
  --shadow-md:      0 8px 24px rgba(0, 0, 0, 0.50);
  --shadow-lg:      0 16px 36px rgba(0, 0, 0, 0.65);

  --badge-success-bg: rgba(111, 191, 115, 0.16);
  --badge-success-tx: #8fd493;
  --badge-primary-bg: rgba(95, 176, 170, 0.16);
  --badge-primary-tx: #8ccdc8;
  --badge-warning-bg: rgba(224, 160, 48, 0.16);
  --badge-warning-tx: #efc06a;
  --badge-info-bg:    rgba(95, 176, 170, 0.16);
  --badge-info-tx:    #8ccdc8;
  --badge-sec-bg:     rgba(168, 168, 168, 0.12);
  --badge-sec-tx:     #a8a8a8;

  --c-ortho:  #5fb0aa;
  --c-cog:    #6fbf73;
  --c-webp:   #76d7c4;
  --c-mns:    #e0a030;
  --c-mnt:    #f39c12;
  --c-mnh:    #a582e0;
  --c-laz:    #5dade2;
  --c-pdf:    #e07a66;
  --c-obj:    #85929e;
  --nav-text:         #cfe0de;
  --nav-text-strong:  #ffffff;
  --calc:             #a582e0;
  --badge-calc-bg:    rgba(165, 130, 224, 0.16);
  --badge-calc-tx:    #c3aef0;
  --badge-danger-bg:  rgba(224, 122, 102, 0.16);
  --badge-danger-tx:  #eea493;
  --st-done:  #6fbf73;
  --st-wait:  #e0a030;
  --st-calc:  #e0a030;
  --st-fail:  #e07a66;
  --st-todo:  #8a9291;
}

:root {
  --radius:    12px;
  --radius-sm: 8px;
  --radius-lg: 14px;
  --ease:      cubic-bezier(.22,.68,0,1);
}

/* ── BASE & TYPOGRAPHY ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-base);
  color: var(--ink);
  line-height: 1.5;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  transition: background-color .2s ease, color .2s ease;
}




/* ── NAVBAR PRINCIPALE (STYLE ACTUMDEV / SIGA) ─────────────── */
.navbar-main {
  background: var(--navbar-bg);
  border-bottom: 1px solid var(--navbar-border);
  padding: 0.35rem 0;
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: 0 2px 10px rgba(0,0,0,0.62);
  transition: background .2s ease, border-color .2s ease;
}

.navbar-main .brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none !important;
}

/* Logo officiel (version blanche, la barre est sarcelle foncé dans les deux thèmes) */
.navbar-main .brand-logo {
  display: block;
  height: 34px;
  width: auto;
}

.navbar-main .brand-sub {
  color: var(--nav-text);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.25;
  text-transform: uppercase;
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.25);
}

.navbar-main .nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.navbar-main .nav-links a {
  color: var(--nav-text);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all .15s ease;
}

.navbar-main .nav-links a:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
}

.navbar-main .nav-links a.active {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-weight: 600;
}

/* Boutons navbar droite */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle-btn {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: transparent;
  color: var(--nav-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .15s ease;
}

.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.40);
  color: #ffffff;
}

/* Disposition : rien ne passe à la ligne, la zone des liens absorbe l'espace */
.navbar-main .container-fluid, .navbar-main .container-fluid { gap: 16px; }
.navbar-main .brand-wrap,
.navbar-main .nav-actions { flex-shrink: 0; }
.navbar-main .nav-links a { white-space: nowrap; }
.navbar-main .nav-links { flex: 1; justify-content: center; min-width: 0; }

/* 8 onglets superviseur (26/10/2026) : avec icônes dès 1600 px ; en dessous, sans icônes et plus serrés ;
   sous 1200 px, ils passent dans le menu « Menu » (d-xl-flex dans base.html, .nav-small-only plus bas). */
@media (max-width: 1599.98px) {
  .navbar-main .brand-sub { display: none; }
  .navbar-main .nav-links { gap: 2px; }
  .navbar-main .nav-links a { padding: 0.45rem 0.6rem; font-size: 0.84rem; }
  .navbar-main .nav-links a i { display: none; }
}

.btn-nav-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  background: #ffffff;
  color: var(--teal-deep) !important;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none !important;
  transition: all .15s ease;
}

.btn-nav-action:hover {
  background: var(--badge-primary-bg);
  color: var(--teal-deep) !important;
}

html[data-theme="dark"] .btn-nav-action {
  background: var(--primary);
  color: #ffffff !important;
}

html[data-theme="dark"] .btn-nav-action:hover {
  background: var(--primary-dark);
}

.mainer-app{
  position: relative;
}
/* .mainer-app{
  position: absolute;
  content: "";
  pointer-events: none;
  width: 50%;
  height: 30%;
  bottom: 0;
  right: 10px;
  background-color: #3c7452;
  opacity: 0.3;
}
 */



/* ── BOUTONS DE LA CHARTE (DPT-BTN) ────────────────────────── */
.dpt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none !important;
  transition: transform .15s var(--ease), background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.dpt-btn:hover {
  transform: translateY(-1px);
}

.dpt-btn-primary {
  background: var(--teal-deep);
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(18, 63, 61, 0.2);
}

.dpt-btn-primary:hover {
  background: var(--teal);
}

html[data-theme="dark"] .dpt-btn-primary {
  background: var(--teal);
  color: #0f0f0f !important;
}

html[data-theme="dark"] .dpt-btn-primary:hover {
  background: var(--primary-light);
}

.dpt-btn-ghost {
  background: var(--bg-card);
  color: var(--ink) !important;
  border-color: var(--line);
}

.dpt-btn-ghost:hover {
  border-color: var(--ink-mute);
  background: var(--inset);
}

.dpt-btn-sm {
  min-height: 32px;
  padding: 0 11px;
  font-size: 12.5px;
  border-radius: 6px;
}

.dpt-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-card);
  color: var(--ink-soft) !important;
  cursor: pointer;
  text-decoration: none !important;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.dpt-icon-btn:hover {
  background: var(--inset);
  color: var(--ink) !important;
  border-color: var(--ink-mute);
}

/* ── PANNEAU / CARTE (DPT-PANEL) ───────────────────────────── */
.dpt-panel {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 22px;
  transition: border-color .15s ease, box-shadow .15s ease, background .2s ease;
}

.dpt-panel:hover {
  box-shadow: var(--shadow-md);
}

.dpt-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.dpt-panel-head h2, .dpt-panel-head h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 9px;
}

.dpt-panel-head p {
  margin: 2px 0 0;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

/* ── BANDEAU HAUT (DPT-TOP) & MISSION HERO ─────────────────── */
.mission-hero {
  padding: 30px 0 20px;
}

.dpt-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.dpt-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft) !important;
  margin-bottom: 8px;
  text-decoration: none;
  transition: color .15s ease;
}

.dpt-back:hover {
  color: var(--teal) !important;
}

.mission-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.mission-title .mission-highlight {
  color: var(--teal-deep);
  position: relative;
}

html[data-theme="dark"] .mission-title .mission-highlight {
  color: var(--teal);
}

.mission-sub {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* ── STATUT DE LA CHARTE (DPT-STATUS) ──────────────────────── */
.dpt-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  white-space: nowrap;
}

.dpt-status.is-ok {
  color: var(--ok);
  border-color: var(--ok);
  background: var(--badge-success-bg);
}

.dpt-status.is-teal {
  color: var(--teal);
  border-color: var(--teal);
  background: var(--badge-primary-bg);
}

.dpt-status.is-warn {
  color: var(--amber);
  border-color: var(--amber);
  background: var(--badge-warning-bg);
}

.dpt-status.is-calc {
  color: var(--badge-calc-tx);
  border-color: var(--calc);
  background: var(--badge-calc-bg);
}

.dpt-status.is-danger {
  color: var(--badge-danger-tx);
  border-color: var(--danger);
  background: var(--badge-danger-bg);
}

.dpt-status.is-off {
  color: var(--badge-sec-tx);
  border-color: var(--line);
  background: var(--badge-sec-bg);
}

/* Couleurs de texte de la charte (utilisées par les icônes des templates) */
.text-teal  { color: var(--teal) !important; }
.text-ok    { color: var(--ok) !important; }
.text-amber { color: var(--amber) !important; }
.text-calc  { color: var(--calc) !important; }

/* ── BANDEAU DE CHIFFRES (TDB-KPIS DE LA CHARTE) ───────────── */
.tdb-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.tdb-kpis > div {
  padding: 18px 24px;
  min-width: 0;
}

.tdb-kpis > div + div {
  border-left: 1px solid var(--line-soft);
}

.tdb-kpis dt {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-mute);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tdb-kpis dd {
  margin: 6px 0 0;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--teal-deep);
  font-variant-numeric: tabular-nums;
}

html[data-theme="dark"] .tdb-kpis dd {
  color: var(--teal);
}

@media (max-width: 900px) {
  .tdb-kpis { grid-template-columns: repeat(2, 1fr); }
  .tdb-kpis > div:nth-child(3) { border-left: 0; }
  .tdb-kpis > div:nth-child(n+3) { border-top: 1px solid var(--line-soft); }
}

@media (max-width: 500px) {
  .tdb-kpis { grid-template-columns: 1fr; }
  .tdb-kpis > div + div { border-left: 0; border-top: 1px solid var(--line-soft); }
}

/* ── STEPPER DU PIPELINE ────────────────────────────────────── */
.pipeline-track {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.pipeline-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  min-width: 78px;
}

.pipeline-node .node-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--badge-success-bg);
  color: var(--ok);
  border: 2px solid var(--ok);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  position: relative;
  box-shadow: 0 0 0 3px var(--inset);
}

.pipeline-node .node-check {
  position: absolute;
  /* contre le rond (40 px, centré), pas au coin de l'étape : sinon la coche cache la fin du libellé */
  top: 26px;
  right: calc(50% - 23px);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ok);
  color: #fff;
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-card);
}

.pipeline-node .node-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.pipeline-line {
  flex: 1;
  height: 3px;
  background: var(--ok);
  margin: 0 8px;
  margin-bottom: 22px;
  border-radius: 2px;
}

/* ── CARTES DE LIVRABLES (DELIV-CARD) ───────────────────────── */
.deliv-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  /* pas d'overflow:hidden : il couperait le menu ⋮ (les coins sont arrondis sur la bande) */
  transition: transform .15s var(--ease), box-shadow .15s ease, border-color .15s ease;
}

/* Carte dont le menu est ouvert : au-dessus des cartes voisines */
.deliv-card:has(.dropdown-menu.show) { z-index: 5; }

.deliv-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-active);
}

.deliv-stripe {
  height: 4px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--card-accent, var(--teal-deep));
  width: 100%;
}

.deliv-inner {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.deliv-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.deliv-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--inset);
  color: var(--card-accent, var(--teal-deep));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  border: 1px solid var(--line-soft);
}

.deliv-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 6px;
  line-height: 1.3;
}

.deliv-desc {
  font-size: 0.86rem;
  color: var(--ink-soft);
  margin: 0 0 14px;
  line-height: 1.45;
  flex: 1;
}

.deliv-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.deliv-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--inset);
  border: 1px solid var(--line-soft);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-soft);
}

.deliv-file-row {
  background: var(--inset);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 10px;
  font-family: 'JetBrains Mono', SFMono-Regular, monospace;
  font-size: 12px;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 16px;
}

.deliv-file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deliv-foot {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.deliv-foot .dpt-btn {
  flex: 1;
}

/* ── PHOTOS BRUTES GRID ─────────────────────────────────────── */
.photo-card {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: 8px;
  overflow: hidden;
  background: var(--inset);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.photo-card:hover {
  transform: translateY(-2px);
  border-color: var(--teal);
  box-shadow: var(--shadow-sm);
}

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

.photo-card-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--ink-mute);
  padding: 8px;
  text-align: center;
}

.photo-card-placeholder i {
  font-size: 22px;
}

.photo-card-name {
  font-size: 10.5px;
  font-family: monospace;
  font-weight: 600;
  color: var(--ink-soft);
}

.photo-overlay {
  position: absolute;
  inset: 0;
  background: rgba(18, 63, 61, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  transition: opacity .18s ease;
}

.photo-card:hover .photo-overlay {
  opacity: 1;
}

.photo-action-btn {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: #ffffff;
  color: var(--teal-deep);
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  transition: transform .1s ease, background .1s ease;
}

.photo-action-btn:hover {
  transform: scale(1.1);
  background: var(--badge-primary-bg);
}

.hidden-photo-col {
  display: none !important;
}

/* ── VISUALISEUR IFRAME & SIDEBAR URLS ──────────────────────── */
.viewer-container {
  height: 520px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-card);
  position: relative;
}

.viewer-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--inset);
  padding: 24px;
}

.viewer-placeholder i.vp-big {
  font-size: 48px;
  color: var(--teal);
  margin-bottom: 14px;
}

.map-iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.code-box {
  background: var(--inset);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  font-family: 'JetBrains Mono', SFMono-Regular, monospace;
  font-size: 12px;
  color: var(--ink);
  word-break: break-all;
  white-space: pre-wrap;
  user-select: all;
  margin: 6px 0 10px;
}

/* ── FOOTER DE LA CHARTE ────────────────────────────────────── */
.site-footer {
  margin-top: 60px;
  background: var(--bg-card);
  border-top: 1px solid var(--line);
  padding: 28px 0;
  transition: background .2s ease;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-brand-title {
  font-weight: 700;
  color: var(--ink);
  font-size: 0.95rem;
}

.footer-brand-sub {
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 18px;
}

.footer-links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: color .15s ease;
}

.footer-links a:hover {
  color: var(--teal);
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--ink-mute);
}

/* ── TOAST NOTIFICATION ─────────────────────────────────────── */
.toast-popup {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--teal-deep);
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  z-index: 9999;
}

html[data-theme="dark"] .toast-popup {
  background: var(--primary);
}

.toast-popup.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ── MODALE DOCUMENT (IDENTIQUE À BASE.HTML) ─────────────────── */
.modal-content {
  background: var(--bg-card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.modal-header {
  border-bottom: 1px solid var(--line);
  padding: 14px 20px;
}

.modal-footer {
  border-top: 1px solid var(--line);
  padding: 12px 20px;
}

/* Apparition en fondu + léger agrandissement, comme les menus (skill dashboard-interactif) */
.modal.fade .modal-dialog {
  transform: scale(0.95) translateY(10px);
  opacity: 0;
  transition: transform 220ms var(--ease), opacity 220ms var(--ease);
}
.modal.show .modal-dialog { transform: none; opacity: 1; }
.modal-title { font-size: 1.05rem; font-weight: 700; color: var(--ink); }
.modal-title i { color: var(--teal); margin-right: 6px; }
html[data-theme="dark"] .btn-close { filter: invert(1) grayscale(1); }

/* Onglets de page (restitution) : soulignement sarcelle sur l'onglet ouvert, compteur en pastille.
   scroll-margin-top : la barre du haut est collante, on s'arrête juste en dessous. */
.dpt-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
  scroll-margin-top: 76px;
}
.tab-pane [id] { scroll-margin-top: 76px; }
/* Ouverte sur une ancre (#section-map), la page donne le focus au panneau d'onglet : pas de contour
   autour de tout le contenu (le focus visible reste sur les boutons d'onglets). */
.tab-content > .tab-pane:focus { outline: none; }
.dpt-tabs .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  padding: 10px 16px;
  margin-bottom: -1px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: none;
  color: var(--ink-mute);
  font-weight: 600;
  font-size: 14px;
  transition: color .15s ease, border-color .15s ease;
}
.dpt-tabs .nav-link:hover { color: var(--ink); }
.dpt-tabs .nav-link.active { color: var(--teal); border-bottom-color: var(--teal); }
.dpt-tab-count {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--inset);
  color: var(--ink-soft);
}
.dpt-tabs .nav-link.active .dpt-tab-count { background: color-mix(in srgb, var(--teal) 14%, transparent); color: var(--teal); }

/* Couches de la mission (restitution, sous la carte) : maquette _apercus/couches_de_la_mission.html,
   aux couleurs de la charte (jetons de statut --st-*). Une ligne teintée par couche, barre de progression. */
.layer-card {
  background: var(--inset);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}
.layer-card-head { display: flex; align-items: center; gap: 10px; }
.layer-card-head strong { font-size: 13px; color: var(--ink); }
.layer-card-icon {
  width: 30px; height: 30px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 6px;
  font-size: 14px;
  color: var(--teal);
  background: color-mix(in srgb, var(--teal) 12%, transparent);
}
.layer-card-count { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--ink-mute); font-variant-numeric: tabular-nums; }
.layer-card-count b { color: var(--ink); }
.layer-card-empty { margin: 10px 0 0; font-size: 12.5px; color: var(--ink-mute); }
.layer-progress { height: 6px; background: var(--line); margin: 12px 0 14px; overflow: hidden; border-radius: 3px; }
.layer-progress-fill { height: 100%; transition: width .7s cubic-bezier(0.16, 1, 0.3, 1); }
.layer-progress-fill.is-ok { background: var(--st-done); }
.layer-progress-fill.is-warn { background: var(--st-wait); }
.layer-progress-fill.is-crit { background: var(--st-fail); }
.layer-progress-fill.is-unknown { background: var(--st-todo); }
.layer-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.layer-list li {
  --c: var(--st-todo);
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--c) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 20%, transparent);
  transition: background .15s ease;
  animation: layerRowIn .45s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(var(--i) * 35ms);
}
.layer-list li.is-ok { --c: var(--st-done); }
.layer-list li.is-absent { --c: var(--st-fail); }
.layer-list li:hover { background: color-mix(in srgb, var(--c) 14%, transparent); }
.layer-list li > i { font-size: 15px; color: var(--c); flex-shrink: 0; }
.layer-name { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px; color: var(--c); word-break: break-all; }
.layer-name .ns { opacity: .6; }
.layer-name .nm { font-weight: 600; }
@keyframes layerRowIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .layer-list li { animation: none; }
  .layer-progress-fill { transition: none; }
}

/* Page Statistiques (templates/supervision/stats.html, static/js/stats_charts.js) */
.stats-filter { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; }
.stats-segment { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-card); }
.stats-segment a {
  padding: 6px 14px; border-radius: 7px; font-size: 13px; font-weight: 600;
  color: var(--ink-soft); text-decoration: none; transition: background .15s ease, color .15s ease;
}
.stats-segment a:hover { background: var(--inset); color: var(--ink); }
.stats-segment a.active { background: var(--teal); color: #fff; }
.stats-window { margin: 0; font-size: 13px; color: var(--ink-mute); }
.stats-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; margin: 0; padding: 0; font-size: 13px; color: var(--ink-soft); }
.stats-legend li { display: inline-flex; align-items: center; gap: 6px; }
.stats-legend i { color: var(--ink-mute); font-size: 12px; }
.stats-swatch { width: 14px; height: 14px; border-radius: 4px; background: var(--st-todo); }
.stats-swatch.is-done { background: var(--st-done); }
.stats-swatch.is-wait { background: var(--st-wait); }
.stats-swatch.is-fail {   /* mêmes hachures que le graphique */
  background: repeating-linear-gradient(135deg, var(--st-fail) 0 3px, color-mix(in srgb, var(--st-fail) 45%, var(--bg-card)) 3px 5px);
}
.stats-card h2 { font-size: 1.05rem; font-weight: 700; margin: 0 0 4px; color: var(--ink); }
.stats-sub { font-size: 12.5px; color: var(--ink-mute); margin: 0 0 14px; }
.stats-canvas { position: relative; }
.stats-canvas.is-teams { height: calc(var(--rows, 4) * 44px + 50px); min-height: 180px; }
.stats-empty { margin: 24px 0; text-align: center; color: var(--ink-mute); font-size: 14px; }
.stats-figure { margin: 18px 0; }
.stats-figure strong { display: block; font-size: 2rem; font-weight: 800; color: var(--ink); }
.stats-figure span { font-size: 13px; color: var(--ink-mute); }
.stats-table { margin-top: 12px; }
.stats-table summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--teal); }
.stats-table table { margin-top: 8px; font-size: 12.5px; color: var(--ink); font-variant-numeric: tabular-nums; }
.stats-table th { font-size: 11.5px; color: var(--ink-mute); font-weight: 700; white-space: nowrap; }
.stats-card h3 { font-size: 1.05rem; font-weight: 700; margin: 0 0 4px; color: var(--ink); }

/* Comptabilité (page Statistiques) : montants en FCFA, budget en jauges (dépassement = même ambre que Paiement) */
.acct { padding-top: 8px; border-top: 1px solid var(--line); }
.acct-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 8px 0 6px; }
.acct-head h2 { font-size: 1.35rem; font-weight: 800; margin: 0; color: var(--ink); }
.acct .tdb-kpis dd { font-size: 24px; }
.acct .tdb-kpis dd small { font-size: 12.5px; font-weight: 600; color: var(--ink-mute); }
.acct .tdb-kpis .acct-over, .acct-over { color: var(--st-wait); }
.acct-budget { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.acct-budget-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 13px; margin-bottom: 5px; }
.acct-budget-figure { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.acct-budget small { font-size: 12px; }
.acct-meter { height: 8px; border-radius: 4px; background: var(--line-soft); overflow: hidden; margin-bottom: 3px; }
.acct-meter span { display: block; height: 100%; border-radius: 4px; background: var(--teal); }
.acct-meter.is-over span { background: var(--st-wait); }

/* Listes déroulantes des modales : background-color seulement (le raccourci background effacerait la flèche) */
.dpt-form .form-select { background-color: var(--bg-input); border-color: var(--line); color: var(--ink); }
.dpt-form .form-select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 18%, transparent); }

/* Fiche équipe (templates/supervision/team_detail.html) */
.team-h2 { font-size: 1.05rem; font-weight: 700; margin: 0 0 12px; color: var(--ink); }
.team-link { color: var(--ink); text-decoration: none; }
.team-link:hover strong { color: var(--teal); text-decoration: underline; }
.team-facts { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 0; font-size: 13.5px; }
.team-facts dt { color: var(--ink-mute); font-weight: 600; }
.team-facts dd { margin: 0; color: var(--ink); }
.team-code { font-size: 13px; font-weight: 700; color: var(--teal); }
.team-warning { margin: 0 0 10px; padding: 8px 12px; border-radius: 8px; font-size: 13px;
  color: var(--ink); background: color-mix(in srgb, var(--st-wait) 14%, transparent); }
.team-warning i { color: var(--st-wait); }
.team-members { font-size: 13.5px; color: var(--ink); }
.team-members th { font-size: 11.5px; color: var(--ink-mute); font-weight: 700; white-space: nowrap; }
.team-members tr.is-inactive td, .table tr.is-inactive > td { opacity: .55; }
.team-role { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-weight: 600; font-size: 12.5px;
  padding: 2px 8px; border-radius: 999px; background: var(--inset); color: var(--ink-soft); }
.team-role.is-chef { background: color-mix(in srgb, var(--teal) 14%, transparent); color: var(--teal); }
.kpi-unit { font-size: 16px; font-weight: 600; color: var(--ink-mute); }

/* text-muted de Bootstrap : gris fixe, illisible en thème sombre. Il suit ici le jeton du thème (clair et sombre). */
.text-muted { color: var(--ink-mute) !important; }

/* Pagination simple (Missions, Journaux) */
.dpt-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; font-size: 13px; color: var(--ink-mute); }

/* Journaux (templates/supervision/logs.html) */
.log-table { font-size: 13.5px; color: var(--ink); }
.log-table th { font-size: 11.5px; color: var(--ink-mute); font-weight: 700; }
.log-category { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--inset); color: var(--ink-soft); white-space: nowrap; }
.log-new { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; color: #fff; background: var(--teal); }
.log-run { border: 1px solid var(--line); border-radius: 8px; background: var(--inset); padding: 10px 12px; }
.log-run summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink); }
.log-pre { margin: 10px 0; max-height: 360px; overflow: auto; padding: 10px 12px; border-radius: 6px;
  background: #101614; color: #d7e3df; font-size: 12px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }

/* Paramètres en onglets (templates/supervision/settings.html) */
.settings-panel { max-width: 920px; }
.settings-row { padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line-soft); }
.settings-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding-top: 4px; }
.settings-actions small { color: var(--ink-mute); font-size: 12.5px; }
.dpt-tabs .nav-link .settings-tab-error,
.dpt-tabs .nav-link.active .settings-tab-error { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.settings-env { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px 28px; margin: 0; }
.settings-env dt { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.settings-env dd { margin: 2px 0 0; }
.settings-env code { font-size: 12.5px; word-break: break-all; }
.settings-env small,
.settings-history small { display: block; font-size: 11.5px; color: var(--ink-mute); }
.settings-history { font-size: 13px; color: var(--ink); padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.settings-history:last-child { border-bottom: 0; }

/* Onglet « Import de données » : quatre cartes, compte rendu de l'essai ou de l'import au-dessus */
.import-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .import-grid { grid-template-columns: 1fr; } }
.import-card h2, .import-report h2 { font-size: 1.05rem; font-weight: 700; margin: 0 0 4px; color: var(--ink); }
.import-card .form-control { background: var(--bg-input); border-color: var(--line); color: var(--ink); }
.import-card .form-label { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); margin-bottom: 4px; }
.import-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.import-report { border-left: 4px solid var(--teal); }
.import-report.is-trial { border-left-color: var(--st-wait); }
.import-report.is-error { border-left-color: var(--st-fail); }
.import-report.is-error h2 i { color: var(--st-fail); }
.import-report.is-trial h2 i { color: var(--st-wait); }
.import-report.is-done h2 i { color: var(--st-done); }
.import-report h2 small { font-weight: 500; color: var(--ink-mute); font-size: 12.5px; }
.import-summary { font-size: 14px; font-weight: 600; color: var(--ink); margin: 6px 0 10px; }
.import-lines { max-height: 280px; overflow: auto; font-size: 12px; line-height: 1.55; background: var(--bg-input);
  border: 1px solid var(--line-soft); border-radius: 8px; padding: 10px 12px; color: var(--ink-soft); margin: 0 0 10px; }
.import-attrs { font-size: 12.5px; color: var(--ink-mute); margin: 0 0 6px; }
@media (max-width: 500px) { .import-fields { grid-template-columns: 1fr; } }

/* Fiche d'une entité spatiale (templates/supervision/feature.html) : carte d'édition du contour */
.feature-map-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.feature-map-head .team-h2 { margin: 0; }
.feature-map { height: 560px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.feature-state { font-size: 12.5px; font-weight: 600; color: var(--st-wait); margin: 8px 0 0; min-height: 1.2em; }
.feature-h3 { font-size: 13px; font-weight: 700; color: var(--ink-soft); margin: 18px 0 8px; }
.feature-attrs { font-size: 12.5px; }
.feature-missions { list-style: none; margin: 0; padding: 0; font-size: 13px; display: grid; gap: 6px; }
.dpt-btn-ghost.is-danger, .dpt-btn-ghost.is-danger i { color: var(--danger); }
@media (max-width: 700px) { .feature-map { height: 420px; } }

/* Paiement (templates/supervision/payments.html) */
.pay-rule { font-size: 12.5px; color: var(--ink-mute); margin: 0 0 16px; }
.pay-days { font-size: 13px; color: var(--ink-soft); }
.pay-over { color: var(--st-wait); font-weight: 700; }
.team-members tfoot td { border-top: 2px solid var(--line); color: var(--ink); }

/* Aide en mini-modale : icône « ? » à côté d'un titre, note courte dans une modale étroite */
.dpt-help-btn {
  border: 0;
  background: none;
  padding: 0 2px;
  margin-left: 2px;
  color: var(--ink-mute);
  font-size: 13px;
  line-height: 1;
  vertical-align: baseline;
  cursor: pointer;
  transition: color .15s ease;
}
.dpt-help-btn:hover, .dpt-help-btn:focus-visible { color: var(--teal); }
.dpt-modal-help { max-width: 360px; }
.dpt-modal-help .modal-body { font-size: 13.5px; color: var(--ink-soft); }
.dpt-help-steps { margin: 0; padding-left: 1.2rem; }
.dpt-help-steps li + li { margin-top: 6px; }

/* Champs de saisie des modales (remplace les styles écrits dans chaque champ) */
.dpt-form .form-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 5px;
}
.dpt-form .form-control {
  background: var(--bg-input);
  border-color: var(--line);
  color: var(--ink);
}
.dpt-form .form-control:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 18%, transparent);
}
.dpt-form .form-control::placeholder { color: var(--ink-mute); opacity: .75; }
.dpt-form .form-text { font-size: 12px; color: var(--ink-mute); }

/* Tableaux des panneaux : Bootstrap pose un fond blanc sur chaque cellule, visible en thème sombre */
.dpt-panel .table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--ink);
  --bs-table-border-color: var(--line-soft);
}
.dpt-form .is-code { text-transform: uppercase; font-family: 'JetBrains Mono', monospace; font-weight: 700; }

/* Modale de confirmation : question, puis attente (la page se recharge ensuite avec le résultat) */
.dpt-btn-primary.is-danger { background: var(--danger); box-shadow: none; }
.dpt-btn-primary.is-danger:hover { background: var(--danger); filter: brightness(1.08); }
.confirm-question { color: var(--ink-soft); font-size: 14.5px; line-height: 1.55; }
.confirm-wait { display: none; align-items: center; gap: 12px; padding: 6px 0; color: var(--ink-soft); }
.confirm-wait .spinner-border { color: var(--teal); width: 1.6rem; height: 1.6rem; }
#confirmModal.is-busy .confirm-question,
#confirmModal.is-busy .modal-footer,
#confirmModal.is-busy .btn-close { display: none; }
#confirmModal.is-busy .confirm-wait { display: flex; }

/* En-tête de panneau avec un bouton d'action à droite (ex. « Nouvelle équipe ») */
.panel-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
/* Titre de panneau : même style que les autres titres de section (avant : taille Bootstrap h3, sans gras) */
.panel-bar h3 { margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  .modal.fade .modal-dialog { transition: none !important; }
}

/* ── MENUS DÉROULANTS ANIMÉS (skill dashboard-interactif) ─────────
   Bootstrap affiche/masque d'un coup (display:none/block). Ici le menu reste dans le flux
   (display:block) et apparaît en fondu + léger agrandissement depuis son bouton, sur la classe
   .show que Bootstrap pose déjà. Rien à changer côté JS. */
.dropdown-menu {
  display: block;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform-origin: top right;
  transform: scale(0.95) translateY(-6px);
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  color: var(--ink);
  padding: 6px;
  font-size: 0.88rem;
  transition: opacity 180ms cubic-bezier(0.16,1,0.3,1), transform 180ms cubic-bezier(0.16,1,0.3,1),
              visibility 180ms cubic-bezier(0.16,1,0.3,1), background-color .2s ease, border-color .2s ease;
}
.dropdown-menu.show { opacity: 1; visibility: visible; pointer-events: auto; transform: scale(1) translateY(0); }
.dropdown-menu-start, .dropdown-menu:not(.dropdown-menu-end) { transform-origin: top left; }
.dropup .dropdown-menu { transform-origin: bottom left; transform: scale(0.95) translateY(6px); }
.dropup .dropdown-menu.show { transform: scale(1) translateY(0); }
/* Dans un tableau défilant, un menu fermé (invisible mais toujours dans le flux) agrandissait la zone
   à faire défiler : barres horizontale et verticale sur du vide. En position fixe, il en sort ;
   ouvert, Popper le place déjà en fixe (base.html). */
.table-responsive .dropdown-menu:not(.show) { position: fixed; }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 9px;
  border-radius: 7px;
  padding: 7px 10px;
  color: var(--ink);
  transition: background-color 120ms ease, padding-left 120ms cubic-bezier(0.16,1,0.3,1), color 120ms ease;
}
.dropdown-item i { width: 16px; text-align: center; color: var(--ink-mute); }
.dropdown-item:hover, .dropdown-item:focus { padding-left: 14px; background: var(--inset); color: var(--ink); }
.dropdown-item:hover i, .dropdown-item.active i { color: var(--teal); }
.dropdown-item.active, .dropdown-item:active { background: var(--badge-primary-bg); color: var(--badge-primary-tx); }
.dropdown-item.is-danger, .dropdown-item.is-danger i { color: var(--danger); }
.dropdown-divider { border-top-color: var(--line); margin: 6px 4px; }
.dropdown-header {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-mute);
  padding: 6px 10px 4px;
}

/* ── BARRE : BOUTONS À MENU (cloche, compte, menu petit écran) ──── */
.nav-drop-btn {
  height: 38px;
  min-width: 38px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  color: var(--nav-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  position: relative;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.nav-drop-btn:hover, .nav-drop-btn[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.36);
  color: var(--nav-text-strong);
}
.nav-drop-btn.dropdown-toggle::after { border-top-color: currentColor; opacity: .7; margin-left: 2px; }
.nav-drop-btn.no-caret::after { display: none; }

.nav-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.nav-bell-dot {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--st-fail);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  border: 2px solid var(--navbar-bg);
  font-variant-numeric: tabular-nums;
}

.nav-menu-account { min-width: 230px; }
.nav-menu-account .who {
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.nav-menu-account .who strong { display: block; color: var(--ink); font-size: 0.9rem; }
.nav-menu-account .who span { color: var(--ink-mute); font-size: 0.76rem; }

.nav-menu-bell { width: 340px; max-width: calc(100vw - 24px); }
.bell-item {
  display: flex;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink);
}
.bell-item:hover { background: var(--inset); color: var(--ink); }
.bell-item .bell-icon {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  background: var(--badge-primary-bg);
  color: var(--badge-primary-tx);
}
.bell-item .bell-icon.is-success { background: var(--badge-success-bg); color: var(--badge-success-tx); }
.bell-item .bell-icon.is-warning { background: var(--badge-warning-bg); color: var(--badge-warning-tx); }
.bell-item .bell-icon.is-danger  { background: var(--badge-danger-bg);  color: var(--badge-danger-tx); }
.bell-item .bell-title { font-size: 0.83rem; font-weight: 600; line-height: 1.3; }
.bell-item.is-unread .bell-title::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  margin-right: 6px;
  vertical-align: middle;
}
.bell-item .bell-time { font-size: 0.72rem; color: var(--ink-mute); }
.bell-empty { padding: 18px 10px; text-align: center; color: var(--ink-mute); font-size: 0.85rem; }
.bell-foot {
  display: block;
  text-align: center;
  padding: 8px;
  margin-top: 4px;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--teal-deep);
  text-decoration: none;
}
.bell-foot:hover { color: var(--teal); }

/* Le menu « petit écran » remplace les liens de la barre sous 992 px */
.nav-small-only { display: none; }
@media (max-width: 1199.98px) { .nav-small-only { display: inline-flex; } }

/* Les menus passent au-dessus de la barre collante et des cartes MapLibre */
.navbar-main .dropdown-menu { z-index: 1040; }

@media (prefers-reduced-motion: reduce) {
  .dropdown-menu, .dropdown-item, .nav-drop-btn { transition: none !important; }
}

/* Téléphone : la barre doit tenir dans l'écran (sinon toute la page déborde à droite) */
@media (max-width: 575.98px) {
  .navbar-main .brand-logo { height: 26px; }
  .navbar-main .container-fluid { gap: 8px; }
  .nav-actions { gap: 6px; }
  .nav-drop-btn .nav-label { display: none; }
  .nav-drop-btn { padding: 0 9px; }
}

/* ── PASTILLES DE STATUT ET COMPTEURS DANS LES MENUS ────────────── */
.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--st-todo);
}
.status-dot.is-done { background: var(--st-done); }
.status-dot.is-wait { background: var(--st-wait); }
.status-dot.is-fail { background: var(--st-fail); }
.status-dot.is-todo { background: var(--st-todo); }

.dropdown-item .drop-count {
  margin-left: auto;
  padding-left: 14px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
}
.dropdown-item.active .drop-count { color: inherit; }

/* Bouton de filtre : signale qu'un filtre est actif */
.filter-drop.is-active {
  border-color: var(--teal);
  background: var(--badge-primary-bg);
  color: var(--badge-primary-tx) !important;
}
.dpt-btn.dropdown-toggle::after { margin-left: 2px; opacity: .7; }

/* ── BASCULE D'AFFICHAGE (tableau / cartes) ─────────────────────── */
.view-toggle {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 9px;
  background: var(--inset);
  border: 1px solid var(--line);
}
.view-toggle button {
  width: 34px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-mute);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.view-toggle button:hover { color: var(--ink); }
/* actif : fond + bordure + ombre ensemble (lisible aussi en sombre, leçon du skill console-ui) */
.view-toggle button.active {
  background: var(--bg-card);
  border-color: var(--line);
  color: var(--teal);
  box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 2px 6px rgba(0,0,0,.10);
}

/* Livrables en tableau */
.deliv-table thead th {
  background: var(--inset) !important;
  color: var(--ink-mute);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line) !important;
  white-space: nowrap;
}
.deliv-table td { color: var(--ink); border-color: var(--line-soft); background: var(--bg-card); font-size: .9rem; }
.deliv-row-icon {
  display: inline-flex;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  align-items: center;
  justify-content: center;
  background: var(--inset);
  color: var(--teal);
  margin-right: 6px;
}
.deliv-row-code {
  font-family: 'JetBrains Mono', SFMono-Regular, monospace;
  font-size: 12px;
  color: var(--ink-soft);
  background: var(--inset);
  padding: 2px 6px;
  border-radius: 5px;
}

/* Bouton ▾ collé à un champ (choix de la semaine) */
.week-picker-btn {
  background: var(--inset);
  border: 1px solid var(--line);
  color: var(--ink-soft);
}
.week-picker-btn:hover, .week-picker-btn[aria-expanded="true"] { background: var(--line-soft); color: var(--ink); }

/* ── CARTE DE RESTITUTION FAÇON SIG DE BUREAU (skill maplibre-desktop-like) ─────────────
   Plans (piège n° 3 du skill) : cartes 0-1 < rideau 1 (plugin) < barre d'état 5 < barre d'outils 10
   < barre du rideau 12 < panneaux 25. Couleurs = jetons de la charte, sans variable alias (piège n° 2). */
.mm-root { position: relative; }
.mm-stage {
  position: relative;
  height: var(--mm-h, 600px);   /* --mm-h : hauteur choisie par la page (templates/missions/_zones_map.html) */
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #e9ecea;
}
.mm-map { position: absolute; inset: 0; }
.mm-root.is-fullscreen .mm-stage { height: 100vh; border-radius: 0; border: 0; }

/* Barres d'icônes (IconControlGroup), posées au-dessus des deux cartes du rideau */
.mm-toolbar {
  position: absolute; top: 10px; left: 10px; z-index: 10;
  display: flex; flex-direction: column; gap: 8px;
}
.mm-toolbar .maplibregl-ctrl { margin: 0; }
.maplibregl-ctrl-icon-group {
  background: var(--bg-card);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.maplibregl-ctrl-icon-group button {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card); color: var(--ink-soft);
  border: 0; border-bottom: 1px solid var(--line-soft);
  cursor: pointer; padding: 0; font-size: 14px;
  transition: background .15s ease, color .15s ease;
}
.maplibregl-ctrl-icon-group button:last-child { border-bottom: 0; }
.maplibregl-ctrl-icon-group button:hover { background: var(--inset); color: var(--ink); }
.maplibregl-ctrl-icon-group button.active { background: color-mix(in srgb, var(--teal) 16%, var(--bg-card)); color: var(--teal); }
.maplibregl-ctrl-icon-group button:disabled { opacity: .4; cursor: not-allowed; }

/* Panneaux ancrés à leur bouton (positionPanel), apparition fondu + agrandissement */
.mm-panel {
  position: absolute; top: 0; left: 0; z-index: 25;
  width: 280px; max-height: calc(100% - 16px);
  display: flex; flex-direction: column;
  background: var(--bg-card); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; pointer-events: none;
  transform-origin: left top;
  transform: scale(0.94) translateX(-8px);
  transition: opacity .16s ease, transform .16s var(--ease), visibility .16s;
}
.mm-panel.is-flipped { transform-origin: right top; transform: scale(0.94) translateX(8px); }
.mm-panel.open { opacity: 1; visibility: visible; pointer-events: auto; transform: none; }
.mm-panel::before {   /* flèche vers le bouton */
  content: ""; position: absolute; left: -7px; top: var(--mm-arrow-top, 12px);
  border: 6px solid transparent; border-left: 0; border-right-color: var(--bg-card);
  filter: drop-shadow(-1px 0 0 var(--line));
}
.mm-panel.is-flipped::before { left: auto; right: -7px; border: 6px solid transparent; border-right: 0; border-left-color: var(--bg-card); filter: drop-shadow(1px 0 0 var(--line)); }
.mm-panel-wide { width: 320px; }
.mm-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-bottom: 1px solid var(--line-soft); font-size: 13.5px;
}
.mm-panel-head i { color: var(--teal); margin-right: 6px; }
.mm-panel-body { padding: 6px 10px 10px; overflow-y: auto; }
.mm-panel-foot { padding: 10px 12px; border-top: 1px solid var(--line-soft); background: var(--inset); border-radius: 0 0 10px 10px; }
.mm-panel-foot small { display: block; color: var(--ink-mute); font-size: 11.5px; margin-top: 3px; }
.mm-close {
  width: 28px; height: 28px; border-radius: 6px; border: 0;
  background: transparent; color: var(--ink-mute); cursor: pointer;
}
.mm-close:hover { background: var(--inset); color: var(--ink); }
.mm-close i { color: inherit; margin: 0; }

/* Gestionnaire de couches en dossiers */
.mm-folder { border-bottom: 1px solid var(--line-soft); }
.mm-folder:last-child { border-bottom: 0; }
.mm-folder-head {
  width: 100%; display: flex; align-items: center; gap: 8px;
  padding: 9px 4px; border: 0; background: transparent; color: var(--ink);
  font-size: 13px; font-weight: 600; text-align: left; cursor: pointer; border-radius: 6px;
}
.mm-folder-head:hover { background: var(--inset); }
.mm-chevron { font-size: 10px; color: var(--ink-mute); transition: transform .18s ease; }
.mm-folder.open .mm-chevron { transform: rotate(90deg); }
.mm-folder-icon { color: #c27400; }
.mm-folder.open .mm-folder-icon::before { content: "\f07c"; }   /* dossier ouvert (Font Awesome) */
.mm-count {
  margin-left: auto; font-size: 10.5px; font-weight: 700; color: var(--ink-mute);
  background: var(--inset); border-radius: 8px; padding: 1px 7px;
}
.mm-folder-body { max-height: 0; overflow: hidden; transition: max-height .2s ease; padding-left: 22px; }
.mm-folder.open .mm-folder-body { max-height: 320px; }
.mm-layer { padding: 6px 0; }
.mm-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); cursor: pointer; margin: 0; }
.mm-check input { accent-color: var(--teal); width: 15px; height: 15px; }
.mm-opacity { display: flex; align-items: center; gap: 8px; padding: 4px 0 0 23px; }
.mm-opacity input { flex: 1; accent-color: var(--teal); height: 4px; }
.mm-opacity span { font-size: 11px; color: var(--ink-mute); width: 38px; text-align: right; font-variant-numeric: tabular-nums; }
.mm-swatch { display: inline-block; width: 14px; height: 10px; }
.mm-swatch.is-dashed { border: 2px dashed #e0b000; }
.mm-swatch.is-dot { width: 11px; height: 11px; border-radius: 50%; background: #1f6f6b; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.mm-swatch.is-status { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); flex-shrink: 0; }

/* Fiche d'une zone (popup MapLibre) aux couleurs du thème, clair comme sombre */
.mm-root .maplibregl-popup-content {
  background: var(--bg-card); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-lg); padding: 12px 14px;
}
.mm-root .maplibregl-popup-anchor-bottom .maplibregl-popup-tip,
.mm-root .maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip,
.mm-root .maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip { border-top-color: var(--bg-card); }
.mm-root .maplibregl-popup-anchor-top .maplibregl-popup-tip,
.mm-root .maplibregl-popup-anchor-top-left .maplibregl-popup-tip,
.mm-root .maplibregl-popup-anchor-top-right .maplibregl-popup-tip { border-bottom-color: var(--bg-card); }
.mm-root .maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: var(--bg-card); }
.mm-root .maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: var(--bg-card); }
.mm-root .maplibregl-popup-close-button { color: var(--ink-mute); font-size: 18px; padding: 2px 8px; border-radius: 0 10px 0 6px; }
.mm-root .maplibregl-popup-close-button:hover { background: var(--inset); color: var(--ink); }
.mm-popup { min-width: 210px; font-size: 12.5px; }
.mm-popup-title { display: block; font-size: 14px; margin-right: 20px; }
.mm-popup-status { display: inline-flex; align-items: center; gap: 6px; margin: 4px 0 8px; font-weight: 600; color: var(--ink-soft); }
.mm-popup-status i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.mm-popup dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 0; }
.mm-popup dt { color: var(--ink-mute); font-weight: 500; }
.mm-popup dd { margin: 0; font-weight: 600; }
.mm-popup-actions { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.mm-popup-actions .dpt-btn { justify-content: center; }

/* Galerie de fonds de carte */
.mm-gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding-top: 6px; }
.mm-basemap {
  position: relative; display: flex; flex-direction: column; gap: 5px;
  padding: 5px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg-card); color: var(--ink-soft); cursor: pointer; text-align: left;
  transition: border-color .15s ease, transform .15s var(--ease);
}
.mm-basemap:hover { border-color: var(--ink-mute); transform: translateY(-1px); }
.mm-basemap.active { border-color: var(--teal); box-shadow: 0 0 0 2px color-mix(in srgb, var(--teal) 30%, transparent); color: var(--ink); }
.mm-basemap-thumb {
  display: block; height: 64px; border-radius: 5px;
  background: repeating-linear-gradient(45deg, var(--inset) 0 8px, var(--line-soft) 8px 16px);
  background-size: cover; background-position: center;
}
.mm-basemap-label { font-size: 12px; font-weight: 600; }
.mm-basemap-wait { position: absolute; top: 28px; left: calc(50% - 8px); color: #fff; display: none; }
.mm-basemap.is-loading .mm-basemap-wait { display: block; }
.mm-basemap.is-loading .mm-basemap-thumb { filter: brightness(.6); }

/* Légende */
.mm-legend-item { padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.mm-legend-item:last-child { border-bottom: 0; }
.mm-legend-item strong { display: block; font-size: 12.5px; margin-bottom: 6px; }
.mm-legend-item img { display: block; max-width: 100%; background: #fff; padding: 4px; border-radius: 6px; }
.mm-empty { font-size: 12.5px; color: var(--ink-mute); margin: 8px 0; }

/* Rideau : barre de choix en haut au centre, curseur aux couleurs de la charte */
.mm-compare-bar {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 12;
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px 6px 12px; border-radius: 10px;
  background: var(--bg-card); border: 1px solid var(--line); box-shadow: var(--shadow-md);
  font-size: 12px; font-weight: 600; color: var(--ink-soft); white-space: nowrap;
}
.mm-compare-bar[hidden] { display: none; }
.mm-compare-bar select {
  margin-left: 6px; font-size: 12.5px; padding: 3px 6px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--bg-card); color: var(--ink);
}
.mm-compare-bar > i { color: var(--teal); }
.mm-root .maplibregl-compare { background: #fff; }
.mm-root .maplibregl-compare .compare-swiper-vertical {
  background-color: var(--teal); width: 44px; height: 44px; left: -22px; margin-top: -22px;
  box-shadow: 0 0 0 3px #fff, var(--shadow-md);
}

/* Barre d'état : toujours sombre, comme le pied d'un logiciel (principe du skill) */
.mm-status {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
  display: flex; align-items: center; gap: 14px;
  height: 28px; padding: 0 10px;
  background: rgba(16, 24, 24, .78); color: #d9e2e1;
  font-size: 11.5px; font-variant-numeric: tabular-nums;
  backdrop-filter: blur(4px);
}
.mm-status > span { white-space: nowrap; flex-shrink: 0; }
.mm-status i { opacity: .7; }
.mm-status .maplibregl-ctrl-scale {
  margin: 0; background: transparent; color: #d9e2e1;
  border-color: #d9e2e1; font-size: 10.5px; line-height: 1.4; padding: 0 4px;
}
.mm-status > .mm-status-info { margin-left: auto; color: #ffd27a; overflow: hidden; text-overflow: ellipsis; flex-shrink: 1; min-width: 0; }
.mm-root .maplibregl-ctrl-bottom-right { bottom: 28px; }   /* attribution au-dessus de la barre d'état */

@media (max-width: 575.98px) {
  .mm-stage { height: min(var(--mm-h, 600px), 480px); }
  .mm-panel, .mm-panel-wide { width: 250px; }
  .mm-compare-bar { font-size: 11px; gap: 6px; }
  .mm-compare-bar label { display: flex; flex-direction: column; }
  .mm-status [data-mm-zoom] { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .mm-panel, .mm-folder-body, .mm-chevron, .mm-basemap { transition: none !important; }
}
.feature-table { font-size: 13px; color: var(--ink); }
.feature-table th { font-size: 11.5px; color: var(--ink-mute); font-weight: 700; white-space: nowrap; }
.mission-links-plots { max-height: 220px; overflow: auto; display: grid; gap: 4px; padding: 6px 2px; }
.feature-table a, .feature-missions a, td a.parcel-link { color: var(--teal); font-weight: 600; text-decoration: none; }
.feature-table a:hover, .feature-missions a:hover, td a.parcel-link:hover { text-decoration: underline; }
.dpt-btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
