/* Triune AV Planner — Tela Planos (edição de projeto)
   Scoped a .plan / .plan-tab / .plan-head. */

.plan {
  display: flex;
  flex-direction: column;
  gap: 0;
  /* Preenche EXATAMENTE a área da .view (que já é flex:1 no shell). NÃO usar
     min-height grande: forçava overflow → o wheel-zoom do canvas travava o
     scroll da página e os menus sumiam pra cima sem volta. Agora o editor
     cabe no viewport; o scroll de listas (patch/pack) acontece em .plan-sub. */
  height: 100%;
  min-height: 0;
}

.plan-head {
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line-2);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.plan-head-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.plan-head-sep {
  color: var(--txt-4);
  font-size: 13px;
}

.plan-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 300;
  color: var(--txt-3);
  text-decoration: none;
  width: max-content;
}
.plan-back:hover { color: var(--red); }

.plan-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.plan-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--txt);
  letter-spacing: -0.3px;
  margin: 0;
  line-height: 1.1;
}

.plan-meta {
  font-size: 11px;
  color: var(--txt-3);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.plan-meta-main {
  color: var(--txt-3);
}

.plan-meta-toggle-btn {
  background: var(--bg-3);
  border: 1px solid var(--line-3);
  color: var(--red);
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  transition: all 0.15s ease;
}
.plan-meta-toggle-btn:hover {
  background: var(--red-soft);
  border-color: var(--red-line);
}

.plan-meta-full-address {
  margin-top: 2px;
  font-size: 11px;
  color: var(--txt-3);
  width: 100%;
  padding: 6px 10px;
  background: var(--bg-3);
  border-radius: 4px;
  border-left: 2px solid var(--red);
}
.plan-meta-full-address.plan-meta-collapsed {
  display: none;
}

.plan-head-loading {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 14px 0;
}
.plan-head-error {
  color: var(--err);
  font-size: 13px;
}

.plan-tabs-wrap {
  border-bottom: 1px solid var(--line-2);
  margin-top: 6px;
}
.plan-tabs {
  display: flex;
  gap: 2px;
  padding: 4px 0 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--line-3) transparent;
}
.plan-tabs::-webkit-scrollbar { height: 6px; }
.plan-tabs::-webkit-scrollbar-track { background: transparent; }
.plan-tabs::-webkit-scrollbar-thumb { background: var(--line-3); border-radius: 6px; }
.plan-tabs::-webkit-scrollbar-thumb:hover { background: var(--txt-4); }
.plan-tab {
  position: relative;
  background: none;
  border: none;
  color: var(--txt-3);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px 10px;
  cursor: pointer;
  transition: color 0.15s;
  flex: 0 0 auto;
  white-space: nowrap;
}
.plan-tab:hover { color: var(--txt-2); }
.plan-tab.is-active { color: var(--txt); }
.plan-tab.is-active::after {
  content: '';
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -1px;
  height: 2px;
  background: var(--red);
  border-radius: 2px 2px 0 0;
}

.plan-sub {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-top: 8px;
  /* Listas (patch/pack/equipe…) rolam AQUI dentro, não na página inteira.
     No canvas o stage é flex:1 e não estoura, então não gera scroll. */
  overflow-y: auto;
}

@media (max-width: 768px) {
  .plan-title { font-size: 14px; }
  .plan-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .plan-tab { padding: 8px 10px 10px !important; white-space: nowrap; font-size: 12.5px; }
}

/* ===== pills de status (reuso) ===== */
.pill { font-size: 11px; font-weight: 500; padding: 3px 9px; border-radius: 20px; border: 1px solid transparent; white-space: nowrap; }
.pill-mute { color: var(--txt-3); background: var(--bg-3); border-color: var(--line); }
.pill-warn { color: var(--warn); background: rgba(243,156,18,.13); border-color: rgba(243,156,18,.3); }
.pill-info { color: var(--info); background: rgba(52,152,219,.13); border-color: rgba(52,152,219,.3); }
.pill-ok   { color: var(--ok);   background: rgba(46,204,113,.13); border-color: rgba(46,204,113,.3); }
.pill-live { color: var(--red);  background: var(--red-soft); border-color: var(--red-line); }

/* ===================== CANVAS (Plano) ===================== */
.cv { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.cv-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 0 6px; flex-wrap: wrap; }
.cv-menus { display: flex; gap: 2px; }
.cv-menu { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 12px; border-radius: var(--r-sm); font-size: 12.5px; color: var(--txt-2); background: none; }
.cv-menu:hover { background: var(--bg-3); }
.cv-menu-add { color: var(--red); }
.cv-menu-add:hover { background: var(--red-soft); }
.cv-line { display: inline-flex; align-items: center; gap: 8px; }
.cv-line-lbl { font-size: 12px; color: var(--txt-3); }
.cv-line-seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line-3); border-radius: 8px; padding: 3px; }
.cv-line-opt { font-size: 12px; color: var(--txt-3); padding: 4px 11px; border-radius: 6px; background: none; }
.cv-line-opt.is-active { color: var(--txt); background: var(--bg-3); font-weight: 500; }
.cv-menu-pop { position: fixed; z-index: 200; min-width: 200px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--sh-3); padding: 6px; }
.cv-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 7px; font-size: 12.5px; color: var(--txt-2); background: none; text-align: left; }
.cv-menu-item:hover { background: var(--bg-3); color: var(--txt); }
.cv-menu-item span { flex: 1; }
.cv-menu-item kbd { font-size: 9.5px; color: var(--txt-4); background: var(--bg-3); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }
.cv-menu-check { flex: 0 0 auto !important; color: var(--ok); font-weight: 700; font-size: 12px; }
.cv-menu-sep { height: 1px; background: var(--line-2); margin: 5px 4px; }
.cv-menu-cabhead { font-size: 10.5px; color: var(--txt-3); padding: 6px 10px 7px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; }
.cv-loom-badge text { font-weight: 600; }

/* ===== Barra de menus persistente (Arquivo/Editar/Exibir/Adicionar/Ajuda) ===== */
/* Menubar agora só tem os menus (à esquerda). Ações globais (Salvo/
   Compartilhar/Salvar) foram pro topbar via setTopActions. */
.plan-menubar { display: flex; align-items: center; gap: 12px; padding: 4px 0 6px; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: var(--line-3) transparent; }
.plan-menubar::-webkit-scrollbar { height: 6px; }
.plan-menubar::-webkit-scrollbar-track { background: transparent; }
.plan-menubar::-webkit-scrollbar-thumb { background: var(--line-3); border-radius: 6px; }
.plan-menubar::-webkit-scrollbar-thumb:hover { background: var(--txt-4); }
.mb-menus { display: flex; gap: 2px; flex-wrap: nowrap; }
/* mb-saved/mb-right agora vivem no #topActions */
#topActions .mb-saved { margin-right: 4px; }
.mb-btn-lbl { display: inline; }
.mb-menu { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 12px; border-radius: var(--r-sm); font-size: 12.5px; color: var(--txt-2); background: none; white-space: nowrap; }
.mb-menu:hover { background: var(--bg-3); color: var(--txt); }
.mb-menu-add { color: var(--red); }
.mb-menu-add:hover { background: var(--red-soft); }
.mb-right { display: flex; align-items: center; gap: 10px; }
.mb-saved { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ok); font-family: var(--font-mono); }
.mb-saved.is-saving { color: var(--warn); }
.btn-sm { height: 32px; padding: 0 13px; font-size: 12.5px; }

/* ===================== NOTAS ===================== */
.nt { display: flex; flex-direction: column; flex: 1; }
.nt-tabs { display: flex; gap: 2px; background: var(--bg-2); border: 1px solid var(--line-3); border-radius: 9px; padding: 3px; width: max-content; max-width: 100%; margin-bottom: 10px; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: var(--line-3) transparent; }
.nt-tabs::-webkit-scrollbar { height: 6px; }
.nt-tabs::-webkit-scrollbar-track { background: transparent; }
.nt-tabs::-webkit-scrollbar-thumb { background: var(--line-3); border-radius: 6px; }
.nt-tabs::-webkit-scrollbar-thumb:hover { background: var(--txt-4); }
.nt-tab { font-size: 12.5px; color: var(--txt-3); padding: 6px 14px; border-radius: 6px; background: none; white-space: nowrap; }
.nt-tab.is-active { color: var(--txt); background: var(--bg-3); font-weight: 500; }
.nt-form { max-width: 720px; }
.nt-grp { grid-column: 1 / -1; font-size: 11px; font-weight: 600; letter-spacing: .5px; color: var(--txt-4); text-transform: uppercase; margin-top: 4px; }
.nt-grp:first-child { margin-top: 0; }
.nt-actions { margin-top: 20px; }

/* ===================== RESUMO (Project Summary) ===================== */
.rs { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.rs-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.rs-tabs { display: flex; gap: 2px; background: var(--bg-2); border: 1px solid var(--line-3); border-radius: 9px; padding: 3px; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: var(--line-3) transparent; }
.rs-tabs::-webkit-scrollbar { height: 6px; }
.rs-tabs::-webkit-scrollbar-track { background: transparent; }
.rs-tabs::-webkit-scrollbar-thumb { background: var(--line-3); border-radius: 6px; }
.rs-tabs::-webkit-scrollbar-thumb:hover { background: var(--txt-4); }
.rs-tab { font-size: 12.5px; color: var(--txt-3); padding: 6px 13px; border-radius: 6px; background: none; white-space: nowrap; }
.rs-tab.is-active { color: var(--txt); background: var(--bg-3); font-weight: 500; }
.rs-table { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-lg); overflow: hidden; }
.rs-h, .rs-row { display: grid; grid-template-columns: repeat(var(--rs-cols), 1fr); gap: 12px; padding: 11px 16px; align-items: center; }
.rs-h { border-bottom: 1px solid var(--line-2); font-size: 10px; font-weight: 600; letter-spacing: .6px; color: var(--txt-4); text-transform: uppercase; }
.rs-row { border-bottom: 1px solid var(--line-2); font-size: 12.5px; color: var(--txt); }
.rs-row:last-child { border-bottom: none; }
.rs-c0 { color: var(--txt-4); }
.rs-empty { padding: 40px; text-align: center; color: var(--txt-3); }
.rs-power-warn { background: rgba(243,156,18,0.12); border: 1px solid rgba(243,156,18,0.4); color: var(--warn); border-radius: var(--r-md); padding: 10px 14px; margin-bottom: 12px; font-size: 12px; line-height: 1.5; }
.rs-power-summary { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 16px 18px; margin-bottom: 16px; display: flex; flex-direction: column; gap: 12px; }
.rs-power-meta { font-size: 11.5px; color: var(--txt-3); }
.rs-circ-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; font-size: 12.5px; color: var(--txt); }
.rs-circ-head .mono { font-size: 11px; color: var(--txt-3); }
.rs-circ-bar { height: 7px; background: var(--bg-3); border-radius: 4px; overflow: hidden; }
.rs-circ-bar i { display: block; height: 100%; border-radius: 4px; }
.rs-over { color: var(--err) !important; font-weight: 600; }
.rs-conflict { display: flex; align-items: center; gap: 9px; background: rgba(243,156,18,.1); border: 1px solid rgba(243,156,18,.35); border-radius: var(--r-md); padding: 11px 14px; margin-bottom: 14px; font-size: 12.5px; color: var(--txt-2); }
.rs-conflict b { color: var(--warn); }
.rs-ok-banner { display: flex; align-items: center; gap: 9px; background: rgba(46,204,113,.08); border: 1px solid rgba(46,204,113,.3); border-radius: var(--r-md); padding: 10px 14px; margin-bottom: 14px; font-size: 12.5px; color: var(--txt-2); }
.rs-row-conflict { background: rgba(243,156,18,.06); }
.rs-ip-dup { color: var(--warn) !important; }
.rs-ip-badge { font-size: 9px; font-weight: 600; color: var(--warn); background: rgba(243,156,18,.15); border: 1px solid rgba(243,156,18,.4); border-radius: 4px; padding: 1px 5px; margin-left: 4px; }

/* Rede editável (BACKLOG #1 — fim do "vejo conflito mas não consigo alterar") */
.rs-net-bar { display: flex; align-items: center; gap: 12px; margin: 10px 0 8px; flex-wrap: wrap; }
.rs-net-hint { font-size: 11px; color: var(--txt-4); }
/* Energia: controles + cards de resumo */
.rs-pw-ctl { display: flex; flex-direction: column; gap: 4px; font-size: 10.5px; color: var(--txt-3); text-transform: uppercase; letter-spacing: .3px; }
.rs-pw-sel, .rs-pw-inp { height: 32px; padding: 0 9px; background: var(--bg-3); border: 1px solid var(--line-2); border-radius: var(--r-md); color: var(--txt); font-size: 13px; }
.rs-pw-inp { width: 120px; }
.rs-pw-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.rs-pw-stat { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 14px 16px; display: flex; flex-direction: column; gap: 3px; }
.rs-pw-stat-v { font-size: 22px; font-weight: 600; color: var(--txt); line-height: 1.1; }
.rs-pw-stat-l { font-size: 11px; color: var(--txt-3); }
.rs-pw-stat-s { font-size: 11px; color: var(--txt-4); }
.rs-pw-circ { height: 28px; padding: 0 6px; min-width: 64px; }
.rs-pw-circ:disabled { opacity: .4; cursor: not-allowed; }
.rs-pw-table .rs-row, .rs-pw-table .rs-h { align-items: center; }
.rs-net-table .rs-h { padding: 9px 14px; }
.rs-net-row { padding: 6px 14px !important; gap: 8px !important; }
.rs-net-cell {
  width: 100%; height: 32px; padding: 0 9px;
  background: transparent; border: 1px solid transparent; border-radius: 6px;
  color: var(--txt); font-family: var(--font-mono); font-size: 12.5px;
  transition: border-color 0.12s, background 0.12s;
}
.rs-net-cell:hover { border-color: var(--line-2); background: var(--bg-3); }
.rs-net-cell:focus { outline: none; border-color: var(--red); background: var(--bg-3); box-shadow: 0 0 0 3px var(--red-soft); }
.rs-net-cell.rs-ip-dup { border-color: var(--warn); background: rgba(243,156,18,0.08); }
.rs-net-del {
  width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent; border-radius: 6px;
  color: var(--txt-4); cursor: pointer; transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.rs-net-del:hover { background: rgba(221,42,27,0.12); color: var(--red); border-color: rgba(221,42,27,0.3); }

.cv-stage {
  position: relative; flex: 1; min-height: 300px; overflow: hidden;
  background-color: var(--bg-deep);
  background-image: radial-gradient(circle, #18222c 1px, transparent 1px);
  background-size: 26px 26px;
  border: 1px solid var(--line-2); border-radius: var(--r-lg);
  /* Mobile: bloqueia pinch nativo do browser pra deixar o nosso assumir */
  touch-action: none;
}
.cv-stage.cv-no-grid { background-image: none; }
.cv-cables { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
/* Hit area: stroke transparente capta cliques numa faixa generosa do cabo */
.cv-cable-hit { pointer-events: stroke !important; }
.cv-cable-hit:hover { stroke: rgba(255,255,255,0.04); }
.cv-cable.is-selected { filter: drop-shadow(0 0 6px rgba(255,255,255,0.45)); }
.cv-cable-end { pointer-events: all !important; transition: r 0.12s ease; }
.cv-cable-end:hover { r: 8; }
.cv-nodes { position: absolute; inset: 0; }
.cv-node {
  position: absolute; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--sh-2); z-index: 2;
}
.cv-node.is-sel { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft), var(--sh-3); }
.cv-node-head { height: 30px; display: flex; align-items: center; gap: 7px; padding: 0 11px; border-bottom: 1px solid var(--line-2); overflow: hidden; }
.cv-node-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.cv-node-id { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.cv-node-name { font-size: 11.5px; font-weight: 600; color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-node-model { font-size: 8px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .9; }
.cv-node-cols { display: flex; padding-bottom: 8px; }
.cv-node-col { flex: 1; min-width: 0; }
.cv-node-col-out { text-align: right; }
.cv-pchip { position: relative; display: flex; align-items: center; gap: 6px; padding: 0 12px; }
.cv-pchip-out { justify-content: flex-end; }
.cv-pchip-lbl { font-size: 10px; color: var(--txt-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-port { position: absolute; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--bg-2); top: 50%; transform: translateY(-50%); }
.cv-port-l { left: -5px; }
.cv-port-r { right: -5px; }

.cv-zoom { position: absolute; left: 16px; bottom: 16px; display: flex; flex-direction: column; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; z-index: 5; }
.cv-zoom button { width: 32px; height: 30px; display: flex; align-items: center; justify-content: center; color: var(--txt-2); border-bottom: 1px solid var(--line-2); }
.cv-zoom button:last-child { border-bottom: none; }
.cv-zoom span { font-size: 8.5px; color: var(--txt-3); text-align: center; padding: 4px 0; border-bottom: 1px solid var(--line-2); }
.cv-legend { position: absolute; right: 16px; bottom: 16px; display: flex; gap: 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 9px 14px; z-index: 5; flex-wrap: wrap; }
.cv-leg { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--txt-2); }
.cv-leg-line { width: 14px; height: 3px; border-radius: 2px; }

/* canvas overlays: background, zonas, text, led wall */
.cv-bg { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.cv-zones { position: absolute; inset: 0; z-index: 1; }
.cv-zone { position: absolute; border: 1.5px solid; border-radius: 10px; }
.cv-zone.is-smart { border-style: dashed; }
.cv-zone-lbl { position: absolute; top: 8px; left: 12px; font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: 1px; }
.cv-overlays { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.cv-text {
  position: absolute; font-size: 12px; color: var(--txt-2); background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 6px; padding: 4px 9px;
  pointer-events: auto; cursor: move; display: inline-flex; align-items: center; gap: 6px;
  transition: border-color 0.12s;
}
.cv-text:hover { border-color: var(--line-3); }
.cv-text-content { outline: none; cursor: text; min-width: 16px; }
.cv-text-content:focus { color: var(--txt); }
.cv-text-del {
  width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent; border-radius: 3px;
  color: var(--txt-4); font-size: 14px; line-height: 1; cursor: pointer; opacity: 0;
  transition: opacity 0.12s, color 0.12s, background 0.12s;
}
.cv-text:hover .cv-text-del { opacity: 1; }
.cv-text-del:hover { color: var(--red); background: rgba(221,42,27,0.1); }
.cv-led { position: absolute; background: var(--bg-2); border: 1px solid #E91E63; border-radius: 10px; box-shadow: var(--sh-2); overflow: hidden; width: 150px; pointer-events: auto; cursor: move; }
.cv-led-del { opacity: 0; transition: opacity .12s ease; }
.cv-led:hover .cv-led-del { opacity: 1; }
.cv-led-del:hover { color: var(--red); }
.cv-led-head { height: 28px; display: flex; align-items: center; gap: 7px; padding: 0 10px; border-bottom: 1px solid var(--line-2); font-size: 11px; font-weight: 600; color: var(--txt); }
.cv-led-grid { display: grid; gap: 2px; padding: 8px; background: #0B0F14; }
.cv-led-grid span { aspect-ratio: 16/9; background: #1A2430; border-radius: 1px; }
.cv-led-res { font-size: 9px; color: var(--txt-3); text-align: center; padding: 4px 0 6px; }

/* ====================== RACK ====================== */
.rk { display: flex; flex: 1; min-height: 480px; gap: 0; border: 1px solid var(--line-2); border-radius: var(--r-lg); overflow: hidden; }
.rk-lib { width: 236px; flex-shrink: 0; border-right: 1px solid var(--line-2); display: flex; flex-direction: column; background: var(--bg); }
.rk-lib-tabs { display: flex; gap: 2px; padding: 12px 12px 8px; }
.rk-lib-tab { flex: 1; font-size: 11.5px; color: var(--txt-3); padding: 6px 4px; border-radius: 7px; background: none; }
.rk-lib-tab.is-active { color: var(--txt); background: var(--bg-3); font-weight: 500; }
.rk-lib-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 12px 8px; }
.rk-lib-count { font-size: 11px; color: var(--txt-3); }
.rk-quick { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 9px; border-radius: 6px; font-size: 11.5px; font-weight: 500; color: #fff; background: var(--red); }
.rk-quick:hover { filter: brightness(1.08); }
.rk-lib-search { position: relative; display: flex; align-items: center; margin: 0 12px 8px; }
.rk-lib-search svg { position: absolute; left: 9px; color: var(--txt-4); }
.rk-lib-search input { height: 32px; width: 100%; padding: 0 10px 0 28px; background: var(--bg-deep); border: 1px solid var(--line-3); border-radius: 7px; color: var(--txt-2); font-size: 12px; }
.rk-lib-cats { margin: 0 12px 8px; height: 32px; padding: 0 8px; background: var(--bg-deep); border: 1px solid var(--line-3); border-radius: 7px; color: var(--txt-2); font-size: 12px; width: calc(100% - 24px); }
.rk-lib-list { flex: 1; overflow: auto; padding: 0 12px 12px; display: flex; flex-direction: column; gap: 7px; }
.rk-lib-item { display: flex; align-items: center; gap: 10px; padding: 7px 9px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 9px; cursor: grab; }
.rk-lib-item:hover { filter: brightness(1.1); }
.rk-lib-pic { flex-shrink: 0; width: 52px; height: 32px; border-radius: 4px; overflow: hidden; background: #0a0a0a; }
.rk-lib-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rk-lib-name { font-size: 12.5px; font-weight: 500; color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk-lib-cat { font-size: 9.5px; color: var(--txt-3); text-transform: capitalize; }
.rk-lib-u { background: var(--bg-3); border: 1px solid var(--line); border-radius: 5px; color: var(--txt-2); font-size: 10px; padding: 2px 4px; width: auto; flex-shrink: 0; }
.rk-lib-hint { display: none; }
.rk-usize { display: inline-flex; align-items: center; gap: 6px; }
.rk-usize label { font-size: 11px; color: var(--txt-3); }
.rk-usize input { width: 48px; height: 28px; background: var(--bg-3); border: 1px solid var(--line); border-radius: 6px; color: var(--txt); font-size: 12px; text-align: center; }
.rk-block { position: relative; }
.rk-block-del { position: absolute; top: 2px; right: 2px; width: 16px; height: 16px; border-radius: 4px; background: rgba(221,42,27,.85); color: #fff; border: none; font-size: 12px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .12s; z-index: 3; }
.rk-block:hover .rk-block-del { opacity: 1; }
.rk-slots.rk-drop { outline: 2px dashed var(--red); outline-offset: -2px; }
.st-equip-pal { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.st-pal-sep { width: 1px; height: 18px; background: var(--line); }
.st-pal-empty { font-size: 11px; color: var(--txt-4); }
.st-add-eq { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 7px; font-size: 12px; color: var(--txt-2); background: var(--bg-2); border: 1px solid var(--line-2); cursor: pointer; }
.st-add-eq:hover { border-color: var(--ec); color: var(--txt); }
.st-eq-dot { width: 7px; height: 7px; border-radius: 50%; }
.st-el-equip { display: flex; align-items: center; justify-content: center; border: 1.5px solid; border-radius: 6px; }
@media print {
  body.printing #print-root .a4-canvas-doc { font-family: Inter, sans-serif; }
  body.printing #print-root .a4-canvas-snap { position: relative; transform: scale(.92); transform-origin: top left; }
  body.printing #print-root .a4-canvas-snap .cv-zoom, body.printing #print-root .a4-canvas-snap .cv-legend { display: none; }
  @page { size: A4 landscape; margin: 10mm; }
}
.rk-addrack { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px; border-radius: 7px; font-size: 12px; color: var(--txt-3); background: none; border: 1px dashed var(--line); }
.rk-addrack:hover { color: var(--red); border-color: var(--red); }
.rk-depth { display: inline-flex; align-items: center; gap: 7px; }
.rk-depth label { font-size: 11px; color: var(--txt-3); }
.rk-depth select { height: 30px; padding: 0 8px; background: var(--bg-2); border: 1px solid var(--line-3); border-radius: 7px; color: var(--txt-2); font-size: 11.5px; width: auto; }
.rk-occ { font-size: 11px; color: var(--txt-2); background: var(--bg-2); border: 1px solid var(--line-3); border-radius: 7px; padding: 5px 10px; }
.rk-lib-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 10px; }
.rk-lib-title { font-size: 13px; font-weight: 600; color: var(--txt); }
.rk-lib-count { font-size: 11px; color: var(--txt-3); }
.rk-lib-list { flex: 1; overflow: auto; padding: 0 14px; display: flex; flex-direction: column; gap: 8px; }
.rk-lib-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-md); cursor: grab; }
.rk-lib-thumb { width: 30px; height: 22px; border-radius: 4px; background: var(--bg-deep); border: 1px solid; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rk-lib-thumb span { width: 14px; height: 3px; border-radius: 2px; }
.rk-lib-name { flex: 1; min-width: 0; font-size: 11.5px; font-weight: 500; color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk-lib-u { font-size: 10px; color: var(--txt-2); background: var(--bg-3); border: 1px solid var(--line); border-radius: 5px; padding: 2px 7px; flex-shrink: 0; }
.rk-lib-hint { padding: 12px 14px; border-top: 1px solid var(--line-2); font-size: 10.5px; font-weight: 300; color: var(--txt-3); line-height: 1.5; }
.rk-stage { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.rk-toolbar { height: 44px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; padding: 0 16px; gap: 8px; }
.rk-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; background: var(--red-soft); border: 1px solid var(--red-line); border-radius: 7px; font-size: 12px; font-weight: 500; color: var(--red); }
.rk-chip .mono { font-size: 9.5px; opacity: .8; }
.rk-seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line-3); border-radius: 8px; padding: 2px; }
.rk-seg-b { font-size: 11.5px; color: var(--txt-3); padding: 4px 11px; border-radius: 6px; background: none; }
.rk-seg-b.is-active { color: var(--txt); background: var(--bg-3); font-weight: 500; }
.rk-tool-spacer { flex: 1; }
.rk-pct { font-size: 11px; color: var(--red); border: 1px solid var(--line-3); border-radius: 8px; padding: 5px 10px; }
.rk-canvas { flex: 1; overflow: auto; background-color: var(--bg-deep); background-image: radial-gradient(circle, #18222c 1px, transparent 1px); background-size: 24px 24px; display: flex; align-items: flex-start; justify-content: center; gap: 36px; padding: 22px; }
.rk-face { display: flex; flex-direction: column; align-items: center; gap: 9px; }
.rk-face-lbl { font-size: 10px; font-weight: 600; letter-spacing: 1px; color: var(--txt-3); }
.rk-frame { display: flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.rk-ruler { width: 22px; display: flex; flex-direction: column; }
.rk-u { display: flex; align-items: center; justify-content: flex-end; padding-right: 7px; font-family: var(--font-mono); font-size: 8.5px; color: var(--txt-4); }
.rk-slots { position: relative; width: 236px; background: var(--bg-deep); border: 1px solid var(--line-2); border-radius: 4px; }
.rk-block { position: absolute; left: 3px; right: 3px; display: flex; align-items: stretch; background: linear-gradient(180deg, #1c1c1c, #141414); border: 1px solid #333; border-radius: 4px; overflow: hidden; box-shadow: inset 0 1px 0 rgba(255,255,255,0.04); }
.rk-block-ear { width: 9px; flex-shrink: 0; background: linear-gradient(90deg, #222, #161616); border-right: 1px solid #2a2a2a; position: relative; }
.rk-block-ear::before, .rk-block-ear::after { content: ''; position: absolute; left: 50%; transform: translateX(-50%); width: 3px; height: 3px; border-radius: 50%; background: #0a0a0a; box-shadow: 0 0 0 1px #3a3a3a; }
.rk-block-ear::before { top: 4px; } .rk-block-ear::after { bottom: 4px; }
.rk-block-ear:last-child { border-right: none; border-left: 1px solid #2a2a2a; }
.rk-block-panel { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent); border-top: 2px solid color-mix(in srgb, var(--mc) 55%, transparent); position: relative; }
.rk-block-badge { display: inline-flex; flex-direction: column; align-items: center; gap: 0; max-width: 92%; padding: 1px 9px; background: rgba(0,0,0,0.78); border: 1px solid; border-radius: 5px; line-height: 1.15; }
.rk-block-badge b { font-family: var(--font-mono); font-size: 9.5px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.rk-block-badge i { font-style: normal; font-size: 8px; color: var(--txt-3); }
/* 1U é muito baixo p/ 2 linhas: esconde o sub-rótulo (o U já aparece na régua) */
.rk-block-1u .rk-block-badge { padding: 0 8px; }
.rk-block-1u .rk-block-badge i { display: none; }
.rk-block-1u .rk-block-badge b { font-size: 9px; }
.rk-block-ports { display: flex; gap: 7px; }
.rk-block-ports span { width: 9px; height: 9px; border-radius: 50%; opacity: .9; box-shadow: 0 0 0 1px rgba(0,0,0,0.4); }n-items: center; gap: 9px; padding: 0 11px; overflow: hidden; }
.rk-block-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.rk-free { position: absolute; left: 0; right: 0; display: flex; align-items: center; justify-content: center; }
.rk-free span { font-size: 9.5px; color: var(--txt-4); background: rgba(13,18,22,.7); border: 1px dashed var(--line); border-radius: 5px; padding: 2px 8px; }

/* ==================== PATCH LIST ==================== */
.pl { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.pl-summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.pl-summary-lbl { font-size: 12px; font-weight: 300; color: var(--txt-3); }
.pl-chip { display: flex; align-items: center; gap: 7px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 7px; padding: 5px 11px; font-size: 12px; color: var(--txt-2); }
.pl-chip-dot { width: 8px; height: 8px; border-radius: 2px; }
.pl-chip b { font-family: var(--font-mono); color: var(--txt); font-weight: 600; }
.pl-spacer { flex: 1; }
.pl-total { font-size: 13px; font-weight: 600; color: var(--txt); }
.pl-total span { font-weight: 400; color: var(--txt-3); }
.pl-pdf { height: 32px; }
.pl-table { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-lg); overflow: hidden; }
.pl-h, .pl-row { display: grid; grid-template-columns: 30px 116px 1fr 26px 1fr 60px 72px; gap: 12px; align-items: center; padding: 11px 18px; }
.pl-h { border-bottom: 1px solid var(--line-2); font-size: 10px; font-weight: 600; letter-spacing: .7px; color: var(--txt-4); text-transform: uppercase; }
.pl-row { border-bottom: 1px solid var(--line-2); }
.pl-row:last-child { border-bottom: none; }
.pl-n { font-size: 12px; color: var(--txt-4); }
.pl-cable { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; color: var(--txt-2); min-width: 0; }
.pl-cable span { text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.pl-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.pl-ep { min-width: 0; overflow: hidden; }
.pl-ep b { display: block; font-size: 12.5px; font-weight: 500; color: var(--txt); text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.pl-ep i { font-style: normal; font-size: 10.5px; color: var(--txt-3); display: block; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.pl-arrow { text-align: center; font-size: 13px; flex-shrink: 0; }
.pl-len, .pl-id { font-size: 11.5px; color: var(--txt-2); text-overflow: ellipsis; overflow: hidden; white-space: nowrap; min-width: 0; }
.pl-id { color: var(--txt-3); }

/* ===================== PACKLIST ===================== */
.pk-topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line-2); }
.pk-topbar-lbl { font-size: 12px; font-weight: 300; color: var(--txt-3); flex: 1; line-height: 1.5; }
.pk { display: flex; gap: 20px; width: 100%; margin-bottom: 24px; }
.pk-col { flex: 1; min-width: 0; }
.pk-col-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.pk-col-head > span:first-child { font-size: 13.5px; font-weight: 600; color: var(--txt); }
.pk-prog { font-size: 12px; color: var(--ok); }
.pk-sobra { font-size: 12px; font-weight: 600; color: var(--warn); background: var(--bg-2); border: 1px solid var(--line); border-radius: 7px; padding: 4px 9px; }
.pk-bar { height: 5px; background: var(--bg-3); border-radius: 3px; overflow: hidden; margin-bottom: 14px; }
.pk-bar i { display: block; height: 100%; background: var(--ok); border-radius: 3px; }
.pk-list { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-lg); overflow: hidden; }
.pk-list.is-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; padding: 12px; background: none; border: none; }
.pk-list.is-grid .pk-grp-head { grid-column: 1 / -1; margin: 8px 0 4px 0; border-radius: var(--r-md); }
.pk-list.is-grid .pk-grp-head:first-child { margin-top: 0; }
.pk-list.is-grid .pk-empty { grid-column: 1 / -1; }
.pk-item { display: flex; align-items: center; gap: 11px; padding: 10px 16px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.pk-item:last-child { border-bottom: none; }
.pk-check { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--line); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--bg-deep); }
.pk-check.is-on { background: var(--ok); border-color: var(--ok); }
.pk-item-main { flex: 1; min-width: 0; }
.pk-item-main b { display: block; font-size: 13px; font-weight: 500; color: var(--txt); }
.pk-item-main i { font-style: normal; font-size: 10px; color: var(--txt-3); }
.pk-qty { font-size: 13px; font-weight: 600; color: var(--txt); }
/* Sub-itens = acessórios do equipamento (indentados, fio fino) */
.pk-subitem { display: flex; align-items: center; gap: 9px; padding: 5px 16px 5px 40px; border-bottom: 1px solid var(--line-2); cursor: pointer; background: rgba(255,255,255,0.012); }
.pk-subitem:last-child { border-bottom: none; }
.pk-subitem-main { flex: 1; min-width: 0; font-size: 12px; color: var(--txt-2); }
.pk-subitem.is-on .pk-subitem-main { color: var(--txt-3); text-decoration: line-through; }
.pk-subitem .pk-qty { font-size: 12px; color: var(--txt-3); }
.pk-check-sm { width: 14px; height: 14px; border-radius: 4px; border-width: 1.5px; }
.pk-acc-badge { font-size: 10px; color: var(--txt-3); background: var(--bg-3); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 6px; align-self: flex-start; margin-top: 2px; }
.pk-cable-h { display: grid; grid-template-columns: 1fr 56px 56px 56px; gap: 10px; padding: 10px 16px; font-size: 9.5px; font-weight: 600; letter-spacing: .6px; color: var(--txt-4); text-transform: uppercase; }
.pk-cable-h span:not(:first-child) { text-align: right; }
.pk-cable { display: grid; grid-template-columns: 1fr 56px 56px 56px; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--line-2); align-items: center; }
.pk-cable:last-child { border-bottom: none; }
.pk-cable-t { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--txt); min-width: 0; }
.pk-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.pk-cable-glyphs { display: inline-flex; align-items: center; gap: 2px; flex-shrink: 0; }
.pk-cable-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pk-cable-text b { font-size: 12px; font-weight: 600; color: var(--txt); }
.pk-cable-text i { font-size: 10px; color: var(--txt-3); font-style: normal; }
.pk-cable-metr { color: var(--ok) !important; font-weight: 600; }
.pk-cable-x { text-align: right; font-size: 13px; font-weight: 600; color: var(--txt); }
.pk-cable-s { text-align: right; font-size: 11.5px; color: var(--txt-3); }
.pk-cable-l { text-align: right; font-size: 13px; font-weight: 600; color: var(--ok); }

/* Patch list: pair de conectores no glyph (adaptador) */
.pl-conn-pair { display: inline-flex; align-items: center; gap: 2px; }
.pl-conn-pair-arrow { color: var(--txt-4); font-size: 11px; padding: 0 1px; }

/* === MODAL CONFIGURAÇÕES DO PLANO (pc-) — agrupa botões soltos em tabs === */
.pc-modal { display: flex; flex-direction: column; gap: 14px; }
.pc-tabs {
  display: flex; gap: 2px;
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  padding: 3px;
  align-self: flex-start;
}
.pc-tab {
  padding: 7px 14px;
  border-radius: var(--r-sm);
  border: none;
  background: transparent;
  color: var(--txt-3);
  font: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer;
}
.pc-tab.is-active { background: var(--bg); color: var(--txt); }
.pc-tabs-c { min-height: 200px; }

.pc-slider-wrap { display: flex; align-items: center; gap: 12px; }
.pc-slider-wrap input[type="range"] { flex: 1; accent-color: var(--red); }
.pc-slider-wrap output { font-size: 13px; font-weight: 600; color: var(--red); min-width: 50px; text-align: right; }
.field-hint { font-size: 11px; color: var(--txt-4); font-weight: 300; margin-top: 4px; }

.pc-line-styles { display: flex; gap: 6px; }
.pc-line-opt {
  padding: 8px 14px;
  background: var(--bg-3); border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  color: var(--txt-2);
  font: inherit; font-size: 12.5px; font-weight: 500;
  cursor: pointer;
}
.pc-line-opt:hover { border-color: var(--line); }
.pc-line-opt.is-active { background: var(--red-soft); border-color: var(--red); color: var(--red); }

.pc-actions { display: flex; flex-direction: column; gap: 8px; }
.pc-action {
  display: flex; align-items: center; gap: 14px;
  width: 100%; padding: 12px 14px;
  background: var(--bg-3); border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  color: var(--txt); text-align: left;
  font: inherit; cursor: pointer;
  transition: background .12s, border-color .12s;
}
.pc-action:hover { background: var(--bg-2); border-color: var(--line); }
.pc-action-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex-shrink: 0;
  background: var(--bg-2); border-radius: var(--r-sm);
  color: var(--red);
}
.pc-action b { display: block; font-size: 13px; font-weight: 600; }
.pc-action i { display: block; font-size: 11.5px; font-weight: 300; color: var(--txt-3); font-style: normal; margin-top: 2px; }

.pc-hint { font-size: 12.5px; color: var(--txt-3); line-height: 1.55; margin-bottom: 12px; }
.pc-hint a { color: var(--red); }

.pc-about { display: flex; flex-direction: column; gap: 1px; margin-bottom: 14px; }
.pc-about-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px;
  background: var(--bg-3); border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
}
.pc-about-row span { font-size: 12px; color: var(--txt-3); }
.pc-about-row b { font-size: 13px; color: var(--txt); }
/* Acessórios — bloco dedicado abaixo das colunas da packlist */
.pk-acess-box {
  margin-top: 18px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  padding: 18px 20px;
}
.pk-acess-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.pk-acess-title { font-size: 15px; font-weight: 700; color: var(--txt); }
.pk-acess-count { color: var(--red); font-weight: 600; font-size: 13px; margin-left: 4px; }
.pk-acess-sub { font-size: 12px; color: var(--txt-3); font-weight: 300; flex: 1; min-width: 240px; text-align: right; }
.pk-acess-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.pk-acess { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r-md); }
.pk-acess-nome { flex: 1; min-width: 0; font-size: 13px; color: var(--txt); word-break: break-word; }
.pk-acess-qtd { width: 58px; flex-shrink: 0; height: 32px; text-align: center; background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--txt); }
.pk-acess-del { width: 30px; height: 30px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-sm); background: transparent; border: 1px solid transparent; color: var(--txt-4); cursor: pointer; }
.pk-acess-del:hover { color: var(--err); background: var(--red-soft); border-color: var(--red-line); }
.pk-acess-empty { padding: 16px; text-align: center; font-size: 12px; color: var(--txt-4); border: 1px dashed var(--line-2); border-radius: var(--r-md); }
.pk-acess-add { display: flex; gap: 8px; align-items: center; }
.pk-acess-add input[type="text"] { flex: 1; min-width: 0; height: 38px; background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 12px; color: var(--txt); }
.pk-acess-add input[type="number"] { width: 64px; flex-shrink: 0; height: 38px; text-align: center; background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--txt); }

.pk-note { margin-top: 14px; display: flex; gap: 10px; align-items: flex-start; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-md); padding: 12px 14px; font-size: 11.5px; font-weight: 300; color: var(--txt-3); line-height: 1.5; }
.pk-note svg { flex-shrink: 0; margin-top: 1px; }

/* ====================== EQUIPE ====================== */
.eq { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.eq-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.eq-count { font-size: 12.5px; color: var(--txt-3); }
.eq-group { margin-bottom: 20px; }
.eq-group-head { display: flex; align-items: center; gap: 9px; margin-bottom: 11px; }
.eq-group-dot { width: 8px; height: 8px; border-radius: 2px; }
.eq-group-title { font-size: 13px; font-weight: 600; color: var(--txt); }
.eq-group-n { font-size: 10.5px; color: var(--txt-4); }
.eq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.eq-card { display: flex; align-items: center; gap: 12px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 12px 14px; }
.eq-avatar { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.05); border: 1px solid; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex-shrink: 0; }
.eq-card-main { flex: 1; min-width: 0; }
.eq-card-main b { display: block; font-size: 13.5px; font-weight: 500; color: var(--txt); }
.eq-card-main i { font-style: normal; font-size: 11.5px; color: var(--txt-3); }
.eq-contact { display: block; font-size: 10.5px; color: var(--txt-4); margin-top: 3px; }
.eq-add-card { display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px dashed var(--line); border-radius: var(--r-lg); padding: 12px; font-size: 12.5px; font-weight: 500; background: none; min-height: 64px; }

@media (max-width: 980px) {
  .pk { flex-direction: column; }
}

/* ================= PATCH PANEL (sub-tab) ================= */
.pp { display: flex; flex: 1; min-height: 480px; border: 1px solid var(--line-2); border-radius: var(--r-lg); overflow: hidden; }
.pp-lib { width: 250px; flex-shrink: 0; border-right: 1px solid var(--line-2); padding: 16px 14px; display: flex; flex-direction: column; background: var(--bg); overflow: auto; }
.pp-lib-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--txt); margin-bottom: 6px; }
.pp-lib-hint { font-size: 11px; font-weight: 300; color: var(--txt-3); line-height: 1.5; margin-bottom: 12px; }
.pp-cat { margin-bottom: 8px; }
.pp-cat-head { display: flex; align-items: center; gap: 6px; padding: 5px 2px; font-size: 11.5px; font-weight: 600; }
.pp-cat-head .mono { font-size: 9.5px; color: var(--txt-4); }
.pp-cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.pp-cat-item { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 7px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 7px; font-size: 9.5px; color: var(--txt-2); overflow: hidden; }
.pp-cat-item.is-sel { background: var(--red-soft); border-color: var(--red); }
.pp-cat-item .mono { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-stage { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.pp-toolbar { height: 44px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; padding: 0 16px; gap: 8px; }
.pp-canvas { flex: 1; overflow: auto; background-color: var(--bg-deep); background-image: radial-gradient(circle, #18222c 1px, transparent 1px); background-size: 24px 24px; display: flex; align-items: center; justify-content: center; padding: 24px; }
.pp-panel { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px 24px; box-shadow: var(--sh-3); }
.pp-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.pp-panel-head .mono { font-size: 13px; font-weight: 600; letter-spacing: 1px; color: var(--txt); }
.pp-panel-sub { font-size: 10px; color: var(--txt-3) !important; font-weight: 400 !important; letter-spacing: 0 !important; }
.pp-rows { display: grid; grid-template-columns: auto 1fr; gap: 14px 12px; align-items: center; }
.pp-rowlabel { font-size: 12px; font-weight: 600; color: var(--txt-3); }
.pp-row { display: flex; gap: 7px; }
.pp-sock { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.pp-sock-lbl { font-size: 8.5px; color: var(--txt-3); }
.pp-sock-hole { width: 30px; height: 30px; border-radius: 7px; display: flex; align-items: center; justify-content: center; border: 1px solid transparent; }
.pp-sock.is-sel .pp-sock-hole { background: var(--red-soft); border-color: var(--red); }
.pp-sock.is-sel .pp-sock-lbl { color: var(--red); font-weight: 600; }
.pp-lib-empty { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 40px 16px; text-align: center; color: var(--txt-3); }
.pp-lib-empty div { font-size: 13px; font-weight: 500; color: var(--txt-2); }
.pp-lib-empty span { font-size: 11px; color: var(--txt-4); }
.pp-cat-empty { display: flex; align-items: center; gap: 7px; }
.pp-empty-dot { width: 16px; height: 16px; border-radius: 50%; border: 1.5px dashed var(--line); flex-shrink: 0; }
.pp-sock { cursor: pointer; }
.pp-sock:hover .pp-sock-hole { border-color: var(--line); }
.pp-tabs { display: flex; align-items: center; gap: 6px; }
.pp-addpanel { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px; border-radius: 7px; font-size: 12px; color: var(--txt-3); background: none; border: 1px dashed var(--line); }
.pp-addpanel:hover { color: var(--red); border-color: var(--red); }
.pp-sel-n { margin-left: auto; font-size: 10.5px; color: var(--red); }
.pp-count { font-family: var(--font-mono); font-size: 11px; color: var(--txt-3); }
.pp-selbar { display: none; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line-2); background: var(--bg); }
.pp-selbar .mono { font-size: 12px; color: var(--txt-2); }
.pp-selbtn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 7px; font-size: 12px; color: var(--txt-2); background: var(--bg-3); border: 1px solid var(--line); }
.pp-selbtn:hover { color: var(--red); border-color: var(--red); }

/* ===================== STUDIO ===================== */
.st { display: flex; flex-direction: column; flex: 1; min-height: 480px; }
.st-toolbar { display: flex; align-items: center; gap: 8px; padding-bottom: 12px; flex-wrap: wrap; }
.st-palette { display: flex; gap: 4px; flex-wrap: wrap; }
.st-add { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px; background: var(--bg-2); border: 1px solid var(--line-3); border-radius: 8px; font-size: 11.5px; color: var(--txt-2); }
.st-add:hover { color: var(--txt); border-color: var(--red); }
.st-dimctl { font-size: 11.5px; color: var(--txt-3); display: inline-flex; align-items: center; gap: 4px; }
.st-dimctl input { width: 52px; height: 28px; text-align: center; }
.st-floor { flex: 1; position: relative; background-color: var(--bg-deep); background-image: linear-gradient(#13202b 1px, transparent 1px), linear-gradient(90deg, #13202b 1px, transparent 1px); background-size: 38px 38px; border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 24px 30px; overflow: hidden; }
.st-room { position: relative; height: 100%; min-height: 420px; border: 1px solid var(--line); border-radius: 6px; }
.st-dim-top { position: absolute; left: 50%; top: 6px; transform: translateX(-50%); font-size: 9px; color: var(--txt-4); pointer-events: none; }
.st-dim-left { position: absolute; left: 6px; top: 50%; transform: translateY(-50%) rotate(-90deg); font-size: 9px; color: var(--txt-4); pointer-events: none; }
.st-hint { margin-top: 8px; font-size: 10.5px; color: var(--txt-4); }
.st-el { position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 1.5px solid; border-radius: 8px; cursor: grab; touch-action: none; user-select: none; }
.st-el:active { cursor: grabbing; }
.st-el.is-sel { box-shadow: 0 0 0 2px var(--red); }
.st-el-lbl { font-size: 8.5px; color: var(--txt); outline: none; max-width: 92%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-el-text { border: none !important; background: var(--bg-2); padding: 4px 9px; border-radius: 6px; }
.st-el-text span { font-size: 11px; color: var(--txt-2); }
.st-el-text.is-sel { box-shadow: 0 0 0 2px var(--red); }
.st-el-del { position: absolute; top: -8px; right: -8px; width: 18px; height: 18px; border-radius: 50%; background: var(--red); display: flex; align-items: center; justify-content: center; }

/* ============ Canvas: pan/zoom + interação (nós, zonas) ============ */
.cv-world { position: absolute; inset: 0; transform-origin: 0 0; }
.cv-stage { cursor: grab; }
.cv-nodes { pointer-events: none; }
.cv-node { pointer-events: auto; cursor: default; }
.cv-node-head { cursor: grab; }
.cv-node-head:active { cursor: grabbing; }
.cv-zones { pointer-events: none; }
.cv-zone { pointer-events: auto; cursor: move; }
.cv-zone .cv-zone-lbl { cursor: text; }
.cv-zone .cv-zone-rs { cursor: nwse-resize; }
.cv-zone-bar { position: absolute; top: 0; left: 0; right: 0; height: 28px; display: flex; align-items: center; justify-content: flex-start; gap: 6px; padding: 0 6px 0 8px; cursor: grab; }
.cv-zone-bar:active { cursor: grabbing; }
.cv-zone-bar .cv-zone-lbl { position: static; top: auto; left: auto; font-family: var(--font-mono); font-size: 12px; font-weight: 700; letter-spacing: .3px; outline: none; cursor: text; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; padding: 2px 7px; border-radius: 5px; background: rgba(10, 16, 20, .55); }
.cv-zone-del { margin-left: auto; }
.cv-zone-del { width: 16px; height: 16px; border-radius: 4px; display: flex; align-items: center; justify-content: center; color: var(--txt-3); opacity: 0; flex-shrink: 0; }
.cv-zone:hover .cv-zone-del { opacity: 1; }
.cv-zone-del:hover { background: rgba(221, 42, 27, .85); color: #fff; }
.cv-zone-rs { position: absolute; right: -2px; bottom: -2px; width: 16px; height: 16px; cursor: nwse-resize; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; opacity: .45; border-bottom-right-radius: 9px; }
.cv-zone:hover .cv-zone-rs { opacity: .9; }

/* ---- Patch Panel: settings / split / 2D-3D / zoom ---- */
.pp-iconbtn { width: 30px; height: 28px; display: inline-flex; align-items: center; justify-content: center; background: var(--bg-2); border: 1px solid var(--line-3); border-radius: 7px; color: var(--txt-2); cursor: pointer; flex-shrink: 0; }
.pp-iconbtn:hover { color: var(--txt); border-color: var(--line); }
.pp-zoom { display: inline-flex; align-items: center; gap: 2px; background: var(--bg-2); border: 1px solid var(--line-3); border-radius: 7px; overflow: hidden; flex-shrink: 0; }
.pp-zoom button { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; color: var(--txt-2); }
.pp-zoom button:hover { color: var(--txt); background: var(--bg-3); }
.pp-zoom span { font-size: 10px; color: var(--txt-3); min-width: 36px; text-align: center; }
.pp-canvas { overflow: auto; }
.pp-stagewrap { display: flex; flex-direction: column; gap: 20px; transform-origin: top center; transition: transform .12s; }
.pp-3d .pp-panel { transform: perspective(1100px) rotateX(34deg); transition: transform .2s; }
.pp-total-prev { color: var(--txt-3); font-size: 12px; }
.mb-dot-dirty { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); margin-right: 5px; vertical-align: middle; }
.mb-dot-saving { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--info); margin-right: 5px; vertical-align: middle; animation: mbSavingPulse 0.8s ease-in-out infinite; }
@keyframes mbSavingPulse { 0%,100% { opacity: 0.4; } 50% { opacity: 1; } }

/* ============ Studio: 2 colunas (lista de equipamentos + canvas) ============ */
.st-2col { flex-direction: row; gap: 14px; }
.st-side { width: 232px; flex-shrink: 0; display: flex; flex-direction: column; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-lg); overflow: hidden; }
.st-side-head { padding: 12px 14px 8px; font-size: 11px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; color: var(--txt-3); }
.st-side-search { display: flex; align-items: center; gap: 7px; margin: 0 12px 10px; padding: 0 9px; height: 32px; background: var(--bg-deep); border: 1px solid var(--line-3); border-radius: 7px; color: var(--txt-4); }
.st-side-search input { flex: 1; min-width: 0; background: none; border: none; outline: none; color: var(--txt); font-size: 12px; }
.st-side-list { flex: 1; overflow: auto; padding: 0 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.st-eq-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; background: var(--bg-deep); border: 1px solid var(--line-2); border-radius: 8px; color: var(--txt-2); font-size: 12px; text-align: left; cursor: pointer; }
.st-eq-item:hover { border-color: var(--ec); color: var(--txt); }
.st-eq-nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-eq-add { color: var(--txt-4); font-size: 15px; line-height: 1; }
.st-eq-item:hover .st-eq-add { color: var(--ec); }
.st-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.st-addwrap { position: relative; }
.st-add-btn { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px; background: var(--bg-2); border: 1px solid var(--line-3); border-radius: 8px; font-size: 11.5px; color: var(--txt-2); cursor: pointer; }
.st-add-btn:hover { color: var(--txt); border-color: var(--red); }
.st-add-menu { position: absolute; top: 36px; left: 0; z-index: 20; min-width: 172px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--sh-3); padding: 5px; display: flex; flex-direction: column; gap: 1px; }
.st-add-menu[hidden] { display: none; }
.st-add-mi { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 6px; font-size: 12px; color: var(--txt-2); cursor: pointer; text-align: left; background: transparent; border: none; width: 100%; font-family: inherit; }
.st-add-mi:hover { background: var(--bg-3); color: var(--txt); }
.st-add-sep { height: 1px; background: var(--line-2); margin: 4px 0; }
.st-el-rs { position: absolute; right: -3px; bottom: -3px; width: 14px; height: 14px; cursor: nwse-resize; border-right: 2px solid var(--red); border-bottom: 2px solid var(--red); border-bottom-right-radius: 6px; }

/* ================= FORNECEDORES ================= */
.fr { display: flex; flex-direction: column; flex: 1; }
.fr-bar { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.fr-count { font-size: 12.5px; color: var(--txt-3); }
.fr-total { font-size: 13px; color: var(--txt-2); margin-left: auto; }
.fr-total b { color: var(--red); }
.fr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.fr-card { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 16px 18px; }
.fr-card-head { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 12px; }
.fr-ico { width: 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.fr-card-info { flex: 1; min-width: 0; }
.fr-card-info b { display: block; font-size: 14.5px; font-weight: 600; color: var(--txt); word-break: break-word; }
.fr-card-info i { font-style: normal; font-size: 11.5px; color: var(--txt-3); word-break: break-word; }
.fr-card-val { font-size: 13px; font-weight: 600; color: var(--txt); white-space: nowrap; flex-shrink: 0; }
.fr-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 11px; border-top: 1px solid var(--line-2); }
.fr-card-foot .mono { font-size: 11px; color: var(--txt-3); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-card-items { font-size: 11px; font-weight: 500; color: var(--txt-2); background: var(--bg-3); border: 1px solid var(--line); border-radius: 20px; padding: 3px 10px; }
.fr-card-qty { flex-shrink: 0; font-size: 11px !important; font-weight: 600; color: var(--red) !important; background: var(--red-soft); border-radius: 20px; padding: 3px 10px; }
.fr-card-items-plano { margin-top: 8px; font-size: 11px; color: var(--txt-3); line-height: 1.45; word-break: break-word; }

/* ================= JOB SHEET (A4 / PDF) ================= */
.js { display: flex; flex-direction: column; flex: 1; align-items: center; }
.js-bar { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 720px; margin-bottom: 16px; }
.js-bar-lbl { font-size: 12px; font-weight: 300; color: var(--txt-3); margin-right: auto; }
.js-paper { width: 720px; max-width: 100%; background: #fff; color: #1a1a1a; border-radius: 4px; box-shadow: var(--sh-3); padding: 38px 42px; }
.js-doc-head { display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 2px solid var(--red); padding-bottom: 16px; margin-bottom: 18px; }
.js-doc-head-left { display: flex; align-items: flex-start; gap: 16px; }
.js-brand { display: flex; align-items: flex-start; gap: 11px; }
.js-brand-txt { display: flex; flex-direction: column; }
.js-brand-divider { width: 1.5px; height: 36px; background: #E6E9EE; align-self: center; }
.js-logo { width: 36px; height: 36px; border-radius: 8px; background: var(--red); display: flex; align-items: center; justify-content: center; print-color-adjust: exact; -webkit-print-color-adjust: exact; overflow: hidden; }
/* Logo do cliente costuma ser LARGO (~200×60). A caixa 36×36 espremia tudo.
   Pro logo (imagem) deixamos a caixa crescer em largura, altura fixa, contain. */
/* Logo = só a imagem, sem caixa/borda (igual ao relatório de referência:
   h-10 w-auto object-contain max-w-150). A caixa branca com borda ficava feia. */
.js-logo-img { width: auto; max-width: 150px; height: 40px; background: transparent !important; border: none; border-radius: 0; padding: 0; overflow: visible; }
.js-logo-img img { max-width: 150px; max-height: 40px; width: auto; height: auto; object-fit: contain; }
.js-brand-name { font-size: 16px; font-weight: 700; color: #1a1a1a; }
.js-brand-sub { font-size: 10.5px; color: #777; }
.js-brand-user { font-size: 10px; color: #999; margin-top: 2px; }
.js-company-details { font-size: 9px; color: #555; line-height: 1.4; text-align: left; margin-top: 4px; }
.js-doc-id { text-align: right; }
.js-doc-id .mono { font-size: 12px; font-weight: 600; color: #1a1a1a; }
.js-doc-date { font-size: 10px; color: #999; }

.js-top-info-grid { display: grid; grid-template-columns: 1.2fr 1.6fr 0.8fr 1.4fr; gap: 16px; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1.5px solid var(--red); }
.js-info-box { display: flex; flex-direction: column; gap: 4px; }
.js-info-lbl { font-size: 9px; font-weight: 700; letter-spacing: 0.5px; color: #999; text-transform: uppercase; }
.js-info-val { font-size: 12px; font-weight: 600; color: #1a1a1a; }

.js-people-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 32px; row-gap: 10px; margin-bottom: 20px; }
.js-people-row { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #E6E9EE; padding-bottom: 6px; font-size: 11.5px; }
.js-people-role { color: #555; font-weight: 400; text-transform: uppercase; font-size: 9px; letter-spacing: 0.4px; }
.js-people-name { color: #1a1a1a; font-weight: 700; text-align: right; }
.js-sec-title { font-size: 10px; font-weight: 700; letter-spacing: .6px; color: var(--red); text-transform: uppercase; margin-bottom: 8px; }
.js-eq { margin-bottom: 18px; }
.js-eq-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid #E6E9EE; font-size: 11.5px; color: #1a1a1a; }
.js-cols { display: flex; gap: 24px; }
.js-cols > div { flex: 1; }
.js-cables { font-size: 11px; color: #333; line-height: 1.9; }
.js-sign { border-bottom: 1px solid #bbb; height: 34px; margin-bottom: 4px; }
.js-sign-lbl { font-size: 9px; color: #999; }
.js-foot { display: flex; justify-content: space-between; border-top: 1px solid #ddd; padding-top: 10px; margin-top: 18px; font-size: 9px; color: #999; }

/* ===================== HISTÓRICO ===================== */
.hi { display: flex; flex-direction: column; flex: 1; }
.hi-note { display: flex; gap: 10px; align-items: flex-start; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-md); padding: 12px 14px; font-size: 11.5px; font-weight: 300; color: var(--txt-3); line-height: 1.5; margin-bottom: 16px; }
.hi-note svg { flex-shrink: 0; margin-top: 1px; }
.hi-list { display: flex; flex-direction: column; gap: 9px; }
.hi-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-lg); }
.hi-item.is-now { background: var(--red-soft); border-color: var(--red-line); }
.hi-v { font-size: 13px; font-weight: 600; color: var(--txt); width: 40px; flex-shrink: 0; }
.hi-item.is-now .hi-v { color: var(--red); }
.hi-divider { width: 1px; height: 32px; background: var(--line-2); flex-shrink: 0; }
.hi-main { flex: 1; min-width: 0; }
.hi-main b { display: block; font-size: 13px; font-weight: 500; color: var(--txt); }
.hi-main i { font-style: normal; font-size: 10.5px; color: var(--txt-3); }
.hi-restore { font-size: 12px; font-weight: 500; color: var(--red); background: none; }

/* ===================== PRINT (PDF) ===================== */
@media print {
  body.printing-jobsheet .side,
  body.printing-jobsheet .topbar,
  body.printing-jobsheet .plan-head,
  body.printing-jobsheet .plan-tabs-wrap,
  body.printing-jobsheet .js-bar { display: none !important; }
  body.printing-jobsheet .app,
  body.printing-jobsheet .main,
  body.printing-jobsheet .view,
  body.printing-jobsheet .plan,
  body.printing-jobsheet .plan-sub,
  body.printing-jobsheet .js { display: block !important; margin: 0 !important; padding: 0 !important; }
  body.printing-jobsheet .js-paper { box-shadow: none; width: 100%; border-radius: 0; }
  @page { size: A4; margin: 12mm; }

  /* Studio: imprime só a planta limpa */
  body.studio-printing .side,
  body.studio-printing .topbar,
  body.studio-printing .plan-head,
  body.studio-printing .plan-tabs-wrap,
  body.studio-printing .st-side,
  body.studio-printing .st-toolbar,
  body.studio-printing .st-hint,
  body.studio-printing .toast { display: none !important; }
  body.studio-printing .app, body.studio-printing .main, body.studio-printing .view,
  body.studio-printing .plan, body.studio-printing .plan-sub,
  body.studio-printing .st, body.studio-printing .st-2col, body.studio-printing .st-main {
    display: block !important; margin: 0 !important; padding: 0 !important;
  }
  body.studio-printing .st-floor { background: #fff !important; border: none !important; }
}

/* ===== Folha de Separação A4 (jobsheet completo) ===== */
.js-paper { width: 760px; min-height: 1075px; }
.js-event { font-size: 17px; font-weight: 700; color: #1a1a1a; margin-bottom: 12px; }
.js-sec-n { font-family: var(--font-mono); font-size: 11px; color: #999; font-weight: 400; }
.js-sec-title-mt { margin-top: 14px; }
.js-people { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid #E6E9EE; }
.js-people-grp { display: flex; flex-direction: column; gap: 2px; min-width: 150px; }
.js-people-grp b { font-size: 9px; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 2px; }
.js-people-grp span { font-size: 11px; color: #1a1a1a; }
.js-people-grp i { font-style: normal; color: #888; }
.js-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 28px; margin-bottom: 18px; }
.js-chk { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid #F0F2F5; }
.js-box { width: 14px; height: 14px; border: 1.5px solid #999; border-radius: 3px; flex-shrink: 0; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
.js-chk-txt { flex: 1; font-size: 11px; color: #1a1a1a; }
.js-chk-txt i { font-style: normal; color: #999; font-size: 10px; }
.js-chk-qty { font-size: 11px; font-weight: 600; color: #1a1a1a; }

@media (max-width: 820px) {
  .js-paper { width: 100%; min-height: 0; padding: 24px 20px; }
  .js-grid2 { grid-template-columns: 1fr; }
}

/* ============================================================
   v2 — Novos componentes: drag-to-connect, picker, empty state
   ============================================================ */

/* Botão principal e dica na cv-bar */
.cv-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--bg-2); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cv-bar-sep { width: 1px; height: 22px; background: var(--line); }
.cv-bar-hint { color: var(--txt-3); font-size: 11px; margin-left: auto; padding: 0 4px; opacity: 0.8; }

/* Drag-to-connect — feedback visual nas portas */
.cv-port { transition: transform 0.12s ease, box-shadow 0.12s ease, outline 0.12s ease; cursor: grab; }
.cv-port:hover { transform: scale(1.4); box-shadow: 0 0 0 3px rgba(255,255,255,0.12); }
.cv-port.cv-port-active { transform: scale(1.6); box-shadow: 0 0 0 4px rgba(221,42,27,0.4); cursor: grabbing; }
.cv-port.cv-port-ok { animation: portPulseOk 1.2s ease-in-out infinite; box-shadow: 0 0 0 3px rgba(46,204,113,0.5); }
.cv-port.cv-port-no { opacity: 0.25; }
.cv-port.cv-port-hover { transform: scale(1.7); box-shadow: 0 0 0 5px rgba(255,255,255,0.35); outline: 2px solid #fff; outline-offset: 1px; }
@keyframes portPulseOk {
  0%, 100% { box-shadow: 0 0 0 3px rgba(46,204,113,0.4); }
  50%      { box-shadow: 0 0 0 6px rgba(46,204,113,0.7); }
}

/* Botão de delete dentro do node */
.cv-node-head { position: relative; }
.cv-node-del {
  position: absolute; top: 4px; right: 4px;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.2); border: 1px solid var(--line-2); border-radius: 6px;
  color: var(--txt-3); cursor: pointer; opacity: 0.5;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.cv-node:hover .cv-node-del { opacity: 1; }
.cv-node-del:hover { background: rgba(221,42,27,0.2); color: var(--red); border-color: rgba(221,42,27,0.5); opacity: 1 !important; }
/* Mobile: X sempre visível (não tem hover) */
@media (hover: none) {
  .cv-node-del { opacity: 0.9; background: rgba(0,0,0,0.4); }
}

/* Empty state quando não há equipamentos no canvas */
.cv-empty {
  position: absolute; inset: 0;
  display: none; align-items: center; justify-content: center;
  padding: 40px; pointer-events: none; z-index: 5;
}
.cv-empty-card {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 32px 40px; max-width: 460px; text-align: center;
  pointer-events: auto; box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.cv-empty-ico {
  width: 64px; height: 64px;
  background: var(--bg-3); border: 1px solid var(--line);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px; color: var(--red);
}
.cv-empty-card h3 { font-size: 18px; font-weight: 600; color: var(--txt); margin: 0 0 8px; }
.cv-empty-card p { font-size: 13px; color: var(--txt-3); margin: 0 0 22px; line-height: 1.5; }

/* Modal: picker de equipamentos */
.cv-pick { display: flex; flex-direction: column; gap: 12px; max-height: 60vh; }
.cv-pick-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 8px 12px;
}
.cv-pick-search svg { color: var(--txt-3); }
.cv-pick-search input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--txt); font-size: 14px; font-family: var(--font);
}
.cv-pick-list {
  display: flex; flex-direction: column; gap: 4px;
  overflow-y: auto; max-height: 50vh; padding: 4px;
  border: 1px solid var(--line-2); border-radius: var(--r-md);
}
.cv-pick-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; background: transparent;
  border: 1px solid transparent; border-radius: var(--r-md);
  cursor: pointer; text-align: left; color: var(--txt-2);
  transition: background 0.12s ease, border-color 0.12s ease;
  font-family: var(--font);
}
.cv-pick-item:hover { background: var(--bg-3); border-color: var(--line); }
.cv-pick-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
/* min-width:0 + word-wrap pra nome longo de gear nunca empurrar a estoque/meta pra fora ou cortar */
.cv-pick-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.cv-pick-main b { font-size: 13.5px; font-weight: 500; color: var(--txt); word-break: break-word; line-height: 1.25; }
.cv-pick-main i { font-style: normal; font-size: 11px; color: var(--txt-3); text-transform: uppercase; letter-spacing: 0.5px; word-break: break-word; line-height: 1.3; }
.cv-pick-meta { font-size: 11px; color: var(--txt-3); flex-shrink: 0; white-space: nowrap; }

/* Badge de estoque no picker — verde/amarelo/vermelho conforme disponibilidade */
.cv-pick-stock {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  padding: 3px 8px; border-radius: 5px; flex-shrink: 0;
  text-transform: uppercase; letter-spacing: 0.4px;
}
.cv-pick-stock-ok    { background: rgba(46,204,113,0.13); color: #2ECC71; border: 1px solid rgba(46,204,113,0.3); }
.cv-pick-stock-low   { background: rgba(243,156,18,0.13); color: #F39C12; border: 1px solid rgba(243,156,18,0.4); }
.cv-pick-stock-empty { background: rgba(221,42,27,0.15); color: #DD2A1B; border: 1px solid rgba(221,42,27,0.4); }
.cv-pick-item.is-empty-stock { opacity: 0.78; }
.cv-pick-item.is-empty-stock:hover { opacity: 1; border-color: rgba(221,42,27,0.4); }
.cv-pick-empty { padding: 32px; text-align: center; color: var(--txt-3); font-size: 13px; }
.cv-pick-empty a { color: var(--red); }
.cv-pick-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 8px; border-top: 1px solid var(--line-2);
}
.cv-pick-hint { font-size: 11px; color: var(--txt-4); }

/* Form-grid utility */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .field { display: flex; flex-direction: column; gap: 4px; }
.form-grid .field-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--txt-4); font-weight: 600; }
.form-grid .field input,
.form-grid .field select,
.form-grid .field textarea {
  background: var(--bg-3); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 10px 12px;
  color: var(--txt); font-size: 14px; font-family: var(--font);
}
.form-grid .field input:focus, .form-grid .field select:focus, .form-grid .field textarea:focus {
  outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(221,42,27,0.18);
}
.form-grid .span-2 { grid-column: 1 / -1; }
.form-grid .field-info { color: var(--txt-3); font-size: 12px; padding: 4px 0; }

/* Mobile: stack the form (regras de porta no bloco "Touch / Mobile" abaixo) */
@media (max-width: 768px) {
  .form-grid { grid-template-columns: 1fr; }
  .cv-bar { padding: 8px 10px; gap: 8px; }
  .cv-bar-hint { display: none; }
  .cv-empty-card { padding: 24px 20px; max-width: none; }
}

/* Botão de fit (centralizar) — ao lado do zoom */
.cv-zoom #cvFit { color: var(--txt-3); }
.cv-zoom #cvFit:hover { color: var(--red); }

/* ===== Share modal (link público read-only) ===== */
.share-modal { display: flex; flex-direction: column; gap: 4px; }
.share-desc { font-size: 13px; color: var(--txt-3); margin: 0 0 12px; line-height: 1.5; }
.share-loading, .share-empty { padding: 24px; text-align: center; color: var(--txt-4); font-size: 13px; }
.share-list { display: flex; flex-direction: column; gap: 10px; max-height: 50vh; overflow-y: auto; }
.share-item {
  display: flex; gap: 10px; align-items: center;
  padding: 12px; background: var(--bg-3); border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.share-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.share-url {
  background: var(--bg-deep); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 6px 10px;
  color: var(--txt-2); font-size: 12px; font-family: var(--font-mono);
  width: 100%;
}
.share-meta { display: flex; gap: 12px; font-size: 11px; color: var(--txt-4); flex-wrap: wrap; }
.share-actions { display: flex; gap: 4px; flex-shrink: 0; }
.share-revoke:hover { background: rgba(221,42,27,0.18) !important; color: var(--red) !important; }

/* ===== Modal de atalhos de teclado ===== */
.shortcuts-modal { display: flex; flex-direction: column; gap: 12px; }
.shortcuts-desc { font-size: 12px; color: var(--txt-3); margin: 0; line-height: 1.5; }
.shortcuts-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.shortcuts-table tr td { padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.shortcuts-table tr:last-child td { border-bottom: none; }
.shortcuts-table td:first-child { width: 130px; }
.shortcuts-table kbd {
  display: inline-block; background: var(--bg-3); border: 1px solid var(--line);
  border-radius: 4px; padding: 2px 8px; font-family: var(--font-mono);
  font-size: 11px; color: var(--txt-2); box-shadow: 0 1px 0 var(--line);
}

/* ===== Histórico: empty state (Fase 3) ===== */
.hi-empty {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 60px 30px; max-width: 520px; margin: 40px auto;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg);
}
.hi-empty-ico {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--bg-3); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; color: var(--txt-3);
  margin-bottom: 20px;
}
.hi-empty h3 { font-size: 18px; color: var(--txt); margin: 0 0 12px; font-weight: 600; }
.hi-empty p { font-size: 13px; color: var(--txt-2); margin: 0 0 12px; line-height: 1.6; }
.hi-empty-hint { color: var(--txt-3); font-size: 12px; padding-top: 16px; border-top: 1px solid var(--line-2); margin-top: 8px !important; }

/* ===== Histórico de versões ===== */
.hi { display: flex; flex-direction: column; gap: 14px; }
.hi-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-md); }
.hi-count { font-size: 12px; color: var(--txt-3); text-transform: uppercase; letter-spacing: 0.5px; }
.hi-note { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: rgba(52,152,219,0.08); border: 1px solid rgba(52,152,219,0.25); border-radius: var(--r-md); font-size: 13px; color: var(--txt-2); }
.hi-list { display: flex; flex-direction: column; gap: 8px; }
.hi-item { display: flex; align-items: center; gap: 14px; padding: 14px 18px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-md); }
.hi-v { background: var(--bg-3); padding: 6px 10px; border-radius: 6px; font-size: 12px; color: var(--txt); font-weight: 600; min-width: 50px; text-align: center; }
.hi-divider { width: 1px; height: 28px; background: var(--line); }
.hi-main { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hi-main b { font-size: 14px; color: var(--txt); font-weight: 500; }
.hi-main i { font-style: normal; font-size: 11px; color: var(--txt-3); }
.hi-restore { background: var(--bg-3); border: 1px solid var(--line); color: var(--txt-2); padding: 8px 14px; border-radius: var(--r-md); cursor: pointer; font-size: 13px; font-family: inherit; }
.hi-restore:hover { background: var(--red); color: #fff; border-color: var(--red); }
.hi-del { background: none; border: none; color: var(--txt-4); cursor: pointer; padding: 6px; border-radius: 4px; }
.hi-del:hover { color: var(--red); background: rgba(221,42,27,0.1); }
@media (max-width: 768px) {
  .hi-item { flex-wrap: wrap; }
  .hi-divider { display: none; }
}

/* ===== Studio: tabs na sidebar + item enriquecido ===== */
.st-side-tabs { display: flex; gap: 4px; padding: 6px; background: var(--bg-3); border-radius: var(--r-md); margin-bottom: 10px; }
.st-side-tab { flex: 1; background: transparent; border: none; color: var(--txt-3); padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 12px; font-family: inherit; transition: background 0.12s, color 0.12s; }
.st-side-tab:hover { color: var(--txt-2); }
.st-side-tab.is-active { background: var(--bg-2); color: var(--txt); }
.st-eq-nm { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.st-eq-nm i { font-style: normal; font-size: 10px; color: var(--txt-4); text-transform: uppercase; letter-spacing: 0.4px; }
.st-eq-add { font-size: 16px; color: var(--txt-3); padding: 0 8px; transition: color 0.12s; }
.st-eq-item:hover .st-eq-add { color: var(--red); }

/* ===== Equipamento locado: badge + estilo ===== */
.cv-node.is-locado { border-color: var(--warn); }
.cv-node.is-locado .cv-node-head { background: linear-gradient(to right, var(--bg-3), rgba(243,156,18,0.08)); }
.cv-node-locado {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; background: var(--warn); color: #fff;
  border-radius: 4px; font-size: 9px; font-weight: 700; margin-left: 6px;
  vertical-align: middle; font-family: var(--font-mono); letter-spacing: 0;
}
.cv-node-edit {
  position: absolute; top: 4px; right: 32px;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.2); border: 1px solid var(--line-2); border-radius: 6px;
  color: var(--txt-3); cursor: pointer; opacity: 0.5;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.cv-node:hover .cv-node-edit { opacity: 1; }
.cv-node-edit:hover { background: rgba(52,152,219,0.2); color: var(--info); opacity: 1 !important; }
@media (hover: none) { .cv-node-edit { opacity: 0.9; background: rgba(0,0,0,0.4); } }

/* ===== Packlist: grupos próprios vs locados ===== */
.pk-grp-head { display: flex; align-items: center; gap: 8px; padding: 12px 4px 8px; font-size: 12px; font-weight: 600; color: var(--txt-2); text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--line-2); }
.pk-grp-head + .pk-item { margin-top: 4px; }
.pk-grp-icon { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; background: var(--bg-3); border-radius: 5px; font-size: 11px; color: var(--txt); }
.pk-grp-locado .pk-grp-icon { background: var(--warn); color: #fff; font-weight: 700; }
.pk-grp-locado { color: var(--warn); }
.pk-grp-n { margin-left: auto; color: var(--txt-3); font-size: 11px; }
.pk-empty { padding: 32px; text-align: center; color: var(--txt-3); font-size: 13px; }

/* ===== Patchify-style: rotação do card + troca de lado de porta BI ===== */
/* Botão "virar card" no cabeçalho — fica à esquerda dos botões edit/del */
.cv-node-flip {
  position: absolute; top: 4px; right: 60px;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.2); border: 1px solid var(--line-2); border-radius: 6px;
  color: var(--txt-3); cursor: pointer; opacity: 0.5;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.cv-node:hover .cv-node-flip { opacity: 1; }
.cv-node-flip:hover { background: rgba(155,89,182,0.2); color: #b07cd6; opacity: 1 !important; }
@media (hover: none) { .cv-node-flip { opacity: 0.9; background: rgba(0,0,0,0.4); } }

/* Botão "↔" dentro de cada porta BI — troca o lado de UMA porta */
.cv-pchip-flip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px;
  background: transparent; border: 1px solid var(--line-2); border-radius: 3px;
  color: var(--txt-4); cursor: pointer; font-size: 9px; line-height: 1;
  padding: 0; opacity: 0; transition: opacity 0.12s, color 0.12s, background 0.12s, border-color 0.12s;
  flex-shrink: 0;
}
.cv-node:hover .cv-pchip-flip { opacity: 0.7; }
.cv-pchip-flip:hover { opacity: 1; color: var(--txt); background: var(--bg-3); border-color: var(--txt-4); }
@media (hover: none) { .cv-pchip-flip { opacity: 0.6; } }

/* Botões extras no header: orientação (V/H) + esconder portas sem cabo */
.cv-node-orient, .cv-node-hide {
  position: absolute; top: 4px; width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.2); border: 1px solid var(--line-2); border-radius: 6px;
  color: var(--txt-3); cursor: pointer; opacity: 0.5;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.cv-node-orient { right: 88px; }
.cv-node-hide   { right: 116px; }
.cv-node:hover .cv-node-orient, .cv-node:hover .cv-node-hide { opacity: 1; }
.cv-node-orient:hover { background: rgba(52,152,219,0.2); color: var(--info); opacity: 1 !important; }
.cv-node-hide:hover { background: rgba(46,204,113,0.18); color: #2ECC71; opacity: 1 !important; }
.cv-node-orient.is-on { color: #b07cd6; border-color: rgba(155,89,182,0.5); opacity: 1; }
.cv-node-hide.is-on { color: var(--warn); border-color: rgba(243,156,18,0.5); opacity: 1; }
@media (hover: none) { .cv-node-orient, .cv-node-hide { opacity: 0.9; background: rgba(0,0,0,0.4); } }

/* Espaçamento extra no head pra acomodar os 5 botões à direita */
/* ===== Novo Container de Ações de Cabeçalho (Evita padding-right fixo e nomes cortados) ===== */
.cv-node-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  margin-left: auto; /* Alinha tudo à direita automaticamente! */
}
/* Força botões sob .cv-node-actions a ignorarem o posicionamento absoluto antigo */
.cv-node-actions button,
.cv-node-actions .cv-node-del,
.cv-node-actions .cv-node-edit,
.cv-node-actions .cv-node-flip,
.cv-node-actions .cv-node-orient,
.cv-node-actions .cv-node-hide {
  position: static !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 24px !important;
  height: 24px !important;
  border-radius: 6px !important;
  flex-shrink: 0 !important;
}

/* Modificações do Cabeçalho e do Meio (Flexbox Completo) */
.cv-node-head, .cv-node-mid {
  position: relative;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  padding: 0 11px !important;
  padding-right: 11px !important; /* sobrescreve padding-right anterior */
  height: 32px !important;
  box-sizing: border-box !important;
}
.cv-node-head {
  border-bottom: 1px solid var(--line-2) !important;
}

/* ===== Card HORIZONTAL (Estilo H2R Premium Modular) ===== */
.cv-node.is-horiz {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: visible !important; /* permite bolinhas flutuarem na borda */
}
.cv-node-mid {
  border-top: none !important;
  border-bottom: none !important;
  cursor: grab;
  height: 32px !important;
}
.cv-node-mid:active {
  cursor: grabbing;
}

/* Banda de portas horizontais (uma régua contínua de células) */
.cv-hband {
  display: flex !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  padding: 0 !important;
  flex-wrap: nowrap !important;
  overflow: visible !important;
  background: var(--bg-3) !important;
  min-height: 38px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}
.cv-hband-in {
  border-bottom: 1px solid var(--line-2) !important;
  border-top-left-radius: 9px !important;
  border-top-right-radius: 9px !important;
}
.cv-hband-out {
  border-top: 1px solid var(--line-2) !important;
  border-bottom-left-radius: 9px !important;
  border-bottom-right-radius: 9px !important;
}

/* Célula de cada porta na horizontal */
.cv-hchip {
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 2px !important;
  padding: 4px 4px !important;
  min-width: 0 !important;
  flex: 1 !important; /* divide o espaço igualmente por igual! */
  height: 100% !important;
  background: rgba(255, 255, 255, 0.015) !important;
  border-right: 1px solid var(--line-2) !important;
  box-sizing: border-box !important;
  transition: background 0.12s ease-in-out !important;
}
.cv-hchip:hover {
  background: rgba(255, 255, 255, 0.04) !important;
}
.cv-hchip:last-child {
  border-right: none !important;
}

/* Bordas arredondadas nos cantos internos das bandas horizontais */
.cv-hband-in .cv-hchip:first-child {
  border-top-left-radius: 9px !important;
}
.cv-hband-in .cv-hchip:last-child {
  border-top-right-radius: 9px !important;
}
.cv-hband-out .cv-hchip:first-child {
  border-bottom-left-radius: 9px !important;
}
.cv-hband-out .cv-hchip:last-child {
  border-bottom-right-radius: 9px !important;
}

/* Destaca o tipo de cabo/sinal com uma linda borda de cor sutil na horizontal */
.cv-hband-in .cv-hchip {
  border-top: 2.5px solid var(--pc) !important;
  padding-top: 10px !important;
}
.cv-hband-out .cv-hchip {
  border-bottom: 2.5px solid var(--pc) !important;
  padding-bottom: 10px !important;
}

/* Rótulo da porta na horizontal */
.cv-hchip-lbl {
  font-size: 9px !important;
  font-weight: 500 !important;
  color: var(--txt-2) !important;
  white-space: normal !important;
  word-break: break-word !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  max-width: 100% !important;
  text-align: center !important;
  line-height: 1.15 !important;
  margin: 0 !important;
  padding: 0 2px !important;
}

.cv-hband-in .cv-hchip-lbl { /* removed */ }
.cv-hband-out .cv-hchip-lbl { /* removed */ }

/* Bolinha de ancoragem na horizontal (centralizada e debaixo/cima de forma impecável) */
.cv-hband .cv-port {
  position: absolute !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  margin: 0 !important;
  z-index: 10 !important;
  box-shadow: 0 0 0 1px var(--bg) !important;
}
.cv-hband-in .cv-port {
  top: -5px !important; /* fica metade pra fora no topo */
  bottom: auto !important;
}
.cv-hband-out .cv-port {
  bottom: -5px !important; /* fica metade pra fora na base */
  top: auto !important;
}

/* ===== Modal: "Próprio ou Locado" (perguntarLocacao) — radio cards ===== */
.loc-radios { display: flex; flex-direction: column; gap: 8px; margin-top: 2px; }
.loc-radio {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; background: var(--bg-3); border: 1.5px solid var(--line);
  border-radius: var(--r-md); cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.loc-radio:hover { border-color: var(--line-2); background: var(--bg-2); }
.loc-radio.is-checked { border-color: var(--red); background: rgba(221,42,27,0.06); box-shadow: 0 0 0 3px rgba(221,42,27,0.10); }
.loc-radio input[type="radio"] { width: 16px; height: 16px; accent-color: var(--red); flex-shrink: 0; }
.loc-radio-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; background: var(--bg); border-radius: 8px;
  font-size: 16px; color: var(--txt-2); flex-shrink: 0;
}
.loc-radio-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.loc-radio-text b { font-size: 13.5px; color: var(--txt); font-weight: 600; }
.loc-radio-text i { font-style: normal; font-size: 11.5px; color: var(--txt-3); }

/* Sem fornecedores cadastrados — CTA pra cadastrar agora */
.loc-no-vendors { display: flex; flex-direction: column; gap: 8px; padding: 14px; background: var(--bg-3); border: 1px dashed var(--line-2); border-radius: var(--r-md); }
.loc-no-vendors-msg { font-size: 12.5px; color: var(--txt-2); }
.loc-no-vendors .btn { align-self: flex-start; }

/* Campo com botão "+" ao lado (criar nova opção sem precisar entrar no select) */
.field-with-add { display: flex; gap: 6px; align-items: stretch; }
.field-with-add select { flex: 1; }
.field-add-btn {
  flex-shrink: 0; width: 38px; background: var(--bg-3); border: 1px solid var(--line);
  border-radius: var(--r-sm); color: var(--txt-2); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.field-add-btn:hover { background: var(--red); color: #fff; border-color: var(--red); }

/* Toggle Lista/Grade (patch + pack) */
.view-toggle { display: inline-flex; background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 2px; gap: 1px; }
.view-tg-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 26px; background: transparent; border: none; border-radius: 4px;
  color: var(--txt-3); cursor: pointer; transition: background 0.12s, color 0.12s;
}
.view-tg-btn:hover { color: var(--txt-2); }
.view-tg-btn.is-on { background: var(--bg-2); color: var(--txt); }

/* Patch — modo GRADE */
.pl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; padding: 4px; }
.pl-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; display: flex; flex-direction: column; gap: 9px; border-left: 3px solid var(--cab); }
.pl-card-h { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--txt-3); }
.pl-card-n { color: var(--txt-4); }
.pl-card-cable { display: inline-flex; align-items: center; gap: 6px; flex: 1; color: var(--txt-2); }
.pl-card-id { background: var(--bg-3); padding: 2px 7px; border-radius: 4px; font-size: 10.5px; }
.pl-card-body { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; padding-top: 6px; border-top: 1px solid var(--line-2); }
.pl-card-ep { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pl-card-ep b { font-size: 12.5px; font-weight: 600; color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-card-ep i { font-style: normal; font-size: 10.5px; color: var(--txt-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-card-ar { font-size: 16px; line-height: 1; }
.pl-card-len { font-size: 10.5px; color: var(--txt-3); align-self: flex-end; }

/* Pack — modo GRADE */
.pk-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; transition: border-color 0.12s; }
.pk-card:hover { border-color: var(--line-3); }
.pk-card.is-on { background: rgba(46,204,113,0.05); border-color: rgba(46,204,113,0.3); }
.pk-card-h { display: flex; align-items: center; justify-content: space-between; }
.pk-card-qty { color: var(--txt-2); font-weight: 600; font-size: 13px; }
.pk-card b { font-size: 13px; font-weight: 600; color: var(--txt); }
.pk-card i { font-style: normal; font-size: 11px; color: var(--txt-3); }

/* ===== Touch / Mobile: alvos maiores e gestos ===== */
/* Touch-action: pra o browser NÃO sequestrar gestos (scroll/zoom) sobre node/porta */
.cv-node-head { touch-action: none; }
.cv-port { touch-action: none; }

/* Estende a hit-area da porta com pseudo-elemento invisível.
   O visual continua 10/12/14px, mas o dedo pega numa caixa ~36px.
   Sem isso, no mobile, é quase impossível acertar uma bolinha de 14px. */
.cv-port::after {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
}

@media (hover: none), (max-width: 768px) {
  /* Botões no card precisam ser maiores no touch (28x28 mínimo) */
  .cv-node-del, .cv-node-edit, .cv-node-flip {
    width: 28px; height: 28px;
    top: 2px;
  }
  .cv-node-actions button,
  .cv-node-actions .cv-node-del,
  .cv-node-actions .cv-node-edit,
  .cv-node-actions .cv-node-flip,
  .cv-node-actions .cv-node-orient,
  .cv-node-actions .cv-node-hide {
    width: 28px !important;
    height: 28px !important;
  }
  .cv-node-head, .cv-node-mid {
    padding-right: 11px !important;
    height: 38px !important;
  }
  /* Portas mais clicáveis no toque — visual e hit-area mais generosos */
  .cv-port { width: 16px; height: 16px; }
  .cv-port-l { left: -8px; }
  .cv-port-r { right: -8px; }
  .cv-port::after { inset: -14px; } /* hit-area ~44px no touch */
  /* Botão de flip de porta sempre visível no mobile */
  .cv-pchip-flip { opacity: 0.6; width: 16px; height: 16px; font-size: 10px; }
}

/* ===== Auto-save: indicador discreto ===== */
.cv-bar-save { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--txt-4); transition: color 0.2s; }
.cv-bar-save.is-saving { color: var(--info); }
.cv-bar-save.is-saved { color: var(--ok); }
.cv-bar-save.is-dirty { color: var(--warn); }
.cv-bar-save-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Patch list — agrupamento por loom (#20) */
.pl-loom-toggle.is-on { background: var(--red-soft); color: var(--red); border-color: var(--red-line); }
.pl-loom-head {
  display: flex; align-items: center; gap: 10px;
  margin: 18px 0 8px;
  padding: 10px 14px;
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
}
.pl-loom-head:first-child { margin-top: 0; }
.pl-loom-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  background: var(--bg-2); border-radius: 6px;
  color: var(--red); font-size: 14px;
}
.pl-loom-name { font-size: 13px; color: var(--txt-2); }
.pl-loom-name b { color: var(--txt); font-weight: 600; margin-left: 2px; }
.pl-loom-meta { font-size: 11px; color: var(--txt-4); margin-left: auto; }
@media (max-width: 768px) {
  .pl-loom-head { flex-wrap: wrap; padding: 9px 12px; }
  .pl-loom-meta { margin-left: 0; width: 100%; }
}
