/* ==========================================================================
   LABSIM MODELICA STUDIO - ESTILOS VISUAIS DE ENGENHARIA (DARK THEME)
   ========================================================================== */

:root {
  --bg-darkest: #131a1c;
  --bg-darker: #192123;
  --bg-dark: #202a2c;
  --bg-panel: #283437;
  --bg-card: #2e3c3f;
  --bg-card-hover: #37474a;
  
  --border-subtle: #374649;
  --border-strong: #4a5c60;
  --border-focus: #00bcd4;

  --text-main: #f0f4f5;
  --text-muted: #9aa8ab;
  --text-dim: #6e7c7f;

  --accent-cyan: #00e5ff;
  --accent-blue: #00b4d8;
  --accent-green: #06d6a0;
  --accent-amber: #ffb703;
  --accent-red: #ef476f;

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'Fira Code', monospace;
}

.labsim-app-wrapper,
.labsim-app-wrapper * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.28) rgba(10, 15, 29, 0.5);
}

.labsim-app-wrapper ::-webkit-scrollbar,
.labsim-app-wrapper::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.labsim-app-wrapper ::-webkit-scrollbar-track,
.labsim-app-wrapper::-webkit-scrollbar-track {
  background: rgba(10, 16, 30, 0.55);
  border-radius: 9999px;
  margin: 2px;
}

.labsim-app-wrapper ::-webkit-scrollbar-thumb,
.labsim-app-wrapper::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.32), rgba(99, 102, 241, 0.32));
  border-radius: 9999px;
  border: 1px solid transparent;
  background-clip: padding-box;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.labsim-app-wrapper ::-webkit-scrollbar-thumb:hover,
.labsim-app-wrapper::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.7), rgba(99, 102, 241, 0.7));
  border: 1px solid transparent;
  background-clip: padding-box;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.45);
}

.labsim-app-wrapper ::-webkit-scrollbar-thumb:active,
.labsim-app-wrapper::-webkit-scrollbar-thumb:active {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.95), rgba(14, 165, 233, 0.95));
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.75);
}

.labsim-app-wrapper ::-webkit-scrollbar-corner,
.labsim-app-wrapper::-webkit-scrollbar-corner {
  background: transparent;
}

.labsim-app-wrapper.studio-body,
body.studio-body {
  font-family: var(--font-sans);
  background: var(--bg-darkest);
  color: var(--text-main);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
}

/* ==========================================
   TOPBAR
   ========================================== */
.studio-topbar {
  height: 52px;
  background: var(--bg-darker);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 16px;
  z-index: 100;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 700;
  font-size: 15px;
}

.brand-icon {
  font-size: 18px;
  color: var(--accent-cyan);
}

.topbar-separator {
  color: var(--text-dim);
  font-size: 16px;
}

.topbar-app-title {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}

.model-name-input {
  background: var(--bg-dark);
  border: 1px solid var(--border-subtle);
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 5px 10px;
  border-radius: 6px;
  width: 220px;
  outline: none;
  transition: border-color 0.2s;
}

.model-name-input:focus {
  border-color: var(--accent-cyan);
}

/* TABS CENTRAIS */
.studio-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-dark);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.tab-button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.tab-button:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.tab-button.active {
  background: var(--bg-card);
  color: var(--text-main);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.badge-count {
  background: var(--accent-blue);
  color: #000;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
}

.badge-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.badge-status.passed { background: var(--accent-green); }
.badge-status.failed { background: var(--accent-red); }

/* AÇÕES DA TOPBAR */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn {
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.btn-primary {
  background: linear-gradient(135deg, #00b4d8, #0077b6);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 180, 216, 0.3);
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: var(--bg-card);
  border-color: var(--border-strong);
}

.btn-icon {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.btn-icon:hover { background: var(--bg-card); }
.btn-icon.danger:hover { background: var(--accent-red); color: #fff; }

/* ==========================================
   WORKSPACE PRINCIPAL
   ========================================== */
.studio-workspace {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

/* SIDEBAR ESQUERDA: PALETA */
.studio-sidebar {
  width: 270px;
  background: var(--bg-darker);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.sidebar-header {
  padding: 14px 16px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-header h3 {
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.sidebar-search {
  padding: 0 12px 10px;
}

.sidebar-search input {
  width: 100%;
  background: var(--bg-dark);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 12px;
  outline: none;
}
.sidebar-search input:focus { border-color: var(--accent-cyan); }

.palette-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 8px 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.palette-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
  transition: all 0.12s ease;
  white-space: nowrap;
  overflow: hidden;
  height: 32px;
  box-sizing: border-box;
}

.palette-item-row:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
  transform: translateX(2px);
}

.palette-item-row:active {
  background: rgba(0, 229, 255, 0.12);
  border-color: rgba(0, 229, 255, 0.25);
}

.palette-row-icon {
  width: 20px;
  height: 20px;
  min-width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  padding: 0;
}

.palette-row-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.palette-row-name {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.palette-item-row:hover .palette-row-name {
  color: #ffffff;
}

/* ==========================================
   ÁREA CENTRAL E TABS
   ========================================== */
.studio-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--bg-darkest);
  overflow: hidden;
}

.tab-pane {
  display: none;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

.tab-pane.active {
  display: flex;
}

/* CANVAS VIEWPORT */
.canvas-toolbar {
  height: 38px;
  background: rgba(25, 33, 35, 0.7);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-size: 12px;
  color: var(--text-muted);
  z-index: 5;
}

.canvas-controls {
  display: flex;
  gap: 4px;
}

.btn-ctrl {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
}
.btn-ctrl:hover { background: var(--bg-card); }

.canvas-viewport {
  flex: 1;
  overflow: hidden;
  position: relative;
  cursor: grab;
  background-color: #171f21;
  background-image: radial-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 24px 24px;
}

.canvas-viewport:active { cursor: grabbing; }

.canvas-surface {
  position: absolute;
  top: 0;
  left: 0;
  width: 5000px;
  height: 5000px;
  transform-origin: 0 0;
}

.canvas-wires-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.canvas-wire {
  fill: none;
  stroke: var(--accent-cyan);
  stroke-width: 2.5;
  stroke-linecap: round;
  cursor: pointer;
  pointer-events: stroke;
  transition: stroke 0.15s;
}

.canvas-wire:hover {
  stroke: #ffffff;
  stroke-width: 3.5;
}

.canvas-wire.active-drag {
  stroke-dasharray: 6 3;
  animation: dash 1s linear infinite;
}

@keyframes dash {
  to { stroke-dashoffset: -18; }
}

.canvas-nodes-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

/* NÓ NO CANVAS (SOMENTE SVG COM NOME ACIMA E PORTAS ABAIXO) */
.canvas-node {
  position: absolute;
  min-width: 90px;
  max-width: 140px;
  background: rgba(18, 26, 28, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  cursor: move;
  transition: box-shadow 0.15s, border-color 0.15s;
  user-select: none;
  padding: 6px 8px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}

.canvas-node:hover {
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55);
}

.canvas-node.selected {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.35), 0 8px 24px rgba(0, 0, 0, 0.7);
}

/* NOME DO COMPONENTE MENOR ACIMA DO SVG */
.canvas-node-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 2px;
  padding: 0 2px;
}

.canvas-node-name {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 95px;
  text-align: center;
  flex: 1;
}

.canvas-node-delete {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 0;
  opacity: 0.5;
  transition: opacity 0.15s, color 0.15s;
}
.canvas-node-delete:hover {
  opacity: 1;
  color: var(--accent-red);
}

/* SOMENTE O SVG NO CENTRO */
.canvas-node-svg-main {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2px 0 4px;
  background: transparent;
}

.canvas-node-svg-main svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}

/* PORTAS ABAIXO DO SVG */
.canvas-node.canvas-node-rack {
  min-width: 220px;
  max-width: 320px;
}

.canvas-node-ports-bottom {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
  padding-top: 6px;
}

/* Camada de Rede: Painel estilo Patch Panel / Switch */
.port-layer-net-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(0, 229, 255, 0.18);
  border-radius: 6px;
  padding: 4px 6px;
  box-sizing: border-box;
}

.port-layer-badge {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-cyan);
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.port-matrix-net {
  display: grid;
  grid-template-rows: repeat(2, 1fr);
  grid-auto-flow: column;
  gap: 3px;
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 2px;
}

.port-matrix-net::-webkit-scrollbar {
  height: 3px;
}
.port-matrix-net::-webkit-scrollbar-thumb {
  background: rgba(0, 229, 255, 0.3);
  border-radius: 2px;
}

.port-net-jack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  background: rgba(15, 23, 26, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  padding: 2px;
  min-width: 16px;
  box-sizing: border-box;
}

.port-net-jack.connected {
  border-color: rgba(0, 229, 255, 0.45);
  box-shadow: 0 0 6px rgba(0, 229, 255, 0.3);
}

.port-net-num {
  font-size: 7px;
  font-family: var(--font-mono);
  color: var(--text-dim);
  line-height: 1;
}

/* Camada Auxiliar (Elétrica, Térmica, Controle) */
.port-layer-aux-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}

.port-bottom-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.port-pin {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg-darkest);
  border: 2px solid var(--accent-cyan);
  cursor: crosshair;
  transition: transform 0.15s, background 0.15s, box-shadow 0.15s;
}

.port-pin:hover {
  transform: scale(1.4);
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
}

.port-pin.port-pin-net {
  border-color: #00e5ff;
}
.port-pin.port-pin-net:hover {
  background: #00e5ff;
  box-shadow: 0 0 8px #00e5ff;
}
.port-pin.port-pin-net.connected {
  background: #10b981;
  border-color: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.port-pin.port-pin-sfp {
  border-color: #38bdf8;
  border-radius: 2px;
}

.port-pin.port-pin-pwr {
  border-color: #f59e0b;
}
.port-pin.port-pin-pwr:hover {
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
}

.port-pin.port-pin-therm {
  border-color: #ef4444;
}
.port-pin.port-pin-therm:hover {
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
}

.port-pin.port-pin-ctrl {
  border-color: #a855f7;
}
.port-pin.port-pin-ctrl:hover {
  background: #a855f7;
  box-shadow: 0 0 8px #a855f7;
}

.port-pin-label {
  font-size: 7.5px;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-dim);
  max-width: 52px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

/* CORES E ANIMAÇÃO DE FIOS POR CAMADA */
.canvas-wire.layer-network {
  stroke: #00e5ff;
  stroke-width: 2.5;
}
.canvas-wire.layer-electrical {
  stroke: #f59e0b;
  stroke-width: 2.5;
}
.canvas-wire.layer-thermal {
  stroke: #ef4444;
  stroke-width: 2.2;
}
.canvas-wire.layer-control {
  stroke: #a855f7;
  stroke-width: 2.0;
}

.canvas-wire.wire-traffic-active {
  stroke-dasharray: 6 3;
  animation: trafficFlowAnim 0.75s linear infinite;
  filter: drop-shadow(0 0 4px rgba(0, 229, 255, 0.6));
}

@keyframes trafficFlowAnim {
  to { stroke-dashoffset: -18; }
}

/* ==========================================
   CODE VIEWER (TAB 2)
   ========================================== */
.code-toolbar {
  height: 44px;
  background: var(--bg-darker);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.code-filename {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-cyan);
}

.code-viewer {
  flex: 1;
  background: #101416;
  padding: 16px 20px;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: #c9d1d9;
}

/* ==========================================
   TELEMETRIA & GRÁFICOS (TAB 3)
   ========================================== */
.telemetry-header {
  padding: 14px 20px;
  background: var(--bg-darker);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.telemetry-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.telemetry-meta h3 {
  font-size: 15px;
  font-weight: 600;
}

.telemetry-info {
  font-size: 12px;
  color: var(--text-muted);
}

.signals-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.signal-pill {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}
.signal-pill.active {
  border-color: var(--accent-cyan);
  background: rgba(0, 229, 255, 0.1);
  color: var(--accent-cyan);
}

.charts-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.chart-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.3);
}

.chart-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.chart-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
}

.chart-stats {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
}

.chart-canvas-wrap {
  position: relative;
  width: 100%;
  height: 220px;
}

.chart-canvas-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.charts-placeholder {
  margin: auto;
  text-align: center;
  color: var(--text-dim);
}
.charts-placeholder span { font-size: 48px; display: block; margin-bottom: 12px; opacity: 0.5; }

/* ==========================================
   DIAGNÓSTICOS (TAB 4)
   ========================================== */
.diag-header {
  padding: 16px 20px;
  background: var(--bg-darker);
  border-bottom: 1px solid var(--border-subtle);
}

.diag-summary-cards {
  display: flex;
  gap: 16px;
  padding: 16px 20px;
}

.diag-summary-card {
  flex: 1;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.diag-summary-card strong { font-size: 22px; }
.diag-summary-card span { font-size: 11.5px; color: var(--text-muted); }

.diag-table-wrap {
  flex: 1;
  overflow: auto;
  padding: 0 20px 20px;
}

.diag-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.diag-table th {
  text-align: left;
  padding: 10px 12px;
  background: var(--bg-dark);
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}

.diag-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}

.diag-severity {
  font-weight: 700;
  font-size: 10.5px;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
}
.diag-severity.blocker { background: rgba(239, 71, 111, 0.2); color: var(--accent-red); }
.diag-severity.warning { background: rgba(255, 183, 3, 0.2); color: var(--accent-amber); }
.diag-severity.info { background: rgba(0, 180, 216, 0.2); color: var(--accent-blue); }

/* ==========================================
   SIDEBAR DIREITA: INSPETOR
   ========================================== */
.studio-inspector {
  width: 300px;
  background: var(--bg-darker);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.inspector-header {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.inspector-header h3 {
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.inspector-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.inspector-empty {
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  margin-top: 40px;
}

.inspector-icon-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px;
}

.inspector-icon-preview {
  width: 52px;
  height: 52px;
  min-width: 52px;
  background: rgba(10, 15, 17, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.5);
}

.inspector-icon-preview svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.inspector-icon-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.inspector-icon-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  width: fit-content;
}
.inspector-icon-badge.badge-ai {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.4);
}
.inspector-icon-badge.badge-procedural {
  background: rgba(0, 229, 255, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 229, 255, 0.3);
}

.btn-inspector-regen {
  background: var(--bg-dark);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 5px;
  cursor: pointer;
  width: fit-content;
  transition: all 0.15s;
}
.btn-inspector-regen:hover {
  background: rgba(168, 85, 247, 0.2);
  border-color: #a855f7;
  color: #e9d5ff;
}

.inspector-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.inspector-field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.inspector-field input {
  background: var(--bg-dark);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 12px;
  outline: none;
}
.inspector-field input:focus { border-color: var(--accent-cyan); }

/* ==========================================
   STATUSBAR INFERIOR
   ========================================== */
.studio-statusbar {
  height: 28px;
  background: var(--bg-darkest);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-size: 11.5px;
  color: var(--text-dim);
  z-index: 100;
}

.statusbar-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-indicator {
  font-size: 10px;
  color: var(--accent-green);
}

/* ==========================================
   POPUP DE TELEMETRIA EM CIMA DO SVG NO CANVAS
   ========================================== */
.node-sim-popup {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(12, 19, 22, 0.96);
  backdrop-filter: blur(12px);
  border: 1px solid var(--accent-cyan);
  border-radius: 8px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.7), 0 0 16px rgba(0, 229, 255, 0.35);
  padding: 6px 10px;
  z-index: 100;
  min-width: 125px;
  pointer-events: auto;
  white-space: nowrap;
  animation: popupBounceIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Seta direcional apontando para o topo do SVG */
.node-sim-popup::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: var(--accent-cyan) transparent transparent transparent;
}

@keyframes popupBounceIn {
  from {
    opacity: 0;
    transform: translate(-50%, 6px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

.sim-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 3px;
  margin-bottom: 5px;
  gap: 8px;
}

.sim-popup-title {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-cyan);
}

.sim-popup-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 0;
  transition: color 0.15s;
}
.sim-popup-close:hover { color: var(--accent-red); }

.sim-popup-metrics {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sim-popup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 10px;
}

.sim-popup-label {
  color: var(--text-muted);
}

.sim-popup-val {
  font-family: var(--font-mono);
  font-weight: 600;
  color: #fff;
  text-shadow: 0 0 6px rgba(0, 229, 255, 0.4);
}

/* ==========================================
   MODAL / DIALOG DE PARÂMETROS (BOTÃO DIREITO)
   ========================================== */
.studio-param-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.15s ease-out;
}

.studio-param-modal {
  width: 390px;
  max-width: 90vw;
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.75), 0 0 25px rgba(0, 229, 255, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalScale 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScale {
  from {
    opacity: 0;
    transform: scale(0.93);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.param-modal-header {
  padding: 14px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.param-modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.param-modal-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.param-modal-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.param-modal-title h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.param-modal-subtitle {
  font-size: 11px;
  color: var(--text-muted);
}

.param-modal-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}
.param-modal-close:hover { color: var(--accent-red); }

.param-modal-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 60vh;
  overflow-y: auto;
}

.param-modal-archetype-info {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.25);
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
}
.param-modal-archetype-info strong {
  color: var(--accent-cyan);
}

.param-modal-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.param-modal-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.param-modal-row label {
  font-size: 11.5px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.param-modal-input {
  width: 125px;
  background: var(--bg-dark);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-family: var(--font-mono);
  outline: none;
}
.param-modal-input:focus {
  border-color: var(--accent-cyan);
}

.param-modal-remove-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}
.param-modal-remove-btn:hover { color: var(--accent-red); }

.param-modal-add-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-subtle);
}

.param-modal-new-input {
  flex: 1;
  background: var(--bg-dark);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 5px 8px;
  border-radius: 5px;
  font-size: 11.5px;
  outline: none;
}
.param-modal-new-input:focus { border-color: var(--accent-cyan); }

.param-modal-footer {
  padding: 12px 16px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
