/* ============================================================
   Portal de Arquivos — design system
   Verde-tinta sobre superfície fria. Trilho fixo, obra fluida.
   ============================================================ */

:root {
  /* chrome escuro — deriva do #07614A da marca */
  --tinta: #0A211B;
  --tinta-2: #12312A;
  --tinta-3: #1C4438;
  --tinta-texto: #B9CFC7;

  /* verdes da marca */
  --verde: #0BA678;
  --verde-escuro: #07614A;
  --menta: #2DE0A6;
  --verde-fundo: #E7F7F0;

  /* superfície de trabalho */
  --fundo: #F2F5F4;
  --papel: #FFFFFF;
  --papel-2: #F7FAF9;
  --texto: #0A211B;
  --texto-2: #5B6B65;
  --linha: #DCE4E1;
  --linha-forte: #C6D3CE;

  /* estados */
  --perigo: #D64430;
  --perigo-fundo: #FBE7E3;
  --perigo-texto: #8F2A1C;
  --alerta: #F5A524;
  --alerta-fundo: #FDF3D6;
  --alerta-texto: #7A5B12;
  --leitura: #7C9BB8;
  --leitura-fundo: #EDF3F8;
  --leitura-texto: #3C5876;

  --scrim: rgba(10, 33, 27, .55);
  --raio: 14px;
  --raio-sm: 9px;
  --raio-xs: 6px;
  --sombra: 0 1px 2px rgba(10,33,27,.05), 0 1px 3px rgba(10,33,27,.04);
  --sombra-md: 0 10px 34px rgba(10,33,27,.16);
  --trilho: 276px;

  --display: 'Archivo', 'Segoe UI', system-ui, sans-serif;
  --corpo: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--corpo);
  background: var(--fundo);
  color: var(--texto);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--verde-escuro); }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -.02em; }

:focus-visible { outline: 2px solid var(--verde); outline-offset: 2px; border-radius: 3px; }
.trilho :focus-visible { outline-color: var(--menta); }

/* dado tabular — tamanhos, datas, prefixos, IPs */
.dado, .dado td { font-family: var(--mono); font-size: .82rem; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------
   Casca: trilho fixo + obra fluida
   ------------------------------------------------------------ */
.app { display: grid; grid-template-columns: var(--trilho) 1fr; min-height: 100dvh; }

.trilho {
  background: var(--tinta);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
  padding: 1.25rem 1rem 2rem;
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.marca {
  display: flex; align-items: center; gap: .65rem; width: 100%;
  text-decoration: none; color: #fff; padding: .5rem .55rem;
  background: none; border: 1px solid transparent; border-radius: var(--raio-sm);
  font: inherit; text-align: left; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.marca:hover, .marca[aria-expanded="true"] { background: var(--tinta-2); border-color: var(--tinta-3); }
.marca .cheve { margin-left: auto; color: #6E8C82; flex: none; transition: transform .15s; }
.marca[aria-expanded="true"] .cheve { transform: rotate(180deg); }
.marca svg { width: 34px; height: 34px; flex: none; }
.marca-txt { display: block; min-width: 0; }
.marca-txt b {
  display: block; font-family: var(--display); font-weight: 800;
  font-size: 1.02rem; letter-spacing: -.03em; line-height: 1.15;
}
.marca-txt > span {
  display: block; font-size: .68rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--menta); line-height: 1.2;
}

.trilho-nav { display: flex; flex-direction: column; gap: .15rem; }
.trilho-nav a {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem .7rem; border-radius: var(--raio-sm);
  text-decoration: none; color: var(--tinta-texto);
  font-weight: 500; font-size: .92rem; transition: background .15s, color .15s;
}
.trilho-nav a:hover { background: var(--tinta-2); color: #fff; }
.trilho-nav a.ativo { background: var(--tinta-2); color: #fff; box-shadow: inset 2px 0 0 var(--menta); }
.trilho-nav a svg { width: 18px; height: 18px; flex: none; opacity: .8; }
.trilho-nav a.ativo svg { color: var(--menta); opacity: 1; }

.trilho-secao { display: flex; flex-direction: column; gap: .5rem; min-height: 0; }
.trilho-rotulo {
  margin: 0; padding: 0 .7rem;
  font-size: .68rem; font-weight: 600; letter-spacing: .16em;
  text-transform: uppercase; color: #6E8C82;
}

.obra { display: flex; flex-direction: column; min-width: 0; }

.cabecalho {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .8rem clamp(1rem, 2.5vw, 2rem);
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--linha);
}
.cabecalho-dir { display: flex; align-items: center; gap: .9rem; }
.identidade { text-align: right; line-height: 1.25; }
.identidade b { display: block; font-weight: 600; font-size: .92rem; }
.identidade span { display: block; font-family: var(--mono); font-size: .72rem; color: var(--texto-2); }

.painel { flex: 1; min-width: 0; padding: clamp(1rem, 2.4vw, 2rem); animation: entrar .28s ease both; display: flex; flex-direction: column; }
@keyframes entrar { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* colunas flex verticais até a zona de solta, para ela poder crescer (flex:1) até o fim da tela */
#vistaArquivos, #conteudo { display: flex; flex-direction: column; flex: 1; min-height: 0; }

.titulo { font-size: 1.5rem; margin: 0 0 1.1rem; }

/* estado vazio */
.vazio {
  border: 1px dashed var(--linha-forte); border-radius: var(--raio);
  padding: 3rem 1.5rem; text-align: center; color: var(--texto-2);
  background: linear-gradient(var(--papel), var(--papel-2));
}
.vazio b { display: block; font-family: var(--display); font-size: 1.05rem; color: var(--texto); margin-bottom: .3rem; }

/* ------------------------------------------------------------
   Superfícies
   ------------------------------------------------------------ */
.card {
  background: var(--papel); border: 1px solid var(--linha);
  border-radius: var(--raio); box-shadow: var(--sombra);
  padding: 1.2rem; margin-bottom: 1.2rem;
}
.card > h3:first-child { margin-top: 0; }
.grade { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1.2rem; align-items: start; }
.muted { color: var(--texto-2); font-size: .88rem; }

/* Seção secundária, discreta — mesma função de um .card, sem competir visualmente. */
.detalhes-discreto { border-top: 1px solid var(--linha); padding-top: .9rem; margin-bottom: 1.2rem; }
.detalhes-discreto > summary {
  cursor: pointer; font-weight: 600; color: var(--texto-2); list-style: none;
  display: flex; align-items: center; gap: .5rem;
}
.detalhes-discreto > summary::-webkit-details-marker { display: none; }
.detalhes-discreto > summary::before { content: '▸'; font-size: .8em; }
.detalhes-discreto[open] > summary::before { content: '▾'; }
.detalhes-discreto > summary .muted { font-weight: 400; }

/* ------------------------------------------------------------
   Guia de arquivo — o objeto-assinatura.
   A aba recortada do favicon vira o marcador de pasta; a cor
   da aba codifica o nível de permissão.
   ------------------------------------------------------------ */
.tile {
  --nivel-cor: var(--linha-forte);
  position: relative;
  display: flex; flex-direction: column; justify-content: center; align-items: stretch; gap: .3rem;
  padding: 1rem 1rem .95rem; text-align: left; color: var(--texto);
  border: 1px solid var(--linha); border-radius: var(--raio-sm);
  background: var(--papel); cursor: pointer; min-width: 0; min-height: 104px;
  transition: border-color .15s, background .15s;
}
.tile::before {
  content: ''; position: absolute; top: -7px; left: 16px;
  width: 44px; height: 8px; border-radius: 4px 4px 0 0;
  background: var(--nivel-cor); transition: width .18s ease;
}
/* só a borda reage ao mouse — a aba (::before) só cresce, não muda de cor aqui */
.tile:hover { border-color: var(--verde); }
.tile:hover::before { width: 64px; }
.tile.leitura { --nivel-cor: var(--leitura); }
.tile.enviar  { --nivel-cor: var(--alerta); }
.tile.total   { --nivel-cor: var(--verde); }
/* pasta vazia: aba cinza, independente do nível de permissão */
.tile.tile-vazio { --nivel-cor: var(--linha-forte); }
.tile.selecionado {
  background: var(--verde-fundo); border-color: var(--verde);
  box-shadow: 0 0 0 2px var(--verde-fundo);
}
.tile.arrastando, tr.arrastando { opacity: .45; }
.tile.alvo-drop {
  background: var(--verde-fundo); border-color: var(--verde);
  box-shadow: 0 0 0 2px var(--verde-fundo);
}
.breadcrumb a.alvo-drop { background: var(--verde-fundo); color: var(--verde-escuro); border-radius: var(--raio-xs); }

/* zona de envio por arrastar-e-soltar, visível para quem pode enviar na pasta aberta —
   cresce (flex:1) até ocupar toda a altura livre abaixo da listagem */
.zona-solta {
  flex: 1; min-height: 220px; margin-top: 1.2rem; padding: 1.5rem; text-align: center; color: var(--texto-2);
  border: 1px dashed var(--linha-forte); border-radius: var(--raio);
  background: linear-gradient(var(--papel), var(--papel-2));
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem;
  transition: border-color .15s, background .15s, color .15s;
}
.zona-solta svg { width: 22px; height: 22px; margin-bottom: .2rem; }
.zona-solta b { font-family: var(--display); font-size: 1.05rem; color: var(--texto); }
#vistaArquivos.solta-ativa .zona-solta {
  border-color: var(--verde); border-style: dashed;
  background: var(--verde-fundo); color: var(--verde-escuro);
  box-shadow: 0 0 0 2px var(--verde-fundo);
}
#vistaArquivos.solta-ativa .zona-solta b { color: var(--verde-escuro); }

.tile-topo { display: flex; align-items: center; gap: .5rem; width: 100%; }
/* nome em uma linha só — cards largos o bastante para não quebrar */
.tile-nome {
  flex: 1; min-width: 0; font-weight: 500; font-size: 1.08rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tile-meta {
  font-family: var(--mono); font-size: .74rem; color: var(--texto-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* menu de três pontos do card — sempre visível (só some com mais de um item selecionado, ver regra abaixo) */
.tile-menu {
  flex: none; width: 28px; height: 28px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: var(--raio-xs);
  background: transparent; color: var(--texto-2); cursor: pointer;
  font-size: 1.05rem; line-height: 1; transition: background .15s, color .15s;
}
.tile-menu:hover, .tile-menu:focus-visible, .tile-menu.aberto { background: var(--fundo); color: var(--texto); }
/* com mais de um item selecionado, os 3 pontinhos somem — as ações vão para a barra */
#conteudo.multi-sel .tile-menu { display: none; }

.nav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); gap: 1.15rem .9rem; }

/* ------------------------------------------------------------
   Menu flutuante (card, marca)
   ------------------------------------------------------------ */
.popover {
  position: fixed; z-index: 120; min-width: 190px; padding: .35rem;
  background: var(--papel); border: 1px solid var(--linha);
  border-radius: var(--raio-sm); box-shadow: var(--sombra-md);
  animation: subir .14s ease both;
}
.popover button {
  display: flex; align-items: center; gap: .55rem; width: 100%;
  padding: .5rem .6rem; border: none; border-radius: var(--raio-xs);
  background: none; font: inherit; font-size: .88rem; color: var(--texto);
  text-align: left; cursor: pointer;
}
.popover button:hover { background: var(--fundo); }
.popover button.perigo { color: var(--perigo-texto); }
.popover button.perigo:hover { background: var(--perigo-fundo); }
.popover button:disabled { opacity: .45; cursor: not-allowed; }
.popover hr { border: none; border-top: 1px solid var(--linha); margin: .3rem 0; }
.popover svg { width: 16px; height: 16px; flex: none; }

/* ------------------------------------------------------------
   Caminho
   ------------------------------------------------------------ */
.breadcrumb { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; font-size: 1.22rem; min-width: 0; }
.breadcrumb a { cursor: pointer; text-decoration: none; color: var(--texto-2); font-weight: 500; }
.breadcrumb a:hover { color: var(--verde-escuro); }
.breadcrumb a:last-of-type { color: var(--texto); font-weight: 600; }
.breadcrumb span.sep { color: var(--linha-forte); }

/* ------------------------------------------------------------
   Formulários
   ------------------------------------------------------------ */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-weight: 600; font-size: .82rem; margin-bottom: .35rem; color: var(--texto); }
.form-control {
  width: 100%; padding: .6rem .8rem;
  border: 1px solid var(--linha); border-radius: var(--raio-sm);
  font-family: inherit; font-size: .95rem;
  background: var(--papel-2); color: var(--texto);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.form-control:focus {
  outline: none; border-color: var(--verde);
  box-shadow: 0 0 0 3px var(--verde-fundo); background: var(--papel);
}
select.form-control { cursor: pointer; }
input[type=checkbox], input[type=radio] { accent-color: var(--verde); width: 1rem; height: 1rem; cursor: pointer; }

/* ------------------------------------------------------------
   Botões
   ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .55rem 1rem; border: 1px solid transparent; border-radius: var(--raio-sm);
  font-family: inherit; font-weight: 600; font-size: .9rem;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--verde); color: #fff; }
.btn-primary:hover { background: var(--verde-escuro); }
.btn-ghost { background: var(--papel); border-color: var(--linha); color: var(--texto); }
.btn-ghost:hover { border-color: var(--linha-forte); background: var(--papel-2); }
.btn-danger { background: var(--perigo); color: #fff; }
.btn-danger:hover { filter: brightness(.92); }
.btn-sm { padding: .35rem .7rem; font-size: .82rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.cabecalho .btn-ghost { background: transparent; }

/* botão de menu — só na tela estreita (vence o display do .btn) */
.btn.menu-btn { display: none; }

/* ------------------------------------------------------------
   Barra de ações — botões de mesma largura e altura
   ------------------------------------------------------------ */
.barra-acoes { display: flex; flex-wrap: wrap; gap: .55rem; margin-bottom: 1.5rem; min-height: 46px; }
/* só ícone, quadrado — o rótulo vive no title/aria-label */
.barra-acoes .btn {
  width: 46px; height: 46px; padding: 0; gap: 0; justify-content: center;
}
.barra-acoes .btn span { display: none; }
.barra-acoes .btn svg { width: 20px; height: 20px; flex: none; }
.barra-acoes .sep-acoes { width: 1px; align-self: stretch; background: var(--linha); margin: 0 .2rem; }
.contador-sel {
  display: inline-flex; align-items: center; height: 46px; padding: 0 .3rem;
  font-family: var(--mono); font-size: .78rem; color: var(--texto-2);
}

/* ------------------------------------------------------------
   Seleção em tabela
   ------------------------------------------------------------ */
table.tabela tbody tr { cursor: pointer; user-select: none; }
table.tabela tbody tr.selecionado td { background: var(--verde-fundo); }
table.tabela tbody tr.selecionado:hover td { background: #DCF2E8; }
table.tabela tbody tr:focus-visible { outline: 2px solid var(--verde); outline-offset: -2px; }

/* ------------------------------------------------------------
   Feed de atividades
   ------------------------------------------------------------ */
.feed { display: flex; flex-direction: column; gap: 1.8rem; max-width: 1440px; }
.feed-dia { display: flex; flex-direction: column; gap: .1rem; }
.feed-data {
  display: flex; align-items: baseline; gap: .6rem;
  padding-bottom: .55rem; margin-bottom: .5rem;
  border-bottom: 1px solid var(--linha);
}
.feed-data b { font-family: var(--display); font-size: 1rem; letter-spacing: -.01em; }
.feed-data span { font-family: var(--mono); font-size: .72rem; color: var(--texto-2); }
.feed-item {
  display: grid; align-items: center; gap: .9rem;
  grid-template-columns: minmax(0, 16rem) 3.4rem 3.2rem minmax(0, 1fr) 6rem auto;
  padding: .6rem .7rem; border-radius: var(--raio-sm);
  cursor: pointer; transition: background .15s;
}
.feed-item:hover { background: var(--papel); }
.feed-item:focus-visible { outline: 2px solid var(--verde); outline-offset: -2px; }
.feed-hora { font-family: var(--mono); font-size: .76rem; color: var(--texto-2); }
.feed-nome { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-local {
  font-size: .82rem; font-weight: 500; color: var(--texto-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.feed-tam { font-family: var(--mono); font-size: .76rem; color: var(--texto-2); text-align: right; }
.feed-item .btn { opacity: 0; transition: opacity .15s; }
.feed-item:hover .btn, .feed-item .btn:focus-visible { opacity: 1; }

@media (max-width: 860px) {
  .feed-item { grid-template-columns: 3.4rem minmax(0, 1fr) auto; row-gap: .15rem; }
  .feed-local { grid-column: 2; grid-row: 1; }
  .feed-hora { grid-column: 1; grid-row: 1 / span 2; }
  .feed-item .ext { grid-column: 1; display: none; }
  .feed-nome { grid-column: 2; grid-row: 2; }
  .feed-tam { display: none; }
  .feed-item .btn { opacity: 1; grid-column: 3; grid-row: 1 / span 2; }
}

/* Ações destrutivas em lista ficam discretas: a cor sinaliza, mas não
   domina a página. O vermelho sólido só aparece no hover e nos diálogos. */
table.tabela .btn-danger, .tile .btn-danger {
  background: transparent; border-color: var(--linha); color: var(--perigo-texto);
}
table.tabela .btn-danger:hover, .tile .btn-danger:hover {
  background: var(--perigo); border-color: var(--perigo); color: #fff; filter: none;
}

/* ------------------------------------------------------------
   Tabelas
   ------------------------------------------------------------ */
.tabela-wrap { overflow-x: auto; }
/* min-width faz a tabela transbordar e o wrapper rolar, em vez de
   espremer as colunas até a quebra letra a letra no celular */
table.tabela { width: 100%; min-width: 620px; border-collapse: collapse; }
table.tabela th, table.tabela td {
  text-align: left; padding: .65rem .7rem;
  border-bottom: 1px solid var(--linha); font-size: .9rem;
  overflow-wrap: anywhere; vertical-align: middle;
}
table.tabela th {
  background: var(--papel-2); white-space: nowrap;
  color: var(--texto-2); font-weight: 600; font-size: .7rem;
  text-transform: uppercase; letter-spacing: .1em;
}
table.tabela tr:last-child td { border-bottom: none; }
table.tabela tbody tr:hover td { background: var(--papel-2); }

/* selo de extensão do arquivo */
.ext {
  display: inline-block; min-width: 2.9rem; text-align: center;
  padding: .1rem .35rem; margin-right: .5rem;
  border-radius: var(--raio-xs); background: var(--verde-fundo); color: var(--verde-escuro);
  font-family: var(--mono); font-size: .66rem; font-weight: 500; text-transform: uppercase;
}

/* ------------------------------------------------------------
   Chips
   ------------------------------------------------------------ */
.chip {
  display: inline-block; padding: .12rem .5rem; border-radius: 999px;
  font-size: .68rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
}
.chip.leitura { background: var(--leitura-fundo); color: var(--leitura-texto); }
.chip.enviar  { background: var(--alerta-fundo); color: var(--alerta-texto); }
.chip.total   { background: var(--verde-fundo); color: var(--verde-escuro); }
.chip.inativo { background: var(--perigo-fundo); color: var(--perigo-texto); }

/* ------------------------------------------------------------
   Mensagens
   ------------------------------------------------------------ */
.msg {
  padding: .6rem .85rem; border-radius: var(--raio-sm);
  font-size: .88rem; margin-bottom: .8rem; border: 1px solid transparent;
}
.msg.erro  { background: var(--perigo-fundo); color: var(--perigo-texto); border-color: #F3CFC7; }
.msg.ok    { background: var(--verde-fundo); color: var(--verde-escuro); border-color: #BFE8D7; }
.msg.aviso { background: var(--alerta-fundo); color: var(--alerta-texto); border-color: #F2DFAE; }

#mSenhaReq { list-style: none; padding: 0; }
#mSenhaReq li { padding-left: 1.1rem; position: relative; }
#mSenhaReq li::before { content: '·'; position: absolute; left: .3rem; }
#mSenhaReq li.ok { color: var(--verde-escuro); }
#mSenhaReq li.ok::before { content: ''; }

/* ------------------------------------------------------------
   Diálogos
   ------------------------------------------------------------ */
.modal-bg {
  position: fixed; inset: 0; background: var(--scrim);
  display: none; align-items: center; justify-content: center;
  z-index: 100; padding: 1rem; backdrop-filter: blur(3px);
}
.modal-bg.aberto { display: flex; }
.modal, .dialogo {
  background: var(--papel); border-radius: var(--raio);
  padding: 1.4rem; width: 100%; max-width: 440px;
  box-shadow: var(--sombra-md); max-height: 88vh; overflow: auto;
  animation: subir .2s ease both;
}
@keyframes subir { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
.modal h3, .dialogo h3 { margin-top: 0; }
.modal-acoes { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1rem; }

/* ------------------------------------------------------------
   Árvore de pastas — modal "Mover para…"
   O recuo vem da custom property --recuo, gravada em cada nó no
   momento em que ele é criado (um nível a mais que o pai).
   ------------------------------------------------------------ */
.arvore {
  max-height: 46vh; overflow: auto;
  border: 1px solid var(--linha); border-radius: var(--raio-sm);
  padding: .35rem; background: var(--papel-2);
}
.arvore-linha {
  display: flex; align-items: center; gap: .4rem; cursor: pointer;
  border-radius: var(--raio-xs); padding: .3rem .4rem;
  padding-left: calc(.4rem + var(--recuo, 0) * 1.1rem);
  transition: background .15s;
}
.arvore-linha:hover { background: var(--papel); }
.arvore-linha svg { width: 16px; height: 16px; flex: none; color: var(--texto-2); }
.arvore-nome { font-size: .9rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arvore-no-sel > .arvore-linha {
  background: var(--verde-fundo); color: var(--verde-escuro); font-weight: 600;
}
.arvore-no-sel > .arvore-linha svg { color: var(--verde); }
.arvore-no-bloqueado > .arvore-linha { opacity: .42; cursor: not-allowed; }
.arvore-no-bloqueado > .arvore-linha:hover { background: none; }
.arvore-alternar {
  background: none; border: 0; padding: 0; line-height: 0; cursor: pointer;
  color: var(--texto-2); flex: none;
  transform: rotate(-90deg); transition: transform .15s ease;
}
.arvore-no-aberto > .arvore-linha > .arvore-alternar { transform: rotate(0); }
.arvore-vazio {
  font-size: .8rem; color: var(--texto-2); padding: .2rem 0;
  padding-left: calc(1.5rem + (var(--recuo, 0) + 1) * 1.1rem);
}

.lista-renomeados {
  max-height: 40vh; overflow: auto; margin: .6rem 0 0; padding-left: 1.1rem;
  font-size: .88rem; line-height: 1.7;
}

/* ------------------------------------------------------------
   Login — tela dividida
   ------------------------------------------------------------ */
/* A coluna do formulário fica só com a largura que os campos pedem (o form tem
   max-width 360px + respiro lateral); a da marca leva todo o resto. Como a 2ª
   coluna tem teto fixo e a 1ª é 1fr, quanto maior a tela mais a marca domina —
   ~60/40 em 1024px, ~73/27 em 1920px — sem precisar de breakpoint extra. */
.entrada { display: grid; grid-template-columns: 1fr clamp(27rem, 28vw, 32rem); min-height: 100dvh; }
.entrada-marca {
  background: var(--tinta); color: #fff;
  padding: clamp(2rem, 5vw, 4.5rem);
  display: flex; flex-direction: column; justify-content: center; gap: 1.5rem;
  position: relative; overflow: hidden;
}
.entrada-marca::after {
  content: ''; position: absolute; right: -22%; bottom: -32%;
  width: 78%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(45,224,166,.16), transparent 68%);
}
.entrada-marca svg { width: 56px; height: 56px; position: relative; }
.entrada-marca h1 {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(2.4rem, 5vw, 4.4rem); line-height: .98;
  letter-spacing: -.04em; margin: 0; position: relative;
}
.entrada-marca h1 em { font-style: normal; color: var(--menta); display: block; }
.entrada-marca p { color: var(--tinta-texto); max-width: 36ch; margin: 1.1rem 0 0; position: relative; }
.entrada-rodape {
  font-family: var(--mono); font-size: .72rem; color: #6E8C82;
  position: absolute; left: clamp(2rem, 5vw, 4.5rem); bottom: clamp(2rem, 5vw, 4.5rem);
}

.entrada-form { display: flex; align-items: center; justify-content: center; padding: clamp(1.5rem, 4vw, 3rem); background: var(--papel); }
.entrada-form form, .entrada-form > div { width: 100%; max-width: 360px; }
.entrada-form h2 { font-size: 1.35rem; margin: 0 0 1.6rem; }
.entrada-form .muted { margin: 0 0 1.6rem; }

/* ------------------------------------------------------------
   Responsivo
   ------------------------------------------------------------ */
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .trilho {
    position: fixed; inset: 0 auto 0 0; z-index: 80;
    width: min(84vw, 300px); height: 100dvh;
    transform: translateX(-100%); transition: transform .22s ease;
  }
  .trilho.aberto { transform: none; }
  .btn.menu-btn { display: inline-flex; }
  .trilho-scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 70; }
  .grade { grid-template-columns: 1fr; }
  .entrada { grid-template-columns: 1fr; }
  .entrada-marca { min-height: auto; padding: 2rem 1.5rem; }
  .entrada-marca p, .entrada-rodape { display: none; }
}

@media (max-width: 560px) {
  .cabecalho { padding: .7rem 1rem; }
  .identidade { display: none; }
  .painel { padding: 1rem; }
  .nav-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .zona-solta { padding: 1.2rem 1rem; min-height: 160px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
}
