/* ============================================================
   Layout do "dashboard vivo" — mesma disposicao de
   app/[locale]/[companySlug]/home/layout.tsx:
   kill chain no topo, 1/5 esquerda, 3/5 radar, 1/5 direita.
   ============================================================ */

/* min-height (e nao height) de proposito: numa tela normal o dashboard ocupa
   exatamente a viewport, mas se o painel de decisao ficar mais alto do que
   cabe, a pagina cresce e o body rola. Com `height: 100vh` o excedente ficava
   fora da tela sem scroll em lugar nenhum. */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 0.75rem 1.25rem 1.25rem;
  gap: 0.75rem;
}

/* ---------- Topbar ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-shrink: 0;
}

.topbar__logo {
  height: 1.5rem;
  width: auto;
}

.topbar__org {
  font-size: 0.8rem;
  color: hsl(var(--muted-foreground));
  border-left: 1px solid hsl(var(--border));
  padding-left: 1.25rem;
}

.topbar__org b {
  color: hsl(var(--foreground));
  font-weight: 500;
}

.topbar__spacer {
  flex: 1;
}

.topbar__stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
}

.topbar__stat span {
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}

.topbar__stat b {
  font-size: 1rem;
  font-weight: 600;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  cursor: pointer;
  font-size: 0.9rem;
}

.icon-btn:hover {
  background: hsl(var(--hover));
}

/* ---------- Corpo ---------- */

/* `flex: 1` (basis 0) fazia o corpo nunca passar da viewport: o excedente era
   cortado em vez de esticar a pagina. Com basis auto + shrink 0 o corpo mede o
   proprio conteudo, cresce quando precisa e a pagina rola. */
.main {
  display: flex;
  gap: 1rem;
  flex: 1 0 auto;
}

.col-side {
  width: 18%;
  min-width: 175px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Coluna de acao: painel de decisao + log. Nunca cobre o radar. */
.col-action {
  width: 27%;
  min-width: 320px;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* O log fica numa faixa curta para o painel de decisao ter espaco. */
.col-action > .card-fill {
  flex: 0 0 11rem;
  min-height: 4.5rem;
}

.col-center {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(90px, 1fr) 3fr minmax(90px, 1fr);
  gap: 0.5rem;
  align-items: stretch;
  padding: 0.75rem;
  min-height: 0;
}

.col-center .radar-host {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

/* Mesmo motivo: basis auto para o card contribuir com a propria altura, e
   shrink 0 para nunca ser espremido (era o que cortava o card do Shield). */
.card-fill {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

.card-head {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
  padding: 0.7rem 0.9rem 0.2rem;
  flex-shrink: 0;
}

/* ---------- Painel de decisao (coluna da direita) ---------- */

/* flex-shrink 0: o painel cresce para preencher a coluna, mas NUNCA encolhe
   abaixo do proprio conteudo. Quem absorve o excedente e a pagina. */
.dock {
  flex: 1 0 auto;
  overflow: visible;
  animation: vg-dock-in 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes vg-dock-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.dock.is-standby {
  animation: none;
}

.dock.is-standby .decision__timer,
.dock.is-standby .decision__tag,
.dock.is-standby .decision__event,
.dock.is-standby .decision__question,
.dock.is-standby .options {
  display: none;
}

.standby {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 2rem 1.25rem;
  text-align: center;
  color: hsl(var(--muted-foreground));
  font-size: 0.8rem;
}

.standby__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: hsl(var(--secondary));
  animation: vg-pulse 1.4s ease-in-out infinite;
}

/* ---------- Tela cheia (briefing / relatorio) ---------- */

.splash {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 2rem 1.5rem;
  text-align: center;
}

.splash__logo {
  height: 2.4rem;
  margin-bottom: 0.5rem;
}

.splash .lead {
  max-width: 46ch;
}

/* ---------- Grade de modos (index) ---------- */

.modes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  max-width: 860px;
  width: 100%;
  margin-top: 1rem;
}

.mode {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.75rem;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition:
    border-color 0.2s,
    transform 0.2s,
    background 0.2s;
}

.mode:hover {
  border-color: hsl(var(--secondary));
  background: hsl(var(--hover));
  transform: translateY(-2px);
}

.mode__kicker {
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: hsl(var(--secondary));
}

.mode--attack .mode__kicker {
  color: hsl(var(--attention));
}

.mode--attack:hover {
  border-color: hsl(var(--attention));
}

.mode__title {
  font-size: 1.35rem;
  font-weight: 600;
}

.mode__desc {
  font-size: 0.85rem;
  line-height: 1.55;
  color: hsl(var(--muted-foreground));
}

.mode__meta {
  margin-top: 0.4rem;
  font-size: 0.7rem;
  color: hsl(var(--muted-foreground));
  display: flex;
  gap: 1rem;
}

/* ---------- Responsivo ---------- */

@media (max-width: 1100px) {
  .app {
    height: auto;
    min-height: 100vh;
  }

  .main {
    flex-direction: column;
  }

  .col-side {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .col-side > * {
    flex: 1 1 200px;
  }

  .col-action {
    width: 100%;
    max-width: none;
    overflow: visible;
  }

  /* Empilhado, a pagina inteira rola: o painel nao precisa de scroll proprio. */
  .dock {
    flex: 0 0 auto;
    overflow: visible;
  }

  .col-action > .card-fill {
    flex: 0 0 auto;
    min-height: 8rem;
  }

  .col-center {
    grid-template-columns: 1fr;
  }

  .col-center .vectors {
    flex-direction: row;
    justify-content: space-around;
    padding: 0.5rem 0;
  }

  .col-center .radar-wrap {
    max-width: min(100%, 460px);
  }

  .killchain {
    overflow-x: auto;
  }

  .kc-stage {
    min-width: 130px;
  }
}
