:root{
  --bg:#0b0f14; --card:#121923; --card2:#0f151e; --text:#f4f7fb; --muted:#8ea0b8;
  --line:#223044; --accent:#1677ff; --accent2:#0b4fb8; --accentSoft:#112b4e;
  --danger:#ef4444; --soft:#152234; --input:#0d141d;
}
*{box-sizing:border-box}
body{margin:0;background:radial-gradient(circle at top right,#10233f 0,#0b0f14 36%,#080b10 100%);color:var(--text);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;min-height:100vh}
button,input,select,textarea{font:inherit}
button{cursor:pointer}
h1,h2,h3,p{margin:0}
h1{font-size:28px}.eyebrow{font-size:11px;letter-spacing:.16em;font-weight:800;color:var(--muted);margin-bottom:4px}
.topbar{position:sticky;top:0;z-index:5;display:flex;align-items:center;justify-content:space-between;padding:18px max(16px,env(safe-area-inset-left));background:rgba(8,11,16,.9);backdrop-filter:blur(14px);border-bottom:1px solid var(--line);box-shadow:0 10px 30px rgba(0,0,0,.28)}
.brandRow{display:flex;align-items:center;gap:12px}.brandMark{width:54px;height:54px;display:grid;place-items:center;flex:0 0 54px}.brandMark img{width:100%;height:100%;display:block;object-fit:contain;filter:drop-shadow(0 6px 14px rgba(47,143,255,.22))}
.tagline{font-size:12px;color:var(--muted);margin-top:2px}
.container{max-width:1220px;margin:0 auto;padding:18px 16px 80px}
.primary,.secondary,.danger,.iconBtn{border:0;border-radius:12px;padding:11px 14px;font-weight:700}
.primary{background:linear-gradient(135deg,#1e88ff,var(--accent2));color:#fff;box-shadow:0 8px 18px rgba(22,119,255,.22)}
.secondary{background:var(--card2);color:var(--text);border:1px solid var(--line)}
.danger{background:#3a171a;color:#ff9aa4;border:1px solid #6d252c}.iconBtn{background:transparent;color:var(--text);font-size:20px}

.stats{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;margin-bottom:14px}
.stat{background:linear-gradient(180deg,#131b26,#0f151e);padding:14px;border-radius:16px;border:1px solid var(--line);display:flex;flex-direction:column;box-shadow:0 6px 18px rgba(0,0,0,.16);min-height:92px;justify-content:center}
.totalStat{background:linear-gradient(180deg,#173154,#10243f);border-color:#2a5ea0}
.stat span{font-size:24px;font-weight:800;line-height:1.1}.stat small{color:var(--muted);font-weight:700}

.toolbar{display:grid;grid-template-columns:2fr 1fr 1fr auto;gap:10px;margin-bottom:14px}
input,select,textarea{width:100%;padding:12px;border:1px solid var(--line);border-radius:12px;background:var(--input);color:var(--text);outline:none}
input:focus,select:focus,textarea:focus{border-color:#2f8fff;box-shadow:0 0 0 3px rgba(47,143,255,.12)}
select option{background:#0d141d;color:#f4f7fb}textarea{resize:vertical}

.cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.card{background:linear-gradient(180deg,var(--card),var(--card2));border:1px solid var(--line);border-radius:18px;padding:16px;box-shadow:0 10px 28px rgba(0,0,0,.2)}
.cardTop{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}.name{font-size:19px}.muted{color:var(--muted)}
.statusBadge{font-size:12px;border-radius:999px;padding:6px 9px;background:var(--accentSoft);color:#69aefc;font-weight:800;white-space:nowrap}
.contactRow{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}.actionLink{color:var(--text);text-decoration:none;background:#0d141d;border:1px solid var(--line);padding:7px 9px;border-radius:10px;font-size:13px}
.tagRow{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:10px}
.tag{background:#172233;border:1px solid #26364b;border-radius:999px;padding:5px 8px;font-size:12px;color:#c7d7ea}
.meta{display:flex;flex-wrap:wrap;gap:10px;font-size:12px;color:var(--muted)}.notes{margin-top:10px;white-space:pre-wrap;font-size:14px;min-height:0}
.cardActions{margin-top:14px;display:flex;justify-content:flex-end}
.empty{text-align:center;padding:70px 20px;color:var(--muted)}.emptyIcon{font-size:42px}.hidden{display:none!important}

.interestBlock{margin:12px 0 10px}
.interestTitle{font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:#8fc2ff;margin-bottom:8px}
.tagRow.interests{gap:8px}
.interestTag{display:inline-flex;align-items:center;gap:8px;background:linear-gradient(135deg,rgba(30,136,255,.20),rgba(11,79,184,.36));border:1px solid rgba(88,166,255,.55);color:#e9f3ff;font-size:13px;font-weight:800;padding:8px 12px;box-shadow:0 6px 16px rgba(13,88,190,.18), inset 0 0 0 1px rgba(255,255,255,.03)}
.interestTag.isEmpty{background:#16202d;border-color:#2b3c53;color:#9db0c7;font-weight:700}
.interestIcon{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;color:#7fc0ff;flex:0 0 16px}
.interestIcon svg{width:16px;height:16px;display:block}
.interestIcon--solar{color:#ffd45a}
.interestIcon--snow{color:#77d1ff}
.interestIcon--flame{color:#ff6b57}
.interestIcon--house{color:#8cc6ff}
.interestIcon--tank{color:#74e2e1}
.interestIcon--battery{color:#8be28f}
.interestChoiceChip{display:block}
.interestChoiceChip > span{display:flex;align-items:center;justify-content:flex-start;gap:10px;min-height:54px;padding:12px 14px;font-weight:800;line-height:1.2;text-align:left}
.interestChoiceChip .interestIcon{width:18px;height:18px;flex:0 0 18px}
.interestChoiceChip .interestIcon svg{width:18px;height:18px;display:block}

.currentUser{font-size:12px;color:#8fc2ff;font-weight:800;white-space:nowrap}
.auditBox{border:1px solid var(--line);background:#0b121b;border-radius:12px;padding:10px 12px;display:grid;gap:5px;color:var(--muted);font-size:12px}
.auditCard{display:grid;gap:3px;margin-top:12px;padding-top:10px;border-top:1px solid var(--line);font-size:11px;color:#71859d}
.topActions{display:flex;align-items:center;gap:8px}.syncState{font-size:12px;color:#9db0c7;padding:7px 9px;border:1px solid var(--line);border-radius:999px;background:#0d141d}.syncError{color:#ff9aa4;border-color:#6d252c;background:#2a1215}

.authScreen{min-height:100vh;display:grid;place-items:center;padding:24px}.authCard{width:min(420px,100%);background:linear-gradient(180deg,var(--card),var(--card2));border:1px solid var(--line);border-radius:22px;padding:24px;display:grid;gap:16px;box-shadow:0 24px 70px rgba(0,0,0,.38)}
.authLogo{width:92px;height:92px;object-fit:contain;margin:0 auto 4px}.authCard h1{text-align:center}.authCard .eyebrow{text-align:center}.authIntro{text-align:center;margin-top:-8px}.fullBtn{width:100%}.authError{padding:10px 12px;border-radius:10px;background:#3a171a;color:#ffb7bd;border:1px solid #6d252c;font-size:13px}

label{display:grid;gap:6px;font-size:13px;font-weight:700}
fieldset{border:1px solid var(--line);border-radius:14px;padding:14px}
legend{padding:0 6px;font-size:13px;font-weight:800}
.chips{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:10px}
.chip input{display:none}
.chip > span{display:flex;align-items:center;justify-content:center;padding:8px 10px;border:1px solid var(--line);border-radius:16px;background:#0d141d;font-size:13px}
.chip input:checked + span{background:linear-gradient(135deg,#1e88ff,var(--accent2));color:#fff;border-color:#1e88ff;box-shadow:0 8px 20px rgba(22,119,255,.22)}
.actions{display:flex;gap:8px;align-items:center;margin-top:4px}.spacer{flex:1}
.toast{position:fixed;left:50%;bottom:28px;transform:translateX(-50%);z-index:100;background:#0f1f33;color:#fff;border:1px solid #2f8fff;padding:12px 18px;border-radius:12px;box-shadow:0 12px 30px rgba(0,0,0,.35);font-weight:800}

dialog{width:min(760px,calc(100vw - 20px));max-height:92vh;border:1px solid var(--line);border-radius:20px;padding:0;background:var(--card2);color:var(--text);box-shadow:0 24px 80px rgba(0,0,0,.5)}
dialog::backdrop{background:rgba(0,0,0,.68)}
#prospectForm{padding:18px;display:grid;gap:14px}.dialogHeader{display:flex;justify-content:space-between;align-items:start}.grid2{display:grid;grid-template-columns:1fr 1fr;gap:10px}

@media(max-width:1100px){
  .stats{grid-template-columns:repeat(4,minmax(0,1fr))}
}
@media(max-width:900px){
  .stats{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:720px){
  .stats{grid-template-columns:repeat(2,1fr)}
  .toolbar{grid-template-columns:1fr 1fr}
  .toolbar input{grid-column:1/-1}
  .cards{grid-template-columns:1fr}
  .grid2{grid-template-columns:1fr}
  .topbar{padding-top:max(14px,env(safe-area-inset-top))}
  .topActions{gap:6px}
  .syncState,.currentUser{display:none}
  #logoutBtn{padding:10px;font-size:12px}
}


/* V24 — vues Liste / Pipeline */
.viewSwitch{
  display:flex;
  justify-content:flex-end;
  gap:8px;
  margin:2px 0 14px;
}
.viewSwitch .active{
  border-color:#2f8fff;
  background:#112b4e;
  color:#8fc2ff;
  box-shadow:0 0 0 1px rgba(47,143,255,.12) inset;
}

/* Kanban horizontal type Odoo */
.pipelineBoard{
  display:grid;
  grid-template-columns:repeat(10,minmax(220px,1fr));
  gap:12px;
  overflow-x:auto;
  padding:2px 2px 24px;
  scroll-snap-type:x proximity;
}
.pipelineColumn{
  background:#0d1622;
  border:1px solid var(--line);
  border-radius:16px;
  min-height:520px;
  padding:10px;
  scroll-snap-align:start;
  transition:border-color .15s ease, background .15s ease;
}
.pipelineColumn.dragOver{
  border-color:#2f8fff;
  background:#10213a;
  box-shadow:0 0 0 2px rgba(47,143,255,.12) inset;
}
.pipelineHeader{
  display:grid;
  grid-template-columns:28px 1fr 28px;
  align-items:center;
  gap:8px;
  min-height:62px;
  padding:10px 8px 12px;
  font-weight:900;
  position:sticky;
  top:0;
  background:linear-gradient(180deg,#14263f 0%,#102039 100%);
  border:1px solid #2f5d91;
  border-radius:12px;
  z-index:1;
  box-shadow:0 8px 18px rgba(0,0,0,.18);
}
.pipelineHeader span{
  grid-column:2;
  text-align:center;
  color:#f7fbff;
  font-size:15px;
  line-height:1.15;
  letter-spacing:.01em;
  text-shadow:0 1px 10px rgba(47,143,255,.18);
}
.pipelineHeader strong{
  grid-column:3;
  background:#1677ff;
  color:#fff;
  border-radius:999px;
  min-width:28px;
  text-align:center;
  padding:5px 7px;
  font-size:12px;
  box-shadow:0 4px 10px rgba(22,119,255,.28);
}
.pipelineCards{
  display:grid;
  gap:9px;
}
.pipelineCard{
  width:100%;
  text-align:left;
  background:#111d2c;
  border:1px solid var(--line);
  border-radius:12px;
  padding:11px;
  color:var(--text);
  display:grid;
  gap:6px;
  cursor:grab;
  touch-action:none;
  user-select:none;
  box-shadow:0 6px 14px rgba(0,0,0,.16);
}
.pipelineCard:hover{border-color:#2c8cff}
.pipelineCard:active{cursor:grabbing}
.pipelineCard.dragging{
  opacity:.42;
  transform:scale(.98);
}
.pipelineCard .pipelineName{
  font-weight:800;
  font-size:14px;
}
.pipelineCard .pipelineCity,
.pipelineCard .pipelineOwner{
  color:var(--muted);
  font-size:12px;
}
.pipelineInterests{
  display:flex;
  flex-wrap:wrap;
  gap:5px;
}
.pipelineInterest{
  display:inline-flex;
  align-items:center;
  gap:5px;
  font-size:11px;
  font-weight:800;
  color:#dff0ff;
  background:rgba(30,136,255,.14);
  border:1px solid rgba(88,166,255,.35);
  border-radius:999px;
  padding:4px 7px;
}
.pipelineInterest .interestIcon{
  width:13px;
  height:13px;
  flex-basis:13px;
}
.pipelineInterest .interestIcon svg{
  width:13px;
  height:13px;
}

/* carte fantôme tactile */
.dragGhost{
  position:fixed;
  z-index:9999;
  pointer-events:none;
  width:220px;
  opacity:.92;
  transform:rotate(1deg);
  box-shadow:0 18px 48px rgba(0,0,0,.45);
}

@media(max-width:1100px){
  .pipelineBoard{grid-template-columns:repeat(10,220px)}
}
@media(max-width:720px){
  .viewSwitch{justify-content:stretch}
  .viewSwitch button{flex:1}
  .pipelineBoard{grid-template-columns:repeat(10,82vw)}
  .pipelineColumn{min-height:430px}
}


/* V26 — sélection automatique de la ville */
#city:disabled{
  opacity:.72;
  cursor:not-allowed;
}


/* V27 — autocomplétion adresse */
.addressField{
  position:relative;
}
.addressSuggestions{
  position:absolute;
  top:100%;
  left:0;
  right:0;
  z-index:80;
  margin-top:5px;
  padding:6px;
  background:#0b121b;
  border:1px solid #2c405a;
  border-radius:12px;
  box-shadow:0 18px 42px rgba(0,0,0,.48);
  max-height:280px;
  overflow-y:auto;
}
.addressSuggestion{
  display:grid;
  width:100%;
  gap:2px;
  text-align:left;
  padding:10px 11px;
  border:0;
  border-radius:9px;
  background:transparent;
  color:var(--text);
}
.addressSuggestion:hover,
.addressSuggestion:focus{
  background:#122641;
  outline:none;
}
.addressSuggestion strong{
  font-size:13px;
  font-weight:800;
}
.addressSuggestion small{
  font-size:11px;
  color:var(--muted);
  font-weight:600;
}


/* V28 — parcours CP > Ville > Adresse */
#address:disabled{
  opacity:.68;
  cursor:not-allowed;
}


/* V29 — notifications */
#notificationBtn{
  white-space:nowrap;
}
#notificationBtn.notificationActive{
  color:#8be28f;
  border-color:#315f45;
  background:#10231a;
}
@media(max-width:900px){
  #notificationBtn{
    padding:10px;
    font-size:12px;
  }
}
