:root{
  --bg:#143d6b;
  --panel:#0f172a;
  --panel-2:#111827;
  --muted:#94a3b8;
  --text:#e5e7eb;
  --border:#1f2937;
  --accent:#64748b;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0; color:var(--text); background:var(--bg);
  font:14px/1.4 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,"Helvetica Neue",Arial;
}

.topbar{
  position:sticky; top:0; z-index:30;
  display:flex; align-items:center; gap:.5rem;
  padding:.6rem .8rem; border-bottom:1px solid var(--border);
  background:rgba(11,18,32,.85); backdrop-filter:saturate(1.2) blur(6px);
}
.topbar h1{font-size:16px; margin:0 6px 0 0; font-weight:600}
.spacer{flex:1}

.user-box{display:flex; align-items:center; gap:.6rem}
.user-info{display:flex; align-items:center; gap:.5rem}
.user-info img{width:28px; height:28px; border-radius:50%; border:1px solid var(--border)}
.user-name{font-weight:600; font-size:13px}
.user-role{font-size:11px; color:var(--muted)}

.btn{
  background:#111827; border:1px solid var(--border);
  color:var(--text); padding:.45rem .7rem; border-radius:.7rem;
  cursor:pointer;
}
.btn:hover{background:#162036}
.btn.danger{background:#7f1d1d;border-color:#7f1d1d}
.btn.danger:hover{background:#991b1b}
.file-label{cursor:pointer}
.icon-btn{
  background:transparent; border:none; color:var(--muted);
  cursor:pointer; font-size:16px;
}
.icon-btn:hover{color:white}

.layout{display:grid; grid-template-columns:320px 1fr; height:calc(100vh - 56px)}
.sidebar{
  border-right:1px solid var(--border); padding:12px; overflow:auto;
  background:linear-gradient(180deg,rgba(16,23,42,.55),rgba(16,23,42,.2));
}
.muted{color:var(--muted); font-weight:600; text-transform:uppercase; letter-spacing:.08em; font-size:12px}
.mt{margin-top:14px}

.legend{display:flex; flex-direction:column; gap:6px; margin:8px 0 14px}
.legend button{
  text-align:left; background:var(--panel); border:1px solid var(--border);
  color:var(--text); border-radius:.6rem; padding:.4rem .6rem; cursor:pointer;
  display:flex; justify-content:space-between; align-items:center;
}
.legend button:hover{background:#182238}
.legend .active{background:#1f2a40}

.pin-list{display:flex; flex-direction:column; gap:8px}
.pin-item{
  background:rgba(17,24,39,.55); border:1px solid var(--border);
  padding:8px; border-radius:.8rem;
}
.pin-item .title{font-weight:600; cursor:pointer}
.pin-item .cat{color:var(--muted); font-size:12px}
.pin-chip{display:inline-block; width:14px; height:14px; border-radius:50%; margin-right:6px; border:1px solid rgba(0,0,0,.25); vertical-align:-2px}

.stage{position:relative; overflow:hidden}
.viewport{
  position:absolute; inset:0;
  transform-origin:0 0;
}
.map-img{width:100%; height:100%; object-fit:contain; user-select:none; pointer-events:none}
#mapImg.blur{filter: blur(3px) saturate(.9)}
.pins-layer{position:absolute; inset:0}

.pin{
  position:absolute; transform:translate(-50%, -100%); cursor:pointer;
  filter:drop-shadow(0 2px 2px rgba(0,0,0,.5));
}
.pin-svg{width:26px; height:26px; display:block}
.pin-body{stroke:rgba(0,0,0,.35)}
.pin-hole{fill:#fff; opacity:.95}

.tooltip{
  margin-top:2px; background:rgba(15,23,42,.9); border:1px solid var(--border);
  padding:2px 6px; border-radius:6px; font-size:12px; white-space:nowrap;
  transform:translateX(-50%); position:absolute; left:50%; top:100%;
  opacity:0; pointer-events:none; transition:opacity .15s;
}
.pin:hover .tooltip{opacity:1}

.editor{
  position:absolute; min-width:280px; max-width:360px;
  background:rgba(15,23,42,.92); backdrop-filter:blur(4px);
  border:1px solid var(--border); border-radius:12px; box-shadow:0 10px 26px rgba(0,0,0,.45); z-index:40;
}
.editor-head{display:flex; align-items:center; gap:8px; padding:8px 10px; border-bottom:1px solid var(--border)}
.ed-title{flex:1; font-weight:700; background:transparent; border:none; color:var(--text); outline:none}
.editor-body{padding:10px; display:flex; flex-direction:column; gap:10px}
.row{display:grid; grid-template-columns:100px 1fr; gap:8px; align-items:center}
.row input, .row textarea, .row select{
  width:100%; background:#101827; border:1px solid var(--border);
  color:var(--text); padding:8px; border-radius:10px; outline:none;
}
.color-row{display:flex; align-items:center; gap:8px}
.swatches{display:flex; gap:6px}
.swatches button{width:20px; height:20px; border-radius:50%; border:1px solid rgba(0,0,0,.25)}
.actions{display:flex; justify-content:space-between; align-items:center; gap:8px}
.actions .left{display:flex; gap:8px}

#search{
  background:#101827; border:1px solid var(--border); color:var(--text);
  padding:.45rem .6rem; border-radius:.7rem; outline:none; width:220px;
}

/* ===== Menu contextuel custom ===== */
.ctx-menu{
  position:absolute; background:var(--panel); border:1px solid var(--border);
  border-radius:8px; box-shadow:0 8px 16px rgba(0,0,0,.6); z-index:50;
}
.ctx-menu button{
  display:block; width:160px; padding:8px 10px; background:transparent; border:none;
  color:var(--text); text-align:left; cursor:pointer;
}
.ctx-menu button:hover{ background:#182238; }

/* Pas de flou : on supprime tout filtre */
.pin, .pins-layer {
  filter: none !important;
}

/* Le clic ne s’applique qu’au SVG, pas au conteneur */
.pin { pointer-events: none; }
.pin-svg { pointer-events: auto; }

/* Rendu vectoriel précis */
.pin-body {
  vector-effect: non-scaling-stroke;
  shape-rendering: geometricPrecision;
}

