/* Layout: mesma identidade do Painel de Entregas GRF — névoa azul e ciano ao fundo, cabeçalho sobre a névoa, organograma dentro de um painel de vidro fosco; ativos em azul sólido, ação principal em degradê azul→ciano. */
:root {
  --bg: #E8EDF8;
  --haze-1: #465EBE; --haze-2: #19B4BE; --haze-3: #6ED8E0; --haze-4: #324598;
  --haze-op: .5;
  --glass: rgba(255, 255, 255, .56);
  --glass-strong: rgba(255, 255, 255, .8);
  --glass-line: rgba(255, 255, 255, .85);
  --shadow: 0 18px 50px -20px rgba(50, 69, 152, .38);
  --ink: #14183A; --ink-2: #3D446E; --ink-3: #59608A;
  --line: rgba(50, 69, 152, .14);
  --accent: #324598; --accent-2: #465EBE; --cyan: #19B4BE;
  --grad: linear-gradient(115deg, #324598 0%, #465EBE 36%, #19B4BE 78%, #6ED8E0 100%);
  --solido: linear-gradient(115deg, #324598, #465EBE);
  --chip-bg: rgba(255, 255, 255, .72); --chip-ink: #2B3470; --chip-line: rgba(50, 69, 152, .2);
  --ready-bg: rgba(25, 180, 190, .2); --ready-ink: #0A6A72; --ready-line: rgba(25, 180, 190, .55);
  --focus: #465EBE;
  --linha: rgba(50, 69, 152, .55);
  --faixa: rgba(70, 94, 190, .11);
  --faixa-forte: rgba(70, 94, 190, .14);
  --linha-faixa: rgba(50, 69, 152, .26);
  --mix-base: rgba(255, 255, 255, .92);
  --hover: rgba(50, 69, 152, .07);
  --campo: rgba(255, 255, 255, .9);
  --av-ini: linear-gradient(150deg, #E7ECFB, #D4F0F3);
  --av-ini-ink: #2B3470;
  --av-foto: #FFFFFF;
  --av-vaga: rgba(50, 69, 152, .07);
  --anel-fundo: #F4F7FD;
  --perigo: #B4233C; --perigo-fundo: rgba(200, 40, 60, .08); --perigo-linha: rgba(200, 40, 60, .35);
  --f-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0C0F2C;
    --haze-op: .42;
    --glass: rgba(30, 37, 92, .42);
    --glass-strong: rgba(38, 46, 108, .66);
    --glass-line: rgba(255, 255, 255, .14);
    --shadow: 0 18px 56px -20px rgba(0, 0, 0, .7);
    --ink: #F6F7FA; --ink-2: #C6CBE0; --ink-3: #9EA5C8;
    --line: rgba(255, 255, 255, .12);
    --accent: #9DB0FF; --accent-2: #7C93F0; --cyan: #6ED8E0;
    --solido: linear-gradient(115deg, #465EBE, #2C86A8);
    --chip-bg: rgba(255, 255, 255, .08); --chip-ink: #E6E9F8; --chip-line: rgba(255, 255, 255, .2);
    --ready-bg: rgba(110, 216, 224, .18); --ready-ink: #6ED8E0; --ready-line: rgba(110, 216, 224, .5);
    --focus: #9DB0FF;
    --linha: rgba(157, 176, 255, .5);
    --faixa: rgba(157, 176, 255, .085);
    --faixa-forte: rgba(157, 176, 255, .11);
    --linha-faixa: rgba(255, 255, 255, .17);
    --mix-base: rgba(20, 25, 66, .9);
    --hover: rgba(255, 255, 255, .07);
    --campo: rgba(12, 15, 44, .55);
    --av-ini: linear-gradient(150deg, #2A3577, #1A4D63);
    --av-ini-ink: #E6E9F8;
    --av-foto: #1A2050;
    --av-vaga: rgba(255, 255, 255, .06);
    --anel-fundo: #1A2050;
    --perigo: #FF9F9F; --perigo-fundo: rgba(255, 120, 120, .12); --perigo-linha: rgba(255, 159, 159, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0C0F2C;
  --haze-op: .42;
  --glass: rgba(30, 37, 92, .42);
  --glass-strong: rgba(38, 46, 108, .66);
  --glass-line: rgba(255, 255, 255, .14);
  --shadow: 0 18px 56px -20px rgba(0, 0, 0, .7);
  --ink: #F6F7FA; --ink-2: #C6CBE0; --ink-3: #9EA5C8;
  --line: rgba(255, 255, 255, .12);
  --accent: #9DB0FF; --accent-2: #7C93F0; --cyan: #6ED8E0;
  --solido: linear-gradient(115deg, #465EBE, #2C86A8);
  --chip-bg: rgba(255, 255, 255, .08); --chip-ink: #E6E9F8; --chip-line: rgba(255, 255, 255, .2);
  --ready-bg: rgba(110, 216, 224, .18); --ready-ink: #6ED8E0; --ready-line: rgba(110, 216, 224, .5);
  --focus: #9DB0FF;
  --linha: rgba(157, 176, 255, .5);
  --faixa: rgba(157, 176, 255, .085);
  --faixa-forte: rgba(157, 176, 255, .11);
  --linha-faixa: rgba(255, 255, 255, .17);
  --mix-base: rgba(20, 25, 66, .9);
  --hover: rgba(255, 255, 255, .07);
  --campo: rgba(12, 15, 44, .55);
  --av-ini: linear-gradient(150deg, #2A3577, #1A4D63);
  --av-ini-ink: #E6E9F8;
  --av-foto: #1A2050;
  --av-vaga: rgba(255, 255, 255, .06);
  --anel-fundo: #1A2050;
  --perigo: #FF9F9F; --perigo-fundo: rgba(255, 120, 120, .12); --perigo-linha: rgba(255, 159, 159, .35);
  color-scheme: dark;
}

html { height: 100%; box-sizing: border-box; -webkit-text-size-adjust: 100%; }
*, *::before, *::after { box-sizing: inherit; }
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 60;
  background: var(--bg);
}
#app { position: relative; z-index: 1; display: flex; flex-direction: column; height: 100%; }
button, input, select { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.oculto { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }

/* névoa */
.haze { position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.haze i { position: absolute; border-radius: 50%; filter: blur(90px); opacity: var(--haze-op); }
.haze .b1 { width: 62vmax; height: 62vmax; left: -18vmax; top: -26vmax; background: radial-gradient(circle, var(--haze-1) 0%, transparent 66%); animation: drift1 46s ease-in-out infinite alternate; }
.haze .b2 { width: 54vmax; height: 54vmax; right: -16vmax; top: -8vmax; background: radial-gradient(circle, var(--haze-2) 0%, transparent 66%); animation: drift2 52s ease-in-out infinite alternate; }
.haze .b3 { width: 58vmax; height: 58vmax; left: 18vmax; bottom: -30vmax; background: radial-gradient(circle, var(--haze-3) 0%, transparent 66%); animation: drift3 60s ease-in-out infinite alternate; }
.haze .b4 { width: 44vmax; height: 44vmax; left: -14vmax; bottom: -12vmax; background: radial-gradient(circle, var(--haze-4) 0%, transparent 66%); animation: drift2 48s ease-in-out infinite alternate-reverse; }
.haze::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
@keyframes drift1 { to { transform: translate(8vmax, 6vmax) scale(1.08); } }
@keyframes drift2 { to { transform: translate(-7vmax, 9vmax) scale(.94); } }
@keyframes drift3 { to { transform: translate(-9vmax, -6vmax) scale(1.1); } }

/* Cabeçalho */
.topo {
  position: relative;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-block: 18px 14px;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.topo-linha { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; }
.marca { display: flex; align-items: center; gap: 16px; min-width: 0; }
.logo { display: flex; flex: none; }
.logo svg { height: 46px; width: auto; display: block; }
.logo .neg { display: none; }
:root[data-theme="dark"] .logo .pos { display: none; }
:root[data-theme="dark"] .logo .neg { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo .pos { display: none; }
  :root:not([data-theme="light"]) .logo .neg { display: block; }
}
.divisor { width: 1px; align-self: stretch; min-height: 36px; background: var(--line); flex: none; }
.titulo { min-width: 0; }
.eyebrow { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.titulo h1 { margin: 2px 0 0; font-family: var(--f-display); font-weight: 600; font-size: 26px; line-height: 1.15; letter-spacing: -.01em; text-wrap: balance; }
.titulo h1 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.acoes { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.resumo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 7px 14px;
  border-radius: 100px;
  border: 1px solid var(--glass-line);
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.resumo::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); }

.filtros { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.segmento { display: flex; gap: 8px; max-width: 100%; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.segmento::-webkit-scrollbar { display: none; }
.segmento button {
  flex: none;
  padding: 8px 15px;
  border-radius: 100px;
  border: 1px solid var(--glass-line);
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.segmento button:hover { background: var(--glass-strong); }
.segmento button[aria-selected="true"] { background: var(--solido); color: #fff; border-color: transparent; box-shadow: 0 6px 14px -9px rgba(50, 69, 152, .7); }
.seletor { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.seletor select, .campo select {
  height: 36px;
  max-width: 100%;
  padding: 0 36px 0 15px;
  border-radius: 100px;
  border: 1px solid var(--glass-line);
  background: var(--glass) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%237A82AD' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  appearance: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
}
.seletor select option, .campo select option { background: var(--bg); color: var(--ink); }
.busca { position: relative; display: flex; align-items: center; margin-left: auto; flex: 0 1 300px; min-width: 200px; }
.busca svg { position: absolute; left: 14px; z-index: 1; width: 16px; height: 16px; color: var(--ink-3); pointer-events: none; }
.busca input {
  width: 100%;
  height: 38px;
  padding: 0 16px 0 38px;
  border-radius: 100px;
  border: 1px solid var(--glass-line);
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  outline: none;
}
.busca input::placeholder { color: var(--ink-3); }
.busca input:focus { border-color: var(--accent-2); }
.resultados {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(360px, calc(100vw - 32px));
  max-height: 360px;
  overflow-y: auto;
  padding: 6px;
  border-radius: 18px;
  border: 1px solid var(--glass-line);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(26px) saturate(1.4);
  backdrop-filter: blur(26px) saturate(1.4);
  box-shadow: var(--shadow);
  z-index: 40;
}
.resultados p { margin: 10px 12px; color: var(--ink-3); font-size: 13px; }

/* Barra de edição e avisos */
.barra-edicao, .aviso {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  padding: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  border-radius: 100px;
  border: 1px solid var(--glass-line);
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  backdrop-filter: blur(22px) saturate(1.4);
  box-shadow: var(--shadow);
  font-size: 13px;
}
.barra-edicao::-webkit-scrollbar, .aviso::-webkit-scrollbar { display: none; }
.barra-edicao > *, .aviso > * { flex: none; }
.aviso > span:first-child { flex: 0 1 auto; padding-left: 10px; color: var(--ink); white-space: normal; min-width: 200px; }
.selo-edicao {
  padding: 8px 14px;
  border-radius: 100px;
  background: var(--solido);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
#pendentes { padding: 0 6px; color: var(--ink-2); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.espaco { flex: 1 0 4px; }

/* Botões */
.bt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border-radius: 100px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, border-color .15s, filter .15s;
}
.bt:disabled { opacity: .45; cursor: default; }
.bt-primario { background: var(--grad); color: #fff; box-shadow: 0 6px 14px -9px rgba(50, 69, 152, .7); }
.bt-primario:not(:disabled):hover { filter: brightness(1.08); }
.bt-claro { background: var(--glass-strong); color: var(--ink); border-color: var(--glass-line); }
.bt-claro:not(:disabled):hover { border-color: var(--accent-2); }
.bt-fantasma { background: var(--chip-bg); color: var(--chip-ink); border-color: var(--chip-line); }
.bt-fantasma:not(:disabled):hover { border-color: var(--accent-2); }
.bt-perigo { background: var(--perigo-fundo); color: var(--perigo); border-color: var(--perigo-linha); }
.bt-pequeno { height: 30px; padding: 0 12px; font-size: 12px; }
.bt-link { padding: 4px 0; border: 0; background: none; color: var(--accent-2); font-size: 13px; font-weight: 600; cursor: pointer; text-align: left; }
.bt-link:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* Palco: o organograma dentro de um painel de vidro */
.tela {
  position: relative;
  flex: 1;
  min-height: 0;
  margin-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px));
  margin-bottom: max(16px, env(safe-area-inset-bottom, 0px));
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid var(--glass-line);
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  backdrop-filter: blur(22px) saturate(1.4);
  box-shadow: var(--shadow);
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.tela.movendo { cursor: grabbing; }
.palco { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.tela.animando .palco, .tela.animando .faixa, .tela.animando .rotulo { transition: transform .35s cubic-bezier(.2, .7, .2, 1), height .35s cubic-bezier(.2, .7, .2, 1); }
.faixas { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.faixa { position: absolute; left: 0; right: 0; top: 0; border-top: 1.5px solid var(--linha-faixa); }
.faixa.par { background: var(--faixa); }
.faixa.vazia { background-image: repeating-linear-gradient(135deg, transparent 0 8px, var(--line) 8px 9px); }
.rotulos {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 5;
  width: 204px;
  pointer-events: none;
  border-right: 1px solid var(--glass-line);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
  box-shadow: 10px 0 26px -22px rgba(50, 69, 152, .7);
}
.rotulos:empty { display: none; }
.rotulo {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  display: flex;
  align-items: center;
  padding: 0 20px 0 16px;
  overflow: hidden;
  border-top: 1.5px solid var(--linha-faixa);
  font-size: var(--rotulo-fonte, 11px);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink);
}
.rotulo.par { background: var(--faixa-forte); }
.rotulo::after { content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: 7px; background: var(--nivel-cor); }
.rotulo.vazio { color: var(--ink-3); font-weight: 600; }
.rotulo-texto { display: block; min-width: 0; }
.rotulo.apertado { letter-spacing: .03em; }
.rotulo.apertado .rotulo-texto { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legenda {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-width: 270px;
  padding: 12px 16px;
  border-radius: 18px;
  border: 1px solid var(--glass-line);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 26px -16px rgba(50, 69, 152, .6);
  cursor: default;
}
.legenda-titulo { display: flex; align-items: center; gap: 8px; margin: 0 0 2px; padding: 0; border: 0; background: none; cursor: pointer; font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.legenda-titulo:hover { color: var(--ink); }
.legenda-titulo .mini-pontos { display: none; gap: 4px; }
.legenda-titulo .mini-pontos .dot { width: 8px; height: 8px; }
.legenda-titulo .seta { margin-left: auto; font-size: 11px; }
.legenda.recolhida { padding: 9px 14px; }
.legenda.recolhida .legenda-titulo { margin: 0; }
.legenda.recolhida .legenda-titulo .mini-pontos { display: inline-flex; }
.legenda.recolhida .legenda-item { display: none; }
.legenda-item { display: flex; align-items: flex-start; gap: 9px; font-size: 12.5px; font-weight: 600; line-height: 1.3; color: var(--ink); }
.legenda-item .dot { margin-top: 3px; }
.legenda-item small { display: block; font-size: 11.5px; font-weight: 500; color: var(--ink-3); }
.dot { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 50%; }
.segmento button { display: inline-flex; align-items: center; gap: 7px; }
.segmento button .dot { width: 8px; height: 8px; }
.segmento button[aria-selected="true"] .dot { box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .9); }
.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 14px; }
.chip .dot { width: 8px; height: 8px; }

.linhas { position: absolute; left: 0; top: 0; overflow: visible; }
.linhas path { fill: none; stroke: var(--linha); stroke-width: var(--traco, 5); stroke-linecap: round; stroke-linejoin: round; }
.nos { position: absolute; inset: 0; }

/* Pessoa: cartão (foto em cima) e pílula (equipes compactas) */
.no {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 252px;
  height: 238px;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: none;
  color: var(--ink);
  text-align: center;
  cursor: pointer;
  transition: opacity .2s;
}
.no:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.no-texto {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  margin-top: 10px;
  padding: 6px 14px 7px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--cor, var(--accent-2)) 38%, transparent);
  background: color-mix(in srgb, var(--cor, var(--accent-2)) 14%, var(--mix-base));
  box-shadow: 0 6px 14px -12px color-mix(in srgb, var(--cor, var(--accent-2)) 80%, transparent);
}
.no-nome { margin-top: 0; max-width: 100%; font-size: 22px; font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.no-cargo {
  margin-top: 2px;
  max-width: 100%;
  font-size: 16px;
  line-height: 1.3;
  color: var(--ink-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.no.pilula { flex-direction: row; width: 196px; height: 52px; text-align: left; }
.no.pilula .no-texto {
  flex: 1;
  align-items: flex-start;
  justify-content: center;
  height: 40px;
  margin-left: -22px;
  padding: 0 14px 0 30px;
  border-radius: 100px;
  border: 1px solid var(--glass-line);
  background: var(--glass-strong);
  box-shadow: 0 8px 20px -16px rgba(50, 69, 152, .7);
}
.no.pilula .no-nome { margin-top: 0; font-size: 12.5px; }
.no.pilula .no-cargo { font-size: 11px; -webkit-line-clamp: 1; }
.avatar {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  flex: none;
  width: var(--tam);
  height: var(--tam);
  border-radius: 50%;
  border: 5px solid var(--cor, var(--accent-2));
  background: var(--av-foto);
  box-shadow: 0 8px 18px -12px rgba(50, 69, 152, .7);
  transition: box-shadow .18s;
}
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.avatar-iniciais {
  background: color-mix(in srgb, var(--cor, var(--accent-2)) 16%, var(--mix-base));
  color: color-mix(in srgb, var(--cor, var(--accent-2)) 80%, var(--ink));
  font-family: var(--f-display);
  font-weight: 700;
  font-size: calc(var(--tam) * .32);
  letter-spacing: .02em;
}
.avatar-vaga { border: 2px dashed var(--cor, var(--accent-2)); background: color-mix(in srgb, var(--cor, var(--accent-2)) 8%, var(--mix-base)); color: var(--cor, var(--accent-2)); box-shadow: none; }
.avatar-vaga svg { width: 58%; height: 58%; margin-top: 8%; opacity: .7; }
.selo-vaga {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 8px;
  border-radius: 100px;
  border: 1px solid var(--ready-line);
  background: var(--glass-strong);
  color: var(--ready-ink);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.no:hover .avatar { box-shadow: 0 0 0 4px color-mix(in srgb, var(--cor, var(--accent-2)) 22%, transparent), 0 8px 18px -12px rgba(50, 69, 152, .7); }
.no.vaga .no-nome { color: var(--ink-2); }
.no.selecionado .avatar { box-shadow: 0 0 0 6px color-mix(in srgb, var(--cor, var(--accent-2)) 34%, transparent), 0 12px 24px -12px rgba(50, 69, 152, .8); }
.no.alterado .avatar::after {
  content: "";
  position: absolute;
  top: -3px;
  right: -3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 3px var(--anel-fundo);
}
.nos.focando .no:not(.realce) { opacity: .28; }
.no.pulso .avatar { animation: pulso 1.4s ease-out 2; }
@keyframes pulso {
  0% { box-shadow: 0 0 0 0 rgba(25, 180, 190, .6); }
  100% { box-shadow: 0 0 0 26px rgba(25, 180, 190, 0); }
}
.no.arrastando { opacity: .35; }
.no.alvo .avatar { box-shadow: 0 0 0 8px rgba(25, 180, 190, .38); }
.no.alvo-invalido { opacity: .4; cursor: not-allowed; }
.editando .no { cursor: grab; }
.fantasma {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 16px 4px 4px;
  border-radius: 100px;
  background: var(--solido);
  color: #fff;
  box-shadow: 0 12px 30px -10px rgba(20, 24, 58, .55);
  font-family: var(--f-body);
  font-size: 13px;
  font-weight: 600;
  pointer-events: none;
}

/* Controles do palco */
.zoom { position: absolute; left: 14px; bottom: 14px; z-index: 10; display: flex; align-items: center; gap: 10px; }
.zoom-grupo {
  display: flex;
  overflow: hidden;
  border-radius: 100px;
  border: 1px solid var(--glass-line);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 22px -14px rgba(50, 69, 152, .6);
}
.zoom button { display: grid; place-items: center; width: 40px; height: 38px; border: 0; background: none; color: var(--ink-2); cursor: pointer; }
.zoom button + button { border-left: 1px solid var(--line); }
.zoom button:hover { color: var(--ink); background: var(--hover); }
.zoom svg { width: 18px; height: 18px; }
.dica {
  margin: 0;
  max-width: 46ch;
  padding: 7px 14px;
  border-radius: 100px;
  border: 1px solid var(--glass-line);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink-3);
}
/* Tela cheia: só o organograma; filtros e o botão de voltar flutuam por cima */
.bt-cheia svg { width: 16px; height: 16px; flex: none; }
.barra-cheia { display: none; }
#app.tela-cheia .topo { display: none; }
#app.tela-cheia .tela {
  position: fixed;
  inset: 0;
  z-index: 40;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
#app.tela-cheia .barra-cheia {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 15;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}
#app.tela-cheia .barra-cheia > * { pointer-events: auto; }
#app.tela-cheia .painel:not([hidden]) ~ .barra-cheia { right: 414px; }
#app.tela-cheia .legenda { top: 62px; }
.filtros-cheia {
  min-width: 0;
  max-width: 100%;
  padding: 4px;
  border-radius: 100px;
  border: 1px solid var(--glass-line);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 22px -14px rgba(50, 69, 152, .6);
}
.filtros-cheia .segmento { gap: 4px; }
.filtros-cheia .segmento button { padding: 6px 13px; font-size: 12.5px; border-color: transparent; background: none; }
.filtros-cheia .segmento button[aria-selected="true"] { background: var(--solido); }
.barra-cheia .bt { flex: none; box-shadow: 0 8px 22px -12px rgba(50, 69, 152, .7); }
.vazio { position: absolute; inset: 0; display: grid; place-content: center; gap: 6px; padding: 24px; text-align: center; color: var(--ink-2); }
.vazio strong { color: var(--ink); font-family: var(--f-display); font-size: 18px; font-weight: 600; }
.toast {
  position: absolute;
  top: 14px;
  left: 50%;
  z-index: 50;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 10px 12px 10px 18px;
  border-radius: 100px;
  border: 1px solid var(--accent-2);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  backdrop-filter: blur(22px) saturate(1.4);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow);
}
.toast button { border: 0; background: none; color: var(--accent-2); font-weight: 700; cursor: pointer; padding: 4px 6px; }

/* Painel lateral (ficha) */
.painel {
  position: absolute;
  top: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  width: min(390px, calc(100% - 24px));
  border-radius: 20px;
  border: 1px solid var(--glass-line);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(26px) saturate(1.4);
  backdrop-filter: blur(26px) saturate(1.4);
  box-shadow: var(--shadow);
  cursor: default;
  user-select: text;
  -webkit-user-select: text;
  touch-action: auto;
}
.painel-cab { display: flex; align-items: center; gap: 10px; padding: 18px 14px 12px 22px; border-bottom: 1px solid var(--line); }
.painel-cab h2 { flex: 1; min-width: 0; margin: 0; font-family: var(--f-display); font-size: 20px; font-weight: 600; line-height: 1.2; letter-spacing: -.01em; text-wrap: balance; overflow-wrap: anywhere; }
.bt-icone {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--chip-line);
  background: var(--chip-bg);
  color: var(--ink-2);
  cursor: pointer;
}
.bt-icone:hover { color: var(--ink); border-color: var(--accent-2); }
.bt-icone svg { width: 16px; height: 16px; }
.painel-corpo { flex: 1; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; padding: 18px 22px 24px; display: flex; flex-direction: column; gap: 20px; }
.p-topo { display: flex; align-items: center; gap: 18px; }
.p-id { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.p-cargo { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink-2); line-height: 1.4; }
.p-completo { margin: 0; font-size: 12.5px; line-height: 1.4; color: var(--ink-3); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 4px 11px;
  border-radius: 100px;
  border: 1px solid var(--chip-line);
  background: var(--chip-bg);
  color: var(--chip-ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  white-space: normal;
  max-width: 100%;
}
.chip-forte { background: var(--ready-bg); color: var(--ready-ink); border-color: var(--ready-line); }
.secao { display: flex; flex-direction: column; gap: 8px; }
.secao h3, .previa h3 { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.secao p { margin: 0; color: var(--ink-2); font-size: 13px; line-height: 1.5; }
.lista { display: flex; flex-direction: column; gap: 4px; }
.linha-pessoa {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: none;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.linha-pessoa:hover { background: var(--hover); border-color: var(--line); }
.linha-pessoa .avatar { border-width: 2px; box-shadow: none; }
.linha-pessoa span:last-child { display: flex; flex-direction: column; min-width: 0; }
.linha-pessoa b { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.linha-pessoa small { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.linha-pessoa.estatica { cursor: default; padding-inline: 0; }
.linha-pessoa.estatica:hover { background: none; border-color: transparent; }
.nota { margin: 0; font-size: 12.5px; color: var(--ink-3); line-height: 1.45; }
.numero { font-variant-numeric: tabular-nums; }
.historico-lista { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; color: var(--ink-2); font-size: 13px; line-height: 1.45; }

/* Formulários */
.p-foto { display: flex; align-items: center; gap: 18px; }
.editor-foto {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: rgba(12, 15, 44, .45);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.editor-cartao {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(400px, 100%);
  max-height: 100%;
  overflow-y: auto;
  padding: 22px;
  border-radius: 24px;
  border: 1px solid var(--glass-line);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(26px) saturate(1.4);
  backdrop-filter: blur(26px) saturate(1.4);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-family: var(--f-body);
}
.editor-cartao h2 { margin: 0; font-family: var(--f-display); font-size: 19px; font-weight: 600; line-height: 1.25; }
.editor-moldura { display: grid; place-items: center; }
.editor-palco { width: min(300px, 72vw); height: min(300px, 72vw); border-radius: 18px; cursor: grab; touch-action: none; background: #fff; }
.editor-palco:active { cursor: grabbing; }
.editor-zoom { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 700; color: var(--ink-2); }
.editor-zoom input { flex: 1; min-width: 0; accent-color: var(--accent-2); }
.p-foto-acoes { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.p-foto-acoes .linha { display: flex; flex-wrap: wrap; gap: 8px; }
.campo { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.campo input[type="text"] {
  height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--chip-line);
  background: var(--campo);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  outline: none;
}
.campo input[type="text"]:focus, .campo select:focus, .campo textarea:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(70, 94, 190, .14); outline: none; }
.campo textarea {
  min-height: 110px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--chip-line);
  background: var(--campo);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--ink);
  resize: vertical;
}
.campo textarea::placeholder { color: var(--ink-3); }
.secao p.atividades { margin: 0; font-size: 14px; line-height: 1.55; color: var(--ink); white-space: pre-line; overflow-wrap: anywhere; }
.campo select { height: 42px; width: 100%; border-radius: 14px; border-color: var(--chip-line); background-color: var(--campo); color: var(--ink); font-weight: 500; }
.campo input::placeholder { color: var(--ink-3); }
.campo select + input { margin-top: 4px; }
.linha-gestor { display: flex; gap: 6px; }
.linha-gestor select { flex: 1; min-width: 0; }
.grade-campos { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grade-campos > * { min-width: 0; }
.marcar { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 500; color: var(--ink); cursor: pointer; }
.marcar input { width: 18px; height: 18px; flex: none; accent-color: var(--accent-2); }
.p-acoes { display: flex; flex-wrap: wrap; gap: 8px; }
.botoes-nivel { display: flex; flex-wrap: wrap; gap: 8px; margin-top: -8px; }
.confirma { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 16px; border: 1px solid var(--perigo-linha); background: var(--perigo-fundo); }
.confirma p { margin: 0; color: var(--ink); font-size: 13px; line-height: 1.45; }
.confirma .linha { display: flex; flex-wrap: wrap; gap: 8px; }
.confirma.neutra { border-color: var(--chip-line); background: var(--chip-bg); }
.bt-vago { align-self: flex-start; }
.aviso-vaga {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 10px 10px 14px;
  border-radius: 14px;
  border: 1px dashed var(--chip-line);
  background: var(--chip-bg);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}
.painel-rodape {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px 14px 22px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 20px 20px;
  background: var(--glass-strong);
}
.painel-rodape .estado { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.alerta { margin: 0; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--perigo-linha); background: var(--perigo-fundo); color: var(--perigo); font-size: 13px; line-height: 1.45; }
.sucesso { margin: 0; padding: 12px 16px; border-radius: 16px; border: 1px solid var(--ready-line); background: var(--glass-strong); color: var(--ink); font-size: 13px; line-height: 1.45; }
.sugestao, .previa { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-radius: 18px; border: 1px solid var(--glass-line); background: var(--chip-bg); }
.sugestao { border-color: var(--accent-2); margin-bottom: 4px; }
.sugestao p { margin: 0; font-size: 13px; line-height: 1.45; color: var(--ink); font-weight: 500; }
.sugestao .linha { display: flex; flex-wrap: wrap; gap: 8px; }
.previa .marcar { font-size: 12.5px; line-height: 1.4; }
details.mais summary { cursor: pointer; color: var(--ink-2); font-size: 13px; font-weight: 600; }
details.mais[open] summary { margin-bottom: 12px; }

@media (max-width: 720px) {
  .haze i { filter: blur(60px); animation: none; }
  .topo { gap: 10px; padding-block: 12px 10px; padding-left: max(14px, env(safe-area-inset-left, 0px)); padding-right: max(14px, env(safe-area-inset-right, 0px)); }
  .logo svg { height: 36px; }
  .marca { gap: 12px; }
  .titulo .eyebrow { display: none; }
  .titulo h1 { font-size: 20px; }
  .acoes { width: 100%; }
  .busca { flex: 1 1 100%; margin-left: 0; min-width: 0; }
  .busca input { font-size: 16px; }
  .seletor > span { display: none; }
  .dica { display: none; }
  .rotulos { width: 100px; }
  .rotulo { padding: 0 11px 0 8px; letter-spacing: .04em; }
  .rotulo::after { width: 5px; }
  .legenda { top: 8px; right: 8px; max-width: calc(100% - 116px); }
  #app.tela-cheia .barra-cheia { top: 8px; left: 8px; right: 8px; }
  #app.tela-cheia .painel:not([hidden]) ~ .barra-cheia { right: 8px; }
  #app.tela-cheia .legenda { top: 58px; }
  .barra-cheia .bt { width: 40px; padding: 0; }
  .barra-cheia .bt .txt { display: none; }
  .tela { margin-inline: max(10px, env(safe-area-inset-left, 0px)) max(10px, env(safe-area-inset-right, 0px)); margin-bottom: max(10px, env(safe-area-inset-bottom, 0px)); border-radius: 20px; -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3); }
  .painel { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 80%; }
  .grade-campos { grid-template-columns: 1fr; }
}
@media (max-height: 620px) {
  .topo { gap: 8px; padding-block: 10px 8px; }
  .logo svg { height: 32px; }
  .titulo .eyebrow { display: none; }
  .titulo h1 { font-size: 19px; }
  .resumo { display: none; }
  .dica { display: none; }
  .legenda { display: none; }
  .busca input, .bt, .seletor select { height: 32px; }
  .segmento button { padding: 5px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .haze i { animation: none; }
  .tela.animando .palco, .tela.animando .faixa, .tela.animando .rotulo { transition: none; }
  .no.pulso .avatar { animation: none; }
}

/* Enquanto os dados chegam do servidor */
.carregando { margin: auto; padding: 24px; color: var(--ink-3); font-weight: 600; text-align: center; }

/* Tela de entrada (login com a conta Google da GRF) */
.entrada { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; height: 100%; padding: 24px 16px; }
.entrada-cartao {
  width: 100%;
  max-width: 400px;
  padding: 32px 28px 28px;
  border-radius: 28px;
  border: 1px solid var(--glass-line);
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  text-align: center;
}
.entrada-cartao .logo { justify-content: center; margin-bottom: 18px; }
.entrada-cartao .logo svg { height: 56px; }
.entrada-cartao h1 { margin: 0 0 6px; font-family: var(--f-display); font-size: 24px; letter-spacing: -.02em; }
.entrada-cartao p { margin: 0; color: var(--ink-2); }
.entrada-botao { display: flex; justify-content: center; min-height: 44px; margin: 22px 0 14px; }
.entrada-aviso { margin-top: 14px !important; padding: 10px 14px; border-radius: 14px; font-weight: 600; }
.entrada-aviso.erro { background: var(--perigo-fundo); color: var(--perigo); border: 1px solid var(--perigo-linha); }
.entrada-aviso.ok { background: var(--ready-bg); color: var(--ready-ink); border: 1px solid var(--ready-line); }
.entrada-nota { font-size: 12.5px; color: var(--ink-3) !important; }
.entrada-nota a { color: var(--accent-2); font-weight: 600; text-underline-offset: 3px; }
.entrada-nota + .entrada-nota { margin-top: 10px !important; }
