/* Fonte Exo 2 servida pelo próprio app (sem Google Fonts) */
@font-face {
  font-family: "Exo 2 Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/exo-2-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Exo 2 Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/exo-2-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

[hidden] { display: none !important; }

/* ---------------- Casca: menu lateral ---------------- */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  padding: var(--space-5) var(--space-4);
}
.sidebar__brand { display: flex; align-items: center; gap: var(--space-3); padding: 0 var(--space-2) var(--space-5); }
.sidebar__symbol { width: 34px; height: 34px; }
.sidebar__name { display: grid; line-height: 1.15; }
.sidebar__name strong { font-size: var(--text-lg); font-weight: var(--weight-semibold); letter-spacing: -0.01em; }
.sidebar__name small { font-size: var(--text-xs); font-weight: var(--weight-light); letter-spacing: 0.04em; }
.sidebar__close {
  display: none; margin-left: auto; padding: 6px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-on-dark-muted);
}
.sidebar__close svg { width: 20px; height: 20px; }
.sidebar__nav {
  display: grid; flex: 1; align-content: start; gap: var(--space-5); overflow-y: auto;
  margin: 0 calc(var(--space-2) * -1); padding: 0 var(--space-2);
}
.sidebar__group { display: grid; gap: 2px; }
.sidebar__label {
  padding: 0 var(--space-3) var(--space-2); color: rgba(251, 251, 251, 0.45); font-size: 0.6875rem;
  font-weight: var(--weight-semibold); letter-spacing: 0.12em; text-transform: uppercase;
}
.sidebar__item {
  position: relative; display: flex; align-items: center; gap: var(--space-3); min-height: 40px;
  padding: 0 var(--space-3); border: 0; border-radius: var(--radius-sm); background: transparent;
  color: rgba(251, 251, 251, 0.78); font-size: var(--text-base); font-weight: var(--weight-medium); text-align: left;
  text-decoration: none; transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.sidebar__item svg { width: 18px; height: 18px; flex: none; opacity: 0.85; }
.sidebar__item:hover { background: rgba(251, 251, 251, 0.07); color: #fff; }
.sidebar__item--active { background: rgba(10, 166, 101, 0.16); color: #fff; font-weight: var(--weight-semibold); }
.sidebar__item--active svg { color: var(--ft-verde-claro); opacity: 1; }
.sidebar__item--active::before {
  content: ""; position: absolute; left: -10px; width: 6px; height: 18px; border-radius: 2px; background: var(--ft-laranja);
}
.sidebar__badge {
  margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: var(--radius-full); background: var(--ft-laranja);
  color: var(--ft-verde-azulado-escuro); font-size: var(--text-xs); font-weight: var(--weight-bold); text-align: center;
}
.sidebar__user {
  display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-4);
  padding: var(--space-3) var(--space-2) 0; border-top: 1px solid rgba(251, 251, 251, 0.1);
}
.sidebar__user-text { display: grid; flex: 1; min-width: 0; line-height: 1.25; }
.sidebar__user-text strong { overflow: hidden; font-size: var(--text-sm); text-overflow: ellipsis; white-space: nowrap; }
.sidebar__user-text small { font-size: var(--text-xs); }
.sidebar__logout {
  display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-on-dark-muted);
}
.sidebar__logout:hover { background: rgba(251, 251, 251, 0.1); color: #fff; }
.sidebar__logout svg { width: 18px; height: 18px; }
.sidebar-fundo { position: fixed; inset: 0; z-index: 39; background: rgba(7, 54, 44, 0.46); }

.avatar {
  display: grid; flex: none; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  color: #fff; font-size: var(--text-sm); font-weight: var(--weight-semibold);
}

/* ---------------- Casca: conteúdo e barra do topo ---------------- */
.shell { min-height: 100vh; padding-left: var(--sidebar-width); }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: var(--space-4);
  min-height: var(--topbar-height); padding: var(--space-4) var(--space-8); border-bottom: 1px solid var(--line);
  background: rgba(251, 251, 251, 0.88); backdrop-filter: blur(10px);
}
.topbar__menu { display: none; }
.topbar__titles { display: grid; flex: 1; gap: 2px; min-width: 0; }
.topbar__titles h1 { font-size: var(--text-2xl); }
.topbar__titles p { overflow: hidden; color: var(--text-muted); font-weight: var(--weight-light); text-overflow: ellipsis; white-space: nowrap; }
.topbar__actions { display: flex; flex: none; align-items: center; gap: var(--space-2); }

@media (max-width: 1024px) {
  .shell { padding-left: 0; }
  .sidebar { transform: translateX(-100%); transition: transform var(--medium) var(--ease); }
  .sidebar--open { box-shadow: var(--shadow-lg); transform: translateX(0); }
  .sidebar__close { display: grid; }
  .topbar__menu { display: inline-grid; margin-left: calc(var(--space-2) * -1); }
}
@media (max-width: 900px) {
  .topbar { padding: var(--space-3) var(--space-4); }
  .topbar__titles h1 { font-size: var(--text-xl); }
  .topbar__titles p { display: none; }
}
@media (max-width: 640px) {
  #topbar-actions .btn span { display: none; }
  #topbar-actions .btn { padding: 0 10px; }
}

/* ---------------- Modal ---------------- */
.modal {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: var(--space-6);
  background: rgba(7, 54, 44, 0.46); backdrop-filter: blur(3px); animation: aparecer var(--medium) var(--ease);
}
.modal__panel {
  display: flex; flex-direction: column; width: 100%; max-height: min(88vh, 900px); border-radius: var(--radius-xl);
  background: var(--surface); box-shadow: var(--shadow-lg); outline: none; overflow: hidden;
  animation: subir var(--medium) var(--ease);
}
.modal__panel--sm { max-width: 440px; }
.modal__panel--md { max-width: 580px; }
.modal__panel--lg { max-width: 760px; }
.modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); padding: var(--space-6) var(--space-6) var(--space-4); }
.modal__heading { display: grid; gap: 4px; min-width: 0; }
.modal__title { font-size: var(--text-xl); }
.modal__subtitle { color: var(--text-muted); font-weight: var(--weight-light); line-height: 1.5; }
.modal__body { flex: 1; padding: var(--space-2) var(--space-6) var(--space-6); overflow-y: auto; }
.modal__foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-2);
  padding: var(--space-4) var(--space-6); border-top: 1px solid var(--line); background: var(--surface-muted);
}
@keyframes aparecer { from { opacity: 0; } }
@keyframes subir { from { opacity: 0; transform: translateY(12px) scale(0.98); } }
@media (max-width: 640px) {
  .modal { align-items: end; padding: 0; }
  .modal__panel { max-width: none; max-height: 92vh; border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
  .modal__head { padding: var(--space-5) var(--space-4) var(--space-3); }
  .modal__body { padding: var(--space-2) var(--space-4) var(--space-5); }
  .modal__foot { padding: var(--space-3) var(--space-4); }
}

/* ---------------- Toasts ---------------- */
.toasts {
  position: fixed; top: var(--space-5); right: var(--space-5); z-index: 80; display: grid; gap: var(--space-2);
  width: min(380px, calc(100vw - 32px)); pointer-events: none;
}
.toast {
  display: flex; align-items: flex-start; gap: var(--space-3); padding: 12px 12px 12px 14px; border: 1px solid var(--line);
  border-left: 4px solid var(--primary-hover); border-radius: var(--radius); background: var(--surface);
  box-shadow: var(--shadow-md); pointer-events: auto; animation: deslizar var(--medium) var(--ease);
}
.toast p { flex: 1; padding-top: 1px; color: var(--text); font-size: var(--text-base); line-height: 1.45; }
.toast__icon { flex: none; width: 19px; height: 19px; color: var(--primary-hover); }
.toast--error { border-left-color: var(--danger); }
.toast--error .toast__icon { color: var(--danger); }
.toast--info { border-left-color: var(--info); }
.toast--info .toast__icon { color: var(--info); }
.toast__close {
  display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 6px;
  background: transparent; color: var(--text-soft);
}
.toast__close:hover { background: var(--surface-sunken); color: var(--text); }
.toast__close svg { width: 15px; height: 15px; }
@keyframes deslizar { from { opacity: 0; transform: translateX(16px); } }
@media (max-width: 640px) { .toasts { top: auto; right: 16px; bottom: 16px; } }

/* ---------------- Estado vazio ---------------- */
.empty { display: grid; justify-items: center; gap: var(--space-2); padding: var(--space-10) var(--space-6); text-align: center; }
.empty__art { position: relative; display: grid; place-items: center; width: 96px; height: 72px; margin-bottom: var(--space-2); }
.empty__road { position: absolute; right: 6px; bottom: 0; height: 72px; opacity: 0.18; }
.empty__icon {
  position: relative; display: grid; place-items: center; width: 52px; height: 52px; border-radius: var(--radius);
  background: var(--primary-soft); color: var(--primary);
}
.empty__icon svg { width: 24px; height: 24px; }
.empty__title { font-size: var(--text-lg); }
.empty__text { max-width: 420px; color: var(--text-muted); font-weight: var(--weight-light); line-height: 1.55; }
.empty__actions { display: flex; gap: var(--space-2); margin-top: var(--space-3); }

/* ---------------- Esqueleto ---------------- */
.esqueleto {
  height: 64px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface-sunken), var(--surface-muted), var(--surface-sunken));
  background-size: 200% 100%; animation: brilho 1.2s linear infinite;
}
@keyframes brilho { to { background-position: -200% 0; } }

/* ---------------- Destaque e projetos ---------------- */
.destaque {
  display: grid; gap: var(--space-2); padding: var(--space-8); border-radius: var(--radius-xl); box-shadow: var(--shadow-md);
}
.destaque__numeros { display: flex; flex-wrap: wrap; gap: var(--space-8); margin-top: var(--space-3); }
.destaque__numeros div { display: grid; }
.destaque__numeros strong { font-size: var(--text-2xl); font-weight: var(--weight-semibold); }
.destaque__numeros small { font-size: var(--text-xs); letter-spacing: 0.06em; text-transform: uppercase; }

.projetos { display: grid; gap: var(--space-3); }
.projeto {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: var(--space-4); padding: var(--space-4) var(--space-5);
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-xs);
  cursor: pointer; transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.projeto:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.projeto__info { display: grid; gap: 6px; min-width: 0; }
.projeto__titulo { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.projeto__titulo h3 { font-size: var(--text-md); }
.projeto__meta { color: var(--text-muted); font-size: var(--text-sm); }
.projeto__acoes { display: flex; gap: var(--space-2); }

.barra { position: relative; height: 6px; overflow: hidden; border-radius: var(--radius-full); background: var(--surface-sunken); }
.barra__valor { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--primary-hover); transition: width var(--medium) var(--ease); }
.barra--laranja .barra__valor { background: var(--ft-laranja); }
.barra--ativa .barra__valor {
  background-image: linear-gradient(90deg, rgba(255,255,255,0) 0, rgba(255,255,255,0.35) 50%, rgba(255,255,255,0) 100%);
  background-size: 60px 100%; animation: andar 1.1s linear infinite;
}
@keyframes andar { from { background-position: -60px 0; } to { background-position: 200px 0; } }
.progresso-texto { display: flex; justify-content: space-between; gap: var(--space-3); color: var(--text-muted); font-size: var(--text-sm); }

@media (max-width: 640px) {
  .projeto { grid-template-columns: 1fr; }
  .projeto__acoes { justify-content: flex-end; }
}

/* ---------------- Arquivo (seleção) ---------------- */
.arquivo-alvo {
  display: grid; justify-items: center; gap: var(--space-2); padding: var(--space-8) var(--space-4);
  border: 2px dashed var(--line-strong); border-radius: var(--radius-lg); background: var(--surface-muted);
  color: var(--text-muted); text-align: center; cursor: pointer; transition: border-color var(--fast), background var(--fast);
}
.arquivo-alvo:hover, .arquivo-alvo--sobre { border-color: var(--primary-hover); background: var(--primary-soft); }
.arquivo-alvo svg { width: 28px; height: 28px; color: var(--primary); }
.arquivo-alvo strong { color: var(--text); }

/* ---------------- Projeto: abas, resumo, arquivos ---------------- */
.abas { display: flex; gap: var(--space-1); overflow-x: auto; overflow-y: hidden; border-bottom: 1px solid var(--line); }
.aba {
  padding: var(--space-3) var(--space-4); border: 0; border-bottom: 2px solid transparent; background: transparent;
  color: var(--text-muted); font-size: var(--text-base); font-weight: var(--weight-medium); white-space: nowrap;
}
.aba:hover { color: var(--text); }
.aba--ativa { border-bottom-color: var(--ft-laranja); color: var(--text); font-weight: var(--weight-semibold); }

.numeros { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--space-3); }
.numero { display: grid; gap: 2px; padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.numero small { color: var(--text-muted); font-size: var(--text-xs); letter-spacing: 0.04em; text-transform: uppercase; }
.numero strong { font-size: var(--text-xl); font-weight: var(--weight-semibold); }

.registro {
  max-height: 340px; padding: var(--space-4); overflow: auto; border-radius: var(--radius); background: #0b241e;
  color: #cfe9de; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap;
}

/* ---------------- Mapa 3D ---------------- */
.mapa {
  position: relative; height: calc(100vh - var(--topbar-height) - 150px); min-height: 460px; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: #0b241e;
}
.mapa__cesium { position: absolute; inset: 0; }
.mapa__painel {
  position: absolute; top: var(--space-3); left: var(--space-3); z-index: 2; display: grid; gap: var(--space-3);
  width: 250px; max-height: calc(100% - 24px); padding: var(--space-4); overflow-y: auto;
  border-radius: var(--radius-lg); background: rgba(255, 255, 255, 0.94); box-shadow: var(--shadow-md);
}
.mapa__painel h4 { color: var(--text-muted); font-size: var(--text-xs); letter-spacing: 0.1em; text-transform: uppercase; }
.camada { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); cursor: pointer; }
.camada input { accent-color: var(--primary); }
.camada__cor { width: 12px; height: 12px; border: 2px solid; border-radius: 3px; }
.mapa__painel input[type="range"] { width: 100%; accent-color: var(--primary); }
.mapa__fechar-painel { display: none; }
@media (max-width: 640px) {
  .mapa { height: calc(100vh - 190px); }
  .mapa__painel { width: calc(100% - 24px); max-height: 45%; }
}
.cesium-viewer-bottom { display: none !important; }
.mapa__creditos { position: absolute; right: 8px; bottom: 6px; z-index: 2; color: rgba(255,255,255,0.75); font-size: 11px; }

/* ---------------- Login ---------------- */
.login { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.login__marca { display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-8); padding: var(--space-10); }
.login__marca img.logo { width: 200px; }
.login__pilula {
  justify-self: start; width: fit-content; padding: 4px 12px; border-radius: var(--radius-full); background: var(--ft-laranja);
  color: var(--ft-verde-azulado-escuro); font-size: var(--text-sm); font-weight: var(--weight-semibold);
}
.login__frase { display: grid; gap: var(--space-4); max-width: 480px; }
.login__frase h1 { font-size: 2.5rem; line-height: 1.1; }
.login__frase p { font-size: var(--text-lg); font-weight: var(--weight-light); line-height: 1.5; }
.login__form { display: grid; place-items: center; padding: var(--space-8); background: var(--bg); }
.login__caixa { display: grid; gap: var(--space-5); width: min(380px, 100%); }
.login__caixa .logo-claro { display: none; width: 170px; }
.login__caixa h2 { font-size: var(--text-2xl); }
@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; }
  .login__marca { display: none; }
  .login__caixa .logo-claro { display: block; }
}
