/**
 * Dashboard customize V3 — overlay boutons + classes de taille.
 *
 * S'applique seulement quand body.dash-v3-editing est present (mode edition)
 * pour les overlays. Les classes de taille (dash-size-sm/md/lg) s'appliquent
 * tout le temps.
 */

/* ─── Tailles applicables aux widgets (ordre par defaut = md) ─── */
.dash-size-sm { max-height: 220px !important; overflow-y: auto !important; }
.dash-size-md { max-height: 420px !important; overflow-y: auto !important; }
.dash-size-lg { max-height: none !important; }

/* Le calendrier n'a pas de max-height par defaut, on le respecte */
#dashRdvSection.dash-size-sm,
#dashRdvSection.dash-size-md { overflow-y: auto !important; }

/* ─── Mode edition : highlight des widgets ─── */
body.dash-v3-editing .dash-v3-overlay {
  position: absolute;
  top: 6px;
  right: 6px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px 6px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(59, 130, 246, 0.6);
  border-radius: 6px;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dash-v3-editing .dash-v3-btn {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  min-width: 26px;
  line-height: 1;
}

body.dash-v3-editing .dash-v3-btn:hover:not(:disabled) {
  background: rgba(59, 130, 246, 0.3);
  border-color: rgba(59, 130, 246, 0.8);
}

body.dash-v3-editing .dash-v3-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

body.dash-v3-editing .dash-v3-btn.active {
  background: rgba(59, 130, 246, 0.6);
  border-color: #3b82f6;
}

body.dash-v3-editing .dash-v3-sep {
  color: rgba(255, 255, 255, 0.3);
  margin: 0 2px;
  font-size: 11px;
}

/* Surligne les widgets pendant l'edition pour bien les identifier */
body.dash-v3-editing #dashTechAction,
body.dash-v3-editing #dashTechPieces,
body.dash-v3-editing #dashboardWidgetsZone,
body.dash-v3-editing #dashWelcome,
body.dash-v3-editing #dashAlerts,
body.dash-v3-editing #dashQuickActions,
body.dash-v3-editing #dashFlux,
body.dash-v3-editing #dashTerrain,
body.dash-v3-editing #dashPipeline,
body.dash-v3-editing #dashInterSection,
body.dash-v3-editing #dashAOSection,
body.dash-v3-editing #dashRoleWidgets,
body.dash-v3-editing #dashRoleView,
body.dash-v3-editing #dashRdvSection,
body.dash-v3-editing #dashGenericSections > .section,
body.dash-v3-editing #dashGenericSections > div[id] {
  outline: 2px dashed rgba(59, 130, 246, 0.45);
  outline-offset: -2px;
}
