:root {
  --verde: #0b2a1f; --verde2: #123a2b; --verde3: #1b4d3a; --acento: #1f6b4f; --claro: #e8f1ec;
  --bg: #f4f7f5; --card: #fff; --ink: #14231c; --muted: #5d6f66; --line: #e1e8e4;
  --alto: #c2453d; --medio: #c9821f; --baixo: #1f6b4f; --azul: #2f6fb0; --warn: #3b5b4a;
}
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', 'Inter', Tahoma, sans-serif; }
body { display: flex; min-height: 100vh; background: var(--bg); color: var(--ink); }
#sidebar { width: 252px; background: var(--verde); color: #d5e3db; padding: 18px 14px; flex-shrink: 0;
           display: flex; flex-direction: column; }
.brand { font-size: 1.5rem; font-weight: 700; padding: 6px 10px 18px; color: #fff; letter-spacing: -.01em; }
.brand::after { content: "."; color: #5fd3a0; }
.grupo { margin-top: 14px; }
.grupo-titulo { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #86a496; padding: 6px 10px; }
.item { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px;
        border-radius: 8px; cursor: pointer; font-size: .92rem; color: #d5e3db; text-decoration: none; }
.item:hover { background: var(--verde2); }
.item.ativo { background: var(--verde3); color: #fff; }
.item.breve { color: #6f8a7b; cursor: default; }
.tag { font-size: .62rem; background: #1a3a2d; color: #9fb8aa; padding: 2px 7px; border-radius: 10px; }
.rodape-lateral { margin-top: auto; padding: 14px 10px 4px; border-top: 1px solid #1b3a2d; font-size: .78rem; color: #9fb8aa; }
.rodape-lateral b { display: block; color: #fff; font-size: .86rem; margin-bottom: 3px; }
.rodape-lateral .independente { display: block; margin-top: 8px; padding-top: 8px; border-top: 1px solid #1b3a2d;
                                color: #d5e3db; font-weight: 600; }
.anuncios { margin-top: 10px; padding-top: 10px; border-top: 1px solid #1b3a2d; font-size: .78rem; color: #9fb8aa; }
.anuncio { background: var(--verde2); border-radius: 8px; padding: 8px 10px; margin-top: 8px; }
.anuncio b { display: block; color: #fff; font-size: .82rem; margin-bottom: 2px; }
.anuncio p { margin-bottom: 4px; }
.anuncio a { color: #5fd3a0; }
.sessao { margin-top: auto; padding: 8px 10px; font-size: .8rem; color: #9fb8aa; }
.sessao a { color: #5fd3a0; }
.sessao + .rodape-lateral { margin-top: 0; }
.login { max-width: 420px; margin: 40px auto; }
.login .campo { margin-bottom: 10px; }
.login p.muted { font-size: .84rem; }
#content { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#topbar { background: #fff; border-bottom: 1px solid var(--line); padding: 12px 24px; display: flex; gap: 16px; align-items: center; }
#busca { flex: 1; max-width: 520px; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line);
         background: var(--bg); color: var(--ink); }
#topbar .muted { color: var(--muted); font-size: .8rem; }
main { padding: 26px 28px; overflow: auto; }
h1 { font-size: 1.7rem; margin-bottom: 6px; letter-spacing: -.01em; }
h1 + .sub { color: var(--muted); margin-bottom: 16px; font-size: .95rem; }
h3 { font-size: .98rem; margin: 14px 0 6px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { border-radius: 12px; padding: 16px 18px; background: var(--card); border: 1px solid var(--line); }
.kpi .rotulo { font-size: .85rem; color: var(--muted); }
.kpi .valor { font-size: 2rem; font-weight: 700; margin-top: 6px; color: var(--verde); }
.kpi .nota { font-size: .75rem; color: var(--muted); margin-top: 2px; }
.grade { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 14px; }
.card { background: var(--card); border-radius: 12px; padding: 18px; border: 1px solid var(--line); }
.card h2 { font-size: 1.05rem; margin-bottom: 4px; }
.card .sub { color: var(--muted); font-size: .85rem; margin-bottom: 12px; }
.card.breve { background: #f8faf9; border-style: dashed; color: var(--muted); }
.card.largo { grid-column: 1 / -1; }
.selo, .pill { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: .74rem; font-weight: 600;
               white-space: nowrap; text-decoration: none; }
.selo { color: #fff; }
.selo.incompativel { background: var(--alto); } .selo.divergente { background: var(--medio); }
.pill { background: var(--claro); color: var(--acento); }
.pill.ok { background: #dff3e8; color: #176244; } .pill.off { background: #eceeed; color: var(--muted); }
.codigo { display: inline-block; font-size: .72rem; font-weight: 700; background: var(--claro); color: var(--acento);
          border-radius: 5px; padding: 1px 6px; margin-right: 6px; }
.aviso { font-size: .86rem; color: var(--warn); background: #eaf3ee; border: 1px solid #cfe3d8;
         border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; }
.regras { padding-left: 18px; font-size: .88rem; line-height: 1.6; }
.regras-grade { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px 28px; margin-top: 8px; }
.regra b { display: block; margin-bottom: 2px; }
.regra p { font-size: .87rem; color: var(--muted); }
.regra details { margin-top: 4px; font-size: .84rem; color: var(--muted); }
.regra summary { cursor: pointer; color: var(--acento); }
.legenda i.anel { background: transparent; border: 3px solid #22d3ee; }
.campo, .lista { width: 100%; margin-top: 8px; }
.breve-msg { padding: 28px 8px; text-align: center; }
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th { text-align: left; color: var(--muted); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--line); font-size: .8rem; }
td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.num, th.num { text-align: right; white-space: nowrap; }
a { color: var(--acento); }
.muted { color: var(--muted); }
.barra { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: .84rem; justify-content: space-between; }
.barra .trilho { flex: 1; background: var(--line); border-radius: 6px; height: 10px; }
.barra .preenche { background: var(--acento); height: 10px; border-radius: 6px; }
.filtros { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
select, input[type=text], input[type=search], input[type=password] { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
button { padding: 8px 14px; border: 0; border-radius: 8px; background: var(--acento); color: #fff; cursor: pointer; }
button:disabled { opacity: .4; cursor: default; }
.vazio { padding: 24px; text-align: center; color: var(--muted); }
.rosca-bloco { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.rosca { width: 130px; height: 130px; border-radius: 50%; display: grid; place-items: center; }
.rosca span { background: #fff; width: 86px; height: 86px; border-radius: 50%; display: grid; place-items: center;
              font-size: 1.6rem; font-weight: 700; color: var(--verde); }
.rosca-legenda { font-size: .88rem; line-height: 1.9; }
.rosca-legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.fontes-grade { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; }
.fonte-card .topo { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.fonte-card h2 { margin-bottom: 2px; }
.fonte-card .estado { margin-top: 12px; font-size: .84rem; color: var(--muted); }
.teia { display: grid; grid-template-columns: 300px 1fr; gap: 14px; height: calc(100vh - 150px); min-height: 480px; }
.teia { grid-template-rows: minmax(0, 1fr); }
.teia .painel { overflow-y: auto; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
#net { background: #0f1f18; border-radius: 12px; min-height: 0; overflow: hidden; position: relative; }
#teia-caso { background: #0f1f18; border-radius: 12px; min-height: 0; position: relative;
             overflow: hidden; }
.teia-radial-svg { position: absolute; top: 0; left: 0; }
.radial-linha { stroke: #334155; stroke-width: 1.4; }
.radial-linha-extra { stroke: #75bfa1; stroke-width: 1.8; stroke-dasharray: 5 7;
                      animation: fluxo-teia 18s linear infinite; }
.teia-caso-canvas { position: relative; transform-origin: center center; transition: transform .18s ease-out; }
.categoria-label { fill: #a7b7b0; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.no-radial { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 4px;
             cursor: pointer; transform: translateX(-10px); outline: none; }
.no-radial:hover .avatar-radial { border-width: 4px; }
.no-radial:focus-visible .avatar-radial { outline: 3px solid #a3e635; outline-offset: 4px; }
.avatar-radial { border-radius: 50%; border: 3px solid #64748b; overflow: hidden; background: #1a2e24;
                 display: grid; place-items: center; flex-shrink: 0;
                 box-shadow: 0 0 18px rgba(95, 211, 160, .16); }
.avatar-radial-img { width: 100%; height: 100%; object-fit: cover; }
.no-radial.hub .avatar-radial { border-width: 4px; }
.no-radial-nome { font-size: .72rem; color: #e8f1ec; text-align: center; max-width: 110px;
                  line-height: 1.25; text-shadow: 0 1px 3px #000, 0 0 6px #000; overflow-wrap: anywhere; }
.legenda { display: flex; gap: 12px; flex-wrap: wrap; font-size: .8rem; }
.legenda .ico { vertical-align: middle; margin-right: 4px; }
.legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; }
.det b { display: block; color: var(--muted); font-weight: 600; font-size: .78rem; margin-top: 6px; }
.paginacao { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 10px; }
@keyframes fluxo-teia { to { stroke-dashoffset: -48; } }
.item-icon { display: none; }
.teia-controles { position: absolute; z-index: 2; top: 12px; right: 12px; display: flex; gap: 6px;
                  padding: 6px; border: 1px solid rgba(255,255,255,.16); border-radius: 12px;
                  background: rgba(4, 18, 15, .78); backdrop-filter: blur(12px); }
.teia-controle { width: 40px; height: 40px; padding: 0; display: grid; place-items: center;
                 border: 1px solid rgba(255,255,255,.14); border-radius: 9px;
                 background: rgba(21, 54, 42, .9); color: #f1f7f4; font-size: 1.2rem; }
.teia-controle:hover { background: #276c50; }
.teia-controle:focus-visible, .teia-legenda summary:focus-visible { outline: 3px solid #a3e635; outline-offset: 2px; }
.teia-status { display: none; }
.teia-caso-apresentacao { position: absolute; z-index: 2; top: 14px; left: 14px;
  max-width: min(420px, 45%); padding: 10px 13px; border: 1px solid rgba(255,255,255,.13);
  border-radius: 12px; color: #f4faf7; background: rgba(4, 18, 15, .68); backdrop-filter: blur(12px); }
.teia-caso-apresentacao h2 { font-size: 1rem; margin-bottom: 3px; }
.teia-caso-apresentacao p { color: #d1e2d9; font-size: .8rem; line-height: 1.4; }
.teia-legenda { position: absolute; z-index: 2; right: 12px; bottom: 12px; display: block;
  max-width: min(340px, 40%); border: 1px solid rgba(255,255,255,.16); border-radius: 12px;
  color: #f1f7f4; background: rgba(4, 18, 15, .78); backdrop-filter: blur(12px); }
.teia-legenda summary { padding: 9px 12px; cursor: pointer; font-weight: 650; }
.teia-legenda-conteudo { display: grid; gap: 8px; padding: 0 12px 12px; font-size: .82rem; }
.teia-legenda-conteudo p { color: #d1e2d9; line-height: 1.4; }
.teia-home-intro { margin-bottom: 12px; }
.teia-home-intro p { color: var(--muted); font-size: .9rem; }
.teia-home { position: relative; display: block; width: 100%; height: min(70vh, 760px);
             min-height: min(500px, 54vh); }
.teia-home .painel { display: none; position: absolute; z-index: 3; left: 12px; bottom: 12px;
                     width: min(320px, calc(100% - 24px)); max-height: calc(100% - 24px); }
.teia-home .painel.detalhe-aberto { display: flex; }
.teia-home .painel .card { overflow-y: auto; max-height: 100%; background: rgba(255,255,255,.96); }
.fechar-detalhe { float: right; margin: -6px -6px 6px 10px; padding: 5px 9px; font-size: .78rem; }
.teia-home #teia-caso { position: absolute; inset: 0; width: 100%; height: 100%;
                        border: 1px solid #203c31; border-radius: 16px;
                        background: radial-gradient(ellipse at 55% 45%, #153a2e 0%, #0a211a 68%, #06140f 100%); }
.teia-home .teia-controles { top: 12px; right: 12px; }
.teia-home .teia-controles .teia-controle:not(:first-child) { display: grid; }
.teia-home .teia-status { display: block; }
.teia-home .teia-caso-apresentacao { display: block; }
.teia-home .teia-caso-canvas { position: absolute; left: 50%; top: 50%;
                               transform: translate(-50%, -50%) scale(1); }
.teia-home .no-radial:not(.hub) { transform: translateX(-10px) scale(1.12); }
.teia-home .no-radial.hub { transform: translateX(-10px) scale(1.08); }
.teia-home .no-radial-nome { max-width: 180px; font-size: .78rem; color: #fff; }
.teia-home .categoria-label { fill: #b5c4be; font-size: 14px; }
.caso-resumo { margin-top: 18px; }
.teia-status { position: absolute; z-index: 3; top: 68px; right: 16px; max-width: min(440px, 90%);
               color: #f1f7f4; font-size: .84rem; text-align: right;
               text-shadow: 0 1px 3px #000; }
body.teia-homepage { display: block; min-height: 100dvh; overflow-x: hidden; background: #020a08; }
body.teia-homepage #sidebar { position: fixed; z-index: 5; left: 14px; top: 50%; transform: translateY(-50%);
  width: 66px; max-height: calc(100dvh - 28px); overflow-y: auto; padding: 12px 8px;
  border: 1px solid rgba(214, 245, 229, .17); border-radius: 18px;
  background: rgba(7, 31, 24, .78); backdrop-filter: blur(16px); box-shadow: 0 14px 40px rgba(0,0,0,.32); }
body.teia-homepage .brand { padding: 5px 0 12px; text-align: center; font-size: 0; }
body.teia-homepage .brand::before { content: 'VC'; font-size: 1rem; letter-spacing: .02em; }
body.teia-homepage .grupo { margin-top: 5px; }
body.teia-homepage .grupo-titulo, body.teia-homepage .item-label,
body.teia-homepage .item .tag, body.teia-homepage .sessao,
body.teia-homepage .rodape-lateral { display: none; }
body.teia-homepage .item { justify-content: center; width: 46px; height: 42px; margin: 2px auto;
                            padding: 0; font-size: 0; }
body.teia-homepage .item-icon { display: inline; font-size: 1.18rem; }
body.teia-homepage .item.ativo { color: #b9f4d5; background: rgba(56, 126, 93, .55); }
body.teia-homepage #content { display: block; width: 100%; min-width: 0; }
body.teia-homepage #topbar { display: none; }
body.teia-homepage main { width: 100%; padding: 0; overflow: visible; }
body.teia-homepage #view, body.teia-homepage #view > div { width: 100%; height: auto; }
body.teia-homepage .teia-home-intro { display: none; }
body.teia-homepage .teia-home { width: 100%; height: 100dvh; min-height: 100dvh; }
body.teia-homepage .teia-home #teia-caso { border: 0; border-radius: 0; }
body.teia-homepage .teia-home .teia-caso-apresentacao { top: 24px; left: clamp(100px, 8vw, 150px);
                                                        max-width: min(520px, 46vw); }
body.teia-homepage .teia-home .teia-controles { top: 24px; right: 24px; }
body.teia-homepage .teia-home .teia-status { top: 78px; right: 30px; }
body.teia-homepage .teia-home .teia-legenda { right: 24px; bottom: 24px; max-width: min(360px, 42vw); }
body.teia-homepage .caso-resumo { padding: 24px 28px; }
.teia-legenda-cor { display: inline-block; width: 12px; height: 12px; border-radius: 50%;
                    margin-right: 7px; vertical-align: -1px; }
body.modo-apresentacao { min-height: 100dvh; overflow: hidden; background: #020a08; }
body.modo-apresentacao #sidebar { position: fixed; z-index: 5; left: 14px; top: 50%; transform: translateY(-50%);
                                  width: 66px; max-height: calc(100dvh - 28px); overflow-y: auto; padding: 12px 8px;
                                  border: 1px solid rgba(214, 245, 229, .17); border-radius: 18px;
                                  background: rgba(7, 31, 24, .78); backdrop-filter: blur(16px);
                                  box-shadow: 0 14px 40px rgba(0, 0, 0, .32); }
body.modo-apresentacao .brand { padding: 5px 0 12px; text-align: center; font-size: 0; }
body.modo-apresentacao .brand::before { content: 'VC'; font-size: 1rem; letter-spacing: .02em; }
body.modo-apresentacao .grupo { margin-top: 5px; }
body.modo-apresentacao .grupo-titulo, body.modo-apresentacao .item-label,
body.modo-apresentacao .item .tag, body.modo-apresentacao .sessao,
body.modo-apresentacao .rodape-lateral { display: none; }
body.modo-apresentacao .item { justify-content: center; width: 46px; height: 42px; margin: 2px auto;
                               padding: 0; font-size: 0; }
body.modo-apresentacao .item-icon { display: inline; font-size: 1.18rem; }
body.modo-apresentacao .item.ativo { color: #b9f4d5; background: rgba(56, 126, 93, .55); }
body.modo-apresentacao #content { width: 100%; height: 100dvh; }
body.modo-apresentacao #topbar { display: none; }
body.modo-apresentacao main { width: 100%; height: 100dvh; padding: 0; overflow: hidden; }
body.modo-apresentacao #view, body.modo-apresentacao #view > div { width: 100%; height: 100%; }
body.modo-apresentacao #view > div > *:not(.teia) { display: none; }
body.modo-apresentacao .teia { display: block; width: 100%; height: 100%; min-height: 0; margin: 0; }
body.modo-apresentacao .teia .painel { display: none; }
body.modo-apresentacao .teia-home .painel.detalhe-aberto { display: flex; }
body.modo-apresentacao #teia-caso { position: absolute; inset: 0; width: 100%; height: 100%;
                                    min-height: 0; overflow: hidden; border-radius: 0;
                                    background: radial-gradient(ellipse at 57% 47%, #10372b 0%, #061a15 52%, #020a08 100%); }
body.modo-apresentacao .teia-caso-apresentacao { position: absolute; z-index: 2; display: block;
  top: 24px; left: clamp(100px, 8vw, 150px); max-width: min(600px, 48vw); padding: 12px 16px;
  border: 1px solid rgba(255,255,255,.13); border-radius: 12px; color: #f4faf7;
  background: rgba(4, 18, 15, .68); backdrop-filter: blur(12px); }
body.modo-apresentacao .teia-caso-apresentacao h2 { font-size: 1.18rem; margin-bottom: 3px; }
body.modo-apresentacao .teia-caso-apresentacao p { color: #d1e2d9; font-size: .88rem; }
body.modo-apresentacao .teia-controles { top: 24px; right: 24px; }
body.modo-apresentacao .teia-controle:not(:first-child), body.modo-apresentacao .teia-status,
body.modo-apresentacao .teia-legenda { display: block; }
body.modo-apresentacao .teia-status { top: 76px; right: 30px; }
body.modo-apresentacao .teia-caso-canvas { position: absolute; left: 50%; top: 50%;
                                            transform: translate(-50%, -50%) scale(1); }
body.modo-apresentacao .no-radial:not(.hub) { transform: translateX(-10px) scale(1.12); }
body.modo-apresentacao .no-radial.hub { transform: translateX(-10px) scale(1.08); }
body.modo-apresentacao .no-radial-nome { max-width: 200px; font-size: .95rem; line-height: 1.3;
                                         color: #fff; }
body.modo-apresentacao .categoria-label { fill: #b5c4be; font-size: 14px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important;
                            animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (max-width: 800px) {
  body.teia-homepage #sidebar { left: 8px; width: 54px; padding: 10px 5px; }
  body.teia-homepage .brand { padding-bottom: 8px; }
  body.teia-homepage .item { width: 40px; height: 38px; }
  body.teia-homepage .teia-home .teia-caso-apresentacao { top: 72px; left: 68px;
                                                           max-width: calc(100vw - 88px); }
  body.teia-homepage .teia-home .teia-controles { top: 12px; right: 10px; gap: 3px; padding: 4px; }
  body.teia-homepage .teia-home .teia-controles button { width: 34px; height: 34px; }
  body.teia-homepage .teia-home .teia-status { top: auto; right: 12px; bottom: 12px;
                                               max-width: calc(100vw - 100px); }
  body.teia-homepage .teia-home .teia-legenda { right: 10px; bottom: 54px; max-width: calc(100vw - 80px); }
  body.teia-homepage .teia-home .no-radial:not(.hub),
  body.teia-homepage .teia-home .no-radial.hub { transform: translateX(-10px) scale(.88); }
  body.teia-homepage .teia-home .no-radial-nome { max-width: 72px; font-size: .72rem; line-height: 1.1; }
  body.teia-homepage .teia-home .categoria-label { display: none; }
  body { flex-direction: column; }
  #sidebar { width: 100%; }
  main { padding: 18px 14px; }
  .teia { grid-template-columns: 1fr; grid-template-rows: auto 420px; height: auto; }
  .teia-home { height: min(64vh, 620px); min-height: min(440px, 54vh); }
  .teia-home .teia-caso-apresentacao { top: 10px; left: 10px; max-width: 45%; padding: 8px 10px; }
  .teia-home .teia-controles { top: 10px; right: 10px; gap: 3px; padding: 4px; }
  .teia-home .teia-controle { width: 34px; height: 36px; }
  .teia-home .teia-legenda { right: 10px; bottom: 10px; max-width: min(280px, 76%); }
  body.modo-apresentacao #sidebar { left: 8px; top: 50%; width: 52px; padding: 8px 4px; }
  body.modo-apresentacao .item { width: 40px; height: 38px; }
  body.modo-apresentacao .teia-caso-apresentacao { top: 12px; left: 68px; max-width: calc(100vw - 180px);
                                                   padding: 9px 11px; }
  body.modo-apresentacao .teia-controles { top: 12px; right: 10px; gap: 3px; padding: 4px; }
  body.modo-apresentacao .teia-controle { width: 34px; height: 36px; }
  body.modo-apresentacao .teia-legenda { right: 10px; bottom: 10px; max-width: min(320px, 78vw); }
}
