* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  font-family: system-ui, sans-serif;
  overflow: hidden;
  background: #fff;
  color: #212529;
}

body {
  display: flex;
  flex-direction: column;
}

/* Outil "Mesurer" actif (voir js/mesure.js) : verrouille le reste de l'UI
   (barre d'outils, boutons flottants, panneaux) tant que la mesure n'est
   pas terminée/annulée — #btn-mesurer lui-même n'est pas concerné (il est
   flottant, hors de ces conteneurs), reste cliquable pour annuler. */
body.mesure-exclusive #barre-outils,
body.mesure-exclusive #controles-zoom,
body.mesure-exclusive #btn-ajouter-meuble,
body.mesure-exclusive #btn-dupliquer,
body.mesure-exclusive #btn-editer-catalogue,
body.mesure-exclusive #btn-exporter-png,
body.mesure-exclusive #btn-grille,
body.mesure-exclusive #panneau-catalogue,
body.mesure-exclusive #inspecteur {
  pointer-events: none;
  opacity: 0.5;
}

#barre-outils {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr auto auto auto 1fr;
  align-items: center;
  padding: 8px;
  background: #f1f3f5;
  border-bottom: 1px solid #dee2e6;
}

.barre-groupe {
  display: flex;
  align-items: center;
  gap: 8px;
}

.barre-gauche {
  justify-self: start;
}

.barre-centre {
  justify-self: center;
}

.barre-droite {
  justify-self: end;
}

#barre-outils button {
  padding: 6px 12px;
  cursor: pointer;
}

.barre-icone {
  width: 18px;
  height: 18px;
  vertical-align: -4px;
  opacity: 0.75;
}

#impression-catalogue {
  display: none;
}

#filigrane-version {
  position: fixed;
  right: 6px;
  bottom: 4px;
  font-family: system-ui, sans-serif;
  font-size: 11px;
  color: #999;
  opacity: 0.5;
  pointer-events: none;
  user-select: none;
  z-index: 1;
}

@media print {
  body > *:not(#impression-catalogue) {
    display: none !important;
  }

  #impression-catalogue {
    display: block !important;
    color: #000;
    font-family: system-ui, sans-serif;
  }

  #impression-catalogue table {
    width: 100%;
    border-collapse: collapse;
  }

  #impression-catalogue th,
  #impression-catalogue td {
    border: 1px solid #333;
    padding: 6px 8px;
    text-align: left;
  }

  .impression-catalogue-icone {
    width: 16px;
    height: 16px;
    vertical-align: -3px;
  }

  .impression-catalogue-description {
    margin-top: 2px;
    font-size: 11px;
    color: #555;
  }
}

#label-proposition-active,
#label-plan-actuel {
  padding: 5px 8px;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
}

#label-echelle,
#label-origine {
  padding: 5px 4px;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: #495057;
}

.separateur {
  width: 1px;
  height: 24px;
  background: #dee2e6;
  margin: 0 4px;
}

.separateur-section {
  width: 1px;
  height: 32px;
  background: #ced4da;
  margin: 0 12px;
  justify-self: center;
}

.menu-conteneur {
  position: relative;
}

.menu-deroulant {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  flex-direction: column;
  min-width: 220px;
  padding: 4px;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  z-index: 1000;
}

.menu-deroulant.visible {
  display: flex;
}

.menu-deroulant button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: transparent;
  border-radius: 3px;
  text-align: left;
  white-space: nowrap;
  font-size: 14px;
}

.menu-deroulant button:hover {
  background: #f1f3f5;
}

.menu-separateur {
  width: 100%;
  border: none;
  border-top: 1px solid #dee2e6;
  margin: 4px 0;
}

.menu-proposition-item.actif {
  font-weight: 600;
  background: #eef4fb;
}

.statut {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  color: #1c7ed6;
  font-size: 14px;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 4px 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  max-width: calc(100% - 32px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.statut.visible {
  opacity: 1;
}

.statut:empty {
  display: none;
}

#grille-plan {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 24px 1fr;
  grid-template-rows: 24px 1fr;
  min-height: 0;
}

#coin-regles {
  grid-column: 1;
  grid-row: 1;
  background: #f1f3f5;
  border-right: 1px solid #dee2e6;
  border-bottom: 1px solid #dee2e6;
}

#regle-horizontale {
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  height: 100%;
  background: #f1f3f5;
  border-bottom: 1px solid #dee2e6;
}

#regle-verticale {
  grid-column: 1;
  grid-row: 2;
  width: 100%;
  height: 100%;
  background: #f1f3f5;
  border-right: 1px solid #dee2e6;
}

#zone-travail {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  min-height: 0;
  position: relative;
  overflow: hidden;
  background: #e9ecef;
  user-select: none;
}

#grille-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

#echelle-visuelle {
  position: fixed;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  z-index: 900;
  display: none;
  flex-direction: column;
  align-items: stretch;
  gap: 1px;
  pointer-events: none;
  opacity: 0.55;
}

#echelle-visuelle-barre {
  display: flex;
  height: 6px;
}

#echelle-visuelle-barre span {
  width: 20px;
  height: 100%;
  background: #fff;
}

#echelle-visuelle-barre span:nth-child(odd) {
  background: #495057;
}

#echelle-visuelle-labels {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: #495057;
  line-height: 1.3;
}

#echelle-visuelle-labels span:first-child {
  text-align: left;
}

#echelle-visuelle-labels span:last-child {
  text-align: right;
}

#btn-ajouter-meuble,
#btn-dupliquer,
#btn-editer-catalogue,
#btn-exporter-png,
#btn-grille,
#btn-mesurer {
  position: fixed;
  bottom: 16px;
  z-index: 1000;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid #dee2e6;
  background: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

#btn-ajouter-meuble {
  left: 16px;
  font-size: 24px;
}

#btn-editer-catalogue {
  left: 72px;
}

#btn-dupliquer {
  left: 128px;
  display: none;
}

#btn-dupliquer.visible {
  display: inline-block;
}

#btn-exporter-png {
  right: 16px;
}

#btn-grille {
  right: 72px;
}

#btn-grille.actif {
  background: #d0ebff;
  border-color: #74c0fc;
}

#btn-mesurer {
  right: 128px;
}

#btn-mesurer.actif {
  background: #d0ebff;
  border-color: #74c0fc;
}

#btn-editer-catalogue,
#btn-exporter-png,
#btn-grille,
#btn-mesurer {
  display: flex;
  align-items: center;
  justify-content: center;
}

#btn-editer-catalogue .barre-icone,
#btn-exporter-png .barre-icone,
#btn-grille .barre-icone,
#btn-mesurer .barre-icone {
  width: 22px;
  height: 22px;
  vertical-align: 0;
}

#zone-travail:not(.blueprint-charge) #btn-grille,
#zone-travail:not(.blueprint-charge) #btn-mesurer,
#zone-travail:not(.blueprint-charge) #cadre-export {
  display: none;
}

#controles-zoom {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 4px;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

#controles-zoom button {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 14px;
  line-height: 1;
  border-radius: 4px;
}

#controles-zoom button:hover {
  background: #f1f3f5;
}

#btn-cadrer {
  font-size: 16px;
}

#zone-travail:not(.blueprint-charge) #controles-zoom {
  display: none;
}

#panneau-catalogue {
  position: fixed;
  left: 16px;
  bottom: 72px;
  z-index: 1000;
  display: none;
  flex-direction: column;
  gap: 6px;
  width: 220px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid #dee2e6;
  border-radius: 4px;
  font-size: 13px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

#panneau-catalogue.visible {
  display: flex;
}

#catalogue-liste {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 240px;
  overflow-y: auto;
}

.catalogue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  padding: 6px 8px;
  border: 1px solid #dee2e6;
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
}

.catalogue-item:hover {
  background: #f1f3f5;
}

.catalogue-item-non-utilise {
  background: #fff3e0;
  border-color: #ffcc80;
}

.catalogue-item-non-utilise:hover {
  background: #ffe6c2;
}

.catalogue-item-icone-nom {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalogue-item-icone {
  width: 16px;
  height: 16px;
  vertical-align: -3px;
}

.catalogue-item-quantite {
  flex: 0 0 auto;
  min-width: 18px;
  padding: 1px 6px;
  border-radius: 10px;
  background: #e9ecef;
  color: #495057;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}

.catalogue-vide {
  color: #868e96;
  padding: 4px 0;
}

#btn-nouveau-modele {
  padding: 6px 8px;
  border: 1px dashed #1c7ed6;
  border-radius: 3px;
  background: #fff;
  color: #1c7ed6;
  cursor: pointer;
}

#inspecteur {
  position: fixed;
  right: 8px;
  top: 56px;
  z-index: 1000;
  display: none;
  flex-direction: column;
  gap: 8px;
  width: 200px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #dee2e6;
  border-radius: 4px;
  font-size: 13px;
}

#inspecteur.visible {
  display: flex;
}

#inspecteur label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#inspecteur input,
#inspecteur select {
  padding: 4px 6px;
  border: 1px solid #ced4da;
  border-radius: 3px;
  font-size: 13px;
}

.insp-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.insp-section-titre {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #868e96;
}

.insp-separateur {
  width: 100%;
  border: none;
  border-top: 1px solid #dee2e6;
  margin: 2px 0;
}

.insp-lecture-seule {
  color: #868e96;
}

#insp-ouvrir-catalogue {
  padding: 6px 8px;
  border: 1px solid #1c7ed6;
  border-radius: 3px;
  background: #fff;
  color: #1c7ed6;
  font-size: 13px;
  cursor: pointer;
}

#insp-ouvrir-catalogue:hover {
  background: #1c7ed6;
  color: #fff;
}

.insp-foldout {
  border: 1px solid #dee2e6;
  border-radius: 3px;
  padding: 6px 8px;
}

.insp-foldout summary {
  cursor: pointer;
  font-size: 13px;
}

.insp-foldout select {
  width: 100%;
  margin-top: 6px;
  padding: 4px 6px;
  border: 1px solid #ced4da;
  border-radius: 3px;
  font-size: 13px;
}

.insp-danger {
  padding: 6px;
  border: 1px solid #e03131;
  border-radius: 3px;
  background: #fff;
  color: #e03131;
  cursor: pointer;
}

.insp-danger:hover {
  background: #e03131;
  color: #fff;
}

#zone-travail:not(.blueprint-charge) #btn-ajouter-meuble {
  display: none;
}

.objet-plan {
  cursor: pointer;
}

/* Objets du mode inactif : toujours visibles (habillage en édition) mais
   verrouillés — pas de curseur "cliquable", ils se comportent comme le fond. */
#calque-habillage.verrouille .objet-plan,
#calque-meubles.verrouille .objet-plan {
  cursor: inherit;
}

.objet-plan.selectionne rect.corps-objet {
  stroke: #1c7ed6;
  stroke-width: 2;
  stroke-dasharray: 6 4;
  vector-effect: non-scaling-stroke;
}

.icone-objet {
  pointer-events: none;
  user-select: none;
  opacity: 0.55;
}

.nom-objet {
  pointer-events: none;
  user-select: none;
  fill: #212529;
  font-family: system-ui, sans-serif;
  font-weight: 700;
  /* Halo blanc systématique : garde le nom lisible quelle que soit la
     couleur (claire ou foncée) du type de meuble en dessous. */
  paint-order: stroke fill;
  stroke: #fff;
  stroke-width: 3px;
  stroke-linejoin: round;
}

/* Objets en arrière-plan (zOrdre "bas") : étiquettes plus discrètes —
   taille déjà réduite côté JS (_appliquerTailleEtiquettes), opacité
   abaissée ici. */
.objet-plan.en-arriere-plan .icone-objet {
  opacity: 0.25;
}

.objet-plan.en-arriere-plan .nom-objet {
  opacity: 0.5;
  stroke-width: 2px;
}

.ligne-poignee-rotation {
  stroke: #1c7ed6;
  stroke-width: 1;
  stroke-dasharray: 3 3;
  vector-effect: non-scaling-stroke;
}

.poignee-rotation {
  fill: #fff;
  stroke: #1c7ed6;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  cursor: grab;
}

.cadre-export-rect {
  fill: none;
  stroke: #000;
  stroke-width: 2;
  stroke-dasharray: 10 6;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.poignee-cadre-export {
  fill: #fff;
  stroke: #000;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  cursor: nesw-resize;
}

.poignee-rotation:active {
  cursor: grabbing;
}

.poignee-taille {
  fill: #fff;
  stroke: #1c7ed6;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  cursor: nesw-resize;
}

#message-accueil {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #868e96;
  text-align: center;
  pointer-events: none;
}

#zone-travail.blueprint-charge #message-accueil {
  display: none;
}

#viewport {
  position: absolute;
  inset: 0;
  display: block;
  cursor: grab;
  touch-action: none;
}

#viewport.pan-actif {
  cursor: grabbing;
}

#viewport.calibration-active,
#viewport.mesure-active {
  cursor: crosshair;
}

#vue-catalogue {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
}

#vue-catalogue.visible {
  display: flex;
}

#vue-catalogue-panneau {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 80%;
  max-height: calc(100% - 48px);
  padding: 16px 20px;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

#vue-catalogue-entete {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#vue-catalogue-titre-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

#vue-catalogue-entete h2 {
  margin: 0;
  font-size: 18px;
}

#vue-catalogue-importer,
#vue-catalogue-exporter,
#vue-catalogue-imprimer {
  border: none;
  background: transparent;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
}

#vue-catalogue-importer:hover,
#vue-catalogue-exporter:hover,
#vue-catalogue-imprimer:hover {
  background: #f1f3f5;
}

#vue-catalogue-fermer {
  border: none;
  background: transparent;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}

#vue-catalogue-fermer:hover {
  background: #f1f3f5;
  border-radius: 4px;
}

#vue-catalogue-onglets {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #dee2e6;
}

.vue-catalogue-onglet {
  padding: 8px 14px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #495057;
  font-size: 13px;
  cursor: pointer;
  margin-bottom: -1px;
}

.vue-catalogue-onglet:hover {
  color: #1c7ed6;
}

.vue-catalogue-onglet-actif {
  color: #1c7ed6;
  font-weight: 600;
  border-bottom-color: #1c7ed6;
}

#vue-catalogue-corps {
  overflow: auto;
}

#vue-catalogue-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

#vue-catalogue-table th,
#vue-catalogue-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #e9ecef;
  text-align: left;
}

#vue-catalogue-table input,
#vue-catalogue-table select {
  width: 100%;
  padding: 4px 6px;
  border: 1px solid #ced4da;
  border-radius: 3px;
  font-size: 13px;
}

.vue-catalogue-colonne-volume {
  white-space: nowrap;
}

.vue-catalogue-cellule-type {
  display: flex;
  align-items: center;
  gap: 6px;
}

.vue-catalogue-icone-type {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.vue-catalogue-supprimer {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 15px;
  padding: 2px 6px;
}

.icone-supprimer {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
}

.vue-catalogue-supprimer:hover {
  background: #f1f3f5;
  border-radius: 4px;
}

/* Ligne mise en avant en arrivant depuis "Éditer dans le catalogue" de
   l'inspecteur (voir EditionCatalogue._mettreEnAvant) — flash qui s'estompe. */
.vue-catalogue-ligne-surlignee {
  animation: vue-catalogue-flash 2s ease-out;
}

@keyframes vue-catalogue-flash {
  0% { background-color: #ffe066; }
  100% { background-color: transparent; }
}

.vue-catalogue-vide {
  color: #868e96;
  text-align: center;
  padding: 16px 0;
}

.vue-catalogue-total td {
  font-weight: 700;
  border-top: 2px solid #ced4da;
  border-bottom: none;
}

#vue-catalogue-nouveau {
  align-self: flex-start;
  padding: 6px 10px;
  border: 1px dashed #1c7ed6;
  border-radius: 3px;
  background: #fff;
  color: #1c7ed6;
  cursor: pointer;
}

.point-calibration {
  fill: #e03131;
  stroke: white;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.segment-calibration {
  stroke: #e03131;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.point-mesure {
  fill: #1c7ed6;
  stroke: white;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.segment-mesure {
  stroke: #1c7ed6;
  stroke-width: 2;
  stroke-dasharray: 6 4;
  vector-effect: non-scaling-stroke;
}

.ligne-origine {
  stroke: #1c7ed6;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.point-origine {
  fill: #1c7ed6;
  stroke: white;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

/* Écran de choix de plan (voir js/selecteur-plans.js) */

body.choix-plan #barre-outils,
body.choix-plan #grille-plan {
  display: none;
}

#vue-plans {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 3000;
  overflow-y: auto;
  background: #f8f9fa;
}

body.choix-plan #vue-plans {
  display: flex;
  justify-content: center;
}

#vue-plans-panneau {
  width: 100%;
  max-width: 900px;
  padding: 48px 24px;
}

#vue-plans-panneau h1 {
  margin: 0 0 24px;
  font-size: 22px;
}

#plans-grille {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.plan-carte {
  position: relative;
  padding: 16px;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.plan-carte:hover {
  border-color: #4dabf7;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.plan-carte-nom {
  font-weight: 600;
  margin-bottom: 6px;
  padding-right: 48px;
}

.plan-carte-detail {
  color: #495057;
  font-size: 14px;
  margin-bottom: 4px;
}

.plan-carte-date {
  color: #adb5bd;
  font-size: 12px;
}

.plan-carte-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
}

.plan-carte-actions button {
  padding: 4px 6px;
  border: none;
  border-radius: 4px;
  background: #f1f3f5;
  cursor: pointer;
}

.plan-carte-actions button:hover {
  background: #e9ecef;
}

.plan-carte-nouveau {
  display: flex;
  width: 100%;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  font: inherit;
  color: #495057;
  border-style: dashed;
}

/* Sidebar de changement de plan (voir js/sidebar-plans.js), ancrée à
   gauche et pleine hauteur, bascule sans recharger la page. */

#sidebar-plans-fond {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1900;
  background: rgba(0, 0, 0, 0.15);
}

body.sidebar-plans-ouverte #sidebar-plans-fond {
  display: block;
}

#sidebar-plans {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-right: 1px solid #dee2e6;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
  transform: translateX(-100%);
  transition: transform 0.2s ease;
}

body.sidebar-plans-ouverte #sidebar-plans {
  transform: translateX(0);
}

#sidebar-plans-entete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  padding: 14px 16px;
  border-bottom: 1px solid #dee2e6;
}

#sidebar-plans-entete h2 {
  margin: 0;
  font-size: 16px;
}

#sidebar-plans-fermer {
  padding: 4px 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
}

#sidebar-plans-liste {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 8px;
}

#sidebar-plans-liste.chargement {
  opacity: 0.5;
  pointer-events: none;
}

.sidebar-plans-vide {
  padding: 12px 8px;
  color: #adb5bd;
  font-size: 13px;
}

#sidebar-plans-nouveau {
  flex: 0 0 auto;
  margin: 8px;
  padding: 10px;
  border: 1px dashed #adb5bd;
  border-radius: 6px;
  background: transparent;
  color: #495057;
  cursor: pointer;
  font: inherit;
}

#sidebar-plans-nouveau:hover {
  background: #f8f9fa;
}

.sidebar-plan-item {
  position: relative;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 2px;
}

.sidebar-plan-item:hover {
  background: #f1f3f5;
}

.sidebar-plan-item.actif {
  background: #eef4fb;
  cursor: default;
}

.sidebar-plan-nom {
  padding-right: 44px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
}

.sidebar-plan-item.actif .sidebar-plan-nom {
  color: #1c7ed6;
}

.sidebar-plan-date {
  margin-top: 2px;
  color: #adb5bd;
  font-size: 11px;
}

.sidebar-plan-actions {
  position: absolute;
  top: 8px;
  right: 6px;
  display: none;
  gap: 2px;
}

.sidebar-plan-item:hover .sidebar-plan-actions {
  display: flex;
}

.sidebar-plan-actions button {
  padding: 3px 5px;
  border: none;
  border-radius: 4px;
  background: #e9ecef;
  cursor: pointer;
  font-size: 12px;
}

.sidebar-plan-actions button:hover {
  background: #dee2e6;
}

body.choix-plan #sidebar-plans,
body.choix-plan #sidebar-plans-fond {
  display: none !important;
}
