/* style.css */
:root{
  --uH: 30px;

  --bg: #f6f7f9;
  --card: #ffffff;
  --fg: #111827;
  --muted: #6b7280;

  --line: #d1d5db;
  --line2: #e5e7eb;

  --radius: 10px;
  --shadow: 0 6px 18px rgba(0,0,0,.08);

  --pad: 10px;
  --gap: 10px;

  --hover: .88;

  /* Couleurs équipements */
  --c-switch: #c9ced6;
  --c-onduleur: #fde68a;
  --c-autocom: #60a5fa;
  --c-brassage: #ffffff;
  --c-brassage-border: #9ca3af;
}

*{ box-sizing:border-box; }
html,body{ min-height:100%; overflow-x:hidden; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-size:14px;
  color:var(--fg);
  background:var(--bg);
}

#aiStatus { opacity: 0.8; font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }

/* ── Spinner de chargement IA ── */
.spinner{
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2.5px solid #d1d5db;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin{
  to{ transform: rotate(360deg); }
}

.typeDot{
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.typeInput {
  border: none;
  background: transparent;
  width: 100%;
  font: inherit;
  color: inherit;
  padding: 0;
  outline: none;
}
.typeInput:focus {
  outline: 1px solid var(--line);
  border-radius: 2px;
}

.marqueInput, .modeleInput {
  border: none;
  background: transparent;
  width: 100%;
  font: inherit;
  color: inherit;
  padding: 0;
  outline: none;
}
.marqueInput:focus, .modeleInput:focus {
  outline: 1px solid var(--line);
  border-radius: 2px;
}

.inputError {
  border: 2px solid #ef4444 !important;
  outline: none;
  background: #fff1f1 !important;
  animation: shakeInput .3s ease;
}
@keyframes shakeInput {
  0%,100%{ transform: translateX(0); }
  25%     { transform: translateX(-4px); }
  75%     { transform: translateX(4px); }
}

/* ── Inputs nom client / site / baie ── */
.ctrlInputs label{
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .03em;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ctrlInputs input[type="text"]{
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg);
  padding: 6px 10px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  width: 140px;
}
.ctrlInputs input[type="text"]:focus{
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
.ctrlInputs input[type="text"]::placeholder{
  color: #b0b7c3;
  font-weight: 400;
}

.app{
  display:grid;
  grid-template-columns: 260px 550px 1fr;
  gap:var(--gap);
  padding:var(--pad);
  width:100%;
  min-width:0;
}

.top{
  display:flex;
  flex-wrap:wrap;
  gap:var(--gap);
  align-items:flex-start;
}

.controls, .stats{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:var(--pad);
}

.controls{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:12px;
}

.controls label{
  display:grid;
  grid-auto-flow:column;
  align-items:center;
  gap:8px;
}

.controls input[type="range"]{
  width:160px;
}

.controls button{
  border:1px solid var(--line);
  background:#fff;
  border-radius:8px;
  padding:6px 10px;
  cursor:pointer;
}

.controls button:hover{ filter:brightness(0.98); }
.controls button:active{ transform:translateY(1px); }

#btnEnrichAll{
  background: #f59e0b;
  color: #fff;
  border-color: #d97706;
  font-weight: 600;
}

#btnGeneratePpt{
  background: #2563eb;
  color: #fff;
  border-color: #1d4ed8;
  font-weight: 600;
}
#btnGeneratePpt:hover{ background: #1d4ed8; }

.photoUpload{
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.photoStatus{
  font-size: 12px;
  color: #6b7280;
}

.btnFileLabel{
  display:inline-flex;
  align-items:center;
  gap:4px;
  border:1px solid var(--line);
  background:#fff;
  border-radius:8px;
  padding:6px 10px;
  cursor:pointer;
  font-size:14px;
  font-family:inherit;
  user-select:none;
}
.btnFileLabel:hover{ filter:brightness(0.98); }
.btnFileLabel:active{ transform:translateY(1px); }

/* Bouton Photos IA : vert */
label[for="aiFiles"].btnFileLabel{
  background: #16a34a;
  color: #fff;
  border-color: #15803d;
  font-weight: 600;
}
label[for="aiFiles"].btnFileLabel:hover{ background: #15803d; }

.stats{
  display:grid;
  gap:4px;
  align-content:start;
  min-width:170px;
}

.stats div{
  display:grid;
  grid-template-columns: 1fr auto;
  gap:10px;
  color:var(--muted);
}
.stats span{ color:var(--fg); font-weight:600; }

.statsAi{
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid var(--line2);
  grid-column: 1 / -1;
}
.statsAi label[for="aiFiles"].btnFileLabel,
.statsAi #btnEnrichAll{
  flex: 1 1 0;
  justify-content: center;
  text-align: center;
  min-width: 0;
}

/* ── Colonne gauche : stats + palette ── */
.leftCol{
  display:grid;
  gap:var(--gap);
  align-content:start;
}

/* ── Colonne centrale : baie ── */
.centerCol{
  display:grid;
  align-content:start;
  min-width:0;
}

/* ── Colonne droite : actions + tableau + plan ── */
.rightCol{
  display:grid;
  grid-template-rows: auto auto 1fr;
  gap:var(--gap);
  min-width:0;
}

.palette, .rackWrap, .tableWrap{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:var(--pad);
  min-height:0;
}

.tableWrap{
  overflow-y:visible;
}

.palette{
  display:grid;
  grid-auto-rows:max-content;
  gap:10px;
  overflow-y:auto;
}

.paletteTitle{
  font-weight:700;
}

.paletteItem{
  border:1px solid var(--line);
  border-radius:10px;
  padding:8px 10px;
  user-select:none;
  cursor:grab;
  touch-action:none;
  background:#fff;
}
.paletteItem:hover{ opacity:var(--hover); }
.paletteItem:active{ cursor:grabbing; }

/* Palette items avec skin équipement */
.paletteItem.equip {
  width: 100% !important;
  height: 30px !important;
  position: relative !important;
  padding: 2px 6px !important;
  border-radius: 6px !important;
  box-sizing: border-box !important;
}
.paletteItemLabel {
  position: absolute;
  bottom: 2px;
  right: 5px;
  font-size: 9px;
  color: rgba(255,255,255,0.75);
  pointer-events: none;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.paletteHint{
  color:var(--muted);
  font-size:12px;
}

.trash{
  border:1px dashed #ef4444;
  border-radius:12px;
  padding:10px;
  display:grid;
  grid-template-columns: 28px 1fr;
  gap:8px;
  align-items:center;
  background: rgba(239,68,68,.12);
  color:#991b1b;
  user-select:none;
}
.trashIcon{
  width:28px;
  height:28px;
  border-radius:10px;
  display:grid;
  place-items:center;
  background: rgba(239,68,68,.20);
  font-size:16px;
}
.trashText{
  display:grid;
  gap:2px;
}
.trashText b{ color:#7f1d1d; }
.trash.hover{
  background: rgba(239,68,68,.22);
  border-style:solid;
  transform: scale(1.01);
}

.boxTitle{
  font-weight:700;
  margin-top:4px;
}

.outOfRange{
  border:1px solid var(--line);
  border-radius:12px;
  padding:8px;
  min-height:110px;
  display:grid;
  grid-auto-rows:max-content;
  gap:6px;
  background:#fff;
}

.outItem{
  border:1px solid var(--line);
  border-radius:10px;
  padding:7px 8px;
  cursor:grab;
  user-select:none;
  touch-action:none;
  background:#fff;
}
.outItem:hover{ opacity:var(--hover); }
.outItem:active{ cursor:grabbing; }

/* Mini baie HORS BAIE */
.horsBaieWrap{
  border:1px solid var(--line);
  border-radius:12px;
  padding:8px;
  background:#fff;
  display:grid;
  gap:8px;
}
.horsBaieHeader{
  display:grid;
  grid-template-columns: 1fr auto;
  align-items:center;
  gap:10px;
}
.horsBaieHeader b{ font-weight:800; }
.horsBaieHeader span{
  color:var(--muted);
  font-size:12px;
}
.horsBaieRack{
  border:1px solid var(--line);
  border-radius:10px;
  overflow:hidden;
  display:grid;
  grid-auto-rows: var(--uH);
  position:relative;
  min-height: calc(var(--uH) * 4);
  background:
    linear-gradient(to bottom, transparent calc(var(--uH) - 1px), var(--line2) 0) 0 0/100% var(--uH);
}
.hbRow{
  display:grid;
  grid-template-columns: 34px 1fr;
  height: var(--uH);
  align-items:center;
}
.hbLabel{
  border-right:1px solid var(--line2);
  color:var(--muted);
  font-size:12px;
  padding-left:6px;
}
.hbSlot{
  height: var(--uH);
}
.hbSlot:hover{ opacity:var(--hover); }

.rackWrap{
  display:grid;
  align-content:start;
}

.rack{
  position:relative;
  border: 20px solid black;
  border-radius:12px;
  overflow:hidden;
  background:#fff;
  background:
    linear-gradient(to bottom, transparent calc(var(--uH) - 1px), var(--line2) 0) 0 0/100% var(--uH);
}

.uRow{
  display:grid;
  grid-template-columns: 46px 1fr;
  height: var(--uH);
  align-items:center;
}

.uLabel{
  background-color: black;
  height: var(--uH);
  display:grid;
  align-items:center;
  padding-left:10px;
  color:var(--muted);
  font-size:12px;
  border-right:1px solid var(--line2);
  user-select:none;
  cursor: pointer;
}
.uLabel:hover{
  background-color: #1f2937;
  color: #fff;
}

.uSlot{
  height: var(--uH);
}
.uSlot:hover{
  background: rgba(59,130,246,.08);
  opacity:1;
}

.equip{
  position:absolute;
  border:1px solid var(--line);
  border-radius:10px;
  display:grid;
  align-content:center;
  padding:6px 8px;
  cursor:grab;
  user-select:none;
  touch-action:none;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  overflow:hidden;
}
.equip:hover{ opacity:var(--hover); }
.equip:active{ cursor:grabbing; }
/* Pendant un drag, les .equip ne capturent plus les events : le :hover des .uSlot fonctionne */
body.dragging .equip{ pointer-events: none; }

/* Cross-highlight : rack ↔ tableau */
.equip--hl{
  outline: 2px solid #3b82f6;
  outline-offset: 1px;
  opacity: 1 !important;
  z-index: 5;
}
.tr--hl td{
  background: rgba(59,130,246,.10) !important;
}

.equipLine1{
  z-index: 1;
  padding-left: 10px;
  font-weight:700;
  font-size:13px;
  line-height:1.2;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.equipLine2{
  color:rgba(17,24,39,.70);
  font-size:12px;
  line-height:1.2;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.eq-switch{ background: var(--c-switch); }
.eq-onduleur{ background: var(--c-onduleur); }
.eq-autocom{ background: var(--c-autocom); color:#fff; }
.eq-panneau_brassage{
  background: var(--c-brassage);
  border-color: var(--c-brassage-border);
}

/* Preview multi-colonnes */
.preview{
  position:absolute;
  border-radius:10px;
  opacity:.5;
  pointer-events:none;
  border:1px solid transparent;
}
.preview.ok{
  background: rgba(34,197,94,.35);
  border-color: rgba(34,197,94,.6);
}
.preview.bad{
  background: rgba(239,68,68,.35);
  border-color: rgba(239,68,68,.6);
}
.previewCol{
  height:100%;
}

.tableWrap{
  overflow-x:hidden;
}

.shiftBar{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:6px;
  padding:6px 8px;
  border-bottom:1px solid var(--line2);
  background:#f9fafb;
}
.shiftLabel{
  font-size:12px;
  color:var(--muted);
  margin-right:2px;
}
.shiftBar button{
  border:1px solid var(--line);
  background:#fff;
  border-radius:6px;
  padding:3px 8px;
  cursor:pointer;
  font-size:12px;
}
.shiftBar button:hover:not(:disabled){ background:#f3f4f6; }
.shiftBar button:active:not(:disabled){ transform:translateY(1px); }
.shiftBar button:disabled{ opacity:.35; cursor:default; }
.shiftSep{ width:1px; background:var(--line2); align-self:stretch; margin:0 4px; }

.infoSummary{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
}
.infoTag{
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  background: #e0e7ff;
  color: #3730a3;
  cursor: pointer;
}
.infoTag .infoTagLabel{
  color: #6b7280;
  font-weight: 400;
  margin-right: 2px;
}
.infraSummary{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
}
.infraSummary img{
  width: 18px;
  height: 18px;
  object-fit: contain;
  vertical-align: middle;
}
.infraTag{
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}
.infraTag--on{
  background: #dcfce7;
  color: #15803d;
}
.infraTag--off{
  background: #fee2e2;
  color: #b91c1c;
}
.shiftBar input[type="number"]{
  width:46px;
  text-align:center;
  border:1px solid var(--line);
  border-radius:6px;
  padding:3px 4px;
  font:inherit;
  font-size:12px;
}

.t{
  width:100%;
  table-layout:fixed;
  border-collapse:separate;
  border-spacing:0;
  border:1px solid var(--line);
  border-radius:12px;
  overflow:hidden;
}
.t td, .t th{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  vertical-align:top;
}

.t thead th{
  position:sticky;
  top:0;
  background:#f9fafb;
  border-bottom:1px solid var(--line);
  padding:8px 8px;
  text-align:left;
  font-size:12px;
  letter-spacing:.02em;
  color:var(--muted);
  z-index:2;
}

.t tbody td{
  padding:7px 8px;
  border-bottom:1px solid var(--line2);
  border-right:1px solid var(--line2);
  background:#fff;
}

.t tbody tr:nth-child(even) td{
  background:#fcfcfd;
}

.t tbody td:last-child,
.t thead th:last-child{
  border-right:none;
}

.t tbody tr:hover td{
  background: rgba(59,130,246,.05);
}

.t td[contenteditable="true"]{
  cursor:text;
  outline:none;
}

.t td[contenteditable="true"]:focus{
  outline:2px solid rgba(59,130,246,.35);
  outline-offset:-2px;
  background:#fff;
}

/* ===== RESPONSIVE : TABLETTE (<=1100px) ===== */
@media (max-width: 1100px){
  .app{
    grid-template-columns: 220px 1fr;
  }

  .leftCol{
    grid-column: 1;
  }

  .centerCol{
    grid-column: 2;
  }

  .rightCol{
    grid-column: 1 / -1;
  }

  .rackWrap{
    max-width: 100%;
    overflow-x: auto;
  }

  .controls input[type="range"]{
    width: 120px;
  }
}

/* ===== RESPONSIVE : TABLETTE + TELEPHONE (<=900px) ===== */
@media (max-width: 900px){
  :root{
    --pad: 4px;
    --gap: 0px;
  }

  html,body{
    overflow-x: hidden;
  }

  body{
    font-size: 13px;
  }

  /* ── Layout : flex column, enfants libérés via display:contents ── */
  .app{
    display: flex;
    flex-direction: column;
    padding: 0;
    gap: 0;
    width: 100%;
  }

  .leftCol{
    display: contents;
  }

  .centerCol{
    display: contents;
  }

  .rightCol{
    display: contents;
  }

  /* ── Palette : grille 3 colonnes, 2 lignes ── */
  .palette{
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 4px;
    border-radius: 0;
    box-shadow: none;
    border-left: none;
    border-right: none;
    overflow: hidden;
  }

  .paletteTitle,
  .paletteHint,
  .trash,
  .boxTitle,
  .horsBaieWrap,
  .outOfRange{
    display: none;
  }

  .paletteItem{
    padding: 4px 6px;
    font-size: 12px;
    border-radius: 8px;
    min-height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  /* ── Palette : pastilles simples, pas de skin équipement ── */
  .paletteItem.equip{
    /* Reset dimensions & positionnement */
    width: auto !important;
    min-width: unset !important;
    max-width: unset !important;
    height: auto !important;
    min-height: 22px !important;
    position: relative !important;
    /* Reset apparence équipement */
    background: #e5e7eb !important;
    border: 1.5px solid #d1d5db !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    padding: 4px 6px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: none !important;
    text-align: center !important;
  }

  /* Masquer les pseudo-éléments (ports, LEDs, décorations) */
  .paletteItem.equip::before,
  .paletteItem.equip::after{
    content: none !important;
    display: none !important;
  }

  /* Masquer le contenu interne (ports HTML, prises, etc.) */
  .paletteItem.equip > *:not(.paletteItemLabel){
    display: none !important;
  }

  /* Label visible et lisible */
  .paletteItem .paletteItemLabel{
    display: block !important;
    font-size: 12px;
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: none;
    line-height: 1.2;
    text-align: center;
    width: 100%;
  }

  /* ── Couleurs par type d'équipement ── */
  .paletteItem[data-type="switch"]{
    background: #e2e8f0 !important;
    border-color: #94a3b8 !important;
  }
  .paletteItem[data-type="onduleur"]{
    background: #fef3c7 !important;
    border-color: #f59e0b !important;
  }
  .paletteItem[data-type="panneau_brassage"]{
    background: #f1f5f9 !important;
    border-color: #9ca3af !important;
  }
  .paletteItem[data-type="autocom"]{
    background: #dbeafe !important;
    border-color: #60a5fa !important;
  }
  .paletteItem[data-type="parefeu"]{
    background: #fee2e2 !important;
    border-color: #f87171 !important;
  }
  .paletteItem[data-type="bandeau prise electrique"]{
    background: #e5e7eb !important;
    border-color: #6b7280 !important;
  }
  .paletteItem[data-type="serveur"]{
    background: #1e293b !important;
    border-color: #334155 !important;
  }
  .paletteItem[data-type="serveur"] .paletteItemLabel{
    color: #f1f5f9 !important;
  }
  .paletteItem[data-type="stockage"]{
    background: #d1d5db !important;
    border-color: #6b7280 !important;
  }
  .paletteItem[data-type="box"]{
    background: #1e293b !important;
    border-color: #475569 !important;
  }
  .paletteItem[data-type="box"] .paletteItemLabel{
    color: #f1f5f9 !important;
  }
  .paletteItem[data-type="to"],
  .paletteItem[data-type="ont"]{
    background: #dcfce7 !important;
    border-color: #86efac !important;
  }
  .paletteItem[data-type="wifi"],
  .paletteItem[data-type="routeur"]{
    background: #e0e7ff !important;
    border-color: #818cf8 !important;
  }
  /* ── 2. Controles : enfants libérés pour réordonnancement ── */
  .top{
    display: contents;
  }

  .controls{
    gap: 6px;
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 6px;
    box-shadow: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
  }

  .controls label{
    grid-auto-flow: column;
    gap: 4px;
    text-align: center;
  }

  .controls input[type="range"]{
    width: 80px;
  }

  .controls input[type="text"]{
    width: 80px !important;
  }

  /* Inputs client/site/baie : pleine largeur */
  .ctrlInputs{
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px 8px;
    justify-content: center;
    padding: 6px 8px;
  }
  .ctrlInputs label{
    flex: 1 1 28%;
    min-width: 80px;
  }
  .ctrlInputs input[type="text"]{
    width: 100% !important;
    font-size: 13px;
    padding: 5px 8px;
  }

  /* Ordre des blocs (dans .app via display:contents) */
  .rightCol > .ctrlActions{ order: 1; }
  .stats{     order: 2; }
  .palette{   order: 3; }
  .rackWrap{  order: 4; }
  .tableWrap{ order: 5; }
  .planSection{ order: 6; }

  /* ── Tableau sticky à mi-écran ── */
  .tableWrap{
    position: sticky;
    top: 0;
    z-index: 100;
    max-height: 50vh;
    overflow-y: auto;
    background: var(--card);
    border-top: 2px solid var(--line);
    border-bottom: 2px solid var(--line);
  }

  .infraBtn{
    width: 44px;
    height: 40px;
    border-radius: 8px;
  }
  .infraIcon{
    width: 20px;
    height: 20px;
  }
  .infraLabel{
    font-size: 8px;
  }

  /* ── Rack : pleine largeur, scroll vertical limité ── */
  .rackWrap{
    width: 100%;
    max-height: 50vh;
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: 0;
    box-shadow: none;
    border-left: none;
    border-right: none;
    padding: 0;
  }

  .rack{
    min-width: unset !important;
    width: 100%;
    border-width: 10px;
    border-radius: 0;
  }

  .uRow{
    grid-template-columns: 28px 1fr;
  }

  .uLabel{
    padding-left: 3px;
    font-size: 9px;
  }

  /* ── Tableau : pleine largeur sur mobile ── */
  .tableWrap{
    border-radius: 0;
    box-shadow: none;
    border-left: none;
    border-right: none;
    overflow-x: auto;
    overflow-y: auto;
    background: var(--card);
    -webkit-overflow-scrolling: touch;
  }

  /* ── Actions et plan pleine largeur ── */
  .rightCol > .ctrlActions{
    margin: 0;
    font-size: 12px;
  }

  .setupScreen{
    min-height: 70vh;
    padding: 16px;
  }
  .setupScreen .ctrlInputs{
    padding: 20px;
    max-width: 100%;
  }
  .setupPanel{
    max-width: 100%;
    padding: 4px;
  }

  .shiftBar{
    flex-wrap: wrap;
    gap: 4px;
    padding: 3px 6px;
    font-size: 11px;
  }
  .shiftBar button{
    font-size: 10px;
    padding: 2px 6px;
  }
  .shiftSep{
    display: none;
  }

  .t{
    min-width: 580px;
    font-size: 11px;
  }
  .t thead th{
    padding: 5px 4px;
    font-size: 10px;
  }
  .t tbody td{
    padding: 4px 3px;
  }
  .thActions{
    width: 70px;
    min-width: 70px;
    max-width: 70px;
  }
  .tdActions{
    width: 70px;
    min-width: 70px;
    max-width: 70px;
  }

  .specsForm{
    gap: 6px 10px;
  }
  .specsInput{
    width: 60px;
  }

  .accordionRow td{
    padding: 6px 8px !important;
  }
}

/* ===== Colonne ACTIONS dans le tableau ===== */
.thActions{
  width: 120px;
  min-width: 120px;
  max-width: 120px;
}

/* Colonnes étroites Emplacement + Taille */
.t thead th:nth-child(6),
.t thead th:nth-child(7){
  width: 68px;
}

/* Stepper +/- dans les cellules Emplacement / Taille */
.tdStepper{
  padding: 2px 3px !important;
  text-align: center;
  white-space: nowrap;
}
.stepBtn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:16px;
  height:16px;
  border:1px solid var(--line);
  border-radius:3px;
  background:#f3f4f6;
  cursor:pointer;
  font-size:11px;
  line-height:1;
  padding:0;
  vertical-align:middle;
}
.stepBtn:hover{ background:#e5e7eb; }
.stepBtn:active{ transform:scale(.92); }
.stepVal{
  display:inline-block;
  min-width:22px;
  text-align:center;
  font-size:12px;
  outline:none;
  cursor:text;
  vertical-align:middle;
}
.stepVal:focus{
  outline:1px solid rgba(59,130,246,.5);
  border-radius:2px;
}

.tdActions{
  width: 120px;
  min-width: 120px;
  max-width: 120px;
  padding: 3px 4px !important;
  text-align: center;
  white-space: nowrap;
  user-select: none;
}
.tdActions--enrichable{
  background: #fef3c7 !important;
}

@keyframes flashBorderRed {
  0%   { outline: 2px solid transparent; }
  20%  { outline: 2px solid #ef4444; }
  40%  { outline: 2px solid transparent; }
  60%  { outline: 2px solid #ef4444; }
  80%  { outline: 2px solid transparent; }
  100% { outline: 2px solid #ef4444; }
}
.flashRed {
  animation: flashBorderRed 0.9s ease forwards;
  border-radius: 2px;
}

.actBtn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 0;
  transition: background .1s, transform .05s;
}

.actBtn:hover{
  background: rgba(0,0,0,.08);
}

.actBtn:active{
  transform: scale(.92);
}

.actBtn--del:hover{
  background: rgba(239,68,68,.15);
}

.actBtn--expand{
  font-size: 10px;
  color: var(--muted);
}
.actBtn--expand:hover{
  background: rgba(59,130,246,.12);
  color: #3b82f6;
}

.actBtn--enrich:hover{
  background: rgba(59,130,246,.12);
}
.actBtn--enrich:disabled{
  cursor: default;
  opacity: 0.5;
  pointer-events: none;
}

/* ===== Bouton mise à jour KB dans accordion ===== */
.kbUpdateBar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--line2);
}
.btnKbUpdate {
  font-size: 11px;
  padding: 3px 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  border-radius: 5px;
  cursor: pointer;
  font-family: inherit;
}
.btnKbUpdate:hover { background: #dbeafe; }
.btnKbUpdate:disabled { opacity: 0.5; cursor: default; }
.kbUpdateMsg {
  font-size: 11px;
}

/* ===== Lifecycle section in accordion ===== */
.lifecycleDivider{
  width: 100%;
  height: 1px;
  background: var(--line2);
  margin: 8px 0 4px 0;
}
.lifecycleSection{
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  align-items: flex-start;
  width: 100%;
}
.lifecycleTitle{
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .03em;
  text-transform: uppercase;
  width: 100%;
  margin-bottom: 2px;
}
.lifecycleField{
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.lifecycleLabel{
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .02em;
}
.lifecycleValue{
  font-size: 12px;
  font-weight: 600;
  color: var(--fg);
}

/* ===== Colonne SPECS — badges =====  */
.tdSpecs{
  white-space: normal;
  overflow: visible;
  max-width: 220px;
}

.specsBadges{
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  align-items: center;
}

.specsEmpty{
  color: var(--muted);
  font-size: 12px;
}

.specsBadge{
  display: inline-block;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}

.specsBadge--green  { background: #dcfce7; color: #15803d; }
.specsBadge--blue   { background: #dbeafe; color: #1d4ed8; }
.specsBadge--grey   { background: #f3f4f6; color: #374151; }
.specsBadge--dark   { background: #e5e7eb; color: #111827; }
.specsBadge--purple { background: #ede9fe; color: #6d28d9; }
.specsBadge--orange { background: #ffedd5; color: #c2410c; }
.specsBadge--yellow { background: #fef9c3; color: #92400e; }
.specsBadge--red    { background: #fee2e2; color: #b91c1c; }

/* ===== Accordéon specs ===== */
.accordionRow td{
  background: #f8faff !important;
  border-bottom: 2px solid #bfdbfe !important;
  padding: 10px 14px !important;
}

.specsForm{
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  align-items: flex-end;
}

.specsFormField{
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: default;
}

.specsFormLabel{
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.specsInput{
  width: 72px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 6px;
  font: inherit;
  font-size: 13px;
}

.specsSelect{
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 6px;
  font: inherit;
  font-size: 13px;
  background: #fff;
  cursor: pointer;
}

.specsCheck{
  width: 16px;
  height: 16px;
  cursor: pointer;
  margin-top: 4px;
}

.specsInput:focus,
.specsSelect:focus{
  outline: 2px solid rgba(59,130,246,.4);
  outline-offset: -1px;
}

/* ===== Boutons INFRA (cliquables) ===== */
.infraFlags{
  display:flex;
  gap:10px;
  align-items:center;
}

/* Fond très légèrement gris (toujours) */
.infraBtn{
  width:86px;
  height:78px;
  background:#f3f4f6;          /* gris léger */
  border:1px solid #d1d5db;
  border-radius:14px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:6px;
  cursor:pointer;
  user-select:none;
  transition: background .12s, border-color .12s, transform .05s;
}
.infraBtn:active{ transform: translateY(1px); }

.infraIcon{
  width:34px;
  height:34px;
  object-fit:contain;
}

.infraLabel{
  font-size:11px;
  font-weight:700;
  color:#374151;
  line-height:1;
}

/* Tous les boutons infra : fond vert quand actif */
.infraBtn.active{
  background:#dcfce7;
  border-color:#22c55e;
}

/* ===== BURGER MENU ===== */
.burger{
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 200;
}

.burgerBtn{
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  color: var(--fg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .1s;
}
.burgerBtn:hover{ background: #f3f4f6; }
.burgerBtn:active{ transform: scale(.96); }

.burgerPanel{
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0,0,0,.15);
  padding: 6px;
  z-index: 201;
}
.burgerPanel.open{
  display: block;
}

.burgerItem{
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  color: var(--fg);
  transition: background .1s;
}
.burgerItem:hover{
  background: #f3f4f6;
}
.burgerItem:active{
  background: #e5e7eb;
}

/* ===== SETUP SCREEN (Step 1 — full page) ===== */
.setupScreen{
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 80vh;
  padding: 20px;
}
.setupScreen .ctrlInputs{
  flex-direction: column;
  gap: 16px;
  padding: 30px 36px;
  max-width: 340px;
  width: 100%;
}
.setupScreen .ctrlInputs input[type="text"]{
  width: 100%;
}

.setupScreen .ctrlSlider{
  flex-direction: column;
  gap: 16px;
  padding: 30px 36px;
  max-width: 340px;
  width: 100%;
}
.setupScreen .ctrlInfra{
  flex-direction: column;
  gap: 16px;
  padding: 30px 36px;
  max-width: 400px;
  width: 100%;
}

.setupCard{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--pad);
}
.setupCard--row{
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
}

.btnOk{
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
  border-radius: 8px;
  padding: 6px 20px;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
}
.btnOk:hover{ background: #16a34a; color: #fff; border-color: #16a34a; }
.btnOk:active{ transform: translateY(1px); }

/* ===== WORKSPACE ===== */
.workspace{
  /* Plain container */
}

/* ===== Modale photo couverture ===== */
.photoModal{
  display:none;
  position:fixed;
  inset:0;
  z-index:10000;
}
.photoModal.open{ display:flex; justify-content:center; align-items:center; }
.photoModalBackdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.6);
}
.photoModalContent{
  position:relative;
  max-width:90vw;
  max-height:90vh;
}
.photoModalContent img{
  display:block;
  max-width:90vw;
  max-height:85vh;
  object-fit:contain;
  border-radius:8px;
  box-shadow:0 8px 32px rgba(0,0,0,.4);
}
.photoModalClose{
  position:absolute;
  top:-12px; right:-12px;
  width:32px; height:32px;
  border:none;
  border-radius:50%;
  background:#fff;
  font-size:20px;
  line-height:1;
  cursor:pointer;
  box-shadow:0 2px 8px rgba(0,0,0,.3);
}

/* ===== Modale arborescence baies ===== */
.treeModal{
  display:none;
  position:fixed;
  inset:0;
  z-index:10000;
}
.treeModal.open{ display:flex; justify-content:center; align-items:center; }
.treeModalBackdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.5);
}
.treeModalContent{
  position:relative;
  background:#fff;
  border-radius:12px;
  box-shadow:0 8px 32px rgba(0,0,0,.3);
  width:360px;
  max-height:80vh;
  display:flex;
  flex-direction:column;
}
.treeModalHeader{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:14px 18px;
  border-bottom:1px solid var(--line);
}
.treeModalClose{
  border:none;
  background:none;
  font-size:22px;
  cursor:pointer;
  color:#6b7280;
  line-height:1;
}
.treeModalBody{
  overflow-y:auto;
  padding:10px 0;
}

/* Niveaux de l'arbre */
.treeClient{
  padding:0;
}
.treeClientName{
  display:flex;
  align-items:center;
  gap:6px;
  padding:8px 18px;
  font-weight:700;
  font-size:14px;
  cursor:pointer;
  user-select:none;
}
.treeClientName:hover{ background:#f3f4f6; }
.treeClientName .treeArrow{
  display:inline-block;
  transition:transform .15s;
  font-size:11px;
}
.treeClient.open > .treeClientName .treeArrow{ transform:rotate(90deg); }
.treeSites{ display:none; }
.treeClient.open > .treeSites{ display:block; }

.treeSiteName{
  display:flex;
  align-items:center;
  gap:6px;
  padding:6px 18px 6px 34px;
  font-weight:600;
  font-size:13px;
  color:#374151;
  cursor:pointer;
  user-select:none;
}
.treeSiteName:hover{ background:#f3f4f6; }
.treeSiteName .treeArrow{
  display:inline-block;
  transition:transform .15s;
  font-size:11px;
}
.treeSite.open > .treeSiteName .treeArrow{ transform:rotate(90deg); }
.treeBaies{ display:none; }
.treeSite.open > .treeBaies{ display:block; }

.treeBaieItem{
  display:flex;
  align-items:center;
  gap:6px;
  padding:5px 18px 5px 52px;
  font-size:13px;
  color:#1d4ed8;
  cursor:pointer;
  user-select:none;
}
.treeBaieItem:hover{ background:#eff6ff; }
.treeBaieItem--active{
  background:#dbeafe;
  font-weight:600;
}

/* ===== ctrlActions (au-dessus du tableau, dans rightCol) ===== */
.rightCol > .ctrlActions{
  justify-content: center;
  padding: 4px 8px;
  gap: 6px;
  font-size: 13px;
}

#btnDeleteBaie{
  background: rgba(239,68,68,.12);
  color:#991b1b;
  border-color:#ef4444;
}
#btnDeleteBaie:hover{
  background: rgba(239,68,68,.25);
}

/* ===== Miniature photo couverture ===== */
#btnShowPhoto{
  padding:0;
  border:2px solid var(--line);
  border-radius:var(--radius);
  width:40px;
  height:40px;
  overflow:hidden;
  cursor:pointer;
  background:#f3f4f6;
  display:flex;
  align-items:center;
  justify-content:center;
}
#btnShowPhoto img{
  width:100%;
  height:100%;
  object-fit:cover;
}

/* ===== PLAN DU SITE (dans rightCol, même largeur que tableau) ===== */
.planSection{
  display:flex;
  flex-direction:column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--pad);
  min-height:0;
}

.planHeader{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line2);
  margin-bottom: 8px;
}

.planHeader b{
  font-size: 14px;
  margin-right: 4px;
}

.planHeader select{
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 8px;
  font: inherit;
  font-size: 13px;
  background: #fff;
}

.planHeader button{
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
}
.planHeader button:hover{ filter: brightness(0.98); }
.planHeader button:active{ transform: translateY(1px); }

#btnSavePlan{
  background: #16a34a;
  color: #fff;
  border-color: #15803d;
  font-weight: 600;
}
#btnSavePlan:hover{ background: #15803d; }

#btnDelFloor{
  color: #b91c1c;
  border-color: #fca5a5;
}

/* Zone "non placée" au-dessus du plan */
.planStaging{
  display: none; /* hidden when empty, shown by JS */
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #fef9c3;
  border: 1px dashed #ca8a04;
  border-radius: 8px;
  margin-bottom: 8px;
  min-height: 40px;
}
.planStaging.has-items{
  display: flex;
}
.planStagingLabel{
  font-size: 11px;
  font-weight: 600;
  color: #92400e;
  margin-right: 4px;
}
.planStagingMarker{
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: #111827;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.planStagingMarker:hover{
  box-shadow: 0 0 0 3px rgba(99,102,241,.4);
}
.planStagingMarker--current{
  border: 2px solid #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,.35);
}

.planCanvas{
  position: relative;
  flex:1;
  min-height: 200px;
  background: #ffffff;
  border: 1px solid var(--line2);
  border-radius: 8px;
  overflow: auto;
}
.planCanvas--noimage{
  border: 2px dashed #cbd5e1;
  background: #f8fafc;
}

.planZoomLayer{
  position: relative;
  transform-origin: 0 0;
  min-height: 400px;
}

.planCanvas img{
  display: block;
  max-width: 100%;
  user-select: none;
  pointer-events: none;
}

.planCanvas .planEmpty{
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 40px;
}

.bayMarker{
  position: absolute;
  width: 32px;
  height: 32px;
  background: #111827;
  border: 2px solid #111827;
  border-radius: 4px;
  cursor: grab;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  touch-action: none;
  transition: box-shadow .1s;
}
.bayMarker:hover{
  box-shadow: 0 0 0 3px rgba(99,102,241,.4);
}
.bayMarker:active{ cursor: grabbing; }

.bayMarker--current{
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,.35);
}

/* Liens visuels entre baies */
.planLink{
  position: absolute;
  height: 2px;
  transform-origin: 0 50%;
  pointer-events: none;
  z-index: 1;
  border-radius: 1px;
}

/* ===== Section interconnexions (au-dessus de la carte) ===== */
.intercoSection{
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  border-radius: 8px 8px 0 0;
  padding: 8px 12px;
  margin-top: 8px;
}
.intercoHeader{
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}
.intercoHeader b{
  font-size: 13px;
  color: #1f2937;
}
.intercoFormBody{
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ===== Carte globale inter-sites ===== */
.globalMapWrap{
  min-height: 300px;
  background: linear-gradient(180deg, #f0f4ff 0%, #f8fafc 100%);
  border: 2px solid #e2e8f0;
  border-top: none;
  border-radius: 0 0 8px 8px;
  overflow: hidden;
  margin-top: -1px;
}
.globalMapSvg{
  width: 100%;
  height: 320px;
}

/* Badge liens externes (vers autre étage/site) */
.bayMarkerBadge{
  position: absolute;
  top: -6px;
  right: -6px;
  background: #f59e0b;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: auto;
  cursor: help;
  transform-origin: center center;
  z-index: 3;
}

/* Boutons zoom plan */
.planZoomBtns{
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}
.planZoomBtns button{
  border: none !important;
  border-radius: 0 !important;
  background: #fff;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  color: var(--fg);
}
.planZoomBtns button:hover{ background: #f3f4f6; }
.planZoomBtns button:active{ background: #e5e7eb; }
.planZoomBtns span{
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  min-width: 40px;
  text-align: center;
  user-select: none;
}

.bayMarkerLabel{
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 2px;
  font-size: 10px;
  font-weight: 700;
  color: #111827;
  white-space: nowrap;
  background: rgba(255,255,255,.85);
  padding: 1px 4px;
  border-radius: 3px;
  pointer-events: none;
  line-height: 1.2;
}

/* ===== INTERCONNEXION — Liens form dans accordion ===== */
.liensForm{
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lienRow{
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  padding: 8px;
  background: #f8fafc;
  border: 1px solid var(--line2);
  border-radius: 8px;
}

.lienField{
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lienFieldLabel{
  font-size: 10px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.lienInput{
  width: 130px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 6px;
  font: inherit;
  font-size: 13px;
}
.lienInput:focus{
  outline: 2px solid rgba(59,130,246,.4);
  outline-offset: -1px;
}

.lienSelect{
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 6px;
  font: inherit;
  font-size: 13px;
  background: #fff;
  cursor: pointer;
}
.lienSelect:focus{
  outline: 2px solid rgba(59,130,246,.4);
  outline-offset: -1px;
}

.lienDelBtn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  background: #fff;
  color: #b91c1c;
  cursor: pointer;
  font-size: 12px;
  margin-bottom: 2px;
}
.lienDelBtn:hover{ background: #fee2e2; }

.lienGoBtn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid #93c5fd;
  border-radius: 6px;
  background: #fff;
  color: #2563eb;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}
.lienGoBtn:hover{ background: #dbeafe; }

.lienAddBtn{
  align-self: flex-start;
  border: 1px dashed #6366f1;
  background: #eff6ff;
  color: #4f46e5;
  border-radius: 6px;
  padding: 5px 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
}
.lienAddBtn:hover{ background: #e0e7ff; }

.lienOkBtn{
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 8px 16px;
  background: #16a34a;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
}
.lienOkBtn:hover{ background: #15803d; }

/* ===== Mobile plan responsive ===== */
@media (max-width: 900px){
  .planSection{
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    border-left: none;
    border-right: none;
  }
  .planHeader{
    gap: 4px;
    font-size: 12px;
  }
  .planHeader button{
    font-size: 11px;
    padding: 3px 8px;
  }
  .planCanvas img{
    max-height: 300px;
  }
  .lienInput{
    width: 90px;
  }
  .lienRow{
    gap: 4px;
    padding: 6px;
  }
}

/* ── Custom Dropdown (replaces datalist) ── */
.customDropdown{
  position: fixed;
  z-index: 10000;
  max-height: 200px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
}
.customDropdown-item{
  padding: 6px 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.customDropdown-item:hover,
.customDropdown-item--active{
  background: #eff6ff;
  color: #1d4ed8;
}
