
/* Base typographic scale */
h1 { font-size: 24px; font-weight: 800; line-height: 1.2; }
h2 { font-size: 20px; font-weight: 700; line-height: 1.25; }
h3 { font-size: 16px; font-weight: 600; line-height: 1.3; }
h4 { font-size: 12px; font-weight: 700; line-height: 1.35; text-transform: uppercase; letter-spacing: 0.04em; }
/* MILITRACK — Charte Graphique Robuste & Accessible */
:root {
  --color-red: #D41840;
  --color-red-hover: #BE123C;
  --color-red-light: #FFE4E6;
  --color-red-bg: #FFF1F2;

  --color-violet: #4338CA;
  --color-violet-hover: #3730A3;
  --color-violet-light: #EEF2FF;
  --color-violet-bg: #F8FAFF;

  --color-amber: #B45309;
  --color-amber-hover: #92400E;
  --color-amber-light: #FEF3C7;
  --color-amber-bg: #FFFBEB;

  --color-green: #047857;
  --color-green-hover: #065F46;
  --color-green-light: #D1FAE5;
  --color-green-bg: #ECFDF5;

  --color-blue: #0369A1;
  --color-blue-hover: #075985;
  --color-blue-light: #E0F2FE;
  --color-blue-bg: #F0F9FF;

  --color-stale: #BE123C;
  --color-stale-bg: #FFF1F2;
  --color-fresh: #047857;

  --gradient-main: linear-gradient(135deg, #D41840 0%, #9F1239 100%);
  --gradient-light: linear-gradient(135deg, #FFF1F2 0%, #FFE4E6 100%);

  --bg-app: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F1F5F9;

  --text-main: #0F172A;
  --text-muted: #475569;
  --text-light: #64748B;

  --border-color: #CBD5E1;
  --border-focus: #94A3B8;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08);
  --shadow-float: 0 20px 25px -5px rgb(0 0 0 / 0.1);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:focus-visible {
  outline: 2px solid var(--color-red) !important;
  outline-offset: 2px !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.05s !important;
    scroll-behavior: auto !important;
  }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  
  height: 100vh;
  width: 100vw;
}

/* AUTH OVERLAY */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}
.auth-overlay.hidden { display: none !important; }

.auth-card {
  background: var(--bg-card);
  width: 100%;
  max-width: 400px;
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-float);
  border: 1px solid var(--border-color);
}

.auth-header {
  text-align: center;
  margin-bottom: 20px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-red-bg);
  padding: 4px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-red-light);
  margin-bottom: 8px;
}

.brand-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--color-red);
  letter-spacing: -0.3px;
}

.auth-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.auth-tabs {
  display: flex;
  background: var(--bg-app);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  border: 1px solid var(--border-color);
}

.auth-tab {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.auth-tab.active {
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.form-group {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-row {
  display: flex;
  gap: 10px;
}
.form-row .form-group { flex: 1; }

label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 9px 11px;
  font-size: 13px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-main);
  outline: none;
  font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--color-red);
  box-shadow: 0 0 0 2px var(--color-red-light);
}

.hp-container {
  opacity: 0;
  position: absolute;
  top: 0;
  left: 0;
  height: 0;
  width: 0;
  z-index: -1;
  pointer-events: none;
}

.info-note {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--color-violet-bg);
  border: 1px solid var(--color-violet-light);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin-bottom: 14px;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  min-height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: background 0.15s ease, filter 0.15s ease, border-color 0.15s ease;
}

.btn-primary { background: var(--color-red); color: #FFFFFF; }
.btn-primary:hover { background: var(--color-red-hover); }

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

.btn-violet { background: var(--color-violet); color: #FFFFFF; }
.btn-violet:hover { background: var(--color-violet-hover); }

.btn-blue { background: var(--color-blue); color: #FFFFFF; }
.btn-blue:hover { background: var(--color-blue-hover); }

.btn-amber { background: var(--color-amber); color: #FFFFFF; }
.btn-amber:hover { background: var(--color-amber-hover); }

.btn-green { background: var(--color-green); color: #FFFFFF; }
.btn-green:hover { background: var(--color-green-hover); }

.btn-secondary {
  background: var(--color-violet-bg);
  color: var(--color-violet-hover);
  border: 1px solid var(--color-violet-light);
}
.btn-secondary:hover {
  background: var(--color-violet-light);
}

.btn-outline {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}
.btn-outline:hover { background: var(--bg-card-hover); }

.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg-card-hover); color: var(--text-main); }

.btn-sm { padding: 6px 12px; font-size: 12px; min-height: 32px; }
.btn-xs { padding: 4px 10px; font-size: 12px; min-height: 28px; }
.btn-block { width: 100%; }

.btn-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  color: var(--text-muted);
}
.btn-icon:hover { background: var(--bg-card-hover); color: var(--text-main); }

.alert-box {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  margin-bottom: 14px;
}
.alert-box.success { background: #ECFDF5; border: 1px solid #A7F3D0; color: #065F46; }
.alert-box.error { background: var(--color-red-bg); border: 1px solid var(--color-red-light); color: #9F1239; }

/* APP LAYOUT */
.app-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  
}

.app-header {
  height: 52px;
  background: #FFFFFF;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-red);
  border: 2px solid var(--color-red-light);
}

.brand-text {
  font-size: 18px;
  font-weight: 800;
  color: var(--color-red);
  letter-spacing: -0.3px;
}

.header-filters {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-group {
  display: flex;
  background: var(--bg-app);
  padding: 4px 6px;
  gap: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.filter-chip {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  min-height: 32px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
}
.filter-chip.active { background: var(--bg-card); color: var(--text-main); border-color: var(--border-color); box-shadow: var(--shadow-sm); }
.filter-chip.chip-amber.active { background: var(--color-amber-bg); color: #92400E; border: 1px solid var(--color-amber-light); font-weight: 600; }
.filter-chip.chip-green.active { background: var(--color-green-bg); color: #065F46; border: 1px solid var(--color-green-light); font-weight: 600; }
.filter-chip.chip-red.active { background: var(--color-red-bg); color: #9F1239; border: 1px solid var(--color-red-light); font-weight: 600; }
.filter-chip.chip-violet.active { background: var(--color-violet-bg); color: #3730A3; border: 1px solid var(--color-violet-light); font-weight: 600; }
.filter-chip.chip-blue.active { background: var(--color-blue-bg); color: #075985; border: 1px solid var(--color-blue-light); font-weight: 600; }

.period-control-container {
  display: flex;
  align-items: center;
  gap: 6px;
}

.month-navigator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-violet-bg);
  border: 1px solid var(--color-violet-light);
  border-radius: var(--radius-full);
  padding: 4px 8px;
  font-size: 12px;
}

.month-label {
  font-size: 12px;
  color: #3730A3;
  font-weight: 600;
  padding: 0 6px;
}

.btn-nav {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px 8px;
  color: #3730A3;
  font-size: 13px;
  min-width: 32px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border-radius: 4px;
}
.btn-nav:hover {
  background: var(--color-violet-light);
}

.btn-nav-reset {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px 8px;
  color: var(--text-muted);
  font-size: 16px;
  min-width: 32px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.btn-nav-reset:hover {
  color: var(--color-red);
}

.btn-freshness {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  min-height: 32px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-freshness:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}
.btn-freshness.active {
  background: #ECFDF5;
  color: #065F46;
  border-color: #A7F3D0;
}
.freshness-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94A3B8;
}
.btn-freshness.active .freshness-dot {
  background: #047857;
}

.select-input {
  padding: 4px 8px;
  font-size: 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: #FFFFFF;
}

.badge-pending {
  background: var(--color-red);
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-app);
  padding: 3px 6px 3px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.user-name { font-size: 13px; font-weight: 500; }

.role-badge {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: var(--color-violet-bg);
  color: #3730A3;
  border: 1px solid var(--color-violet-light);
}

/* MAP & RIGHT TOOLS PANEL */
.map-wrapper {
  position: relative;
  flex: 1;
  width: 100%;
  height: calc(100vh - 52px);
}

#map {
  width: 100%;
  height: 100%;
  background: #F1F5F9;
}

/* Atténuation des couleurs de fond de la carte pour faire ressortir les actions */
.leaflet-tile-pane {
  filter: saturate(55%) brightness(101%);
  transition: filter 0.3s ease;
}

/* Mode couleur standard si désiré */
.leaflet-tile-pane.full-color {
  filter: none;
}

/* Halo blanc pour détacher les tracés rouges et violets de la carte */
.leaflet-overlay-pane path {
  filter: drop-shadow(0 0 2px #FFFFFF) drop-shadow(0 0 1px #FFFFFF);
}

/* VERTICAL TOOLBAR ON THE RIGHT SIDE */
.map-tools-right {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 800;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.side-tool-btn {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: #FFFFFF;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}

.side-tool-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.side-tool-btn:active {
  transform: translateY(1px);
}

.side-tool-btn .tool-label {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.1;
  margin-top: 2px;
}

.side-tool-btn.tool-red {
  background: #FFFFFF;
  border-color: var(--color-red-light);
  color: var(--color-red);
}
.side-tool-btn.tool-red:hover {
  background: var(--color-red-bg);
}

.side-tool-btn.tool-violet {
  background: #FFFFFF;
  border-color: var(--color-violet-light);
  color: var(--color-violet);
}
.side-tool-btn.tool-violet:hover {
  background: var(--color-violet-bg);
}

.side-tool-btn.tool-blue {
  background: #FFFFFF;
  border-color: var(--color-blue-light);
  color: var(--color-blue);
}
.side-tool-btn.tool-blue:hover {
  background: var(--color-blue-bg);
}

.side-tool-btn.tool-neutral {
  color: var(--text-main);
}
.side-tool-btn.tool-neutral:hover {
  background: var(--bg-card-hover);
}

.tool-divider {
  height: 1px;
  background: var(--border-color);
  margin: 2px 4px;
}

/* QUICK ADD POPUP (when clicking directly on the map) */
.quick-add-popup {
  padding: 8px 10px;
  text-align: center;
}

.quick-add-title {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.quick-add-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

/* DEZOOM ZONE SUMMARY BUBBLE */
.zone-bubble-container {
  display: flex;
  align-items: center;
  justify-content: center;
}

.zone-summary-bubble {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(4px);
  border: 2px solid var(--color-violet);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  padding: 6px 12px;
  text-align: center;
  white-space: nowrap;
  pointer-events: auto;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.zone-summary-bubble:hover {
  transform: scale(1.05);
  border-color: var(--color-red);
}

.zone-bubble-main {
  font-size: 12px;
  color: var(--text-main);
  font-weight: 600;
}

.zone-bubble-sub {
  font-size: 12px;
  color: var(--text-muted);
}

/* DRAWING TOOLBAR */
.drawing-toolbar {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  background: var(--bg-card);
  border: 2px solid var(--color-red);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  box-shadow: var(--shadow-float);
  transition: border-color 0.2s ease;
}

.toolbar-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toolbar-info {
  font-size: 12px;
  color: var(--text-main);
  font-weight: 500;
}

.toolbar-op-selector {
  display: flex;
  background: var(--bg-app);
  padding: 4px 6px;
  gap: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.op-chip-btn {
  padding: 5px 10px;
  font-size: 12px;
  min-height: 28px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
}

.op-chip-btn.op-chip-boitage.active {
  background: var(--color-amber-bg);
  color: #92400E;
  border: 1px solid var(--color-amber-light);
  font-weight: 600;
}
.op-chip-btn.op-chip-pap.active {
  background: var(--color-green-bg);
  color: #065F46;
  border: 1px solid var(--color-green-light);
  font-weight: 600;
}
.op-chip-btn.op-chip-tractage.active {
  background: var(--color-red-bg);
  color: #9F1239;
  border: 1px solid var(--color-red-light);
  font-weight: 600;
}

.toolbar-options {
  display: flex;
  align-items: center;
  gap: 8px;
  border-left: 1px solid var(--border-color);
  padding-left: 10px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  cursor: pointer;
}

.points-badge {
  background: var(--color-red-bg);
  color: var(--color-red);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  border-left: 1px solid var(--border-color);
  padding-left: 10px;
}

/* MAP LEGEND */
.map-legend {
  position: absolute;
  bottom: 20px;
  left: 20px;
  z-index: 800;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(4px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  box-shadow: var(--shadow-sm);
  font-size: 12px;
}

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

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  user-select: none;
}
.legend-item:hover { opacity: 0.8; }

.legend-color { width: 10px; height: 10px; border-radius: 50%; }
.legend-amber { background: var(--color-amber); }
.legend-green { background: var(--color-green); }
.legend-red { background: var(--color-red); }
.legend-violet { background: var(--color-violet); }
.legend-blue { background: var(--color-blue); }

.legend-fresh-recent { background: #10B981; }
.legend-fresh-medium { background: #F59E0B; }
.legend-fresh-stale { background: #BE123C; }

/* SIDE DRAWER */
.side-drawer {
  position: fixed;
  top: 52px;
  right: 0;
  bottom: 0;
  width: 320px;
  background: #FFFFFF;
  border-left: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  z-index: 950;
  transform: translateX(0);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
}
.side-drawer.closed { transform: translateX(100%); }

.drawer-header {
  padding: 14px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.drawer-header h3 { font-size: 18px; }
.btn-close { background: transparent; border: none; font-size: 18px; color: var(--text-muted); cursor: pointer; }

.drawer-content { padding: 14px; overflow-y: auto; flex: 1; }

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px;
  text-align: center;
}

.stat-val { display: block; font-size: 18px; font-weight: 700; }
.stat-val.text-red { color: var(--color-red); }
.stat-val.text-violet { color: var(--color-violet); }
.stat-val.text-amber { color: var(--color-amber); }
.stat-val.text-green { color: var(--color-green); }
.stat-val.text-blue { color: var(--color-blue); }
.stat-lbl { font-size: 12px; font-weight: 500; color: var(--text-muted); }

/* STALE / INACTIVE ZONES HIGHLIGHT IN DRAWER */
.drawer-section {
  margin-bottom: 20px;
}
.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.section-title-row h4 {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-stale {
  font-size: 12px;
  background: var(--color-red-bg);
  color: var(--color-stale);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-weight: 700;
}
.stale-zones-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
}
.stale-zone-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 12px;
}
.stale-zone-info {
  flex: 1;
  min-width: 0;
}
.stale-zone-name {
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stale-zone-meta {
  font-size: 12px;
  color: var(--color-stale);
  font-weight: 600;
}

.feed-section h4 {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 10px;
}

.activities-list { display: flex; flex-direction: column; gap: 8px; }

.activity-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 12px;
}

.activity-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.activity-badge {
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}
.activity-badge.red { background: var(--color-red-bg); color: #9F1239; }
.activity-badge.violet { background: var(--color-violet-bg); color: #3730A3; }
.activity-badge.amber { background: var(--color-amber-bg); color: #92400E; }
.activity-badge.green { background: var(--color-green-bg); color: #065F46; }
.activity-badge.blue { background: var(--color-blue-bg); color: #075985; }

.activity-date { font-size: 12px; color: var(--text-muted); }
.activity-title { font-size: 12px; margin-bottom: 1px; }
.activity-author { font-size: 12px; color: var(--text-muted); }

/* MODALS */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 14px;
}
.modal-overlay.hidden { display: none !important; }

.modal-card {
  background: #FFFFFF;
  width: 100%;
  max-width: 440px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.modal-large { max-width: 700px; }

.modal-header {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}
.modal-header h3 { font-size: 18px; }
.modal-header.header-red { background: var(--color-red-bg); color: var(--color-red-hover); }
.modal-header.header-violet { background: var(--color-violet-bg); color: var(--color-violet-hover); }
.modal-header.header-blue { background: var(--color-blue-bg); color: var(--color-blue-hover); }
.modal-header.header-amber { background: var(--color-amber-bg); color: var(--color-amber-hover); }
.modal-header.header-green { background: var(--color-green-bg); color: var(--color-green-hover); }
.modal-header.header-gradient { background: var(--gradient-light); }

.input-readonly {
  background: var(--bg-app) !important;
  color: var(--text-muted) !important;
}

/* LEAFLET CUSTOM BILLBOARD PIN */
.billboard-pin {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0284C7;
  color: #FFFFFF;
  width: 24px;
  height: 24px;
  border-radius: 5px;
  border: 2px solid #FFFFFF;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  position: relative;
}
.billboard-badge-faces {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #FFFFFF;
  color: #0369A1;
  font-size: 12px;
  font-weight: 800;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #0369A1;
  line-height: 1;
}

/* OP TAGS IN POPUPS */
.op-tag {
  display: inline-block;
  font-size: 12px;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.op-tag-boitage { background: var(--color-amber-bg); color: #92400E; border: 1px solid var(--color-amber-light); }
.op-tag-pap { background: var(--color-green-bg); color: #065F46; border: 1px solid var(--color-green-light); }
.op-tag-tractage { background: var(--color-red-bg); color: #9F1239; border: 1px solid var(--color-red-light); }
.op-tag-autre { background: #EEF2FF; color: #3730A3; }
.op-tag-poster { background: var(--color-violet-bg); color: #3730A3; border: 1px solid var(--color-violet-light); }
.op-tag-billboard { background: var(--color-blue-bg); color: #075985; border: 1px solid var(--color-blue-light); }

.freshness-pill {
  display: inline-block;
  font-size: 12px;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  margin-top: 4px;
}
.freshness-pill.fresh { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }
.freshness-pill.medium { background: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; }
.freshness-pill.stale { background: var(--color-stale-bg); color: #9F1239; border: 1px solid #FECDD3; font-weight: 600; }

.passages-history-list {
  margin-top: 8px;
  border-top: 1px dashed var(--border-color);
  padding-top: 6px;
  font-size: 12px;
}
.passages-history-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.passage-history-item {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  color: var(--text-muted);
}
.passage-history-item .highlight {
  color: var(--text-main);
  font-weight: 500;
}

.modal-close { background: transparent; border: none; font-size: 20px; cursor: pointer; color: var(--text-muted); }
.modal-body { padding: 16px; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-app);
  border-top: 1px solid var(--border-color);
}

.admin-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 6px;
}

.table-responsive { overflow-x: auto; max-height: 340px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th {
  background: var(--bg-app);
  padding: 8px 10px;
  text-align: left;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}
.data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-color);
}

.popup-card { padding: 10px; font-size: 12px; min-width: 180px; }
.popup-header { font-size: 13px; margin-bottom: 4px; }
.popup-meta { color: var(--text-muted); font-size: 12px; margin-bottom: 6px; }
.popup-notes { background: var(--bg-app); padding: 5px 7px; border-radius: var(--radius-sm); margin-bottom: 6px; font-size: 12px; }
.popup-actions { display: flex; justify-content: flex-end; }

.hidden { display: none !important; }

/* MOBILE RESPONSIVENESS */
@media (max-width: 768px) {
  .app-header {
    height: auto;
    padding: 8px 10px;
    flex-wrap: wrap;
    gap: 6px;
  }
  .header-left, .header-right {
    width: 100%;
    justify-content: space-between;
  }
  .header-filters {
    overflow-x: auto;
  }
  .map-wrapper {
    height: calc(100vh - 90px);
  }
  .map-tools-right {
    top: 10px;
    right: 10px;
  }
  .side-tool-btn {
    width: 46px;
    height: 46px;
  }
  .side-drawer {
    width: 100vw;
    top: 0;
    z-index: 2000;
  }
  .drawing-toolbar {
    top: 100px;
    width: calc(100% - 20px);
    max-width: 380px;
    border-radius: var(--radius-md);
  }
  .toolbar-content {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  .toolbar-options, .toolbar-actions {
    border-left: none;
    padding-left: 0;
    justify-content: space-between;
  }
  .modal-card {
    max-width: 100%;
    margin: 8px;
    max-height: 90vh;
  }
}

/* ==========================================================================
   ORGANIZATIONS & COMMUNITY CONTROLS
   ========================================================================== */
.org-selector-container {
  display: flex;
  align-items: center;
  gap: 4px;
}

.org-select {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  max-width: 160px;
  min-height: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  cursor: pointer;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.org-select option {
  background-color: #FFFFFF;
  color: #0F172A;
}

.btn-icon-subtle {
  background: var(--bg-app);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: bold;
  transition: background 0.15s ease, color 0.15s ease;
}
.btn-icon-subtle:hover {
  background: var(--bg-card-hover);
  color: var(--color-red);
}

.org-links-container {
  display: flex;
  align-items: center;
  gap: 6px;
}

.org-channel-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  min-height: 28px;
  transition: opacity 0.15s ease;
}
.org-channel-btn:hover { opacity: 0.85; }

.btn-tg {
  background: #0088CC;
  color: #FFFFFF;
}

.btn-signal {
  background: #2563EB;
  color: #FFFFFF;
}

/* ==========================================================================
   CITY SEARCH BAR
   ========================================================================== */
.city-search-container {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  gap: 6px;
  width: 210px;
  max-width: 100%;
  transition: border-color 0.15s ease;
}
.search-input-wrapper:focus-within {
  border-color: var(--color-red);
}

.search-icon {
  color: var(--text-light);
  flex-shrink: 0;
}

.search-input-wrapper input {
  border: none;
  background: transparent;
  font-size: 12px;
  color: var(--text-main);
  outline: none;
  width: 100%;
}

.btn-clear-search {
  background: transparent;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 2px 4px;
  min-width: 24px;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-clear-search:hover { color: var(--text-main); }

.city-search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 250px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 3000;
  max-height: 220px;
  overflow-y: auto;
}

.city-search-item {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  font-size: 12px;
}
.city-search-item:last-child { border-bottom: none; }
.city-search-item:hover { background: var(--bg-app); color: var(--color-red); }
.city-item-name { font-weight: 600; color: var(--text-main); }
.city-item-sub { font-size: 12px; color: var(--text-muted); }

/* User pill button */
.user-pill-btn {
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-family: inherit;
  padding: 2px 4px;
  border-radius: var(--radius-sm);
}
.user-pill-btn:hover {
  background: rgba(0, 0, 0, 0.04);
}

/* ==========================================================================
   TOTAL ACTIONS BANNER & ORG INFO IN DRAWER
   ========================================================================== */
.total-actions-banner {
  background: var(--gradient-light);
  border: 1px solid var(--color-red-light);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
  margin-bottom: 14px;
}
.total-actions-val {
  font-size: 28px;
  font-weight: 800;
  color: var(--color-red);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.total-actions-lbl {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.drawer-org-subtitle {
  font-size: 12px;
  color: #3730A3;
  font-weight: 600;
}

.org-info-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 14px;
}
.org-info-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.org-info-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-main);
}
.org-info-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.drawer-org-links {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

/* ==========================================================================
   MASCOTTE TORTUE WIDGET 🐢
   ========================================================================== */
.mascot-container {
  position: absolute;
  bottom: 22px;
  right: 18px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.mascot-btn {
  background: #FFFFFF;
  border: 2px solid #10B981;
  border-radius: var(--radius-full);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.mascot-btn:hover {
  transform: scale(1.08);
  box-shadow: var(--shadow-float);
}
.mascot-icon {
  font-size: 22px;
  line-height: 1;
}
.mascot-badge-phi {
  position: absolute;
  bottom: -2px;
  right: -2px;
  background: var(--color-violet);
  color: white;
  font-size: 12px;
  font-weight: 800;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid white;
}

.mascot-bubble {
  position: relative;
  background: var(--bg-card);
  border: 1.5px solid #047857;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 8px;
  max-width: 260px;
  box-shadow: var(--shadow-float);
  animation: mascotPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes mascotPop {
  from { opacity: 0; transform: translateY(8px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.mascot-bubble-text {
  font-size: 12px;
  color: var(--text-main);
  line-height: 1.35;
  font-style: italic;
}
.mascot-bubble-author {
  font-size: 12px;
  font-weight: 700;
  color: #047857;
  text-align: right;
  margin-top: 4px;
}
.mascot-bubble-close {
  position: absolute;
  top: 4px;
  right: 6px;
  background: transparent;
  border: none;
  font-size: 16px;
  color: var(--text-light);
  cursor: pointer;
  min-width: 24px;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mascot-bubble-close:hover { color: var(--text-main); }

/* Live GPS Pulse Marker */
.live-gps-marker {
  position: relative;
}
.gps-pulse-circle {
  width: 20px;
  height: 20px;
  background: rgba(3, 105, 161, 0.4);
  border-radius: 50%;
  animation: gpsPulse 2s infinite ease-out;
  position: absolute;
  top: -2px;
  left: -2px;
}
@keyframes gpsPulse {
  0% { transform: scale(0.6); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

.side-tool-btn.gps-active {
  background: var(--color-blue);
  color: #FFFFFF;
  border-color: var(--color-blue);
  box-shadow: none;
}

/* Transformed Billboard Pin */
.billboard-pin.stuck-pin {
  background: #7C3AED !important;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
}
.billboard-pin.stuck-pin svg {
  stroke: #FFFFFF;
}
.billboard-badge-phi {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--color-red);
  color: white;
  font-size: 12px;
  font-weight: 800;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid white;
}

/* Spot tractage styling */
.tract-spot-pin {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-red);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
  border: 2px solid #FFFFFF;
}


