/* V3.0.3.7 — clic droit réserve robuste, détection sous les couches du plan */
/* COBAT V3.0.3 — codes thématiques + menu contextuel réserves */
.model-code{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:34px;
  height:20px;
  padding:0 6px;
  border-radius:6px;
  background:#eef5fb;
  border:1px solid #c8d9e8;
  color:#0B5CAD;
  font-size:9px;
  font-weight:800;
  letter-spacing:.06em;
  vertical-align:middle;
}

.reserve-context-menu{
  position:fixed;
  z-index:100500;
  width:158px;
  padding:5px;
  border:1px solid rgba(255,255,255,.12);
  border-radius:11px;
  background:rgba(12,17,22,.90);
  box-shadow:0 14px 34px rgba(5,16,25,.28);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  color:#fff;
}
.reserve-context-menu.hidden{display:none!important}
.reserve-context-head{
  min-height:28px;
  display:flex;
  align-items:center;
  padding:0 8px 4px;
  margin-bottom:3px;
  border-bottom:1px solid rgba(255,255,255,.10);
  color:rgba(255,255,255,.72);
  font-size:9px;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.reserve-context-menu button{
  width:100%;
  height:38px;
  border:0;
  border-radius:8px;
  background:transparent;
  color:#fff;
  display:flex;
  align-items:center;
  gap:9px;
  padding:0 9px;
  cursor:pointer;
  font:650 11px/1 Arial,Helvetica,sans-serif;
  text-align:left;
}
.reserve-context-menu button:hover,
.reserve-context-menu button:focus-visible{
  background:rgba(78,163,255,.16);
  outline:none;
}
.reserve-context-menu button.danger{color:#ffb9bf}
.reserve-context-menu button.danger:hover,
.reserve-context-menu button.danger:focus-visible{background:rgba(213,76,86,.18)}
.reserve-context-menu svg{
  width:17px;
  height:17px;
  flex:0 0 17px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.7;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.reserve-marker{
  -webkit-touch-callout:none;
  user-select:none;
}
@media(max-width:767px){
  .reserve-context-menu{width:166px;padding:6px}
  .reserve-context-menu button{height:44px;font-size:12px}
}


/* V3.0.3.10 — fiche Réserve en modale centrale, alignée sur l'architecture Autocontrôle */
.reserve-detail-modal-backdrop{
  position:fixed;
  inset:0;
  z-index:100380;
  background:rgba(24,35,44,.58);
  backdrop-filter:blur(1px);
  -webkit-backdrop-filter:blur(1px);
}
.reserve-detail-modal-backdrop.hidden{display:none!important}
body.reserve-detail-modal-open{overflow:hidden}

/* La fiche Réserve n'occupe plus la colonne droite du viewer. */
.detail-panel,
body.acm-mobile .detail-panel{
  position:fixed!important;
  z-index:100400!important;
  left:50%!important;
  right:auto!important;
  top:50%!important;
  bottom:auto!important;
  transform:translate(-50%,-50%)!important;
  width:min(980px,94vw)!important;
  min-width:0!important;
  height:min(820px,92vh)!important;
  max-height:92vh!important;
  border:1px solid #cbd5db!important;
  border-radius:12px!important;
  background:#fff!important;
  box-shadow:0 22px 70px rgba(17,29,38,.34)!important;
  overflow:hidden!important;
  flex-direction:column!important;
}
.detail-panel::before,
body.acm-mobile .detail-panel::before{display:none!important}
.detail-panel.open{display:flex!important}

.detail-head{
  flex:0 0 auto;
  padding:15px 18px!important;
  border-bottom:1px solid #d7e0e5!important;
  background:#fff;
  align-items:center!important;
}
.detail-id{
  font-size:9px!important;
  text-transform:uppercase;
  letter-spacing:.06em;
  color:#6f7f89!important;
}
.detail-title{
  margin-top:4px!important;
  font-size:17px!important;
  color:#2f4654;
}
.detail-head .btn.icon-only{
  width:36px;
  height:36px;
  border-radius:8px;
  font-size:18px;
}

.detail-scroll{
  flex:1 1 auto;
  min-height:0;
  padding:16px 18px!important;
  overflow:auto!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
  align-content:start;
  gap:14px!important;
  background:#f7f9fa;
}
.detail-scroll>div{
  min-width:0;
  padding:13px 14px;
  border:1px solid #dce4e8;
  border-radius:10px;
  background:#fff;
}
.detail-scroll>div:nth-child(3),
.detail-scroll>div:nth-child(4){grid-column:1/-1}
.detail-scroll .section-label{
  margin-bottom:10px;
  color:#657985;
  font-weight:700;
}
.detail-scroll .form-grid{gap:10px 11px}
.detail-scroll .field input,
.detail-scroll .field select,
.detail-scroll .field textarea{
  min-height:38px;
  border-radius:7px;
  background:#fff;
}
.detail-scroll .field textarea{min-height:92px}
.reserve-photo-preview{grid-template-columns:repeat(3,minmax(0,1fr))}

.detail-history-block{
  flex:0 0 auto;
  padding:10px 18px 12px!important;
  border-top:1px solid #e0e7ea;
  background:#fff!important;
}
.detail-history-block .section-label{margin-bottom:6px}
.detail-history-block .history-list.compact{max-height:112px}

.detail-actions{
  flex:0 0 auto;
  padding:12px 18px!important;
  border-top:1px solid #d8e1e6!important;
  background:#fafcfd!important;
  justify-content:flex-end!important;
  align-items:center;
}
.detail-actions .btn{flex:0 0 auto!important;min-width:116px;justify-content:center}
.detail-actions .reserve-export-menu{margin-right:auto}
.reserve-export-menu-bottom .reserve-export-btn-bottom{min-width:116px}

@media(max-width:820px){
  .detail-panel,
  body.acm-mobile .detail-panel{
    width:100vw!important;
    height:100dvh!important;
    max-height:100dvh!important;
    top:0!important;
    left:0!important;
    transform:none!important;
    border:0!important;
    border-radius:0!important;
  }
  .detail-scroll{grid-template-columns:1fr!important;padding:12px!important}
  .detail-scroll>div:nth-child(3),.detail-scroll>div:nth-child(4){grid-column:auto}
  .detail-history-block{display:block!important;padding:9px 12px!important}
  .detail-history-block .history-list.compact{max-height:90px}
  .detail-actions{padding:10px 12px!important;display:grid!important;grid-template-columns:1fr 1fr 1fr;gap:7px!important}
  .detail-actions .reserve-export-menu{margin-right:0}
  .detail-actions .btn,.reserve-export-menu-bottom .reserve-export-btn-bottom{width:100%;min-width:0}
  .reserve-photo-preview{grid-template-columns:1fr 1fr}
}
@media(max-width:520px){
  .form-grid{grid-template-columns:1fr!important}
  .field.full{grid-column:auto!important}
  .reserve-photo-preview{grid-template-columns:1fr}
  .reserve-detail-nav{display:none}
  .detail-actions{grid-template-columns:1fr 1fr}
  .detail-actions .reserve-export-menu{grid-column:1/-1}
}
