/* ZeraSync 2 — casca: trilho lateral, topo, área da tela, navegação no celular. */

.app { display: grid; grid-template-columns: var(--trilho) 1fr; grid-template-rows: var(--topo) 1fr; height: 100vh; height: 100dvh; overflow: hidden; }

/* ------------------------------------------------------------------ trilho */
.trilho {
  grid-row: 1 / 3; grid-column: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 0 12px; background: var(--zera-noite); color: #c8d3de; z-index: 20;
}
.trilho .marca { width: 40px; height: 40px; border-radius: 12px; display: block; overflow: hidden; margin-bottom: 10px; box-shadow: 0 0 0 1px rgba(255,255,255,.14), 0 6px 16px rgba(0,0,0,.35); transition: transform var(--t-rapido), box-shadow var(--t-rapido); }
.trilho .marca:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px rgba(255,255,255,.28), 0 8px 20px rgba(0,0,0,.4); }
.trilho .marca img { width: 100%; height: 100%; display: block; }
.trilho nav { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.item-trilho {
  position: relative; width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  color: #9fb0c1; border: 0; background: transparent; transition: background var(--t-rapido), color var(--t-rapido);
}
.item-trilho:hover { background: var(--zera-noite-2); color: #fff; text-decoration: none; }
.item-trilho[aria-current="page"] { background: rgba(143, 176, 207, 0.16); color: #fff; }
.item-trilho[aria-current="page"]::before { content: ""; position: absolute; left: -11px; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--wa); }
.item-trilho .selo { position: absolute; top: 3px; right: 1px; min-width: 18px; height: 18px; font-size: 10.5px; padding: 0 5px; box-shadow: 0 0 0 2px var(--zera-noite); }
.trilho .base-trilho { margin-top: auto; display: flex; flex-direction: column; gap: 6px; align-items: center; }

/* ------------------------------------------------------------------ topo */
.topo {
  grid-column: 2; display: flex; align-items: center; gap: 12px; padding: 0 16px; height: var(--topo);
  background: var(--sup); border-bottom: 1px solid var(--linha); z-index: 15; min-width: 0;
}
.seletor-conta { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 10px 0 6px; border-radius: 11px; border: 0; background: transparent; min-width: 0; max-width: 300px; }
.seletor-conta:hover { background: var(--hover); }
.seletor-conta .logo-conta { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; background: var(--zera); flex: none; }
.seletor-conta .nomes { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; line-height: 1.2; }
.seletor-conta .nomes b { font-size: 14px; font-weight: 650; }
.seletor-conta .nomes span { font-size: 11.5px; color: var(--txt-3); }
.topo .busca-global { flex: 1; max-width: 560px; margin: 0 auto 0 12px; }
.topo .busca-global .entrada { height: 38px; }
.topo .busca-global kbd { position: absolute; right: 10px; }
.botao-presenca { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px 0 10px; border-radius: 999px; border: 1px solid var(--linha); background: var(--sup); font-weight: 600; font-size: 13px; color: var(--txt); }
.botao-presenca:hover { border-color: var(--linha-forte); }
.botao-presenca i { width: 9px; height: 9px; border-radius: 50%; background: var(--wa); box-shadow: 0 0 0 3px var(--wa-suave); }
.botao-presenca.pausa i { background: var(--alerta); box-shadow: 0 0 0 3px var(--alerta-bg); }
.botao-presenca.ausente i { background: #9aa5b1; box-shadow: none; }
.topo .sino { position: relative; }
.topo .sino .selo { position: absolute; top: 2px; right: 0; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; background: var(--erro); color: #fff; }
.botao-eu { border: 0; background: none; padding: 0; border-radius: 50%; }
.faixa-sombra { display: none; }
body.modo-sombra .faixa-sombra { display: flex; align-items: center; gap: 8px; height: 26px; padding: 0 12px; border-radius: 999px; background: var(--alerta-bg); color: var(--alerta-forte); font-size: 12px; font-weight: 700; }
/* marca da conta (Configurações › Conta): logo no lugar das iniciais; versão pequena no menu de contas */
.logo-conta.com-logo { background: var(--sup) !important; box-shadow: inset 0 0 0 1px var(--linha); overflow: hidden; }
.logo-conta img { width: 100%; height: 100%; object-fit: contain; display: block; }
.logo-conta-p { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; font-size: 10px; font-weight: 700; color: #fff; flex: none; }
/* suporte da equipe Zera: aviso em todas as telas quando o super admin abriu uma conta da qual não é membro */
.faixa-suporte { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px 0 10px; border: 1px solid color-mix(in srgb, var(--zera) 45%, transparent);
  border-radius: 999px; background: var(--zera-suave); color: var(--zera-txt); font-size: 12px; font-weight: 700; white-space: nowrap; flex: none;
  clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 10px, 100% 100%, 0 100%); transition: background-color 120ms; }
.faixa-suporte:hover { background: color-mix(in srgb, var(--zera) 20%, transparent); }
.menu-suporte { display: flex; flex-direction: column; gap: 4px; padding: 8px 12px 6px; max-width: 256px; }
.menu-suporte b { font-size: 13.5px; }
.menu-suporte span { font-size: 12.5px; color: var(--txt-2); line-height: 1.4; }
@media (max-width: 767px) { .faixa-suporte span { display: none; } .faixa-suporte { padding: 0 9px; } }

/* ------------------------------------------------------------------ miolo */
.miolo { grid-column: 2; grid-row: 2; min-width: 0; min-height: 0; overflow: hidden; position: relative; background: var(--bg); }
.tela { height: 100%; overflow: auto; }
.tela-padrao { max-width: 1280px; margin: 0 auto; padding: 22px 24px 40px; }
.cab-tela { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.cab-tela h1 { margin-right: auto; }
.cab-tela .sub { width: 100%; color: var(--txt-3); font-size: 13.5px; margin-top: -10px; }

.carregando-app { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: var(--bg); z-index: 200; }
.carregando-app .carregando-logo { width: 56px; height: 56px; border-radius: 16px; box-shadow: var(--sombra-2); animation: aparecer 300ms; }
.carregando-app .anel { width: 42px; height: 42px; border-radius: 50%; border: 3px solid var(--zera-suave); border-top-color: var(--zera); animation: girar 0.8s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

/* conexão caiu */
.aviso-conexao { position: fixed; left: 50%; top: 10px; transform: translateX(-50%); z-index: 95; display: none; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; background: var(--alerta-bg); color: var(--alerta-forte); font-weight: 650; font-size: 12.5px; box-shadow: var(--sombra-2); backdrop-filter: blur(6px); }
body.sem-conexao .aviso-conexao { display: flex; }

/* ------------------------------------------------------------------ celular */
.nav-celular { display: none; }
@media (max-width: 767px) {
  .app { grid-template-columns: 1fr; grid-template-rows: 52px 1fr 60px; }
  .trilho { display: none; }
  .topo { grid-column: 1; padding: 0 10px; gap: 8px; height: 52px; }
  .topo .busca-global, .topo .botao-presenca .rotulo-presenca, .seletor-conta .nomes span { display: none; }
  .miolo { grid-column: 1; grid-row: 2; }
  .nav-celular { grid-row: 3; display: flex; justify-content: space-around; align-items: center; background: var(--zera-noite); padding-bottom: env(safe-area-inset-bottom); }
  .nav-celular a, .nav-celular .nav-mais { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; color: #9fb0c1; font-size: 10.5px; font-weight: 600; padding: 6px 10px; text-decoration: none; }
  .nav-celular .nav-mais { background: none; border: 0; font-family: inherit; cursor: pointer; }
  .nav-celular a[aria-current="page"], .nav-celular .nav-mais[aria-current="page"] { color: #fff; }
  .nav-celular a .selo { position: absolute; top: 0; right: 4px; min-width: 16px; height: 16px; font-size: 10px; }
  .tela-padrao { padding: 14px 12px 28px; }
}

/* ------------------------------------------------------------------ movimento da casca */
.tela { animation: entrada-tela 320ms cubic-bezier(.16, 1, .3, 1); }
@keyframes entrada-tela { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.item-trilho svg { transition: transform var(--t-estado); }
.item-trilho:hover svg { transform: scale(1.08); }
.item-trilho[aria-current="page"]::before { animation: indicador-entra 260ms cubic-bezier(.16, 1, .3, 1); }
@keyframes indicador-entra { from { transform: scaleY(.2); opacity: 0; } to { transform: none; opacity: 1; } }
.trilho nav .item-trilho { animation: surgir 420ms cubic-bezier(.16, 1, .3, 1) both; }
.trilho nav .item-trilho:nth-child(2) { animation-delay: 40ms; } .trilho nav .item-trilho:nth-child(3) { animation-delay: 80ms; }
.trilho nav .item-trilho:nth-child(4) { animation-delay: 120ms; } .trilho nav .item-trilho:nth-child(5) { animation-delay: 160ms; }
.trilho nav .item-trilho:nth-child(6) { animation-delay: 200ms; } .trilho nav .item-trilho:nth-child(7) { animation-delay: 240ms; }
.botao-presenca i { animation: respirar 2.8s ease-in-out infinite; }
.botao-presenca.ausente i { animation: none; }
.botao-eu .avatar { transition: transform var(--t-estado), box-shadow var(--t-estado); }
.botao-eu:hover .avatar { transform: scale(1.06); box-shadow: 0 0 0 3px var(--zera-suave); }
