/* ===================== Análise de Vínculos ===================== */
:root {
  --navy-900: #071530;
  --navy-800: #0b1f45;
  --navy-700: #10295a;
  --blue-700: #0f4c9c;
  --blue-600: #1559b8;
  --blue-500: #1f6fd6;
  --blue-400: #3d8cf0;
  --blue-100: #e6f0fd;
  --blue-50: #f3f8ff;
  --ink-900: #0f1b2d;
  --ink-700: #2b3a52;
  --ink-500: #5b6a82;
  --ink-400: #8090a8;
  --line: #e3e9f2;
  --line-strong: #cfd9e8;
  --bg: #f4f7fb;
  --white: #fff;
  --green-600: #1f9d55;
  --green-100: #dff5e7;
  --green-border: #9ad7ad;
  --green-bg: #f2fbf5;
  --purple-600: #7b4cc9;
  --purple-border: #c6b3ee;
  --purple-bg: #f8f5ff;
  --red-600: #d23c3c;
  --red-100: #fde6e6;
  --amber-600: #b7791f;
  --amber-100: #fdf2dc;
  --edge: #2a6fc9;
  --pill: #e8ecf2;
  --shadow-sm: 0 1px 2px rgba(16, 41, 90, .06), 0 2px 6px rgba(16, 41, 90, .06);
  --shadow-md: 0 4px 14px rgba(16, 41, 90, .10), 0 1px 3px rgba(16, 41, 90, .08);
  --shadow-lg: 0 14px 40px rgba(16, 41, 90, .18);
  --radius: 12px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink-900);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
.sprite { display: none; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg .fill { fill: currentColor; }
[hidden] { display: none !important; }

.app { display: grid; grid-template-columns: 255px minmax(0, 1fr); height: 100vh; overflow: hidden; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: relative;
  background: linear-gradient(180deg, var(--navy-800) 0%, var(--navy-900) 100%);
  color: #dbe6f7;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 18px 22px 22px; background: rgba(0, 0, 0, .15); }
.brand-mark { display: flex; gap: 4px; transform: skewX(-22deg); }
.brand-mark span { width: 11px; height: 26px; border-radius: 2px; background: linear-gradient(180deg, #4aa3ff, #1b63d6); }
.brand-mark span + span { background: linear-gradient(180deg, #8cc6ff, #3d8cf0); }
.brand-text strong { display: block; font-size: 27px; font-weight: 800; letter-spacing: .5px; color: #fff; line-height: 1; }
.brand-text small { display: block; font-size: 11.5px; letter-spacing: .6px; color: #c5d4ec; margin-top: 4px; }

.nav { display: flex; flex-direction: column; gap: 4px; padding: 14px 12px; position: relative; z-index: 1; flex: 1; min-height: 0; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 16px;
  padding: 13px 16px; border-radius: 8px;
  color: #dbe6f7; font-size: 15.5px; font-weight: 500; text-align: left;
  transition: background .15s;
}
.nav-item svg { width: 23px; height: 23px; stroke-width: 1.6; }
.nav-item:hover { background: rgba(255, 255, 255, .06); }
.nav-item.active { background: linear-gradient(90deg, #1d5fc4, #1a54ad); color: #fff; box-shadow: 0 6px 18px rgba(16, 80, 190, .35); }

.sidebar-art {
  position: absolute; left: 0; right: 0; bottom: 0; height: 260px; pointer-events: none;
  background:
    radial-gradient(circle at 22% 70%, rgba(70, 150, 255, .9) 0 2px, transparent 3px),
    radial-gradient(circle at 48% 86%, rgba(70, 150, 255, .9) 0 2.5px, transparent 3.5px),
    radial-gradient(circle at 60% 66%, rgba(70, 150, 255, .7) 0 2px, transparent 3px),
    radial-gradient(circle at 85% 80%, rgba(70, 150, 255, .9) 0 2px, transparent 3px),
    radial-gradient(circle at 10% 92%, rgba(70, 150, 255, .7) 0 2px, transparent 3px),
    radial-gradient(circle at 75% 95%, rgba(70, 150, 255, .7) 0 1.5px, transparent 2.5px),
    linear-gradient(160deg, transparent 40%, rgba(40, 110, 230, .18) 100%);
}
.sidebar-art::before, .sidebar-art::after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(28deg, transparent 49.6%, rgba(80, 150, 255, .35) 50%, transparent 50.4%),
    linear-gradient(-35deg, transparent 49.7%, rgba(80, 150, 255, .25) 50%, transparent 50.3%);
}
.sidebar-art::after { transform: translate(30%, 25%) rotate(15deg); opacity: .7; }

/* ---------- Main ---------- */
.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 14px 18px 10px 36px; background: var(--white); }
.titles h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.3px; color: var(--ink-900); }
.breadcrumb { display: flex; align-items: center; gap: 10px; margin-top: 6px; color: var(--ink-700); font-size: 15px; }
.breadcrumb a { color: var(--blue-600); text-decoration: underline; text-underline-offset: 3px; }
.breadcrumb svg { width: 14px; height: 14px; color: var(--ink-500); }

.search { position: relative; display: flex; align-items: stretch; width: min(580px, 46vw); }
.search-box { flex: 1; display: flex; align-items: center; gap: 10px; padding: 0 14px; border: 1px solid var(--line-strong); border-right: 0; border-radius: 8px 0 0 8px; background: var(--white); box-shadow: var(--shadow-sm); }
.search-box svg { color: var(--ink-500); width: 22px; height: 22px; }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; padding: 13px 0; font-size: 15px; background: transparent; }
.search-box:focus-within { border-color: var(--blue-400); }
.btn-primary { padding: 0 22px; border-radius: 0 8px 8px 0; background: var(--navy-700); color: #fff; font-weight: 600; font-size: 15px; transition: background .15s; }
.btn-primary:hover { background: var(--blue-700); }
.btn-primary:disabled { opacity: .6; cursor: wait; }

.search-results {
  position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; right: 0;
  max-height: 60vh; overflow: auto;
  background: var(--white); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg);
  padding: 6px;
}
.sr-group { padding: 8px 10px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .5px; color: var(--ink-400); text-transform: uppercase; }
.sr-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border-radius: 8px; text-align: left; }
.sr-item:hover, .sr-item:focus { background: var(--blue-50); outline: 0; }
.sr-item .ico { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-100); color: var(--blue-600); flex: none; }
.sr-item .ico svg { width: 18px; height: 18px; }
.sr-item strong { display: block; font-size: 14px; font-weight: 600; }
.sr-item small { display: block; color: var(--ink-500); font-size: 12.5px; margin-top: 2px; }
.sr-empty { padding: 16px; color: var(--ink-500); text-align: center; }

.content { flex: 1; min-height: 0; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 10px; padding: 0 10px 10px 18px; }

/* ---------- Workspace ---------- */
.workspace { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 0; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 8px; }
.workspace.sem-kpis .stats { display: none; }
.stat {
  display: flex; align-items: center; gap: 16px; padding: 12px 20px;
  border-radius: 8px; background: linear-gradient(180deg, #f6f9fd, #edf2f9);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm); text-align: left;
  color: var(--blue-600); transition: transform .12s, box-shadow .12s;
}
.stat:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.stat svg { width: 36px; height: 36px; stroke-width: 1.5; }
.stat strong { display: block; font-size: 26px; font-weight: 700; color: var(--ink-900); line-height: 1.05; }
.stat span { font-size: 15px; color: var(--ink-700); }
.stat.active { background: linear-gradient(135deg, #1c5fc6, #0f3f8e); color: #fff; border-color: transparent; box-shadow: 0 8px 20px rgba(20, 80, 180, .3); }
.stat.active strong, .stat.active span { color: #fff; }

.canvas-wrap { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.canvas-wrap:fullscreen { background: var(--white); padding: 12px; }
.canvas {
  position: relative; flex: 1; min-height: 0; overflow: hidden;
  cursor: default; user-select: none;
  background-image: radial-gradient(circle, #e6ecf4 1px, transparent 1.2px);
  background-size: 22px 22px;
  border-radius: 8px;
}
.canvas.sem-grade { background-image: none; }
.canvas.mode-pan { cursor: grab; }
.canvas.panning { cursor: grabbing; }
.world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.edges { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; }
.edges line { stroke: var(--edge); stroke-width: 2.2; }
.edges line.e-cnae { stroke: #3aa35f; }
.edges line.e-endereco { stroke: #3b6fc4; }
.edges line.dim { opacity: .15; }
.edges line.hl { stroke-width: 3.2; }
.edge-labels { position: absolute; left: 0; top: 0; }
.edge-label {
  position: absolute; transform: translate(-50%, -50%);
  padding: 4px 11px; border-radius: 999px; white-space: nowrap;
  background: var(--pill); border: 1px solid #d8dee8;
  font-size: 13.5px; color: var(--ink-900); pointer-events: none;
}
.edge-label.dim { opacity: .2; }
.hide-labels .edge-label { display: none; }

.nodes { position: absolute; left: 0; top: 0; }
.node {
  position: absolute; width: 252px; min-height: 84px;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; border-radius: 10px;
  background: var(--white); border: 2px solid #2f74d0;
  box-shadow: var(--shadow-md);
  transform: translate(-50%, -50%);
  cursor: pointer; transition: box-shadow .15s, opacity .2s, border-color .15s;
}
.node:hover { box-shadow: 0 8px 24px rgba(20, 70, 160, .2); }
.node.selected { box-shadow: 0 0 0 4px rgba(61, 140, 240, .35), var(--shadow-lg); }
.node.dim { opacity: .25; }
.node.faded { opacity: .55; }
.node .avatar { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; flex: none; background: linear-gradient(180deg, #2a6fd0, #144a9e); color: #fff; }
.node .avatar svg { width: 26px; height: 26px; stroke-width: 1.7; }
.node .body { min-width: 0; flex: 1; }
.node .title { font-size: 15px; font-weight: 700; line-height: 1.2; color: var(--ink-900); text-transform: uppercase; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.node .sub { margin-top: 4px; font-size: 13px; color: var(--ink-700); line-height: 1.35; }
.node .sub b { font-weight: 600; }
.node .badge { position: absolute; top: -9px; right: 10px; padding: 1px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: .3px; background: var(--green-100); color: var(--green-600); border: 1px solid #bfe7cf; }
.node .badge.bad { background: var(--red-100); color: var(--red-600); border-color: #f5c2c2; }
.node .badge.warn { background: var(--amber-100); color: var(--amber-600); border-color: #f1d9a6; }
.node { padding-right: 30px; }
.node.root { padding-right: 16px; }
.node .badge { right: 36px; }
.node .pin-btn {
  position: absolute; top: 5px; right: 5px; width: 24px; height: 24px;
  display: grid; place-items: center; border-radius: 6px;
  color: var(--ink-400); opacity: .45; cursor: pointer;
  transition: opacity .15s, background .15s, color .15s, transform .15s;
}
.node .pin-btn svg { width: 15px; height: 15px; transform: rotate(45deg); }
.node:hover .pin-btn, .node.selected .pin-btn { opacity: .85; }
.node .pin-btn:hover { background: var(--blue-50); color: var(--blue-600); opacity: 1; }
.node .pin-btn.on { opacity: 1; color: #fff; background: var(--red-600); }
.node .pin-btn.on svg { transform: none; fill: currentColor; }
.node.travado { cursor: default; border-style: dashed; }
.node.travado .pin-btn { cursor: pointer; }
.marquee { position: absolute; z-index: 4; pointer-events: none; border: 1.5px dashed var(--blue-500); background: rgba(61, 140, 240, .10); border-radius: 4px; }

/* SweetAlert2 com a identidade do sistema */
.swal2-popup { font-family: var(--font); border-radius: 14px; }
.swal2-title { font-size: 21px; color: var(--ink-900); }
.swal2-html-container { font-size: 15px; color: var(--ink-700); }
.swal2-popup.swal2-toast { font-size: 14px; }
.swal-lista { text-align: left; margin: 12px auto 0; padding-left: 20px; max-height: 180px; overflow: auto; font-size: 14px; }
.swal-lista li { margin: 3px 0; }
.node.loading::after {
  content: ''; position: absolute; top: 8px; right: 8px; width: 14px; height: 14px;
  border: 2px solid var(--blue-100); border-top-color: var(--blue-500); border-radius: 50%; animation: spin .8s linear infinite;
}

.node.t-socio { min-width: 248px; }
.node.t-socio .avatar { background: linear-gradient(180deg, #e3edfb, #cfe0f7); color: #1b56b0; }
.node.t-socio .title { text-transform: none; font-size: 17px; }

.node.t-endereco { border-color: var(--purple-border); background: linear-gradient(180deg, #fff, var(--purple-bg)); width: 290px; }
.node.t-endereco .avatar { background: transparent; color: var(--purple-600); width: 40px; }
.node.t-endereco .avatar svg { width: 34px; height: 34px; stroke-width: 2; fill: rgba(123, 76, 201, .12); }
.node.t-endereco .title { text-transform: none; font-size: 14.5px; }

.node.t-cnae { border-color: var(--green-border); background: linear-gradient(180deg, #fff, var(--green-bg)); width: 290px; }
.node.t-cnae .avatar { border-radius: 10px; background: #dff2e5; color: var(--green-600); }
.node.t-cnae .title { text-transform: none; }
.node.t-cnae .code { font-size: 17px; font-weight: 700; margin-top: 2px; }
.node.t-cnae .sub { font-size: 12px; }

.node.root {
  width: 280px; flex-direction: column; text-align: center; gap: 8px; padding: 16px 16px 14px;
  border-width: 3px; border-color: #3184e4;
  box-shadow: 0 0 0 6px rgba(61, 140, 240, .12), 0 10px 30px rgba(20, 80, 180, .22);
}
.node.root .avatar { width: 60px; height: 60px; }
.node.root .avatar svg { width: 30px; height: 30px; }
.node.root .title { font-size: 19px; -webkit-line-clamp: 3; }
.node.root .sub { font-size: 15px; }

/* ---------- Toolbar ---------- */
.toolbar { position: absolute; z-index: 5; top: 16px; left: 4px; display: flex; flex-direction: column; gap: 4px; padding: 6px; background: var(--white); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-md); }
.tool { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 7px; color: var(--ink-700); }
.tool:hover { background: var(--blue-50); color: var(--blue-600); }
.tool.active { background: var(--blue-100); color: var(--blue-700); }
.tool-sep { height: 1px; background: var(--line); margin: 4px 2px; }

.empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; color: var(--ink-500); padding: 40px; }
.empty svg { width: 64px; height: 64px; color: var(--blue-400); stroke-width: 1.3; }
.empty h2 { color: var(--ink-900); margin: 14px 0 6px; font-size: 20px; }
.empty p { max-width: 420px; margin: 0; line-height: 1.5; }

.loading { position: absolute; z-index: 6; top: 16px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 9px 16px; background: var(--white); border-radius: 999px; box-shadow: var(--shadow-md); border: 1px solid var(--line); font-weight: 500; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--blue-100); border-top-color: var(--blue-500); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Bottom bar ---------- */
.bottombar { position: relative; display: flex; align-items: center; gap: 22px; padding: 10px 4px 12px; border-top: 1px solid var(--line); background: var(--white); }
.select { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 8px; min-width: 260px; }
.select span { color: var(--ink-500); }
.select select { flex: 1; border: 0; outline: 0; background: transparent; font-weight: 500; cursor: pointer; }
.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14.5px; user-select: none; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle .track { position: relative; width: 40px; height: 22px; border-radius: 999px; background: #cfd8e5; transition: background .15s; flex: none; }
.toggle .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .15s; }
.toggle input:checked + .track { background: var(--blue-500); }
.toggle input:checked + .track::after { transform: translateX(18px); }
.toggle input:focus-visible + .track { outline: 2px solid var(--blue-400); outline-offset: 2px; }
.bottom-actions { margin-left: auto; display: flex; gap: 10px; }
.icon-btn { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--ink-900); background: var(--white); }
.icon-btn:hover { background: var(--blue-50); color: var(--blue-600); }
.settings-pop { position: absolute; z-index: 20; right: 4px; bottom: calc(100% + 8px); width: 280px; display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; background: var(--white); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); }
.settings-pop h4 { margin: 0; font-size: 14px; }
.btn-ghost { display: inline-flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line-strong); font-weight: 500; }
.btn-ghost svg { width: 17px; height: 17px; }
.btn-ghost:hover { background: var(--blue-50); }
.btn-ghost.danger { color: var(--red-600); border-color: #f1c6c6; }
.btn-ghost.danger:hover { background: var(--red-100); }

/* ---------- Painel direito ---------- */
.panel { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); padding: 0 8px; }
.tab { padding: 18px 6px 14px; font-size: 15.5px; color: var(--ink-700); border-bottom: 3px solid transparent; }
.tab.active { color: var(--blue-600); font-weight: 600; border-bottom-color: var(--blue-600); }
.panel-body { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; }
.tab-pane { display: none; padding: 14px; }
.tab-pane.active { display: block; }
.panel-empty { padding: 40px 18px; text-align: center; color: var(--ink-500); line-height: 1.5; }

.d-head { display: flex; align-items: center; gap: 14px; padding: 6px 4px 14px; border-bottom: 1px solid var(--line); }
.d-head .avatar { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; flex: none; background: linear-gradient(180deg, #2a6fd0, #144a9e); color: #fff; }
.d-head .avatar svg { width: 27px; height: 27px; }
.d-head.t-socio .avatar { background: linear-gradient(180deg, #e3edfb, #cfe0f7); color: #1b56b0; }
.d-head.t-endereco .avatar { background: var(--purple-bg); color: var(--purple-600); }
.d-head.t-cnae .avatar { background: #dff2e5; color: var(--green-600); border-radius: 12px; }
.d-head h3 { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.25; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.d-head .doc { margin-top: 4px; color: var(--ink-700); font-size: 14.5px; }
.status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .3px; background: var(--green-100); color: var(--green-600); }
.status.bad { background: var(--red-100); color: var(--red-600); }
.status.warn { background: var(--amber-100); color: var(--amber-600); }

.kv { margin: 0; padding: 4px 0; }
.kv-row { display: grid; grid-template-columns: 22px 125px minmax(0, 1fr); gap: 8px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.kv-row svg { width: 17px; height: 17px; color: var(--ink-500); }
.kv-row dt { color: var(--ink-700); }
.kv-row dd { margin: 0; color: var(--ink-900); font-weight: 500; overflow-wrap: anywhere; }

.card { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; box-shadow: var(--shadow-sm); }
.card h4 { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 16px; font-weight: 700; }
.card h4 svg { color: var(--blue-600); width: 21px; height: 21px; }
.cnae-row { display: flex; gap: 12px; align-items: flex-start; font-size: 13.5px; line-height: 1.4; padding: 4px 0; }
.chip { flex: none; padding: 5px 10px; border-radius: 6px; background: var(--blue-100); color: var(--blue-700); font-weight: 600; font-size: 13px; }
.chip.muted { background: #f0f3f7; color: var(--ink-700); font-weight: 500; }
.more { margin-top: 6px; font-size: 13px; color: var(--blue-600); cursor: pointer; text-decoration: underline; }

.person { display: flex; align-items: center; gap: 14px; padding: 10px 2px; border-top: 1px solid var(--line); }
.person:first-of-type { border-top: 0; }
.person .avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: none; background: linear-gradient(180deg, #e3edfb, #cfe0f7); color: #1b56b0; }
.person .avatar.pj { background: linear-gradient(180deg, #2a6fd0, #144a9e); color: #fff; }
.person .avatar svg { width: 21px; height: 21px; }
.person strong { display: block; font-size: 15px; overflow-wrap: anywhere; }
.person small { display: block; font-size: 12.5px; color: var(--ink-700); margin-top: 2px; }
.person-click { cursor: pointer; border-radius: 8px; }
.person-click:hover { background: var(--blue-50); }

.addr { display: flex; gap: 14px; align-items: center; padding: 6px 2px; font-size: 14px; line-height: 1.45; }
.addr svg { width: 26px; height: 26px; color: var(--ink-700); }

.note { margin: 12px 4px 0; color: var(--ink-500); font-size: 12.5px; line-height: 1.5; }
.sr-toggle { display: flex; align-items: center; gap: 10px; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-size: 13.5px; }
.actions-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.link-list { display: flex; flex-direction: column; gap: 6px; }
.link-item { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; align-items: center; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.link-item:hover { background: var(--blue-50); border-color: #c9dbf5; }
.link-item .ico { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--blue-100); color: var(--blue-600); }
.link-item .ico svg { width: 16px; height: 16px; }
.link-item strong { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-item small { display: block; color: var(--ink-500); font-size: 12px; overflow-wrap: anywhere; }
.link-item > div, .person > div, .hist-item > div, .sr-item > span:last-child { min-width: 0; }
.list-title { font-size: 12px; font-weight: 700; color: var(--ink-400); letter-spacing: .5px; text-transform: uppercase; margin: 6px 2px 10px; }

.hist-item { display: flex; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.hist-item svg { width: 17px; height: 17px; color: var(--blue-600); margin-top: 1px; }
.hist-item time { display: block; color: var(--ink-400); font-size: 12px; margin-top: 2px; }

/* ---------- Menu de contexto ---------- */
.ctx { position: fixed; z-index: 100; min-width: 270px; padding: 6px; background: var(--white); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); }
.ctx-title { padding: 8px 10px 8px; font-size: 12px; font-weight: 700; color: var(--ink-400); text-transform: uppercase; letter-spacing: .4px; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border-radius: 7px; text-align: left; font-size: 14px; }
.ctx-item svg { width: 18px; height: 18px; color: var(--blue-600); }
.ctx-item:hover, .ctx-item:focus { background: var(--blue-50); outline: 0; }
.ctx-item.danger { color: var(--red-600); }
.ctx-item.danger svg { color: var(--red-600); }
.ctx-item.primary { font-weight: 600; }
.ctx-sep { height: 1px; background: var(--line); margin: 5px 4px; }
.ctx-subwrap { position: relative; }
.ctx-item.has-sub .ctx-caret { width: 16px; height: 16px; margin-left: auto; color: var(--ink-400); }
.ctx-label { flex: 1; min-width: 0; }
.ctx-sub {
  display: none; position: absolute; left: calc(100% - 4px); top: 0; z-index: 2; min-width: 168px;
  padding: 6px; background: var(--white); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg);
}
.ctx-sub.flip { left: auto; right: calc(100% - 4px); }
.ctx-subwrap:hover > .ctx-sub,
.ctx-subwrap:focus-within > .ctx-sub,
.ctx-subwrap.open > .ctx-sub { display: block; }
.ctx-hint { padding: 6px 10px 8px; max-width: 230px; font-size: 11.5px; line-height: 1.35; color: var(--ink-400); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 200; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; }
.toast { max-width: 380px; padding: 11px 16px; border-radius: 9px; background: var(--navy-800); color: #fff; box-shadow: var(--shadow-lg); font-size: 14px; animation: toast-in .2s ease-out; }
.toast.err { background: #a52a2a; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

/* ---------- Responsivo ---------- */
@media (max-width: 1400px) {
  .content { grid-template-columns: minmax(0, 1fr) 350px; }
  .titles h1 { font-size: 23px; }
}
@media (max-width: 1100px) {
  .app { grid-template-columns: 76px 1fr; }
  .brand-text, .nav-item { font-size: 0; }
  .brand-text { display: none; }
  .nav-item { justify-content: center; padding: 13px 0; }
  .stat { padding: 10px 12px; gap: 10px; }
  .stat svg { width: 28px; height: 28px; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; height: auto; overflow: visible; }
  .sidebar { display: none; }
  .main { height: auto; }
  .topbar { flex-direction: column; align-items: stretch; padding: 14px 16px; }
  .search { width: 100%; }
  .content { grid-template-columns: 1fr; padding: 0 16px 16px; }
  .workspace { height: 78vh; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .bottombar { flex-wrap: wrap; gap: 12px; }
  .select { min-width: 0; }
  .panel { max-height: 80vh; }
}

@media print {
  .sidebar, .topbar, .toolbar, .bottombar, .panel, .stats { display: none !important; }
}

/* ---------- Desfazer / refazer ---------- */
.topbar { gap: 14px; }
.titles { margin-right: auto; }
.history-btns { display: flex; gap: 6px; }
.hist-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--white); color: var(--navy-700); box-shadow: var(--shadow-sm); transition: background .15s, color .15s; }
.hist-btn svg { width: 21px; height: 21px; stroke-width: 1.9; }
.hist-btn:hover:not(:disabled) { background: var(--blue-50); color: var(--blue-600); }
.hist-btn:disabled { opacity: .4; cursor: default; box-shadow: none; }

/* ---------- Modal CNPJs de um texto ---------- */
.swal-lote { width: min(960px, 96vw) !important; }
.swal-lote-html { margin: 8px 4px 0 !important; text-align: left; }
.lote-ajuda { margin: 0 0 8px; color: #5c6b80; font-size: 13px; }
.lote-texto { width: 100%; box-sizing: border-box; height: 52vh; min-height: 220px; resize: vertical; padding: 10px 12px; border: 1px solid #cfd8e4; border-radius: 8px; font: 13px/1.45 ui-monospace, Consolas, monospace; color: #1c2838; }
.lote-texto:focus { outline: none; border-color: #2a6fdb; box-shadow: 0 0 0 3px rgba(42, 111, 219, .15); }
.lote-rodape { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 8px; font-size: 13px; color: #243044; }
.lote-cont b { color: #10295a; }
.lote-cont .lote-inv { color: #a33; margin-left: 6px; }
.lote-add { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.lote-lista { margin: 6px 0 0; padding-left: 18px; max-height: 40vh; overflow: auto; text-align: left; font: 13px/1.5 ui-monospace, Consolas, monospace; }

/* ---------- Modal Transparência Federal ---------- */
.swal-transp { width: min(820px, 94vw) !important; }
.swal-transp-html { margin: 8px 4px 0 !important; }
.tr-box { text-align: left; max-height: 62vh; overflow: auto; font-size: 14px; color: #1c2838; }
.tr-sum { margin: 0 0 8px; color: #243044; font-weight: 600; }
.tr-emp { padding: 10px 0; border-top: 1px solid #e6ebf2; }
.tr-emp h3 { margin: 0; font-size: 15px; font-weight: 700; }
.tr-meta { color: #5c6b80; font-size: 12.5px; margin-top: 2px; }
.tr-ct { margin: 8px 0 0; padding: 8px 10px; background: #f6f8fb; border-radius: 8px; }
.tr-obj { display: block; margin-top: 3px; color: #243044; }
.tr-vals { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.tr-val { background: #fff; border-radius: 6px; padding: 6px 8px; }
.tr-val .tr-k { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #5c6b80; }
.tr-val b { display: block; margin-top: 2px; font-size: 14px; color: #1c2838; }
.tr-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.tr-dot.valor { background: #1f9d55; }
.tr-dot.vig { background: #1f6fd6; }
.tr-dot.sanc { background: #d23c3c; }
.tr-sec { margin: 12px 0 0; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #5c6b80; }
.tr-sec.sanc { color: #a52a2a; }
.tr-ano { margin: 10px 0 0; font-size: 12px; font-weight: 700; color: #1f6fd6; }
.tr-linha { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px 10px; align-items: center; margin-top: 6px; padding: 6px 8px; background: #f6f8fb; border-radius: 8px; }
.tr-linha-t { min-width: 0; font-size: 13px; color: #243044; }
.tr-linha-v, .tr-linha-a { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; white-space: nowrap; }
.tr-lic { margin-top: 8px; font-size: 13px; color: #243044; }
.tr-vazio { color: #5c6b80; }
.tr-nota { margin: 12px 0 0; font-size: 12px; color: #6a788c; }

/* ---------- Submenu Exportar ---------- */
.nav-caret { width: 14px !important; height: 14px !important; margin-left: auto; transition: transform .15s; }
.nav-item[aria-expanded="true"] .nav-caret { transform: rotate(90deg); }
.nav-sub { display: flex; flex-direction: column; gap: 2px; margin: -2px 0 4px; padding-left: 26px; }
.nav-sub[hidden] { display: none; }
.nav-subitem { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 8px; color: #c4d3ea; font-size: 14.5px; font-weight: 500; text-align: left; }
.nav-subitem svg { width: 19px; height: 19px; stroke-width: 1.7; }
.nav-subitem:hover { background: rgba(255, 255, 255, .08); color: #fff; }
@media (max-width: 1100px) {
  .nav-caret { display: none; }
  .nav-sub { padding-left: 0; }
  .nav-subitem { font-size: 0; justify-content: center; }
}

/* ---------- Painel lateral recolhível ---------- */
.content.sem-painel { grid-template-columns: 1fr; }
.content.sem-painel > .panel { display: none; }
#btn-panel[aria-pressed="false"] { color: var(--ink-400); }

/* ---------- Telefone / e-mail ---------- */
.node.t-telefone { border-color: #f0b77a; background: linear-gradient(180deg, #fff, #fff8f0); width: 250px; }
.node.t-telefone .avatar { border-radius: 10px; background: #fdebd6; color: #c96a12; }
.node.t-email { border-color: #8fd3dc; background: linear-gradient(180deg, #fff, #f0fbfc); width: 290px; }
.node.t-email .avatar { border-radius: 10px; background: #d9f2f5; color: #0f8a99; }
.node.t-telefone .title, .node.t-email .title { text-transform: none; font-size: 13px; color: var(--ink-500); font-weight: 600; }
.node.t-telefone .code, .node.t-email .code { font-size: 16px; font-weight: 700; margin-top: 2px; word-break: break-all; }

.node.t-obra { border-color: #c4a574; background: linear-gradient(180deg, #fff, #faf6f0); width: 300px; }
.node.t-obra .avatar { border-radius: 10px; background: #f0e6d4; color: #8a6a3a; }
.node.t-obra .title { text-transform: none; font-size: 14px; }
.node.t-obra .code { font-size: 15px; font-weight: 700; margin-top: 2px; }
.node.t-obra .fonte { font-size: 11px; color: #8a6a3a; font-weight: 600; margin-top: 4px; letter-spacing: .2px; }
.node .badge.ok { background: var(--green-100); color: var(--green-600); border-color: #bfe7cf; }
.d-head.t-obra .avatar { background: #f0e6d4; color: #8a6a3a; border-radius: 12px; }
.node.t-aeronave { border-color: #7fa8c9; background: linear-gradient(180deg, #fff, #f3f8fc); width: 290px; }
.node.t-aeronave .avatar { border-radius: 10px; background: #dceaf5; color: #2b6a99; }
.node.t-aeronave .title { text-transform: none; font-size: 15px; letter-spacing: .3px; }
.node.t-aeronave .code { font-size: 13px; font-weight: 600; margin-top: 2px; }
.node.t-aeronave .fonte { font-size: 11px; color: #2b6a99; font-weight: 600; margin-top: 4px; letter-spacing: .2px; }
.d-head.t-aeronave .avatar { background: #dceaf5; color: #2b6a99; border-radius: 12px; }
.status.ok { background: var(--green-100); color: var(--green-600); }
.edges line.e-telefone { stroke: #d98a3a; stroke-dasharray: 6 4; }
.edges line.e-email { stroke: #1aa0b0; stroke-dasharray: 6 4; }
.d-head.t-telefone .avatar { background: #fdebd6; color: #c96a12; }
.d-head.t-email .avatar { background: #d9f2f5; color: #0f8a99; }

/* ---------- Nova pesquisa (×) ---------- */
.search-box input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.search-clear { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: var(--ink-500); flex: none; }
.search-clear svg { width: 16px; height: 16px; stroke-width: 2.2; }
.search-clear:hover { background: var(--red-100); color: var(--red-600); }
.search-clear[hidden] { display: none; }

/* ---------- Mapa (troca o grafo) ---------- */
.mapa-view { display: none; position: relative; flex: 1; min-height: 0; border-radius: 8px; overflow: hidden; background: #eef2f6; }
.canvas-wrap.modo-mapa .mapa-view { display: block; }
.canvas-wrap.modo-mapa .canvas, .canvas-wrap.modo-mapa .toolbar, .canvas-wrap.modo-mapa .empty,
.canvas-wrap.modo-mapa .dash-view { display: none; }

/* ---------- Dashboard BI ---------- */
.dash-view { display: none; position: relative; flex: 1; min-height: 0; border-radius: 8px; overflow: hidden; background: linear-gradient(180deg, #f7f9fc, #eef3f9); }
.canvas-wrap.modo-dash .dash-view { display: block; }
.canvas-wrap.modo-dash .canvas, .canvas-wrap.modo-dash .toolbar, .canvas-wrap.modo-dash .empty,
.canvas-wrap.modo-dash .mapa-view { display: none; }
.dash-scroll { height: 100%; overflow: auto; padding: 16px 18px 28px; }
.dash-topo { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.dash-topo h2 { margin: 0; font-size: 22px; font-weight: 800; color: var(--ink-900); }
.dash-topo p { margin: 4px 0 0; color: var(--ink-500); font-size: 13.5px; }
.dash-voltar {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px;
  border-radius: 8px; background: var(--white); border: 1px solid var(--line-strong);
  color: var(--navy-700); font-weight: 600; font-size: 13.5px; box-shadow: var(--shadow-sm); flex: none;
}
.dash-voltar svg { width: 16px; height: 16px; stroke-width: 1.8; }
.dash-voltar:hover { background: var(--blue-50); border-color: var(--blue-400); }
.dash-sintese {
  margin-bottom: 14px; padding: 14px 16px; background: var(--white);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-sm);
}
.dash-sintese h3 {
  margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .45px;
  text-transform: uppercase; color: var(--ink-400);
}
.dash-sintese p { margin: 0; color: var(--ink-700); font-size: 13.5px; line-height: 1.55; }
.dash-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.dash-kpis-8 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dash-chart-wrap { position: relative; height: 240px; }
.dash-card-chart .dash-chart-wrap { min-height: 220px; }
.dash-kpi {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px;
  background: var(--white); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-sm);
}
.dash-kpi.alerta { border-color: #f0c7c7; background: linear-gradient(180deg, #fff, #fff6f6); }
.dash-kpi-ico {
  width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; flex: none;
  background: var(--blue-50); color: var(--blue-600);
}
.dash-kpi-ico svg { width: 18px; height: 18px; stroke-width: 1.7; }
.dash-kpi strong { display: block; font-size: 20px; font-weight: 800; line-height: 1.1; color: var(--ink-900); }
.dash-kpi span { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-700); margin-top: 2px; }
.dash-kpi small { display: block; font-size: 11.5px; color: var(--ink-400); margin-top: 2px; }
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.dash-card {
  background: var(--white); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px 16px; box-shadow: var(--shadow-sm); min-width: 0;
}
.dash-card h3 {
  margin: 0 0 12px; font-size: 12px; font-weight: 700; letter-spacing: .45px;
  text-transform: uppercase; color: var(--ink-400);
}
.dash-bars { display: flex; flex-direction: column; gap: 8px; }
.dash-bar-meta { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--ink-700); margin-bottom: 4px; }
.dash-bar-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.dash-bar-meta b { flex: none; font-weight: 700; color: var(--ink-900); white-space: nowrap; }
.dash-bar-track { height: 7px; border-radius: 999px; background: #e8eef6; overflow: hidden; }
.dash-bar-track i { display: block; height: 100%; border-radius: inherit; background: var(--blue-500); }
.dash-bar-track i.c-ok { background: var(--green-600); }
.dash-bar-track i.c-warn { background: var(--amber-600); }
.dash-bar-track i.c-bad { background: var(--red-600); }
.dash-bar-track i.c-mute { background: var(--ink-400); }
.dash-bar-track.mini { margin-top: 6px; height: 4px; }
.dash-lista { display: flex; flex-direction: column; gap: 4px; }
.dash-item {
  display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px;
  border: 1px solid transparent; color: var(--ink-700);
}
.dash-item:hover { background: var(--blue-50); border-color: var(--line); }
.dash-item.alerta:hover { background: #fff5f5; }
.dash-item-txt strong { display: block; font-size: 13.5px; color: var(--ink-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-item-txt small { display: block; font-size: 12px; color: var(--ink-500); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-empty, .dash-vazio { color: var(--ink-500); font-size: 13.5px; padding: 8px 2px; }
.dash-vazio { display: grid; place-items: center; text-align: center; min-height: 50vh; gap: 8px; color: var(--ink-500); }
.dash-vazio svg { width: 48px; height: 48px; stroke-width: 1.4; color: var(--blue-500); opacity: .7; }
.dash-vazio h2 { margin: 8px 0 0; color: var(--ink-900); font-size: 20px; }
.dash-vazio p { margin: 0; max-width: 360px; }
.dash-comp { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; }
.dash-donut {
  width: 118px; height: 118px; border-radius: 50%; display: grid; place-items: center; flex: none;
  box-shadow: inset 0 0 0 1px rgba(16, 41, 90, .06);
}
.dash-donut-hole {
  width: 72px; height: 72px; border-radius: 50%; background: var(--white);
  display: grid; place-content: center; text-align: center; box-shadow: var(--shadow-sm);
}
.dash-donut-hole strong { font-size: 20px; font-weight: 800; color: var(--ink-900); line-height: 1; }
.dash-donut-hole span { font-size: 10px; color: var(--ink-400); text-transform: uppercase; letter-spacing: .4px; }
.dash-legenda { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.dash-leg { display: grid; grid-template-columns: 10px 1fr auto; gap: 8px; align-items: center; font-size: 12.5px; color: var(--ink-700); }
.dash-leg i { width: 10px; height: 10px; border-radius: 3px; }
.dash-leg span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-leg b { font-weight: 700; color: var(--ink-900); white-space: nowrap; }
@media (max-width: 1200px) {
  .dash-kpis, .dash-kpis-8 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .dash-kpis, .dash-kpis-8 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-topo { flex-direction: column; }
  .dash-comp { grid-template-columns: 1fr; justify-items: center; }
  .dash-chart-wrap { height: 220px; }
}
#btn-mapa[aria-pressed="true"] { background: var(--blue-100); color: var(--blue-700); }
.mapa-area { position: absolute; inset: 0; }
.mapa-resumo {
  position: absolute; z-index: 500; top: 12px; right: 12px; width: 280px; max-height: calc(100% - 64px); overflow: auto;
  padding: 14px 16px; background: rgba(255, 255, 255, .97); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-md); font-size: 13px;
}
.mp-tit { font-size: 11.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--ink-400); }
.mp-total { font-size: 26px; font-weight: 800; color: var(--ink-900); margin-top: 2px; }
.mp-sub { color: var(--ink-500); margin-bottom: 8px; }
.mp-sec { margin: 12px 0 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--ink-400); }
.mp-linha { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; width: 100%; padding: 4px 0; text-align: left; font-size: 12.5px; color: var(--ink-700); }
.mp-linha span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-linha b { font-weight: 700; color: var(--ink-900); }
.mp-click { border-radius: 6px; }
.mp-click:hover { background: var(--blue-50); }
.mp-barra { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.mp-barra span { display: block; height: 100%; background: var(--blue-500); }
.mp-legenda { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 12px; font-size: 12px; color: var(--ink-500); }
.mp-legenda span { display: inline-flex; align-items: center; gap: 5px; }
.mp-legenda i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; border: 1.5px solid #fff; box-shadow: 0 0 0 1px var(--line-strong); }
.mp-legenda i.trac { background: transparent; border: 1.5px dashed var(--ink-400); box-shadow: none; }
.mp-nota { margin-top: 10px; font-size: 11.5px; color: var(--ink-400); }
.mapa-status { position: absolute; z-index: 500; left: 12px; bottom: 12px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .95); box-shadow: var(--shadow-sm); font-size: 12.5px; color: var(--ink-700); }
.mapa-status:empty { display: none; }
.mp-pop { font-family: var(--font); font-size: 12.5px; line-height: 1.45; color: var(--ink-700); }
.mp-pop strong { display: block; font-size: 13.5px; color: var(--ink-900); margin-bottom: 2px; }
.mp-ir { margin-top: 6px; padding: 5px 10px; border-radius: 6px; background: var(--navy-700); color: #fff; font-size: 12px; font-weight: 600; }
.leaflet-container { font-family: var(--font); }
@media (max-width: 860px) { .mapa-resumo { width: auto; left: 12px; max-height: 45%; } }

/* ---------- Dados extras ---------- */
.ex-modal { text-align: left; font-size: 14px; }
.ex-alvo { font-weight: 700; color: var(--ink-900); margin-bottom: 12px; }
.ex-cpf { padding: 12px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--blue-50); }
.ex-cpf small { display: block; margin-top: 6px; color: var(--ink-500); }
.ex-cpf strong { margin-left: 8px; font-size: 15px; }
.ex-rot { font-size: 12px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; color: var(--ink-500); }
.ex-linha { display: flex; gap: 8px; margin-top: 6px; }
.ex-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) auto; gap: 8px; }
.ex-input { width: 100%; min-width: 0; height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; font: inherit; font-size: 14px; background: #fff; }
.ex-input:focus { outline: 2px solid var(--blue-400); outline-offset: -1px; }
.ex-btn { height: 40px; padding: 0 16px; border-radius: 8px; background: var(--navy-700); color: #fff; font-weight: 600; white-space: nowrap; }
.ex-btn.ghost { background: #fff; color: var(--navy-700); border: 1px solid var(--line-strong); }
.ex-btn:disabled { opacity: .6; }
.ex-msg { min-height: 20px; margin: 6px 0 4px; font-size: 13px; color: var(--green-600); }
.ex-msg.erro { color: var(--red-600); }
.ex-sub { margin-top: 6px; font-size: 12px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; color: var(--ink-400); }
.ex-lista-wrap { max-height: 300px; overflow: auto; margin-top: 6px; }
.ex-lista { list-style: none; margin: 0; padding: 0; }
.ex-lista li { display: grid; grid-template-columns: minmax(90px, auto) 1fr auto; gap: 10px; align-items: baseline; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.ex-chave { font-weight: 700; color: var(--ink-900); overflow-wrap: anywhere; }
.ex-valor { color: var(--ink-700); overflow-wrap: anywhere; }
.ex-valor a { color: var(--blue-600); }
.ex-lista time { font-size: 11.5px; color: var(--ink-400); white-space: nowrap; }
.ex-vazio { padding: 8px 0; color: var(--ink-500); font-size: 13.5px; }
.ex-nota { margin: 12px 0 0; font-size: 12px; color: var(--ink-400); }
.ex-card .ex-lista li { grid-template-columns: minmax(70px, auto) 1fr; }
.ex-card .ex-lista time { display: none; }
.ex-cpf-linha { display: flex; gap: 10px; padding: 6px 0 8px; border-bottom: 1px solid var(--line); }
.ex-abrir { margin-top: 10px; }
@media (max-width: 640px) { .ex-form { grid-template-columns: 1fr; } }

/* ANAC: aeronaves (RAB) e drones (SISANT) */
.an-resumo { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.an-cont { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--blue-50); color: var(--navy-700); font-size: 13px; font-weight: 700; }
.an-cont svg { width: 16px; height: 16px; color: var(--blue-600); }
.an-lista { display: grid; gap: 8px; margin-top: 6px; }
.an-item { border: 1px solid var(--line); border-left: 3px solid var(--blue-500); border-radius: 8px; padding: 10px 12px; background: #fff; }
.an-item.drone { border-left-color: var(--purple-600); }
.an-topo { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.an-marca { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 15px; font-weight: 700; color: var(--ink-900); letter-spacing: .4px; }
.an-selo { flex: none; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--blue-100); color: var(--navy-700); }
.an-selo.ok { background: var(--green-100); color: var(--green-600); }
.an-selo.alerta { background: var(--amber-100); color: var(--amber-600); }
.an-selo.cancel { background: var(--red-100); color: var(--red-600); }
.an-modelo { margin-top: 4px; font-weight: 600; color: var(--ink-700); }
.an-papel { margin-top: 2px; font-size: 12.5px; color: var(--blue-700); font-weight: 600; }
.an-kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; margin: 8px 0 0; }
.an-kv dt { font-size: 10.5px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; color: var(--ink-400); }
.an-kv dd { margin: 0; font-size: 13px; color: var(--ink-900); overflow-wrap: anywhere; }
.an-gravame { margin-top: 8px; padding: 6px 8px; border-radius: 6px; background: var(--amber-100); color: var(--ink-900); font-size: 12.5px; }
.an-origem { margin-top: 8px; font-size: 12px; color: var(--ink-500); overflow-wrap: anywhere; }
.an-match { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; margin-top: 6px; padding: 6px 8px; border-radius: 6px; background: var(--blue-50); font-size: 12px; color: var(--ink-700); }
.an-match strong { color: var(--ink-900); }
.an-match.ambiguo { background: var(--amber-100); }
.an-mais { justify-self: start; }
.an-nota { display: block; margin: 8px 0 0; font-size: 11.5px; color: var(--ink-400); }

/* ---------- A janela principal nunca rola (desktop) ---------- */
/* Cada área rola por dentro (painel, listas); nada pode empurrar a página. */
@media (min-width: 861px) {
  html, body { overflow: hidden; }
}

/* ---------- Empresário individual / MEI, filial e titular ---------- */
.node.t-empresa.individual { border-color: #6aa6ec; background: linear-gradient(180deg, #fff, #f2f8ff); }
.node.t-empresa.individual .avatar { background: linear-gradient(180deg, #7db4f2, #4a8fe0); }
.node.t-empresa.filial { border-style: dashed; }
.node.t-empresa.filial .avatar { background: linear-gradient(180deg, #4f8fdc, #2a6fc9); }
.node .tag-tipo { display: inline-block; margin-top: 5px; padding: 1px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; background: var(--blue-100); color: var(--blue-600); }
.node.individual .tag-tipo { background: #e3f0fe; color: #2a78d4; }
.node.root .tag-tipo { font-size: 11.5px; }
.node.t-socio.titular .avatar { background: linear-gradient(180deg, #eaf3fe, #d6e8fb); }
.d-head.t-empresa.individual .avatar { background: linear-gradient(180deg, #7db4f2, #4a8fe0); }

/* ---------- Impressão: marca ALIAS CNPJ no topo e no rodapé ---------- */
.print-marca { display: none; }
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  html, body { height: auto !important; overflow: visible !important; background: #fff !important; }
  .app { display: block !important; height: auto !important; overflow: visible !important; }
  .main { height: auto !important; }
  .content { display: block !important; padding: 8px 0 !important; }
  .workspace { border: 0 !important; padding: 0 !important; }
  .canvas-wrap { height: 150mm !important; flex: none !important; }
  .print-marca {
    display: flex !important; align-items: center; gap: 16px; padding: 10px 14px; border-radius: 6px;
    background: #070809 !important; color: #fff !important;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .print-marca img { height: 34px; width: auto; display: block; }
  .print-marca .pm-txt { flex: 1; min-width: 0; }
  .print-marca strong { display: block; font-size: 16px; letter-spacing: .08em; }
  .print-marca small { display: block; font-size: 10.5px; color: #c9ced6 !important; }
  .print-marca .pm-dir { text-align: right; font-size: 10.5px; color: #c9ced6 !important; }
  .print-marca .pm-dir b { color: #fff !important; }
  .print-marca.print-rodape { margin-top: 6px; border-radius: 0; padding-top: 6px; border-top: 1px solid #cfd9e8; display: flex !important; justify-content: space-between; gap: 12px; background: none !important; color: #5b6a82 !important; font-size: 9.5px; }
}

/* Voos da aeronave (modal) */
.voo-modal { text-align: left; }
.voo-status { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; border: 1px solid #d6e2ef; background: #f5f8fc; margin: 6px 0 10px; }
.voo-status svg { width: 26px; height: 26px; flex: none; color: #8090a8; }
.voo-status strong { display: block; font-size: 15px; }
.voo-status small { color: #5a6b82; }
.voo-status > div { flex: 1; }
.voo-status.live { background: #fff8e1; border-color: #f2c94c; }
.voo-status.live svg { color: #b7791f; }
.voo-status.solo svg { color: #2b6a99; }
.voo-live { background: #f2c94c; color: #5a3d00; font-weight: 800; font-size: 11px; letter-spacing: .5px; padding: 3px 8px; border-radius: 6px; }
.voo-kv { margin-bottom: 10px; }
.voo-hist-wrap { max-height: 320px; overflow: auto; border: 1px solid #e3e9f1; border-radius: 8px; }
.voo-hist { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.voo-hist th { position: sticky; top: 0; background: #f2f6fb; text-align: left; padding: 6px 8px; font-weight: 700; color: #3b4b62; }
.voo-hist td { padding: 6px 8px; border-top: 1px solid #edf1f6; white-space: nowrap; }
.voo-rodape { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }

/* Mapa do voo */
.voo-mapa { height: 340px; border-radius: 10px; border: 1px solid #d6e2ef; margin: 4px 0 6px; overflow: hidden; }
.voo-aviao { background: none; border: 0; }
.voo-aviao svg { width: 30px; height: 30px; color: #b7791f; fill: #f2c94c; stroke: #5a3d00; stroke-width: 1.2; filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
.voo-aviao.solo svg { fill: #9cc3e0; stroke: #2b6a99; }
.voo-legenda { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: #5a6b82; margin-bottom: 8px; }
.voo-legenda span { display: inline-flex; align-items: center; gap: 6px; }
.voo-legenda i { display: inline-block; }
.voo-legenda .lg-aviao { width: 11px; height: 11px; background: #f2c94c; border: 1px solid #5a3d00; transform: rotate(45deg); }
.voo-legenda .lg-rastro { width: 22px; height: 3px; background: #1559b8; border-radius: 2px; }
.voo-legenda .lg-origem { width: 11px; height: 11px; border-radius: 50%; background: #1f9d55; }
.voo-legenda .lg-destino { width: 11px; height: 11px; border-radius: 50%; background: #c0392b; }

/* Foto da aeronave (Planespotters) */
.voo-foto { margin: 4px 0 10px; text-align: left; }
.voo-foto-img { display: block; border-radius: 10px; overflow: hidden; background: #eef3f8; }
.voo-foto-img img { display: block; width: 100%; height: auto; max-height: 300px; object-fit: cover; }
.voo-foto-credito { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 11.5px; color: #5a6b82; margin-top: 4px; }
.voo-foto-credito a { color: #1559b8; }
.voo-foto-mais { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; color: #1559b8; font-size: 12px; }
.voo-foto-mais svg { width: 15px; height: 15px; }
.voo-foto-vazio { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; color: #5a6b82; padding: 8px 0; }
.voo-status .voo-sem-pos { display: block; margin-top: 3px; color: #8a5a00; }

/* ANTT (RNTRC / TRIC) no painel */
.antt-paises { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.antt-paises li { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; font-size: 12.5px; color: #5a6b82; padding: 4px 8px; border-radius: 6px; background: #f5f7fa; }
.antt-paises li strong { color: #1d2b3a; min-width: 82px; }
.antt-paises li.ok { background: #eef8f1; }
.antt-paises li.ok strong { color: #1f7a45; }

/* Login por WhatsApp */
.lg-box { text-align: left; }
.lg-texto { font-size: 14px; color: #33373b; line-height: 1.5; margin: 0 0 14px; }
.lg-rotulo { display: block; font-size: 12px; font-weight: 700; color: #5a6b82; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .4px; }
.lg-input { width: 100%; box-sizing: border-box; height: 46px; border: 1px solid #c9d3df; border-radius: 8px; padding: 0 14px; font-size: 18px; }
.lg-input:focus { outline: 2px solid #1559b8; border-color: transparent; }
.lg-codigo { font-size: 28px; letter-spacing: 10px; text-align: center; font-weight: 700; }
.lg-btn { width: 100%; height: 46px; margin-top: 12px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.lg-btn:disabled { opacity: .6; cursor: wait; }
.lg-msg { min-height: 20px; margin-top: 10px; font-size: 13px; color: #1f7a45; }
.lg-msg.erro { color: #c0392b; }
.lg-nota { font-size: 12px; color: #8090a8; margin: 10px 0 0; }
.lg-voltar { margin-top: 8px; width: 100%; justify-content: center; }
/* usuário na barra lateral */
.usuario-box { margin: 10px 14px; display: flex; align-items: center; gap: 8px; font-size: 13px; }
.usuario-box .us-info { flex: 1; display: flex; align-items: center; gap: 6px; color: #cfe0f7; min-width: 0; }
.usuario-box .us-info svg { width: 16px; height: 16px; color: #25d366; }
.usuario-box .us-info span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usuario-box button { border: 1px solid rgba(255,255,255,.25); background: transparent; color: #fff; border-radius: 6px; padding: 5px 10px; font-size: 12px; cursor: pointer; }
.usuario-box .us-entrar { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: #1f9d55; border-color: #1f9d55; padding: 8px 10px; font-weight: 600; }
.usuario-box .us-entrar svg { width: 15px; height: 15px; }

.usuario-box { flex-direction: column; align-items: stretch; }
.usuario-box .us-linha { display: flex; align-items: center; gap: 8px; }
.usuario-box .us-uso { margin-top: 2px; }
.usuario-box .us-barra { height: 5px; border-radius: 3px; background: rgba(255,255,255,.14); overflow: hidden; }
.usuario-box .us-barra i { display: block; height: 100%; width: 0; background: #25d366; border-radius: 3px; transition: width .3s; }
.usuario-box .us-barra.alerta i { background: #f2c94c; }
.usuario-box .us-barra.cheio i { background: #ec2638; }
.usuario-box .us-uso small { display: block; margin-top: 4px; font-size: 11px; color: #9fb3cf; }
