:root{--blue:#2563eb;--blue2:#1d4ed8;--green:#16a34a;--dark:#0f172a;--muted:#64748b;--line:#e2e8f0;--bg:#f8fafc;--panel:#fff;--danger:#dc2626;--shadow:0 18px 50px #0f172a33;--top-safe:env(safe-area-inset-top,0px);--bottom-safe:env(safe-area-inset-bottom,0px)}
*{box-sizing:border-box}html,body{height:100%;margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;background:var(--bg);color:var(--dark);overflow:hidden}button,.button,input,select,textarea{font:inherit}button,.button{border:0;border-radius:14px;background:var(--blue);color:white;padding:11px 14px;font-weight:850;text-decoration:none;cursor:pointer;min-height:44px}button:disabled{background:#cbd5e1;color:#64748b;cursor:not-allowed}button.secondary,.button.secondary{background:#e2e8f0;color:#0f172a}.button.export{background:#0f766e;display:flex;align-items:center;justify-content:center}.iconbtn{background:#eef2f7;color:#0f172a;border-radius:999px;width:42px;height:42px;padding:0;font-size:25px;min-height:42px}.flash{position:fixed;z-index:5000;top:10px;left:10px;right:10px;background:#fff7ed;border:1px solid #fed7aa;border-radius:12px;padding:8px}.terrain-app,.map-area,#map{height:100dvh;width:100%;overflow:hidden}.map-area{position:relative}#map{z-index:1}.leaflet-control-zoom{margin-top:86px!important}.topbar{position:absolute;z-index:950;left:12px;right:12px;top:calc(10px + var(--top-safe));display:grid;grid-template-columns:minmax(0,1fr) 74px 96px;gap:10px;pointer-events:none}.topbar button{pointer-events:auto;box-shadow:0 10px 24px #0f172a26;border:1px solid #ffffffb0}.top-action{background:#fff;color:#111827;border-radius:18px;font-size:18px;min-height:58px}.top-action.primary{background:linear-gradient(180deg,#3168f1,#1d4ed8);color:#fff}.top-action.icon{font-size:23px}.drawer{position:absolute;z-index:2000;inset:0;background:#0f172a66;display:none}.drawer.open{display:block}.drawer-card{position:absolute;left:0;right:0;bottom:0;max-height:calc(100dvh - var(--top-safe) - 12px);background:#f8fafc;border-radius:24px 24px 0 0;box-shadow:var(--shadow);overflow:auto;padding:16px 16px calc(16px + var(--bottom-safe));animation:slideup .18s ease-out}@keyframes slideup{from{transform:translateY(18px);opacity:.85}to{transform:none;opacity:1}}.drawer-head{display:flex;justify-content:space-between;gap:10px;align-items:flex-start;margin-bottom:8px}.drawer h1{font-size:24px;line-height:1.05;margin:0}.subtitle{font-size:14px;color:var(--muted);margin-top:3px}.stats-card,.search-card,.filter-block{background:#fff;border:1px solid var(--line);border-radius:18px;padding:13px;margin:10px 0;box-shadow:0 1px 7px #0f172a0a}.section-title,.filter-block summary{font-weight:900;font-size:14px;text-transform:uppercase;letter-spacing:.02em;color:#334155}.filter-block summary{cursor:pointer;list-style:none}.filter-block summary::-webkit-details-marker{display:none}.filter-block summary:after{content:'+';float:right;color:#64748b}.filter-block[open] summary:after{content:'−'}.warn{color:var(--danger)}.field{display:block;font-weight:800;font-size:13px;margin:10px 0}.field input,.field select,.field textarea,.save-row input{width:100%;border:2px solid #cbd5e1;border-radius:15px;padding:12px;background:white;min-height:48px}.field textarea{min-height:92px;resize:vertical}.main-combo input{border-color:var(--green);font-size:17px;font-weight:850}.grid2{display:grid;grid-template-columns:1fr 1fr;gap:10px}.combo{position:relative}.suggestions{display:none;position:absolute;left:0;right:0;top:100%;background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:0 16px 36px #0f172a33;max-height:280px;overflow:auto;z-index:3000;padding:6px}.suggestions.open{display:block}.suggestions button{display:block;width:100%;background:white;color:#0f172a;text-align:left;border-radius:10px;padding:12px;min-height:42px}.suggestions button.active,.suggestions button:hover{background:#eff6ff}.suggestions small{display:block;color:#64748b;font-weight:600;margin-top:2px}.chips{display:flex;flex-wrap:wrap;gap:7px;margin-top:8px}.chips.empty{display:block;color:#64748b;background:#f1f5f9;padding:9px;border-radius:12px}.chip,.quick-row button{background:#dcfce7;color:#14532d;border:1px solid #86efac;min-height:34px;padding:7px 10px;border-radius:999px}.chip span{font-weight:900;margin-left:6px}.quick-row{display:flex;gap:7px;overflow-x:auto;padding:8px 0 2px}.quick-row button{flex:0 0 auto;background:#f0fdf4}.save-row{display:grid;grid-template-columns:1fr 64px;gap:8px}.saved-list{display:flex;flex-direction:column;gap:6px;margin-top:8px}.saved-item{display:grid;grid-template-columns:1fr 38px;gap:6px}.saved-item .load{background:#eff6ff;color:#1e3a8a;text-align:left}.saved-item .delete{background:#fee2e2;color:#991b1b;min-height:38px;padding:0}.drawer-actions{display:grid;grid-template-columns:1fr 1fr 92px;gap:8px;margin-top:12px}.sticky-actions{position:sticky;bottom:0;background:linear-gradient(#f8fafc00,#f8fafc 20%);padding-top:14px}.hidden-actions{display:none}.bottom-sheet{position:absolute;z-index:900;left:10px;right:10px;bottom:calc(8px + var(--bottom-safe));background:#fffffff7;backdrop-filter:blur(12px);border:1px solid var(--line);border-radius:24px;box-shadow:0 18px 55px #0f172a38;padding:10px 14px 14px;transition:max-height .2s ease,transform .2s ease;overflow:hidden}.bottom-sheet.collapsed{max-height:168px}.bottom-sheet.half{max-height:48dvh}.bottom-sheet.expanded{top:calc(76px + var(--top-safe));bottom:calc(8px + var(--bottom-safe));max-height:none;overflow:auto}.sheet-handle{width:58px;height:6px;background:#cbd5e1;border-radius:999px;margin:0 auto 9px;cursor:pointer}.sheet-title-row{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:8px}.sheet-title-row strong{font-size:18px}.sheet-title-row span{display:block;color:#64748b;font-size:13px;margin-top:2px}.mini-btn{background:#eef2f7;color:#0f172a;min-height:38px;border-radius:999px;padding:8px 12px}.selection{font-size:15px;line-height:1.35}.selection h2{margin:0 0 6px;font-size:20px}.muted{color:var(--muted)}.route-row{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0}.gps-distance{background:#eff6ff;border:1px solid #bfdbfe;border-radius:12px;padding:9px;margin:8px 0}.sheet-actions{display:grid;grid-template-columns:1fr 1fr 1fr;gap:8px;margin:10px 0}.sheet-actions button{min-height:45px;padding:9px 8px;border-radius:15px}.results-head{border-top:1px solid var(--line);padding-top:10px;margin-top:8px}.results{display:grid;grid-template-columns:1fr;gap:8px;margin-top:8px;max-height:calc(48dvh - 160px);overflow:auto}.bottom-sheet.expanded .results{max-height:none;overflow:visible}.result-card{border:1px solid var(--line);background:white;border-radius:16px;padding:10px;cursor:pointer}.result-card:active{transform:scale(.995)}.result-title{font-weight:900;display:flex;justify-content:space-between;gap:8px}.result-title span{font-size:13px;color:var(--muted);font-weight:700}.result-meta{font-size:13px;color:#334155;margin:5px 0}.badges{display:flex;flex-wrap:wrap;gap:5px}.badge,.pill{font-size:12px;background:#f1f5f9;border-radius:999px;padding:4px 8px}.leaflet-control-attribution{font-size:9px!important}
@media(min-width:901px){.drawer{display:block;inset:0 auto 0 0;width:390px;background:transparent}.drawer-card{position:static;height:100dvh;max-height:none;border-radius:0;box-shadow:none;border-right:1px solid var(--line)}.map-area{padding-left:390px}.topbar{left:402px;grid-template-columns:170px 64px 86px;right:auto}.bottom-sheet{left:410px;right:18px;max-width:760px}.bottom-sheet.expanded{left:410px;right:18px;top:auto;max-height:72dvh}.results{grid-template-columns:repeat(auto-fill,minmax(230px,1fr))}.leaflet-control-zoom{margin-top:80px!important}}
@media(max-width:420px){.topbar{left:8px;right:8px;grid-template-columns:minmax(0,1fr) 64px 82px;gap:8px}.top-action{font-size:16px;min-height:54px;border-radius:16px}.bottom-sheet{left:8px;right:8px}.sheet-actions button{font-size:14px}.drawer-card{padding-left:12px;padding-right:12px}.drawer-actions{grid-template-columns:1fr 1fr}.drawer-actions .export{grid-column:1/3}}


/* V11 - fiche parcelle terrain directement exploitable */
.topbar{top:calc(18px + var(--top-safe));}
.leaflet-control-zoom{margin-top:108px!important}
.bottom-sheet{bottom:calc(18px + var(--bottom-safe));}
.bottom-sheet.collapsed{max-height:132px;}
.bottom-sheet.half{max-height:58dvh;}
.bottom-sheet.expanded{top:calc(96px + var(--top-safe));bottom:calc(12px + var(--bottom-safe));overflow:auto;}
body.parcel-selected .bottom-sheet.expanded{top:calc(92px + var(--top-safe));}
body.parcel-selected .results-head,body.parcel-selected .results{display:none;}
body.parcel-selected .sheet-actions{display:none;}
body.parcel-selected .sheet-title-row{margin-bottom:4px;}
body.parcel-selected #sheetTitle{font-size:16px;color:#64748b;}
body.parcel-selected #sheetExpand{display:block;}
.parcel-detail h2{font-size:24px;margin:2px 0 6px;line-height:1.08;}
.parcel-kicker{font-size:12px;font-weight:900;text-transform:uppercase;letter-spacing:.05em;color:#64748b;margin-bottom:2px;}
.parcel-main{font-size:16px;line-height:1.28;color:#334155;}
.parcel-main span{font-weight:800;color:#0f172a;}
.parcel-facts{display:flex;flex-wrap:wrap;gap:7px;margin:10px 0;}
.parcel-facts span{background:#f1f5f9;border:1px solid #e2e8f0;border-radius:999px;padding:6px 9px;font-size:13px;font-weight:800;color:#334155;}
.control-form{margin-top:8px;border-top:1px solid var(--line);padding-top:8px;}
.control-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px;align-items:end;}
.photo-field input{padding:10px;font-size:13px;}
.save-control{width:100%;margin-top:8px;min-height:54px;font-size:17px;background:#16a34a;}
.route-row .route{flex:1 1 220px;text-align:center;}
.route-row .secondary{flex:0 0 auto;}
.selection .field{margin:7px 0;}
.selection .field textarea{min-height:86px;}
@media(max-width:420px){
  .topbar{grid-template-columns:minmax(0,1fr) 60px 78px;top:calc(14px + var(--top-safe));}
  .top-action{min-height:50px;font-size:15px;}
  .bottom-sheet.expanded{top:calc(84px + var(--top-safe));}
  .control-grid{grid-template-columns:1fr;gap:3px;}
  .parcel-detail h2{font-size:22px;}
  .route-row{display:grid;grid-template-columns:1fr;}
  .route-row .secondary{width:100%;}
}

/* V12 - sélection de parcelles et tournée */
.topbar{grid-template-columns:minmax(0,1fr) 74px 96px 110px;}
.top-action.tour-top{background:#0f766e;color:white;}
.tour-panel{border-top:1px solid var(--line);margin-top:10px;padding-top:10px;display:block;}
.tour-head{display:flex;justify-content:space-between;gap:10px;align-items:center;margin-bottom:8px;}
.tour-head b{font-size:17px;display:block;}
.tour-head span{display:block;font-size:13px;color:#64748b;margin-top:1px;}
.tour-tools{display:flex;gap:6px;}
.danger-soft{background:#fee2e2!important;color:#991b1b!important;}
.tour-list{display:flex;flex-direction:column;gap:7px;margin:8px 0;max-height:220px;overflow:auto;}
.tour-item{display:grid;grid-template-columns:1fr 38px;gap:6px;align-items:stretch;}
.tour-select{background:#f8fafc;color:#0f172a;border:1px solid var(--line);border-radius:14px;text-align:left;min-height:54px;padding:8px 10px;}
.tour-select b{display:block;font-size:14px;}
.tour-select span{display:block;font-size:12px;color:#64748b;font-weight:650;margin-top:2px;}
.tour-remove{background:#fee2e2;color:#991b1b;border-radius:12px;min-height:42px;padding:0;font-size:22px;}
.start-tour{width:100%;background:#0f766e;margin-top:8px;min-height:50px;}
.result-actions{margin-top:8px;display:flex;justify-content:flex-end;}
.select-tour{background:#ecfeff;color:#155e75;border:1px solid #a5f3fc;border-radius:999px;min-height:36px;padding:7px 11px;font-size:13px;}
.select-tour.selected{background:#dcfce7;color:#166534;border-color:#86efac;}
.tour-add{background:#ecfeff!important;color:#155e75!important;border:1px solid #a5f3fc!important;}
@media(min-width:901px){.topbar{grid-template-columns:170px 64px 86px 108px;}.tour-list{max-height:260px;}}
@media(max-width:520px){.topbar{grid-template-columns:minmax(0,1fr) 58px 72px 86px;gap:6px;left:6px;right:6px}.top-action{font-size:14px;min-height:48px;border-radius:15px;padding-left:8px;padding-right:8px}.top-action.primary{font-size:15px}.top-action.icon{font-size:19px}.top-action.tour-top{font-size:13px}.tour-tools .mini-btn{padding:7px 8px;font-size:12px}.tour-head{align-items:flex-start}.tour-list{max-height:180px}.start-tour{font-size:15px}.result-actions{justify-content:stretch}.select-tour{width:100%;}}


/* V13 - panneau non affiché par défaut + fiche épurée */
.bottom-sheet.closed{transform:translateY(calc(100% + 32px));pointer-events:none;max-height:0;}
.bottom-sheet{transition:max-height .2s ease,transform .22s ease,top .2s ease;}
.sheet-close{position:absolute;top:10px;left:12px;z-index:2;width:40px;height:40px;min-height:40px;border-radius:999px;background:#eef2f7;color:#0f172a;font-size:26px;line-height:1;padding:0;}
.sheet-title-row{padding-left:44px;}
.sheet-handle{display:none;}
body.parcel-selected .sheet-title-row{padding-left:44px;}
body.parcel-selected #sheetExpand{display:none;}
.route-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;}
.route-row .route{flex:none;width:100%;}
.route-row .tour-add{white-space:nowrap;}
@media(max-width:620px){
  .route-row{grid-template-columns:1fr;}
  .route-row .tour-add{width:100%;}
  .sheet-title-row{padding-left:42px;}
}


/* V13.1 - correction panneau mobile/tablette : fermeture toujours visible */
.bottom-sheet.expanded,
.bottom-sheet.half{
  scroll-padding-top:64px;
}
.sheet-close{
  position:sticky !important;
  top:10px !important;
  left:12px !important;
  z-index:50 !important;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 8px 22px #0f172a22;
  margin-bottom:-40px;
}
.sheet-title-row{
  position:sticky;
  top:0;
  z-index:40;
  background:linear-gradient(180deg,#fffffff8 0%,#fffffff8 78%,#ffffff00 100%);
  backdrop-filter:blur(8px);
  padding-top:6px;
  padding-bottom:10px;
}
body.parcel-selected .sheet-title-row{
  position:sticky;
  top:0;
  z-index:40;
}
.control-form{
  padding-bottom:calc(18px + var(--bottom-safe));
}


/* V14.1 - corrections panneau, fermeture recherche desktop, affichage tournée */
.drawer-head{
  position:sticky;
  top:0;
  z-index:80;
  background:linear-gradient(180deg,#f8fafc 0%,#f8fafc 82%,#f8fafc00 100%);
  backdrop-filter:blur(8px);
  padding-top:8px;
  padding-bottom:12px;
}
#closeFilters{
  flex:0 0 auto;
  box-shadow:0 8px 22px #0f172a1f;
}
.sheet-close{
  position:sticky !important;
  top:10px !important;
  left:12px !important;
  z-index:80 !important;
  margin-bottom:8px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
}
.sheet-title-row,
body.parcel-selected .sheet-title-row{
  padding-left:0 !important;
  top:0;
}
.bottom-sheet.expanded,
.bottom-sheet.half{
  overflow:auto !important;
  -webkit-overflow-scrolling:touch;
}
.tour-panel{
  padding-bottom:calc(14px + var(--bottom-safe));
}
@media(min-width:901px){
  body.filters-closed .drawer{display:none!important;}
  body.filters-closed .map-area{padding-left:0!important;}
  body.filters-closed .topbar{left:12px!important;}
  body.filters-closed .bottom-sheet{left:18px!important;}
  .bottom-sheet.expanded{
    top:calc(96px + var(--top-safe))!important;
    bottom:calc(18px + var(--bottom-safe))!important;
    max-height:none!important;
    overflow:auto!important;
  }
  .bottom-sheet.half{
    max-height:72dvh!important;
    overflow:auto!important;
  }
}

/* V14.2 - cartes, tournée dédiée, GPS plus clair */
.leaflet-control-layers{
  margin-top:108px!important;
  border-radius:14px!important;
  box-shadow:0 8px 22px #0f172a22!important;
  border:1px solid #ffffffb0!important;
}
.leaflet-control-layers-expanded{
  padding:8px 10px!important;
  font-weight:750;
}
body.tour-mode #selection,
body.tour-mode .results-head,
body.tour-mode #results,
body.tour-mode #sheetExpand{display:none!important;}
body.tour-mode #tourPanel{display:block!important;border-top:0;margin-top:0;padding-top:0;}
body.tour-mode .bottom-sheet.expanded{overflow:auto!important;}
.saved-tour-block{margin-top:12px;background:#f8fafc;border:1px solid var(--line);border-radius:16px;padding:10px;}
.saved-tour-block summary{cursor:pointer;font-weight:900;color:#334155;list-style:none;}
.saved-tour-block summary::-webkit-details-marker{display:none;}
.saved-tour-block summary:after{content:'+';float:right;color:#64748b;}
.saved-tour-block[open] summary:after{content:'−';}
.tour-save-row{margin-top:9px;}
.saved-item .load small{display:block;color:#64748b;font-size:12px;font-weight:650;margin-top:2px;}
@media(max-width:520px){
  .leaflet-control-layers{margin-top:96px!important;}
}

/* V15 - tournée estimée et parcelles proches */
.tour-summary{background:#f0fdf4;border:1px solid #bbf7d0;border-radius:16px;padding:11px 12px;margin:8px 0 10px;color:#14532d;}
.tour-summary.muted{background:#f8fafc;border-color:var(--line);color:#64748b;font-weight:650;}
.tour-summary-title{font-weight:950;font-size:16px;margin-bottom:6px;}
.tour-metrics{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:8px;}
.tour-metrics span{background:white;border:1px solid #dcfce7;border-radius:999px;padding:5px 9px;font-size:13px;}
.tour-villages{margin:0;padding-left:22px;font-size:14px;line-height:1.55;}
.tour-villages span{color:#64748b;font-size:12px;margin-left:4px;}
.nearby-list{display:flex;flex-direction:column;gap:6px;margin:8px 0;}
.nearby-title{font-weight:900;color:#0f172a;font-size:14px;margin-top:4px;}
.nearby-item{display:grid;grid-template-columns:1fr 40px;gap:6px;}
.nearby-select{background:#fff7ed;color:#0f172a;border:1px solid #fed7aa;border-radius:14px;text-align:left;min-height:48px;padding:7px 10px;}
.nearby-select b{display:block;font-size:14px;}
.nearby-select span{display:block;font-size:12px;color:#64748b;font-weight:650;margin-top:2px;}
.nearby-add{background:#ffedd5;color:#9a3412;border-radius:12px;min-height:40px;padding:0;font-size:20px;}
.nearby-empty{background:#f8fafc;border:1px dashed var(--line);border-radius:14px;color:#64748b;padding:10px;font-size:13px;}
@media(max-width:520px){.tour-tools{flex-wrap:wrap}.tour-tools .mini-btn{flex:1 1 auto}.tour-metrics span{font-size:12px}.tour-summary{padding:10px}}

/* V16 - tournée en cours partagée + bouton proches visible */
.tour-sync{font-size:12px;background:#f8fafc;border:1px solid var(--line);border-radius:12px;padding:7px 9px;margin:4px 0 8px;}
.nearby-primary{width:100%;background:#eff6ff!important;color:#1e40af!important;border:1px solid #bfdbfe!important;margin:8px 0 6px;min-height:48px;}
.nearby-list:empty{display:none;}
.nearby-list{margin:8px 0;display:flex;flex-direction:column;gap:7px;}
.nearby-title{font-weight:900;color:#0f172a;margin:4px 0 2px;}
.nearby-empty{background:#f8fafc;border:1px dashed #cbd5e1;border-radius:12px;padding:9px;color:#64748b;}
.nearby-item{display:grid;grid-template-columns:1fr 42px;gap:7px;align-items:stretch;}
.nearby-select{background:#fff;color:#0f172a;border:1px solid var(--line);text-align:left;border-radius:14px;min-height:52px;padding:8px 10px;}
.nearby-select b{display:block;font-size:14px;}
.nearby-select span{display:block;font-size:12px;color:#64748b;margin-top:2px;}
.nearby-add{background:#dcfce7!important;color:#166534!important;border:1px solid #86efac!important;border-radius:12px;min-height:42px;padding:0;font-size:22px;}
.nearby-from-parcel{background:#eff6ff!important;color:#1e40af!important;border:1px solid #bfdbfe!important;}
@media(max-width:620px){.route-row{grid-template-columns:1fr}.nearby-primary{font-size:16px}}

/* V16.1 - tournée partagée + panneau tournée épuré */
body.tour-mode .sheet-title-row{display:none!important;}
body.tour-mode .bottom-sheet{padding-top:14px;}
body.tour-mode #tourPanel{display:block!important;border-top:0!important;margin-top:0!important;padding-top:0!important;}
body.tour-mode .tour-head{position:sticky;top:0;z-index:70;background:linear-gradient(180deg,#fffffff7 0%,#fffffff7 82%,#ffffff00 100%);backdrop-filter:blur(10px);padding:4px 0 10px;margin-bottom:4px;}
body.tour-mode .sheet-close{position:sticky!important;top:0!important;z-index:90!important;margin-bottom:8px!important;}
body.tour-mode #selection,
body.tour-mode .results-head,
body.tour-mode #results,
body.tour-mode #sheetExpand{display:none!important;}
.tour-head > div:first-child b{font-size:22px;}
.tour-head > div:first-child span{display:block;color:#64748b;font-size:13px;margin-top:2px;}
@media(min-width:901px){
  body.tour-mode .bottom-sheet.expanded{top:calc(58px + var(--top-safe))!important;bottom:calc(14px + var(--bottom-safe))!important;max-height:none!important;}
}

/* V16.2 - parcelles proches en panneau dédié + auto optimisation optionnelle */
.auto-optimize{
  display:flex;
  align-items:center;
  gap:8px;
  margin:6px 0 8px;
  padding:9px 11px;
  background:#f8fafc;
  border:1px solid var(--line);
  border-radius:14px;
  color:#334155;
  font-size:13px;
  font-weight:800;
}
.auto-optimize input{width:18px;height:18px;accent-color:#2563eb;}
.nearby-panel{
  background:#fff;
  border:1px solid #bfdbfe;
  box-shadow:0 10px 24px #1e3a8a1a;
  border-radius:18px;
  padding:10px;
  margin:8px 0 12px;
}
.nearby-panel-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:8px;
}
.nearby-panel-head b{font-size:17px;color:#0f172a;}
.nearby-close{
  width:38px;
  height:38px;
  min-height:38px;
  border-radius:999px;
  padding:0;
  background:#eff6ff!important;
  color:#1e40af!important;
  font-size:22px;
  line-height:1;
}
.nearby-hint{
  font-size:12px;
  color:#64748b;
  margin:-2px 0 8px;
  line-height:1.35;
}
body.nearby-mode.tour-mode #tourList{margin-top:8px;}
@media(max-width:620px){
  body.nearby-mode.tour-mode #tourList{
    opacity:.35;
    max-height:120px;
    overflow:hidden;
    pointer-events:none;
  }
  body.nearby-mode.tour-mode #tourList::before{
    content:'Tournée déjà sélectionnée';
    display:block;
    font-weight:900;
    color:#334155;
    margin-bottom:6px;
    opacity:1;
  }
  .nearby-panel{position:relative;z-index:20;}
}

/* V17 - module Export Word contrôles */
.button.export.word{background:#1d4ed8;}
.export-page{max-width:1120px;margin:0 auto;padding:24px;color:#0f172a;}
.export-header{display:flex;gap:18px;justify-content:space-between;align-items:flex-start;margin-bottom:18px;}
.export-header h1{margin:8px 0 6px;font-size:32px;line-height:1.1;}
.export-header p{margin:0;color:#64748b;}
.back-link{display:inline-flex;text-decoration:none;color:#1d4ed8;font-weight:850;}
.export-stats{background:white;border:1px solid #e2e8f0;border-radius:18px;padding:14px 18px;box-shadow:0 8px 24px #0f172a12;white-space:nowrap;}
.export-card{background:white;border:1px solid #e2e8f0;border-radius:22px;padding:20px;box-shadow:0 16px 45px #0f172a12;}
.export-card section{border-bottom:1px solid #e2e8f0;padding:0 0 18px;margin-bottom:18px;}
.export-card section:last-of-type{border-bottom:0;margin-bottom:8px;}
.export-card h2{font-size:18px;margin:0 0 12px;}
.export-grid{display:grid;gap:12px;margin-bottom:12px;}
.export-grid.two{grid-template-columns:repeat(2,minmax(0,1fr));}
.export-grid.three{grid-template-columns:repeat(3,minmax(0,1fr));}
.export-card label{font-weight:850;font-size:14px;color:#334155;display:block;}
.export-card input,.export-card select{width:100%;margin-top:6px;border:2px solid #cbd5e1;border-radius:14px;padding:11px 12px;min-height:46px;background:#fff;}
.export-options{display:flex;flex-wrap:wrap;gap:10px 18px;margin-bottom:12px;}
.export-options .check{display:flex;align-items:center;gap:8px;background:#f8fafc;border:1px solid #e2e8f0;border-radius:999px;padding:9px 13px;}
.export-options input{width:auto;min-height:auto;margin:0;}
.limit-field{max-width:240px;}
.export-actions{display:flex;gap:12px;justify-content:flex-end;align-items:center;margin-top:16px;}
.export-actions button,.export-actions .button{min-width:210px;text-align:center;}
@media(max-width:760px){.export-page{padding:14px}.export-header{display:block}.export-stats{margin-top:12px}.export-grid.two,.export-grid.three{grid-template-columns:1fr}.export-actions{display:grid;grid-template-columns:1fr}.export-actions button,.export-actions .button{width:100%;min-width:0}.export-header h1{font-size:26px}}

/* V18 - Auth + PWA */
.auth-page,.settings-page{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:24px;background:linear-gradient(135deg,#064e3b,#0f172a);box-sizing:border-box}.auth-card,.settings-card{width:min(760px,100%);background:#fff;border-radius:22px;box-shadow:0 24px 80px rgba(0,0,0,.28);padding:24px;box-sizing:border-box}.auth-card{max-width:420px;text-align:center}.auth-logo{width:88px;height:88px;border-radius:24px;object-fit:cover;box-shadow:0 10px 30px rgba(0,0,0,.18)}.auth-card h1,.settings-card h1{margin:14px 0 8px}.muted{color:#64748b}.auth-form{display:grid;gap:14px;text-align:left;margin-top:20px}.auth-form label,.icon-form{display:grid;gap:6px}.auth-form input,.icon-form input{font:inherit;border:1px solid #cbd5e1;border-radius:14px;padding:12px;background:#fff}.auth-form button,.icon-form button,.settings-card .button{border:0;border-radius:14px;padding:12px 16px;background:#166534;color:#fff;font-weight:800;text-decoration:none;text-align:center}.settings-head{display:flex;gap:16px;justify-content:space-between;align-items:flex-start}.settings-section{border-top:1px solid #e2e8f0;margin-top:20px;padding-top:18px}.icon-preview-row{display:flex;gap:18px;align-items:center}.icon-preview{width:96px;height:96px;border-radius:22px;object-fit:cover;border:1px solid #e2e8f0}.settings-card pre{white-space:pre-wrap;background:#0f172a;color:#e2e8f0;border-radius:14px;padding:14px;overflow:auto}.danger-note{background:#fff7ed;border:1px solid #fed7aa;border-radius:16px;padding:16px;margin-top:18px}.topbar a.top-action{display:inline-flex;align-items:center;justify-content:center;text-decoration:none;color:inherit}
@media(max-width:640px){.auth-page,.settings-page{padding:14px;align-items:stretch}.auth-card,.settings-card{border-radius:18px;padding:18px}.settings-head,.icon-preview-row{display:grid}.settings-card .button{display:inline-block}.auth-logo{width:76px;height:76px}}

/* V19 - sécurité utilisateurs + PWA */
.app-user-bar{position:fixed;top:8px;right:8px;z-index:5000;display:flex;gap:8px;align-items:center;background:rgba(15,23,42,.86);color:#fff;border-radius:999px;padding:6px 10px;font-size:12px;backdrop-filter:blur(8px)}
.app-user-bar a{color:#fff;text-decoration:none;border-left:1px solid rgba(255,255,255,.25);padding-left:8px}
.settings-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.user-form{display:grid;grid-template-columns:1fr 1fr auto auto;gap:10px;align-items:end}.user-form label,.password-form input{min-width:0}.users-list{display:flex;flex-direction:column;gap:10px}.user-row{border:1px solid #e2e8f0;border-radius:16px;padding:12px;background:#fff}.user-main{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:10px}.user-main small{width:100%;color:#64748b}.badge{font-size:12px;border-radius:999px;padding:3px 8px}.badge.ok{background:#dcfce7;color:#166534}.badge.off{background:#fee2e2;color:#991b1b}.user-actions{display:flex;gap:8px;flex-wrap:wrap}.inline-form{display:flex;gap:6px;align-items:center}.inline-form input,.inline-form select,.user-form input,.user-form select{border:1px solid #cbd5e1;border-radius:12px;padding:9px 10px}.install-button{background:#166534;color:#fff;border:0;border-radius:14px;padding:12px 16px;font-weight:700}
@media (max-width:720px){.app-user-bar{left:8px;right:8px;justify-content:center;top:calc(8px + env(safe-area-inset-top));font-size:11px}.user-form{grid-template-columns:1fr}.user-actions,.inline-form{width:100%}.inline-form input,.inline-form select,.inline-form button{flex:1;min-width:0}.settings-head{gap:10px}.settings-actions{justify-content:flex-start}}

/* V20 - mode terrain : menu utilisateur discret + boutons plus proches appli mobile */
.app-user-bar{display:none!important;}
.account-fab{
  position:fixed;
  right:calc(14px + env(safe-area-inset-right,0px));
  bottom:calc(18px + env(safe-area-inset-bottom,0px));
  z-index:2600;
  width:58px;
  height:58px;
  min-height:58px;
  border-radius:999px;
  background:linear-gradient(180deg,#ffffff,#eef2f7);
  color:#0f172a;
  border:1px solid #ffffffd9;
  box-shadow:0 14px 34px #0f172a38;
  font-size:26px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0;
}
.account-fab:active,.top-action:active,.mini-btn:active,button:active{transform:scale(.985)}
.account-menu[hidden]{display:none!important;}
.account-menu{
  position:fixed;
  inset:0;
  z-index:5000;
  background:#0f172a66;
  display:flex;
  align-items:flex-end;
  justify-content:flex-end;
  padding:12px calc(12px + env(safe-area-inset-right,0px)) calc(84px + env(safe-area-inset-bottom,0px)) 12px;
}
.account-card{
  width:min(340px,calc(100vw - 24px));
  background:#fffffff8;
  backdrop-filter:blur(16px);
  border:1px solid #ffffffc9;
  border-radius:24px;
  box-shadow:0 26px 70px #0f172a45;
  padding:12px;
  display:flex;
  flex-direction:column;
  gap:6px;
}
.account-head{display:flex;justify-content:space-between;align-items:flex-start;gap:8px;padding:4px 4px 8px;border-bottom:1px solid #e2e8f0;margin-bottom:4px;}
.account-head strong{display:block;font-size:18px;}
.account-head span{display:block;font-size:13px;color:#64748b;margin-top:3px;}
.account-head button{width:42px;height:42px;min-height:42px;border-radius:999px;background:#eef2f7;color:#0f172a;padding:0;font-size:22px;}
.account-card a,.account-card button:not(#closeAccountMenu){
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:10px;
  min-height:48px;
  border-radius:16px;
  padding:12px 14px;
  background:#f8fafc;
  color:#0f172a;
  text-decoration:none;
  font-weight:850;
  border:1px solid #e2e8f0;
}
.account-card a.logout{background:#fef2f2;color:#991b1b;border-color:#fecaca;}
.sync-ok{color:#16a34a!important}.sync-warn{color:#d97706!important}.sync-progress{color:#2563eb!important}
.topbar{top:calc(14px + var(--top-safe));}
.top-action{
  border-radius:999px!important;
  box-shadow:0 12px 30px #0f172a2e!important;
  font-weight:900;
  letter-spacing:-.01em;
}
.top-action.primary{background:linear-gradient(180deg,#3b82f6,#2563eb)!important;}
.top-action.tour-top{background:linear-gradient(180deg,#0f766e,#0d9488)!important;color:white!important;}
.leaflet-control-zoom a,.leaflet-control-layers-toggle{border-radius:14px!important;}
.bottom-sheet,.drawer-card{box-shadow:0 24px 80px #0f172a35!important;}
.sheet-close,#closeFilters{border-radius:999px!important;background:#eef2f7!important;color:#0f172a!important;}
.save-control,.start-tour{background:linear-gradient(180deg,#16a34a,#15803d)!important;}
@media(max-width:520px){
  .account-menu{align-items:flex-end;justify-content:center;padding-bottom:calc(86px + env(safe-area-inset-bottom,0px));}
  .account-fab{width:54px;height:54px;min-height:54px;}
  .topbar{right:72px;grid-template-columns:minmax(0,1fr) 58px 76px 86px;gap:8px;}
  .top-action{min-height:52px;font-size:15px;}
  .top-action.icon{font-size:22px;}
}
@media(min-width:901px){
  .account-fab{right:24px;bottom:24px;}
  .account-menu{padding:16px 24px 94px 16px;}
}
.topbar{grid-template-columns:minmax(0,1fr) 74px 96px 112px;}
@media(min-width:901px){.topbar{grid-template-columns:170px 64px 86px 106px;}}


/* V20.1 - correction boutons haut mobile + PWA */
.topbar{
  left:12px!important;
  right:12px!important;
  display:flex!important;
  grid-template-columns:none!important;
  align-items:center;
  gap:10px;
  overflow:visible;
}
.topbar .top-action{flex:0 0 auto;white-space:nowrap;min-width:0;}
.topbar .top-action.primary{flex:1 1 auto;min-width:118px;overflow:hidden;text-overflow:ellipsis;}
.topbar .top-action.icon{width:64px;flex-basis:64px;padding-left:0;padding-right:0;}
.topbar .top-action:not(.primary):not(.icon){padding-left:18px;padding-right:18px;}
@media(max-width:430px){
  .topbar{left:10px!important;right:10px!important;gap:8px;}
  .topbar .top-action{min-height:52px;border-radius:18px;font-size:15px;}
  .topbar .top-action.primary{min-width:92px;padding-left:12px;padding-right:12px;}
  .topbar .top-action.icon{width:58px;flex-basis:58px;font-size:22px;}
  .topbar .tour-top{padding-left:13px!important;padding-right:13px!important;}
}
@media(max-width:360px){
  .topbar .top-action.primary{font-size:0;flex:0 0 58px;}
  .topbar .top-action.primary::before{content:'🔍';font-size:22px;}
  .topbar .top-action:not(.primary):not(.icon){font-size:14px;padding-left:10px!important;padding-right:10px!important;}
}
.account-fab{right:calc(16px + env(safe-area-inset-right,0px));bottom:calc(20px + env(safe-area-inset-bottom,0px));}
.install-help{font-size:12px;color:#64748b;margin:6px 2px 0;line-height:1.35;}

/* V20.7 FIX - version visible + bannière de mise à jour PWA */
.app-version-badge {
  margin: 10px 14px 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.08);
  color: #0f172a;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.88rem;
}
.app-version-badge strong { font-size: 0.98rem; }
.pwa-update-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 20px;
  background: #0f172a;
  color: white;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.28);
}
.pwa-update-banner[hidden] { display: none !important; }
.pwa-update-banner div { display: flex; flex-direction: column; gap: 2px; }
.pwa-update-banner span { opacity: .86; font-size: .9rem; }
.pwa-update-banner button {
  border: 0;
  border-radius: 999px;
  background: white;
  color: #0f172a;
  font-weight: 700;
  padding: 10px 14px;
  white-space: nowrap;
}
@media (min-width: 900px) {
  .pwa-update-banner {
    left: auto;
    right: 24px;
    bottom: 24px;
    width: min(460px, calc(100vw - 48px));
  }
}

/* Correctif desktop bouton Filtres */
@media (min-width: 900px) {
  .topbar {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 14px !important;
    padding: 20px 24px !important;
  }

  #openFilters.top-action.primary {
    flex: 0 0 auto !important;
    width: 260px !important;
    max-width: 260px !important;
    min-width: 260px !important;
    height: 58px !important;
    padding: 0 24px !important;
    border-radius: 22px !important;
  }

  #locateTop.top-action.icon {
    flex: 0 0 58px !important;
    width: 58px !important;
    min-width: 58px !important;
    max-width: 58px !important;
    height: 58px !important;
  }

  #toggleList.top-action,
  #openTour.top-action {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 120px !important;
    max-width: 180px !important;
    height: 58px !important;
    padding: 0 24px !important;
  }
}

/* V1.0.8 - parcelle suivante et historique */
.next-actions{display:flex;gap:10px;flex-wrap:wrap;margin:10px 0 6px}.next-actions .secondary{flex:1 1 180px}.history-panel{margin:12px 0;border:1px solid #dbe4f0;border-radius:16px;background:#f8fafc;overflow:hidden}.history-panel summary{cursor:pointer;padding:14px 16px;font-weight:900;color:#0f172a}.history-panel[open] summary{border-bottom:1px solid #dbe4f0}.history-item{padding:12px 16px;border-bottom:1px solid #e5edf6}.history-item:last-child{border-bottom:0}.history-item b{display:block}.history-item small{display:block;color:#64748b;margin-top:2px}.history-item p{margin:8px 0 0}.history-item a{display:inline-block;margin-top:8px;font-weight:800;color:#2563eb}.next-parcel-bar{position:fixed;left:50%;bottom:22px;transform:translateX(-50%);z-index:9999;display:flex;align-items:center;gap:12px;max-width:min(720px,calc(100vw - 24px));background:#0f172a;color:white;border-radius:22px;padding:12px 14px;box-shadow:0 18px 50px rgba(15,23,42,.35)}.next-parcel-bar[hidden]{display:none}.next-parcel-bar div{display:flex;flex-direction:column;min-width:0}.next-parcel-bar span{font-size:13px;color:#cbd5e1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:320px}.next-parcel-bar button{border:0;border-radius:16px;padding:10px 14px;font-weight:900;cursor:pointer}.next-parcel-bar .next-close{background:transparent;color:white;font-size:22px;padding:4px 8px}.next-parcel-bar .next-open{background:#2563eb;color:white}.next-parcel-bar .next-map{background:#16a34a;color:white}@media(max-width:700px){.next-parcel-bar{left:10px;right:10px;bottom:12px;transform:none;display:grid;grid-template-columns:auto 1fr;gap:8px}.next-parcel-bar .next-open,.next-parcel-bar .next-map{grid-column:auto}.next-parcel-bar div{grid-column:2 / -1}.next-parcel-bar span{max-width:calc(100vw - 120px)}}

/* Correctif desktop bouton Filtres */
@media (min-width: 900px) {
  .topbar {display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:14px!important;padding:20px 24px!important;}
  #openFilters.top-action.primary {flex:0 0 auto!important;width:260px!important;max-width:260px!important;min-width:260px!important;height:58px!important;padding:0 24px!important;border-radius:22px!important;}
  #locateTop.top-action.icon {flex:0 0 58px!important;width:58px!important;min-width:58px!important;max-width:58px!important;height:58px!important;}
  #toggleList.top-action,#openTour.top-action {flex:0 0 auto!important;width:auto!important;min-width:120px!important;max-width:180px!important;height:58px!important;padding:0 24px!important;}
}

/* V2 - module import annuel parcellaire */
.admin-page{min-height:100dvh;overflow:auto;background:#f8fafc;padding:22px;color:#0f172a}.admin-card{max-width:1120px;margin:0 auto;background:#fff;border:1px solid #e2e8f0;border-radius:22px;box-shadow:0 12px 38px #0f172a14;padding:22px}.admin-head{display:flex;justify-content:space-between;gap:14px;align-items:flex-start;margin-bottom:16px}.admin-head h1{margin:0 0 6px;font-size:30px}.admin-head p{margin:0;color:#64748b}.import-upload{display:grid;grid-template-columns:1fr auto;gap:14px;align-items:end;background:#f8fafc;border:1px solid #e2e8f0;border-radius:18px;padding:14px}.notice{margin:14px 0;background:#eff6ff;border:1px solid #bfdbfe;border-radius:16px;padding:12px;color:#1e3a8a}.import-jobs{display:grid;gap:8px}.import-jobs a{display:block;text-decoration:none;color:#0f172a;border:1px solid #e2e8f0;border-radius:14px;padding:12px;background:#f8fafc}.import-jobs span{display:block;color:#64748b;font-size:13px;margin-top:3px}.import-summary{display:grid;grid-template-columns:repeat(5,1fr);gap:10px;margin:14px 0}.import-summary div{background:#f8fafc;border:1px solid #e2e8f0;border-radius:16px;padding:14px;text-align:center}.import-summary b{display:block;font-size:26px}.import-summary span{color:#64748b;font-size:13px;font-weight:800}.import-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:14px 0}.import-detail{border:1px solid #e2e8f0;border-radius:16px;margin:10px 0;background:#fff;overflow:hidden}.import-detail summary{cursor:pointer;font-weight:900;background:#f8fafc;padding:12px}.import-table{display:grid;gap:0}.import-table div{padding:10px 12px;border-top:1px solid #e2e8f0}.import-table span{display:block;color:#64748b;font-size:13px;margin-top:2px}.pill.ok{background:#dcfce7;color:#166534;border:1px solid #86efac}
@media(max-width:760px){.admin-page{padding:10px}.admin-card{padding:14px;border-radius:18px}.admin-head{display:block}.import-upload{grid-template-columns:1fr}.import-summary{grid-template-columns:1fr 1fr}.import-summary div:first-child{grid-column:1/3}}

/* V2.0.2 - Import annuel : synthèse des vraies modifications */
.import-field-counts{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  padding:12px 0;
}
.import-field-counts span{
  background:#eef6ff;
  border:1px solid #d8e8ff;
  border-radius:999px;
  padding:8px 12px;
  font-weight:700;
  color:#17324d;
}
.import-field-counts b{
  color:#2563eb;
  margin-right:4px;
}
.import-table small{
  display:block;
  color:#475569;
  margin-top:4px;
  line-height:1.4;
}

/* V2.0.4 - Import annuel : listes consultables + navigation rapide */
.admin-page {
  height: 100dvh !important;
  min-height: 0 !important;
  overflow: auto !important;
  -webkit-overflow-scrolling: touch !important;
}
.import-nav {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  margin: 12px 0 14px;
  padding: 10px 12px;
  border: 1px solid #dbeafe;
  border-radius: 16px;
  background: #eff6ff;
}
.import-nav label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 850;
  color: #1e3a8a;
}
.import-nav select {
  min-height: 42px;
  border: 2px solid #bfdbfe;
  border-radius: 12px;
  padding: 8px 12px;
  background: #fff;
  color: #0f172a;
  font-weight: 750;
}
.import-detail summary span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1e40af;
  font-size: 12px;
}
.import-table-scroll {
  max-height: min(62dvh, 640px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.import-table-scroll div:nth-child(even) {
  background: #fafcff;
}
.import-table-modified small {
  display: block;
  margin-top: 6px;
  line-height: 1.35;
  color: #0f172a;
}
@media(max-width:760px){
  .import-nav label { align-items: stretch; flex-direction: column; width: 100%; }
  .import-nav select { width: 100%; }
  .import-table-scroll { max-height: 58dvh; }
}

/* V1.1.0 - Import annuel : UX par onglets + scroll global propre */
.admin-import-mode,
.admin-import-mode body {
  height: auto !important;
  min-height: 100% !important;
  overflow: auto !important;
}
.admin-import-mode .admin-page.import-page {
  height: auto !important;
  min-height: 100dvh !important;
  overflow: visible !important;
  padding-bottom: 72px !important;
}
.admin-import-mode .admin-card.import-shell {
  overflow: visible !important;
}
.import-dashboard {
  position: relative;
}
.import-page .notice.compact {
  margin: 10px 0;
}
.import-page .sticky-actions {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  padding: 10px 0;
  border-bottom: 1px solid #e2e8f0;
}
.import-tabs {
  position: sticky;
  top: 58px;
  z-index: 4;
  display: flex;
  gap: 10px;
  margin: 16px 0 12px;
  padding: 10px;
  border: 1px solid #dbeafe;
  border-radius: 18px;
  background: rgba(239,246,255,.94);
  backdrop-filter: blur(12px);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.import-tabs button {
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  background: #fff;
  color: #1e3a8a;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px #bfdbfe;
}
.import-tabs button.active {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 10px 26px rgba(37,99,235,.22);
}
.import-tabs button span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(15,23,42,.08);
}
.import-tabs button.active span {
  background: rgba(255,255,255,.22);
}
.import-panel {
  display: none;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  background: #fff;
  overflow: hidden;
  margin-bottom: 24px;
}
.import-panel.active {
  display: block;
}
.import-panel h2 {
  position: sticky;
  top: 132px;
  z-index: 3;
  margin: 0;
  padding: 14px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 18px;
}
.import-panel h2 span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1e40af;
  font-size: 13px;
}
.import-list {
  display: grid;
  gap: 0;
  max-height: none !important;
  overflow: visible !important;
}
.import-row {
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}
.import-row:nth-child(even) {
  background: #fbfdff;
}
.import-row:last-child {
  border-bottom: 0;
}
.import-row b {
  display: block;
  color: #0f172a;
  font-size: 15px;
}
.import-row span,
.import-row small {
  display: block;
  color: #475569;
  margin-top: 4px;
  line-height: 1.35;
}
.import-row.created { border-left: 5px solid #16a34a; }
.import-row.modified { border-left: 5px solid #f59e0b; }
.import-row.removed { border-left: 5px solid #ef4444; }
.diff-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.diff-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #7c2d12;
  font-size: 13px;
  font-weight: 800;
}
.diff-chip strong { color: #9a3412; }
.diff-chip em {
  font-style: normal;
  color: #0f172a;
  font-weight: 700;
}
.empty-list {
  padding: 18px;
}
.admin-import-mode .import-table-scroll {
  max-height: none !important;
  overflow: visible !important;
}
@media (max-width: 760px) {
  .import-page .sticky-actions {
    top: 0;
  }
  .import-tabs {
    top: 54px;
    margin-left: -4px;
    margin-right: -4px;
  }
  .import-panel h2 {
    top: 122px;
  }
  .import-tabs button {
    padding: 11px 14px;
  }
  .diff-chip {
    width: 100%;
    justify-content: space-between;
    border-radius: 14px;
  }
}


/* V1.1.1 - import annuel lisible + filtre plantier */
.import-panel > h2{display:none!important;}
.import-card{position:relative;padding:16px 18px 16px 20px!important;border-left-width:5px!important;display:grid;gap:6px;background:#fff;}
.import-card-badge{font-weight:900;font-size:13px;text-transform:uppercase;letter-spacing:.02em;color:#334155;margin-bottom:2px;}
.import-card b{font-size:16px;}
.import-card span,.import-card small{color:#475569;line-height:1.35;}
.import-row.created{border-left-color:#22c55e!important;}
.import-row.modified{border-left-color:#f59e0b!important;}
.import-row.removed{border-left-color:#ef4444!important;}
.labeled-diffs{margin-top:8px;display:grid;gap:8px;}
.labeled-diffs .diff-chip{display:grid;grid-template-columns:minmax(110px,180px) minmax(0,1fr) auto minmax(0,1fr);gap:8px;align-items:center;background:#fff7ed;border:1px solid #fed7aa;border-radius:12px;padding:8px 10px;}
.notice.danger{background:#fff1f2;border-color:#fecdd3;color:#9f1239;}
.checkbox-field{display:flex!important;align-items:center;gap:10px;background:#f8fafc;border:1px solid #dbe4f0;border-radius:14px;padding:10px 12px;}
.checkbox-field input{width:22px!important;min-height:22px;height:22px;accent-color:#2563eb;}
.checkbox-field span{display:flex;flex-direction:column;gap:2px;}
.checkbox-field small{font-weight:600;color:#64748b;line-height:1.2;}
@media(max-width:700px){.labeled-diffs .diff-chip{grid-template-columns:1fr;}.labeled-diffs .diff-chip span{display:none;}}

/* V1.1.2 - Import annuel : statistiques finales et arborescences */
.import-final-stats {
  border: 1px solid rgba(15, 23, 42, .10);
  background: #fff;
  border-radius: 22px;
  padding: 14px 16px;
  margin: 14px 0;
}
.import-final-stats > summary,
.import-subdetails > summary {
  cursor: pointer;
  font-weight: 800;
  color: #0f172a;
}
.final-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.final-stats-grid > div {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-radius: 18px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, .08);
}
.final-stats-grid span { color: #64748b; font-size: .86rem; }
.final-stats-grid b { font-size: .98rem; color: #0f172a; }
.final-stats-grid strong { color: #166534; font-size: .92rem; }
.import-subdetails { margin-top: 12px; }
.appellation-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.appellation-stat {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 16px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, .08);
}
.appellation-stat span { color: #475569; font-size: .9rem; }
.appellation-stat em { color: #166534; font-style: normal; font-weight: 800; }
.import-tree { display: grid; gap: 12px; }
.tree-group,
.tree-subgroup {
  border: 1px solid rgba(15, 23, 42, .10);
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
}
.tree-subgroup { margin: 10px 12px; background: #f8fafc; }
.tree-group > summary,
.tree-subgroup > summary {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  font-weight: 900;
  color: #0f172a;
}
.tree-group > summary em,
.tree-subgroup > summary em {
  font-style: normal;
  font-size: .86rem;
  color: #475569;
  text-align: right;
}
.tree-items {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}
.tree-subgroup .tree-items { padding: 0 10px 10px; }
.single-focus .diff-chip { grid-template-columns: minmax(110px, 1fr) auto auto auto; }
@media (max-width: 720px) {
  .final-stats-grid { grid-template-columns: 1fr; }
  .final-stats-grid > div { grid-template-columns: 1fr auto auto; }
  .final-stats-grid > div strong { grid-column: 1 / -1; }
  .tree-group > summary,
  .tree-subgroup > summary { align-items: flex-start; flex-direction: column; }
  .tree-group > summary em,
  .tree-subgroup > summary em { text-align: left; }
}

/* V1.2.0 — ajout en masse à la tournée */
.drawer-actions .bulk-tour{white-space:nowrap;min-width:max-content}
.bulk-tour-modal[hidden]{display:none!important}
.bulk-tour-modal{position:fixed;inset:0;z-index:10050;background:rgba(15,23,42,.55);display:flex;align-items:center;justify-content:center;padding:18px}
.bulk-tour-dialog{position:relative;width:min(520px,100%);background:#fff;border-radius:24px;padding:26px;box-shadow:0 24px 70px rgba(15,23,42,.28)}
.bulk-tour-dialog h2{margin:0 42px 12px 0;font-size:1.25rem}
.bulk-tour-dialog p{line-height:1.5;color:#475569}
.bulk-tour-close{position:absolute;top:12px;right:12px;width:42px;height:42px;border:0;border-radius:50%;font-size:1.7rem;line-height:1;background:#eef2f7;color:#334155}
.bulk-tour-actions{display:grid;gap:10px;margin-top:20px}
.bulk-tour-actions button{min-height:48px;border-radius:15px;font-weight:700}
@media (min-width:700px){.bulk-tour-actions{grid-template-columns:1fr 1fr}.bulk-tour-actions .secondary{grid-column:1/-1}}
@media (max-width:900px){.drawer-actions.sticky-actions{grid-template-columns:repeat(2,minmax(0,1fr))}.drawer-actions .bulk-tour,.drawer-actions .export{width:100%;text-align:center}}

/* V1.2.1 — panneau de filtres et actions optimisés sur ordinateur */
@media (min-width: 1100px) {
  .drawer {
    width: 460px !important;
  }

  .drawer-card {
    width: 460px !important;
  }

  .map-area {
    padding-left: 460px !important;
  }

  .topbar {
    left: 472px !important;
  }

  .bottom-sheet {
    left: 480px !important;
  }

  body.filters-closed .map-area {
    padding-left: 0 !important;
  }

  body.filters-closed .topbar {
    left: 12px !important;
  }

  body.filters-closed .bottom-sheet {
    left: 18px !important;
  }

  .drawer-actions.sticky-actions {
    display: grid !important;
    grid-template-columns: 96px 96px minmax(210px, 1fr) 96px !important;
    gap: 8px !important;
    align-items: stretch !important;
  }

  .drawer-actions.sticky-actions > * {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  .drawer-actions #addFilteredToTour {
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .drawer-actions #exportLink {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
}

@media (min-width: 901px) and (max-width: 1099px) {
  .drawer-actions.sticky-actions {
    grid-template-columns: 1fr 1fr !important;
  }

  .drawer-actions #addFilteredToTour,
  .drawer-actions #exportLink {
    width: 100% !important;
  }
}
