/* ==========================================================================
   CSS v5.1 PRO: DESIGN SYSTEM ESTÁVEL (ZERO JITTER NO HOVER), LINHAS RETAS
   ORTOGONAIS, CONTROLE DE CABOS FLEXÍVEIS E SPLITTERS ÓPTICOS
   ========================================================================== */

:root {
  --bg-deep: #080b12;
  --bg-panel: #0e1422;
  --bg-card: #141c2e;
  --bg-slot: #182238;
  --bg-slot-hover: #1f2c47;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: #00f2fe;
  
  --cyan-neon: #00f2fe;
  --blue-brand: #3b82f6;
  --green-neon: #10b981;
  --red-neon: #ef4444;
  --amber-neon: #f59e0b;
  --purple-neon: #a855f7;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --font-sans: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-deep);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  user-select: none;
}

.app-layout {
  position: relative;
  width: 100vw;
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   TOP NAV BAR HUD COMPACTA (ALTURA MÁX: 52px • SCI-FI GLASSMORPHISM)
   ========================================================================== */
.top-nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  background: rgba(11, 16, 28, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(0, 242, 254, 0.22);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 60;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  cursor: help;
}

.brand-chip {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #fff;
  padding: 3px 6px;
  border-radius: 5px;
  letter-spacing: 0.05em;
}

.brand-headline {
  display: flex;
  align-items: center;
  gap: 6px;
}

.app-name {
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #fff;
}

.version-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(0, 242, 254, 0.12);
  color: var(--cyan-neon);
  border: 1px solid rgba(0, 242, 254, 0.3);
  padding: 1px 5px;
  border-radius: 8px;
}

/* ABAS DE BANDEJA INTEGRADAS (HORIZONTALMENTE DESLIZÁVEIS) */
.tray-tabs-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 4px;
  flex: 1;
  max-width: 520px;
  justify-content: center;
}

.tray-tabs-bar::-webkit-scrollbar {
  display: none;
}

.tray-tab-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.15s;
  height: 32px;
}

.tray-tab-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.15);
}

.tray-tab-btn.active {
  background: rgba(0, 242, 254, 0.14);
  color: #fff;
  border-color: var(--cyan-neon);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.25);
}

.tab-tube-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* DIREITA: CONTROLES DE ZOOM, STATS E MENU PROJETO */
.nav-right-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ZOOM TOOLBAR */
.zoom-toolbar {
  display: flex;
  align-items: center;
  background: rgba(9, 13, 22, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  padding: 2px;
  gap: 2px;
  height: 32px;
}

.btn-zoom {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 3px;
  height: 26px;
}

.btn-zoom:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

#zoom-level-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--cyan-neon);
}

.stat-pill-wrap {
  display: flex;
  align-items: center;
}

.stat-pill {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--green-neon);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.28);
  padding: 4px 9px;
  border-radius: 8px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 32px;
}

/* MENU PROJETO DROPDOWN */
.menu-project-wrapper {
  position: relative;
}

.btn-menu-project {
  background: rgba(2, 132, 199, 0.15);
  border: 1px solid rgba(2, 132, 199, 0.4);
  color: #38bdf8;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0 10px;
  border-radius: 7px;
  height: 32px;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-menu-project:hover,
.btn-menu-project.active {
  background: rgba(2, 132, 199, 0.3);
  border-color: #38bdf8;
  color: #fff;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.menu-project-dropdown {
  position: fixed;
  top: 56px;
  right: 16px;
  width: 280px;
  background: rgba(13, 19, 34, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 242, 254, 0.35);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 25px rgba(0, 242, 254, 0.15);
  border-radius: 12px;
  padding: 8px;
  z-index: 100;
  display: none;
  flex-direction: column;
  gap: 3px;
  animation: dropdownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.menu-project-dropdown.is-open {
  display: flex;
}

@keyframes dropdownFade {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px 8px 8px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--cyan-neon);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 4px;
}

.btn-close-dropdown {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: none; /* Só visível no mobile */
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  color: #e2e8f0;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.dropdown-item .item-icon {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.dropdown-item .item-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.dropdown-item .item-text strong {
  font-size: 0.8rem;
  font-weight: 600;
}

.dropdown-item .item-text small {
  font-size: 0.68rem;
  color: var(--text-dim);
}

.dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 4px 0;
}

.dropdown-item.item-danger {
  color: #fca5a5;
}

.dropdown-item.item-danger:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fff;
}

/* BOTÕES DE AÇÃO GENÉRICOS */
.btn-action {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #fff;
  font-weight: 700;
}

.btn-outline {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border-color: var(--border-subtle);
}

.btn-splitter {
  background: rgba(168, 85, 247, 0.15);
  color: #d8b4fe;
  border-color: rgba(168, 85, 247, 0.35);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

/* ==========================================================================
   VIEWPORT E CONTAINER COM ZOOM
   ========================================================================== */

.workbench-viewport {
  flex: 1;
  overflow: hidden;
  position: relative;
  display: block;
  padding: 0;
  background: 
    radial-gradient(circle at 50% 50%, rgba(18, 25, 42, 0.6) 0%, rgba(8, 11, 18, 0.98) 100%),
    linear-gradient(rgba(0, 242, 254, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 242, 254, 0.035) 1px, transparent 1px);
  background-size: 100% 100%, 24px 24px, 24px 24px;
  user-select: none;
  cursor: grab;
}

.workbench-viewport.is-panning {
  cursor: grabbing !important;
}

.zoomable-container {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
}

/* ==========================================================================
   SPLITTERS ÓPTICOS FLUTUANTES COM ARRASTE E REDIMENSIONAMENTO LIVRE
   ========================================================================== */
.floating-splitter-card,
.splitter-card {
  position: absolute;
  background: #100b21;
  border: 1.5px solid rgba(168, 85, 247, 0.6);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 15px rgba(168, 85, 247, 0.25);
  display: flex;
  flex-direction: column;
  z-index: 25;
  min-width: 340px !important;
  max-width: 800px;
  box-sizing: border-box;
  touch-action: none;
  pointer-events: auto !important;
  transition: box-shadow 0.2s, border-color 0.2s;
  overflow: visible;
}

.floating-splitter-card *,
.spl-drag-handle,
.btn-spl-scale,
.btn-micro-del,
.spl-resize-grip,
.btn-disconnect-out,
.btn-disconnect-in,
.spl-node-pill {
  pointer-events: auto !important;
}

.floating-splitter-card.is-dragging {
  border-color: #00f2fe;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.85), 0 0 25px rgba(0, 242, 254, 0.4);
  cursor: grabbing !important;
}

.spl-drag-handle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: linear-gradient(90deg, #181030, #221445);
  border-bottom: 1px solid rgba(168, 85, 247, 0.25);
  cursor: grab;
  user-select: none;
  border-top-left-radius: 9px;
  border-top-right-radius: 9px;
}

.spl-drag-handle:active {
  cursor: grabbing;
}

.spl-drag-grip {
  color: #a855f7;
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: -2px;
  cursor: grab;
}

.spl-title-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.spl-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 800;
  background: rgba(168, 85, 247, 0.25);
  color: #d8b4fe;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.spl-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spl-size-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-spl-scale {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #d8b4fe;
  font-size: 0.72rem;
  font-weight: 700;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-spl-scale:hover {
  background: rgba(168, 85, 247, 0.3);
  color: #fff;
  border-color: #a855f7;
}

.btn-micro-del {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  opacity: 0.7;
  padding: 2px 4px;
}

.btn-micro-del:hover {
  opacity: 1;
}

.splitter-flow-row {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  padding: 10px;
  gap: 10px;
  flex: 1;
  position: relative;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.spl-in-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.3);
  padding: 6px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  min-width: 65px;
  max-width: 90px;
  flex-shrink: 0;
}

.spl-in-pin-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.spl-in-pin,
.spl-out-pin {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  position: relative;
  border-radius: 50%;
  background: #25334c;
  border: 2px solid #a855f7;
  flex-shrink: 0;
  cursor: pointer;
  z-index: 28;
  transition: transform 0.15s, background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

/* Área de toque expandida (Hitbox >= 32px) para facilitar clique e drag & drop */
.spl-in-pin::after,
.spl-out-pin::after {
  content: '';
  position: absolute;
  top: -7px;
  left: -7px;
  right: -7px;
  bottom: -7px;
  border-radius: 50%;
  cursor: pointer;
}

.spl-in-pin.connected,
.spl-out-pin.connected {
  background: var(--green-neon);
  border-color: #fff;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
}

.spl-in-pin:hover,
.spl-out-pin:hover {
  background: var(--cyan-neon);
  border-color: #fff;
  transform: scale(1.22);
  box-shadow: 0 0 10px var(--cyan-neon), 0 0 4px #fff;
}

.spl-center-divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(168, 85, 247, 0.5);
  font-size: 0.85rem;
  padding: 0 4px;
  flex-shrink: 0;
}

.spl-chip-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: rgba(168, 85, 247, 0.15);
  border: 1px dashed rgba(168, 85, 247, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

.spl-node-pill {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 3px 6px;
  border-radius: 5px;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spl-node-pill.connected {
  background: rgba(16, 185, 129, 0.2);
  color: var(--green-neon);
  border-color: rgba(16, 185, 129, 0.5);
  font-weight: 700;
}

.spl-outputs-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: stretch;
  flex: 1;
  min-width: 140px;
  max-height: 520px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  padding-right: 2px;
}

.spl-out-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 3px 6px;
  border-radius: 5px;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 28px;
}

.spl-out-slot:hover {
  background: rgba(168, 85, 247, 0.2);
  border-color: rgba(168, 85, 247, 0.45);
}

.spl-out-slot.active {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.3);
}

.spl-out-p {
  font-family: var(--font-mono);
  font-weight: 800;
  color: #d8b4fe;
}

.spl-out-status {
  color: var(--text-muted);
  font-size: 0.7rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  text-align: right;
  padding-right: 4px;
}

.spl-out-status.active {
  color: #34d399;
  font-weight: 600;
}

/* BOTÕES DE DESCONECTAR PORTAS (1-TAP INSTANT DISCONNECT) */
.btn-disconnect-out,
.btn-disconnect-in {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #f87171;
  font-size: 0.65rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: all 0.15s;
}

.btn-disconnect-out:hover,
.btn-disconnect-in:hover {
  background: #ef4444;
  color: #fff;
  border-color: #fff;
  transform: scale(1.15);
}

/* ALÇAS DE REDIMENSIONAMENTO ESTILO CAIXA DE IMAGEM / FIGMA */
.spl-resize-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #00f2fe;
  border: 2px solid #ffffff;
  border-radius: 4px;
  box-shadow: 0 0 8px rgba(0, 242, 254, 0.8), 0 2px 6px rgba(0, 0, 0, 0.6);
  z-index: 70;
  pointer-events: auto !important;
  touch-action: none;
  transition: transform 0.1s, background-color 0.1s;
}

.spl-resize-handle:hover {
  transform: scale(1.35);
  background: #38bdf8;
  box-shadow: 0 0 14px rgba(0, 242, 254, 1);
}

.spl-resize-handle.handle-se {
  right: -6px;
  bottom: -6px;
  cursor: nwse-resize;
}

.spl-resize-handle.handle-sw {
  left: -6px;
  bottom: -6px;
  cursor: nesw-resize;
}

.spl-resize-handle.handle-ne {
  right: -6px;
  top: -6px;
  cursor: nesw-resize;
}

.spl-resize-handle.handle-e {
  right: -6px;
  top: 50%;
  margin-top: -12px;
  width: 10px;
  height: 24px;
  border-radius: 3px;
  background: #c084fc;
  cursor: ew-resize;
}

.spl-resize-handle.handle-s {
  bottom: -6px;
  left: 50%;
  margin-left: -12px;
  width: 24px;
  height: 10px;
  border-radius: 3px;
  background: #c084fc;
  cursor: ns-resize;
}

/* ALÇA DE REDIMENSIONAMENTO NO CANTO INFERIOR DIREITO */
.spl-resize-grip {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 24px;
  height: 24px;
  cursor: nwse-resize;
  color: #c084fc;
  font-size: 1.1rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  touch-action: none;
  pointer-events: auto !important;
  z-index: 50;
  background: rgba(168, 85, 247, 0.2);
  border-radius: 4px;
  transition: all 0.15s;
}

.spl-resize-grip:hover {
  background: var(--cyan-neon);
  color: #000;
  transform: scale(1.15);
}

/* PALCO PRINCIPAL (PRANCHETA CAD DE PROJETO LIVRE) */
/* PALCO PRINCIPAL (PRANCHETA CAD INFINITA DE PROJETO LIVRE) */
.cassette-stage {
  width: 3200px;
  min-width: 3200px;
  height: 2400px;
  min-height: 2400px;
  position: relative;
  display: block;
}

.cad-cables-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 20;
}

/* CAMADA DE NOTAS ADESIVAS (STICKY NOTES - Z-INDEX 18 PARA NÃO BLOQUEAR PINOS DE FIBRA) */
.sticky-notes-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 18;
}

.sticky-note-card {
  position: absolute;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 12px rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  pointer-events: auto !important;
  user-select: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 18;
  transition: box-shadow 0.2s, border-color 0.2s;
  overflow: hidden;
  box-sizing: border-box;
  min-width: 160px;
  min-height: 80px;
}

.sticky-note-card.color-yellow,
.sticky-note-card.note-color-yellow {
  background: rgba(234, 179, 8, 0.22);
  border-color: rgba(234, 179, 8, 0.6);
}
.sticky-note-card.color-cyan,
.sticky-note-card.note-color-cyan {
  background: rgba(6, 182, 212, 0.22);
  border-color: rgba(6, 182, 212, 0.6);
}
.sticky-note-card.color-green,
.sticky-note-card.note-color-green {
  background: rgba(34, 197, 94, 0.22);
  border-color: rgba(34, 197, 94, 0.6);
}
.sticky-note-card.color-purple,
.sticky-note-card.note-color-purple {
  background: rgba(168, 85, 247, 0.22);
  border-color: rgba(168, 85, 247, 0.6);
}

.note-drag-handle,
.note-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.45);
  cursor: grab;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  user-select: none;
}
.note-drag-handle:active,
.note-header:active {
  cursor: grabbing;
}
.note-drag-grip,
.note-grip {
  font-size: 0.85rem;
  color: var(--cyan-neon);
  opacity: 0.85;
  margin-right: 4px;
}
.note-title-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  overflow: hidden;
}
.note-card-title {
  font-size: 0.76rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.note-tools,
.note-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.btn-note-color {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  cursor: pointer;
  padding: 1px 4px;
  font-size: 0.75rem;
  transition: transform 0.15s;
}
.btn-note-color:hover {
  transform: scale(1.15);
}
.btn-note-del {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
  opacity: 0.7;
  padding: 0 2px;
}
.btn-note-del:hover {
  opacity: 1;
}

.note-body-content {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.note-textarea {
  flex: 1 1 auto;
  height: 100%;
  background: transparent;
  border: none;
  outline: none;
  padding: 8px 10px 20px 10px;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  line-height: 1.45;
  resize: none;
  width: 100%;
  box-sizing: border-box;
}

.btn-note-scale {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
  padding: 0 4px;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.4;
  transition: all 0.15s;
}
.btn-note-scale:hover {
  background: rgba(0, 242, 254, 0.25);
  border-color: var(--cyan-neon);
  color: var(--cyan-neon);
}

.note-resize-grip {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.45);
  cursor: nwse-resize;
  user-select: none;
  touch-action: none;
  z-index: 25;
  transition: color 0.15s, transform 0.15s;
  pointer-events: auto !important;
}
.note-resize-grip:hover {
  color: var(--cyan-neon);
  transform: scale(1.25);
}

.note-resize-handle.handle-se {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 24px;
  height: 24px;
  cursor: nwse-resize;
  z-index: 26;
  touch-action: none;
  pointer-events: auto !important;
}

/* MINIMAPA RADAR FLUTUANTE RETRÁTIL */
.cad-minimap {
  position: fixed;
  bottom: 68px;
  right: 18px;
  width: 170px;
  height: 120px;
  background: rgba(13, 19, 34, 0.92);
  border: 1.5px solid rgba(0, 242, 254, 0.35);
  border-radius: 8px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7);
  z-index: 55;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.cad-minimap.is-minimized {
  height: 26px !important;
  width: 140px !important;
  border-bottom: 1.5px solid rgba(0, 242, 254, 0.35);
}

.cad-minimap.is-minimized .minimap-canvas-wrapper {
  display: none !important;
}

.minimap-title {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--cyan-neon);
  background: rgba(0, 0, 0, 0.55);
  padding: 4px 8px;
  border-bottom: 1px solid rgba(0, 242, 254, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.btn-toggle-minimap {
  background: transparent;
  border: none;
  color: var(--cyan-neon);
  cursor: pointer;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.85rem;
  line-height: 1;
  padding: 0 4px;
  border-radius: 3px;
  transition: background 0.15s;
}

.btn-toggle-minimap:hover {
  background: rgba(0, 242, 254, 0.2);
}

.minimap-canvas-wrapper {
  position: relative;
  flex: 1;
  cursor: pointer;
}

#minimap-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.minimap-view-rect {
  position: absolute;
  border: 1.5px solid var(--cyan-neon);
  background: rgba(0, 242, 254, 0.18);
  pointer-events: none;
  border-radius: 2px;
}

/* PÍLULA RETRÁTIL DO MINIMAPA NO MOBILE */
.mobile-minimap-pill {
  display: none;
  position: fixed;
  bottom: 72px;
  right: 14px;
  z-index: 54;
  background: rgba(13, 19, 34, 0.94);
  border: 1.5px solid rgba(0, 242, 254, 0.4);
  border-radius: 20px;
  padding: 5px 12px;
  color: var(--cyan-neon);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6), 0 0 10px rgba(0, 242, 254, 0.2);
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
}

.mobile-minimap-pill:hover,
.mobile-minimap-pill.is-active {
  background: rgba(0, 242, 254, 0.2);
  border-color: var(--cyan-neon);
  color: #fff;
  transform: translateY(-2px);
}

/* ==========================================================================
   SIMULAÇÃO REALISTA DE ONDAS ÓPTICAS E ESPECTRO DE FREQUÊNCIAS (VFL / GPON / DWDM)
   ========================================================================== */
@keyframes waveFlowForward {
  0% {
    stroke-dashoffset: var(--wave-period, 48px);
  }
  100% {
    stroke-dashoffset: 0;
  }
}

@keyframes waveFlowReverse {
  0% {
    stroke-dashoffset: 0;
  }
  100% {
    stroke-dashoffset: var(--wave-period, 48px);
  }
}

@keyframes waveHaloPulse {
  0%, 100% {
    opacity: 0.4;
    stroke-width: 7px;
  }
  50% {
    opacity: 0.85;
    stroke-width: 11px;
  }
}

.optical-wave-container {
  pointer-events: none;
}

.optical-wave-halo {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 8px;
  opacity: 0.45;
  filter: blur(4px);
  animation: waveHaloPulse 1.8s ease-in-out infinite;
}

.optical-wave-stream {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3.8px;
}

.optical-wave-stream.flow-forward {
  animation: waveFlowForward var(--wave-speed, 0.9s) linear infinite;
}

.optical-wave-stream.flow-reverse {
  animation: waveFlowReverse var(--wave-speed, 0.9s) linear infinite;
}

/* Modulações e Formatos de Onda */
.optical-wave-stream.shape-square {
  stroke-linecap: square !important;
  stroke-linejoin: miter !important;
}

.optical-wave-stream.shape-laser_beam {
  stroke-width: 5.2px !important;
}

.optical-wave-stream.shape-pulse {
  stroke-width: 4.5px !important;
}

.optical-photon-packet {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.8px;
  opacity: 0.95;
  filter: drop-shadow(0 0 3px #ffffff) drop-shadow(0 0 8px #ffffff);
}

.optical-photon-packet.flow-forward {
  animation: waveFlowForward var(--wave-speed, 0.9s) linear infinite;
}

.optical-photon-packet.flow-reverse {
  animation: waveFlowReverse var(--wave-speed, 0.9s) linear infinite;
}

/* Compatibilidade legada */
.vfl-pulsing-wire {
  stroke-width: 3px !important;
}

.vfl-active-pin {
  box-shadow: 0 0 15px var(--vfl-pin-color, #00f2fe), 0 0 25px var(--vfl-pin-glow, rgba(0, 242, 254, 0.7)) !important;
  background: var(--vfl-pin-color, #00f2fe) !important;
  transform: scale(1.3) !important;
}

.vfl-source-pin {
  box-shadow: 0 0 20px #ff003c, 0 0 30px rgba(255, 0, 60, 0.8) !important;
  background: #ff003c !important;
  transform: scale(1.35) !important;
  animation: vflSourcePulse 0.9s ease-in-out infinite alternate;
}

@keyframes vflSourcePulse {
  0% { transform: scale(1.2); box-shadow: 0 0 12px #ff003c; }
  100% { transform: scale(1.42); box-shadow: 0 0 28px #ff003c, 0 0 45px rgba(255, 0, 60, 0.8); }
}

/* GRUPO VFL NA DOCK & SELETOR DE COMPRIMENTO DE ONDA */
.dock-vfl-group {
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 2px;
}

.dock-btn-lambda {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid rgba(0, 242, 254, 0.35);
  border-radius: 6px;
  padding: 4px 6px;
  cursor: pointer;
  color: #fff;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 58px;
  user-select: none;
}

.dock-btn-lambda:hover,
.dock-btn-lambda.active {
  background: rgba(0, 242, 254, 0.25);
  border-color: var(--cyan-neon);
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.4);
}

.lambda-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--cyan-neon);
  letter-spacing: 0.5px;
}

.lambda-chevron {
  font-size: 0.6rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1;
}

/* POPOVER DO SELETOR DE FREQUÊNCIA E COMPRIMENTO DE ONDA */
.popover-wavelength-card {
  position: fixed;
  bottom: 74px;
  left: 50%;
  transform: translateX(-50%);
  width: 490px;
  max-width: 95vw;
  background: rgba(13, 19, 34, 0.96);
  border: 1.5px solid rgba(0, 242, 254, 0.4);
  border-radius: 12px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.88), 0 0 25px rgba(0, 242, 254, 0.2);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 60;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: popoverFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.popover-wavelength-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wavelength-hint {
  font-size: 0.75rem;
  color: #94a3b8;
  margin: 0;
  line-height: 1.35;
}

.wavelength-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 8px;
  max-height: 380px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 242, 254, 0.3) transparent;
}

.wavelength-card-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.15s ease;
  user-select: none;
}

.wavelength-card-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(0, 242, 254, 0.5);
  transform: translateY(-2px);
}

.wavelength-card-item.active {
  background: rgba(0, 242, 254, 0.15);
  border-color: var(--cyan-neon);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.25);
}

.wl-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wl-name-tag {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
}

.wl-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 6px currentColor;
}

.wl-band-badge {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  font-family: var(--font-mono);
}

.wl-label-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #f1f5f9;
}

.wl-desc-text {
  font-size: 0.68rem;
  color: #94a3b8;
  line-height: 1.25;
}

/* SEÇÃO DE FORMATO E TIPO DA ONDA (SENOIDAL, DIGITAL, FÓTONS, OTDR) */
.wave-shapes-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.wave-shapes-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--cyan-neon);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.wave-shapes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.wave-shape-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 8px 10px;
  color: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.75rem;
  transition: all 0.15s ease;
  user-select: none;
  text-align: left;
}

.wave-shape-btn:hover {
  background: rgba(0, 242, 254, 0.12);
  border-color: rgba(0, 242, 254, 0.4);
  transform: translateY(-1px);
}

.wave-shape-btn.active {
  background: rgba(0, 242, 254, 0.22);
  border-color: var(--cyan-neon);
  box-shadow: 0 0 14px rgba(0, 242, 254, 0.35);
}

.wave-shape-btn-top {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}

.wave-shape-btn-desc {
  font-size: 0.65rem;
  color: #94a3b8;
  line-height: 1.2;
}

/* ==========================================================================
   CARDS DE CABO MÓVEIS E REDIMENSIONÁVEIS (ESTILO DIAGRAMA FTTH / FIGMA)
   ========================================================================== */
.movable-cable-card {
  position: absolute;
  background: #0d1322;
  border: 1.5px solid rgba(56, 189, 248, 0.4);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.75), 0 0 15px rgba(56, 189, 248, 0.15);
  display: flex;
  flex-direction: column;
  z-index: 20;
  min-width: 285px;
  max-width: 800px;
  box-sizing: border-box;
  touch-action: none;
  pointer-events: auto !important;
  transition: box-shadow 0.2s, border-color 0.2s;
  overflow: visible;
}

.movable-cable-card.cable-side-in {
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.75), 0 0 15px rgba(16, 185, 129, 0.15);
}

.movable-cable-card.is-dragging {
  border-color: #00f2fe;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.85), 0 0 25px rgba(0, 242, 254, 0.4);
  cursor: grabbing !important;
}

/* Modo Compacto de Alta Densidade (permite cabos menores sem cortar fibras) */
.movable-cable-card.cable-compact .fiber-slot-row {
  min-height: 28px !important;
  height: 28px !important;
  padding: 2px 8px !important;
}
.movable-cable-card.cable-compact .slot-number {
  font-size: 0.65rem !important;
  padding: 1px 4px !important;
}
.movable-cable-card.cable-compact .slot-name {
  font-size: 0.72rem !important;
}
.movable-cable-card.cable-compact .slot-pin {
  width: 14px !important;
  height: 14px !important;
}
.movable-cable-card.cable-compact .btn-micro-vfl,
.movable-cable-card.cable-compact .btn-micro-tag {
  font-size: 0.65rem !important;
  padding: 0 2px !important;
}

.cable-drag-handle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: linear-gradient(90deg, #131c31, #1e293b);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  cursor: grab;
  user-select: none;
  border-top-left-radius: 9px;
  border-top-right-radius: 9px;
}

.cable-drag-handle:active {
  cursor: grabbing;
}

.cable-drag-grip {
  color: #38bdf8;
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: -2px;
  cursor: grab;
}

.cable-title-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.cable-dir-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.cable-dir-tag.dir-in {
  background: rgba(16, 185, 129, 0.2);
  color: var(--green-neon);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.cable-dir-tag.dir-out {
  background: rgba(56, 189, 248, 0.2);
  color: var(--cyan-neon);
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.cable-card-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cable-size-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-cable-scale {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #38bdf8;
  font-size: 0.72rem;
  font-weight: 700;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-cable-scale:hover {
  background: rgba(56, 189, 248, 0.3);
  color: #fff;
  border-color: #38bdf8;
}

.cable-body-slots,
.fiber-list-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.25) transparent;
  padding-right: 4px;
}

.cable-body-slots::-webkit-scrollbar,
.fiber-list-container::-webkit-scrollbar,
.tube-fibers-list::-webkit-scrollbar {
  width: 4px;
}

.cable-body-slots::-webkit-scrollbar-track,
.fiber-list-container::-webkit-scrollbar-track,
.tube-fibers-list::-webkit-scrollbar-track {
  background: transparent;
}

.cable-body-slots::-webkit-scrollbar-thumb,
.fiber-list-container::-webkit-scrollbar-thumb,
.tube-fibers-list::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.25);
  border-radius: 9999px;
}

.cable-body-slots::-webkit-scrollbar-thumb:hover,
.fiber-list-container::-webkit-scrollbar-thumb:hover,
.tube-fibers-list::-webkit-scrollbar-thumb:hover {
  background: rgba(56, 189, 248, 0.55);
}

.cable-resize-grip {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 22px;
  height: 22px;
  cursor: nwse-resize;
  color: #38bdf8;
  font-size: 1rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  touch-action: none;
  pointer-events: auto !important;
  z-index: 50;
  background: rgba(56, 189, 248, 0.15);
  border-radius: 4px;
  transition: all 0.15s;
}

.cable-resize-grip:hover {
  background: var(--cyan-neon);
  color: #000;
  transform: scale(1.15);
}

/* CARDS DE CABO LEGADOS (COMPATIBILIDADE) */
.cable-block {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.block-header {
  padding: 12px 16px;
  background: #111827;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.block-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.port-direction-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

.dir-in {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.dir-out {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.block-cable-name {
  font-size: 0.92rem;
  font-weight: 800;
  color: #fff;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cable-cap-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  background: #1f2d45;
  color: #38bdf8;
  padding: 2px 6px;
  border-radius: 4px;
}

.block-tube-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.tube-color-box {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}

.tube-dot-multi {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(90deg, #00cc66, #ffeb3b, #ffffff);
  display: inline-block;
}

.btn-cable-settings {
  align-self: flex-start;
  margin-top: 4px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
}

.btn-cable-settings:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* LISTA DE FIBRAS */
.fiber-slots-list {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.fiber-slot-row {
  min-height: 42px;
  height: auto;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--bg-slot);
  border: 1px solid transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  gap: 8px;
  position: relative;
}

.fiber-slot-row:hover {
  background: var(--bg-slot-hover);
  border-color: rgba(0, 242, 254, 0.3);
}

.fiber-slot-row.selected-pending,
.fiber-slot-row.tap-pending-slot {
  background: rgba(0, 242, 254, 0.22) !important;
  border-color: var(--cyan-neon) !important;
  box-shadow: 0 0 14px rgba(0, 242, 254, 0.4) !important;
}

.fiber-slot-row.fused {
  background: #142236;
}

.fiber-badge {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fiber-inner-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
}

.fiber-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.fiber-primary-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.fiber-color-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

.fiber-sub-meta {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.fiber-custom-tag {
  font-size: 0.68rem;
  color: var(--amber-neon);
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 2px 6px;
  border-radius: 4px;
  align-self: flex-start;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.btn-tag-fiber {
  background: transparent;
  border: none;
  font-size: 0.75rem;
  cursor: pointer;
  opacity: 0.4;
  padding: 2px;
}

.fiber-slot-row:hover .btn-tag-fiber {
  opacity: 1;
}

.slot-pin {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  position: relative;
  border-radius: 50%;
  background: #25334c;
  border: 2px solid #526789;
  flex-shrink: 0;
  cursor: pointer;
  z-index: 28;
  transition: transform 0.15s, background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

/* Área de toque expandida (Hitbox >= 32px) para facilitar clique e drag & drop */
.slot-pin::after {
  content: '';
  position: absolute;
  top: -7px;
  left: -7px;
  right: -7px;
  bottom: -7px;
  border-radius: 50%;
  cursor: pointer;
}

.slot-pin:hover,
.fiber-slot-row:hover .slot-pin:not(.connected),
.fiber-slot-row.selected-pending .slot-pin {
  background: var(--cyan-neon);
  border-color: #fff;
  transform: scale(1.25);
  box-shadow: 0 0 10px var(--cyan-neon), 0 0 4px #fff;
}

.slot-pin.connected {
  background: var(--green-neon) !important;
  border-color: #fff !important;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8) !important;
}

.slot-pin.pin-left {
  margin-right: 2px;
}

.slot-pin.pin-right {
  margin-left: 2px;
}

/* CLIQUE-PARA-CONECTAR (TAP-TO-CONNECT): PINO SELECIONADO PULSANDO EM NEON */
.tap-pending-pin,
.slot-pin.tap-pending-pin,
.spl-in-pin.tap-pending-pin,
.spl-out-pin.tap-pending-pin {
  box-shadow: 0 0 14px #00f2fe, 0 0 25px #00f2fe !important;
  background: #00f2fe !important;
  border-color: #ffffff !important;
  transform: scale(1.35) !important;
  animation: tapPendingPulse 0.8s ease-in-out infinite alternate !important;
}

@keyframes tapPendingPulse {
  from {
    transform: scale(1.2);
    box-shadow: 0 0 8px #00f2fe;
  }
  to {
    transform: scale(1.45);
    box-shadow: 0 0 22px #00f2fe, 0 0 35px #38bdf8;
  }
}

/* VISIBILIDADE CRÍTICA EM DARK MODE: FIBRA 9 (PRETA) E FIBRA 3 (BRANCA) */
.fiber-badge[data-fiber-name="Preto"],
.fiber-slot-row[data-fiber-id="9"] .fiber-badge {
  background-color: #1e293b !important;
  border: 2px solid #cbd5e1 !important;
  box-shadow: 0 0 0 1.5px #94a3b8, 0 0 8px rgba(255, 255, 255, 0.45) !important;
}

.fiber-badge[data-fiber-name="Branco"],
.fiber-slot-row[data-fiber-id="3"] .fiber-badge {
  background-color: #f8fafc !important;
  border: 2px solid #94a3b8 !important;
  box-shadow: 0 0 0 1px #64748b, 0 0 8px rgba(255, 255, 255, 0.6) !important;
}

.trace-visible-wire.wire-black {
  stroke: #475569 !important;
  filter: drop-shadow(0 0 2px #ffffff) drop-shadow(0 0 4px #94a3b8) !important;
}

.trace-visible-wire.wire-white {
  stroke: #f8fafc !important;
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.95)) !important;
}

.tube-separator-bar {
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.03);
  border-left: 4px solid #fff;
  border-radius: 4px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  margin: 6px 0 2px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.out-cable-bar {
  border-left-color: #a855f7;
  background: rgba(168, 85, 247, 0.06);
}

.btn-micro-edit {
  margin-left: auto;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
  opacity: 0.7;
}

.btn-micro-edit:hover {
  opacity: 1;
}

.tube-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.empty-cable-msg {
  padding: 20px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  margin: 10px;
}

/* ==========================================================================
   BANDEJA CENTRAL (CASSETTE) COM SVG ESTÁVEL
   ========================================================================== */

.cassette-center {
  background: #0b101c;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  min-height: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.6);
}

.cassette-header {
  padding: 10px;
  text-align: center;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}

.cassette-title {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: var(--cyan-neon);
}

.cassette-sub {
  font-size: 0.68rem;
  color: var(--text-dim);
}

.cassette-tray-body {
  flex: 1;
  min-height: 560px;
  position: relative;
  display: block;
  overflow: visible;
}

.tray-alignment-guide {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  height: 100%;
  border-left: 1px dashed rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.floating-splitters-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 20;
}

#cassette-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 50;
}

/* LINHAS SVG - ESTABILIDADE ABSOLUTA (CORREÇÃO TOTAL DA IMAGEM 1) */
.trace-visible-wire {
  fill: none;
  stroke-width: 2.8px;
  stroke-linecap: butt;
  stroke-linejoin: round;
  transition: stroke 0.15s, filter 0.15s;
  pointer-events: none;
}

.trace-hit-path {
  fill: none;
  stroke: transparent;
  stroke-width: 14px;
  cursor: pointer;
  pointer-events: all;
}

/* ZERO JITTER / ZERO OVERLAP */
.fusion-trace-item:hover .trace-visible-wire,
.trace-visible-wire.highlighted {
  stroke-width: 3.2px !important;
  filter: drop-shadow(0 0 3px #00f2fe);
}

.trace-sleeve-node {
  cursor: pointer;
  pointer-events: all;
  transition: none;
}

.trace-sleeve-node rect {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.7));
  transition: transform 0.15s, stroke 0.15s;
}

.fusion-trace-item:hover .trace-sleeve-node rect,
.trace-sleeve-node.highlighted rect,
.trace-sleeve-node:hover rect {
  stroke: #00f2fe !important;
  stroke-width: 1.8px !important;
}

.sleeve-label-text {
  display: none; /* Rótulos longos no HUD Bar para nunca sobrepor tubetes */
}

/* ==========================================================================
   WAYPOINTS INTERATIVOS ESTILO GOOGLE MAPS (PUXAR LINHAS LIVREMENTE)
   ========================================================================== */
.wire-waypoint-group {
  cursor: grab;
  pointer-events: all;
}

.waypoint-handle {
  fill: #ffffff;
  stroke: #00f2fe;
  stroke-width: 2.5px;
  cursor: grab;
  pointer-events: all;
  filter: drop-shadow(0 0 4px rgba(0, 242, 254, 0.8));
  transition: r 0.15s cubic-bezier(0.4, 0, 0.2, 1), stroke-width 0.15s, fill 0.15s;
  touch-action: none;
}

.waypoint-handle:hover {
  r: 9px !important;
  fill: #00f2fe;
  stroke: #ffffff;
  stroke-width: 3px;
  filter: drop-shadow(0 0 8px #00f2fe);
}

.waypoint-handle.is-dragging {
  cursor: grabbing !important;
  r: 10px !important;
  fill: #38bdf8;
  stroke: #ffffff;
  stroke-width: 3.5px;
  filter: drop-shadow(0 0 12px rgba(56, 189, 248, 1));
}

.waypoint-handle.custom-waypoint {
  fill: #ffeb3b;
  stroke: #f59e0b;
  filter: drop-shadow(0 0 5px rgba(245, 158, 11, 0.8));
}

.waypoint-handle.custom-waypoint:hover {
  fill: #f59e0b;
  stroke: #ffffff;
}

/* BOTÕES DE AÇÃO MICRO E PRESETS */
.btn-micro-action {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(168, 85, 247, 0.4);
  background: rgba(168, 85, 247, 0.15);
  color: #e9d5ff;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-micro-action:hover {
  background: rgba(168, 85, 247, 0.35);
  color: #fff;
}

.spl-actions-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.elastic-fusion-preview {
  fill: none;
  stroke: var(--cyan-neon);
  stroke-width: 2.5px;
  stroke-dasharray: 6, 4;
  animation: dashGlow 0.8s linear infinite;
  pointer-events: none;
}

@keyframes dashGlow {
  from { stroke-dashoffset: 20; }
  to { stroke-dashoffset: 0; }
}

/* ==========================================================================
   RODAPÉ E MODAIS
   ========================================================================== */

.app-footer {
  background: var(--bg-panel);
  border-top: 1px solid var(--border-subtle);
  padding: 8px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.74rem;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.legend-badge {
  font-weight: 700;
  color: var(--text-muted);
  margin-right: 4px;
}

.c-tag {
  background: rgba(255, 255, 255, 0.05);
  border-left: 3px solid var(--c);
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: #fff;
}

.btn-subtle {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.74rem;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
}

.btn-subtle:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* MODAIS */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  padding: 16px;
}

.modal-backdrop.is-open {
  opacity: 1;
  pointer-events: all;
}

.modal-card {
  background: #111827;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  width: 100%;
  max-width: 460px;
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7);
}

.modal-top {
  padding: 14px 18px;
  background: #162032;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-group label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.field-group input,
.field-group select,
.field-group textarea {
  background: #090d16;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 8px 12px;
  color: #fff;
  font-size: 0.88rem;
  font-family: var(--font-sans);
}

.fusion-info-box {
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.2);
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  color: #e2e8f0;
}

.modal-bottom {
  padding: 12px 18px;
  background: #0c121e;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* TOASTS */
.toast-stack {
  position: fixed;
  top: 65px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
  max-width: 90%;
}

.toast-msg {
  background: rgba(17, 24, 39, 0.95);
  border: 1px solid var(--cyan-neon);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.82rem;
  color: #fff;
  text-align: center;
}

.toast-msg.fade-out {
  opacity: 0;
  transition: opacity 0.3s;
}

/* ==========================================================================
   MODAL: RELATÓRIO TÉCNICO DE FUSÃO DA CEO (FICHA DE CAMPO / PDF)
   ========================================================================== */
.modal-tech-card {
  max-width: 920px !important;
  width: 95% !important;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.tech-report-body {
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.report-header-box {
  background: rgba(17, 24, 39, 0.85);
  border: 1px solid rgba(0, 242, 254, 0.3);
  border-radius: 8px;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.report-title-grp h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  margin: 0;
}

.report-title-grp p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 4px 0 0;
}

.report-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.report-stat-card {
  background: #111827;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
}

.report-stat-val {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--cyan-neon);
  font-family: var(--font-mono);
}

.report-stat-lbl {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 4px;
}

.report-table-section h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #c084fc;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  background: #0f1523;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.report-table th {
  background: #1a2234;
  color: #94a3b8;
  font-weight: 700;
  text-align: left;
  padding: 8px 10px;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.report-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
}

.report-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.pill-color-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
}

.pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

/* ==========================================================================
   ESTRUTURA HIERÁRQUICA ABNT: TUBOS LOOSE NOS CABOS
   ========================================================================== */
.cable-tube-group {
  margin-bottom: 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.cable-tube-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  background: rgba(0, 0, 0, 0.45);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.72rem;
}

.tube-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tube-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
}

.tube-label {
  font-family: var(--font-sans);
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
}

.tube-range-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--cyan-neon);
  background: rgba(0, 242, 254, 0.12);
  border: 1px solid rgba(0, 242, 254, 0.25);
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.tube-fibers-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 4px;
}

.fiber-tube-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.05);
  margin-left: 4px;
}

/* BOTÃO MICRO VFL NO SLOT DA FIBRA */
.btn-micro-vfl {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.78rem;
  opacity: 0.45;
  padding: 0 3px;
  border-radius: 3px;
  transition: all 0.15s;
  flex-shrink: 0;
}

.btn-micro-vfl:hover,
.btn-micro-vfl.active {
  opacity: 1;
  background: rgba(239, 68, 68, 0.35);
  transform: scale(1.2);
  filter: drop-shadow(0 0 5px #ef4444);
}

/* FONTE DO LASER VFL ATIVA (CANETA ÓPTICA INJETADA) */
.vfl-source-pin {
  box-shadow: 0 0 16px #ef4444, 0 0 30px #ef4444 !important;
  background: #ef4444 !important;
  border-color: #ffffff !important;
  transform: scale(1.4) !important;
  animation: vflSourcePulse 0.7s ease-in-out infinite alternate !important;
}

@keyframes vflSourcePulse {
  from {
    transform: scale(1.2);
    box-shadow: 0 0 10px #ef4444, 0 0 20px #ef4444;
  }
  to {
    transform: scale(1.5);
    box-shadow: 0 0 25px #ff0055, 0 0 45px #ff0055;
  }
}

.vfl-source-active {
  background: rgba(239, 68, 68, 0.22) !important;
  border-color: rgba(239, 68, 68, 0.6) !important;
}

.workbench-viewport.is-vfl-mode {
  cursor: crosshair !important;
}

/* PRÉ-VISUALIZAÇÃO DE TUBOS LOOSE NO MODAL DO CABO */
.cable-tubes-preview-box {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  background: #090d16;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  min-height: 40px;
}

.preview-tube-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
}

.preview-tube-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

@media print {
  body.printing-tech-report * {
    visibility: hidden;
  }
  body.printing-tech-report #modal-tech-report,
  body.printing-tech-report #modal-tech-report * {
    visibility: visible;
  }
  #modal-tech-report {
    position: absolute;
    inset: 0;
    width: 100% !important;
    background: #ffffff !important;
    color: #000000 !important;
    padding: 0 !important;
    display: block !important;
  }
  .modal-tech-card {
    background: #ffffff !important;
    color: #000000 !important;
    border: none !important;
    box-shadow: none !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  .report-header-box,
  .report-stat-card,
  .report-table {
    background: #ffffff !important;
    color: #000000 !important;
    border: 1px solid #ccc !important;
  }
  .report-table th {
    background: #f1f5f9 !important;
    color: #000000 !important;
  }
  .report-table td {
    color: #000000 !important;
    border-bottom: 1px solid #e2e8f0 !important;
  }
  .modal-top button,
  .modal-bottom {
    display: none !important;
  }
}

/* ==========================================================================
   PRANCHETA LIMPA • ESTADO VAZIO (EMPTY STATE SCI-FI CAD)
   ========================================================================== */
.canvas-empty-state-card {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 580px;
  max-width: 90vw;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 242, 254, 0.45);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.85), 0 0 35px rgba(0, 242, 254, 0.22);
  border-radius: 14px;
  padding: 26px 30px;
  z-index: 60;
  pointer-events: auto !important;
  animation: fadeInEmptyCard 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.canvas-empty-state-card * {
  pointer-events: auto !important;
}

.empty-state-buttons button {
  pointer-events: auto !important;
  cursor: pointer !important;
  user-select: none;
}

@keyframes fadeInEmptyCard {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 14px)) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.empty-state-badge {
  display: inline-block;
  background: rgba(0, 242, 254, 0.15);
  border: 1px solid var(--cyan-neon);
  color: var(--cyan-neon);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.empty-state-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.empty-state-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
}

.empty-state-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-subtle-danger {
  color: #f87171 !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
}

.btn-subtle-danger:hover {
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: #ef4444 !important;
  color: #fff !important;
}

/* ==========================================================================
   DOCK FLUTUANTE DE CRIAÇÃO E FERRAMENTAS CAD (ESTILO macOS / FIGMA)
   ========================================================================== */
.cad-action-dock {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(13, 19, 34, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(0, 242, 254, 0.3);
  border-radius: 40px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.75), 0 0 20px rgba(0, 242, 254, 0.15);
  padding: 5px 10px;
  display: flex;
  align-items: center;
  gap: 5px;
  z-index: 55;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.dock-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 30px;
  padding: 6px 14px;
  color: #e2e8f0;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s ease;
  height: 36px;
  white-space: nowrap;
  user-select: none;
}

.dock-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  transform: translateY(-2px);
}

.dock-btn:active {
  transform: translateY(0);
}

.dock-btn.is-active,
.dock-btn.active {
  background: rgba(0, 242, 254, 0.22);
  border-color: var(--cyan-neon);
  color: var(--cyan-neon);
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.35);
}

.dock-btn-splitter {
  color: #d8b4fe;
}

.dock-btn-splitter:hover {
  background: rgba(168, 85, 247, 0.22);
  border-color: #a855f7;
  color: #fff;
}

.dock-btn-primary {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--green-neon);
}

.dock-btn-primary:hover {
  background: rgba(16, 185, 129, 0.3);
  border-color: var(--green-neon);
  color: #fff;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.4);
}

.dock-icon {
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dock-label {
  font-size: 0.76rem;
  font-weight: 700;
}

.dock-divider {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 3px;
  flex-shrink: 0;
}

/* ==========================================================================
   GAVETA FLUTUANTE RETRÁTIL: CÓDIGO ABNT NBR 14106 (ALTO CONTRASTE)
   ========================================================================== */
.floating-abnt-drawer {
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 56;
  width: min(92vw, 680px);
  background: rgba(13, 19, 34, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(0, 242, 254, 0.35);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 25px rgba(0, 242, 254, 0.15);
  padding: 10px 14px;
  display: none;
  flex-direction: column;
  gap: 8px;
  animation: dropdownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-abnt-drawer.is-open {
  display: flex;
}

.abnt-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 6px;
}

.drawer-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--cyan-neon);
  letter-spacing: 0.05em;
}

.btn-close-drawer {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
  border-radius: 4px;
  transition: all 0.15s;
}

.btn-close-drawer:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.abnt-colors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
  gap: 6px;
}

.c-tag {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 4px solid var(--c);
  color: #f1f5f9;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* ALTO CONTRASTE CORRIGIDO DA FIBRA 3 (BRANCO) */
.c-tag.tag-branco {
  border-left: 4px solid #ffffff !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  background: rgba(255, 255, 255, 0.18) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  text-shadow: 0 0 4px #000, 0 0 8px rgba(255, 255, 255, 0.6) !important;
}

/* ALTO CONTRASTE DA FIBRA 9 (PRETO) */
.c-tag.tag-preto {
  border-left: 4px solid #94a3b8 !important;
  color: #f8fafc !important;
  background: rgba(0, 0, 0, 0.6) !important;
  border: 1px solid #475569 !important;
  text-shadow: 0 0 3px #000 !important;
}

/* ==========================================================================
   POPOVER FLUTUANTE DE DICAS E ATALHOS
   ========================================================================== */
.popover-tips-card {
  position: fixed;
  bottom: 70px;
  right: 20px;
  z-index: 56;
  width: min(92vw, 360px);
  background: rgba(13, 19, 34, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 25px rgba(245, 158, 11, 0.15);
  padding: 12px 14px;
  display: none;
  flex-direction: column;
  gap: 8px;
  animation: dropdownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.popover-tips-card.is-open {
  display: flex;
}

.popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(245, 158, 11, 0.2);
  padding-bottom: 6px;
}

.popover-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--amber-neon);
}

.btn-close-popover {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
  border-radius: 4px;
  transition: all 0.15s;
}

.btn-close-popover:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.popover-body {
  font-size: 0.78rem;
  line-height: 1.5;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.popover-body p {
  margin: 0;
}

.popover-body strong {
  color: #fff;
}

/* ==========================================================================
   RESPONSIVIDADE CAD HUD (MOBILE < 768px & < 480px)
   ========================================================================== */
@media (max-width: 768px) {
  .top-nav {
    padding: 0 10px;
    height: 48px;
    gap: 8px;
  }

  .brand-chip {
    font-size: 0.65rem;
    padding: 2px 4px;
  }

  .app-name {
    font-size: 0.88rem;
  }

  .version-badge {
    display: none;
  }

  /* ABAS DE BANDEJA NO MOBILE: FAIXA FINA DESLIZÁVEL ABAIXO DO HEADER */
  .tray-tabs-bar {
    position: absolute;
    top: 48px;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    background: rgba(11, 16, 28, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 242, 254, 0.18);
    justify-content: flex-start;
    padding: 4px 10px;
    z-index: 58;
    height: 36px;
    box-sizing: border-box;
  }

  .tray-tab-btn {
    height: 28px;
    font-size: 0.7rem;
    padding: 2px 8px;
  }

  .zoom-toolbar {
    height: 28px;
    gap: 1px;
    padding: 1px;
  }

  .btn-zoom {
    height: 24px;
    padding: 2px 5px;
    font-size: 0.7rem;
  }

  #zoom-level-label {
    display: none;
  }

  .stat-pill {
    height: 28px;
    font-size: 0.68rem;
    padding: 2px 6px;
  }

  .btn-menu-project {
    height: 28px;
    padding: 0 8px;
    font-size: 0.72rem;
  }

  .btn-menu-project span {
    display: none;
  }

  /* MENU PROJETO EM BOTTOM SHEET NO MOBILE */
  .menu-project-dropdown {
    position: fixed !important;
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    border-radius: 16px 16px 0 0 !important;
    max-height: 82vh !important;
    overflow-y: auto !important;
    padding: 16px !important;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.85) !important;
    border-bottom: none !important;
    animation: slideUpSheet 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
    z-index: 100 !important;
  }

  @keyframes slideUpSheet {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  .btn-close-dropdown {
    display: block;
  }

  /* DOCK FLUTUANTE COMPACTO NO MOBILE */
  .cad-action-dock {
    bottom: 8px;
    width: calc(100vw - 16px);
    max-width: 440px;
    border-radius: 14px;
    padding: 4px 6px;
    justify-content: space-around;
    gap: 2px;
  }

  .dock-btn {
    padding: 4px 6px;
    flex-direction: column;
    gap: 1px;
    height: 42px;
    border-radius: 8px;
    flex: 1;
    min-width: 0;
    justify-content: center;
  }

  .dock-icon {
    font-size: 1rem;
    line-height: 1;
  }

  .dock-label {
    font-size: 0.62rem;
    line-height: 1;
  }

  .dock-divider {
    height: 26px;
    margin: 0 1px;
  }

  /* MINIMAPA NO MOBILE: COMEÇA RECOLHIDO, MOSTRA PÍLULA FLUTUANTE */
  .cad-minimap {
    display: none;
    bottom: 64px;
    right: 10px;
    width: 150px;
    height: 100px;
  }

  .cad-minimap.is-mobile-visible {
    display: flex !important;
  }

  .mobile-minimap-pill {
    display: inline-flex;
  }

  .canvas-empty-state-card {
    left: 16px;
    right: 16px;
    width: auto;
    padding: 20px;
    top: 90px;
  }
}

@media (max-width: 480px) {
  .cad-action-dock {
    padding: 3px 4px;
  }

  .dock-btn {
    padding: 3px 2px;
  }

  .dock-label {
    font-size: 0.58rem;
  }
}

/* ==========================================================================
   SUBSISTEMA DE ENGENHARIA ÓPTICA & LINK BUDGET FTTH (v5.8.5)
   ========================================================================== */

/* Botão Link Budget no Top Bar */
.btn-budget-nav {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(56, 189, 248, 0.15));
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  font-weight: 700;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-budget-nav:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.3), rgba(56, 189, 248, 0.3));
  border-color: #34d399;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.35);
  color: #fff;
}

/* Pílula de Comprimento do Cabo no Cabeçalho */
.cable-length-pill {
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  font-family: var(--font-mono);
  font-weight: 600;
  margin-left: 6px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cable-length-pill:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
}

/* Badges de Potência Recebida (Prx) nos Slots de Fibras de Ramal */
.fiber-signal-pill {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  letter-spacing: -0.2px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  cursor: help;
  user-select: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  margin-left: auto;
  margin-right: 6px;
}

.fiber-signal-pill:hover {
  transform: scale(1.08);
}

.fiber-signal-pill.pill-normal {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #34d399;
}

.fiber-signal-pill.pill-warning {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fbbf24;
}

.fiber-signal-pill.pill-critical {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.55);
  color: #f87171;
  animation: pulseCritical 1.8s infinite;
}

.fiber-signal-pill.pill-open {
  background: rgba(100, 116, 139, 0.15);
  border: 1px solid rgba(100, 116, 139, 0.4);
  color: #94a3b8;
}

@keyframes pulseCritical {
  0%, 100% { box-shadow: 0 0 0 rgba(239, 68, 68, 0); }
  50% { box-shadow: 0 0 8px rgba(239, 68, 68, 0.5); }
}

/* Indicadores de Sinal nas Portas do Splitter */
.spl-port-signal {
  font-size: 0.64rem;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 8px;
  cursor: help;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.spl-port-signal.pill-normal {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.spl-port-signal.pill-warning {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.spl-port-signal.pill-critical {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #f87171;
}

.spl-port-signal.pill-open {
  background: rgba(100, 116, 139, 0.15);
  border: 1px solid rgba(100, 116, 139, 0.3);
  color: #94a3b8;
}

.spl-in-power-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.65rem;
  font-family: var(--font-mono);
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  cursor: help;
  margin-left: 6px;
}

/* Tooltip Topológico HUD Flutuante */
.hud-optical-tooltip {
  position: fixed;
  z-index: 9999;
  background: rgba(11, 16, 28, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 10px;
  padding: 12px 14px;
  min-width: 270px;
  max-width: 360px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.8), 0 0 16px rgba(56, 189, 248, 0.15);
  pointer-events: none;
  font-family: var(--font-sans);
  color: #e2e8f0;
  animation: tooltipFadeIn 0.15s ease-out;
}

@keyframes tooltipFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.hud-tooltip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.hud-tooltip-icon {
  font-size: 1rem;
}

.hud-tooltip-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hud-status-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}

.hud-status-badge.status-normal { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.hud-status-badge.status-warning { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.hud-status-badge.status-critical { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.hud-status-badge.status-open { background: rgba(100, 116, 139, 0.2); color: #94a3b8; }

.hud-tooltip-main-power {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.04);
  padding: 6px 10px;
  border-radius: 6px;
}

.hud-power-label {
  font-size: 0.76rem;
  color: var(--text-dim);
}

.hud-power-val {
  font-size: 1.05rem;
  font-family: var(--font-mono);
}

.hud-calc-breakdown {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.72rem;
  color: #94a3b8;
}

.hud-calc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hud-calc-row.total-loss {
  border-top: 1px dashed rgba(255, 255, 255, 0.15);
  padding-top: 6px;
  margin-top: 4px;
  font-weight: 700;
  color: var(--cyan-neon);
}

.hud-calc-val {
  font-family: var(--font-mono);
}

.hud-path-trail {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.68rem;
  color: var(--text-dim);
  word-break: break-all;
}

/* Modal de Configuração do Link Budget */
.modal-budget-card {
  max-width: 900px !important;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.budget-params-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  background: rgba(16, 24, 39, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 14px;
  border-radius: 8px;
}

.input-with-unit {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-unit input {
  width: 100%;
  padding-right: 48px;
}

.input-unit-tag {
  position: absolute;
  right: 10px;
  font-size: 0.74rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  pointer-events: none;
}

.budget-presets-row {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.btn-preset-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-preset-chip:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #fff;
}

.btn-preset-chip.active {
  background: rgba(16, 185, 129, 0.22);
  border-color: #10b981;
  color: #34d399;
  font-weight: 700;
}

.budget-summary-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.budget-kpi-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
}

.budget-kpi-card.kpi-normal { border-color: rgba(16, 185, 129, 0.4); }
.budget-kpi-card.kpi-warning { border-color: rgba(245, 158, 11, 0.4); }
.budget-kpi-card.kpi-critical { border-color: rgba(239, 68, 68, 0.4); }
.budget-kpi-card.kpi-open { border-color: rgba(100, 116, 139, 0.4); }

.kpi-val {
  font-size: 1.4rem;
  font-weight: 800;
  font-family: var(--font-mono);
}

.kpi-normal .kpi-val { color: #34d399; }
.kpi-warning .kpi-val { color: #fbbf24; }
.kpi-critical .kpi-val { color: #f87171; }
.kpi-open .kpi-val { color: #94a3b8; }

.kpi-label {
  font-size: 0.68rem;
  color: var(--text-dim);
}

.budget-table-wrap {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: 280px;
}

.budget-section-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
}

.budget-table-mini {
  font-size: 0.75rem;
}

.status-pill {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  display: inline-block;
}

.status-normal { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.status-warning { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.status-critical { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.status-open { background: rgba(100, 116, 139, 0.2); color: #94a3b8; }

.report-budget-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.budget-banner-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.78rem;
}

.budget-banner-item .lbl {
  font-size: 0.68rem;
  color: var(--text-dim);
}

@media (max-width: 768px) {
  .budget-summary-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .budget-params-grid {
    grid-template-columns: 1fr;
  }
  .btn-budget-nav span {
    display: none;
  }
}

