/* ==========================================================================
   CPM Vision 2.0 — layout.css
   O esqueleto que TODA página usa. Nenhuma página inventa o seu.
   ========================================================================== */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* --- Luz ambiente (assinatura) --------------------------------------------
   Um único foco de luz bordô no alto da área de trabalho, como a luz que
   atravessa uma lente. É a nossa marca visual. Aparece uma vez, em um lugar
   só, e nunca se repete em outro componente.
   -------------------------------------------------------------------------- */
.main {
  position: relative;
  min-width: 0;                    /* impede overflow de tabelas/grids */
  display: flex;
  flex-direction: column;
}

.main::before {
  content: '';
  position: absolute;
  top: -160px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 420px;
  background: radial-gradient(ellipse at center, var(--primary-glow), transparent 65%);
  pointer-events: none;
  z-index: 0;
}

/* --- Conteúdo -------------------------------------------------------------- */
.content {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--sp-4) var(--sp-5) var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

/* --- Cabeçalho de página --------------------------------------------------- */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.page-header__eyebrow {
  display: block;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--sp-1);
}

.page-header__title {
  font-size: var(--fs-xl);
  font-weight: var(--fw-semibold);
}

.page-header__subtitle {
  color: var(--text-secondary);
  font-size: var(--fs-base);
  margin-top: var(--sp-1);
}

.page-header__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-shrink: 0;
}

/* --- Grid de 12 colunas ---------------------------------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--sp-3);
}

.col-2  { grid-column: span 2; }
.col-3  { grid-column: span 3; }
.col-4  { grid-column: span 4; }
.col-5  { grid-column: span 5; }
.col-6  { grid-column: span 6; }
.col-7  { grid-column: span 7; }
.col-8  { grid-column: span 8; }
.col-9  { grid-column: span 9; }
.col-12 { grid-column: span 12; }

/* Faixa de KPIs — auto-ajusta, nunca quebra em coluna órfã. */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-3);
}

/* --- Seção ----------------------------------------------------------------- */
.section { display: flex; flex-direction: column; gap: var(--sp-3); }

.section__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
}

.section__title a {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  transition: color var(--t-fast);
}
.section__title a:hover { color: var(--text); }

/* --- Rodapé ---------------------------------------------------------------- */
.footer {
  position: relative;
  z-index: 1;
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

/* Links legais no centro do rodapé (Termos, Política, Tratamento de Dados). */
.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-1) var(--sp-3);
}
.footer-links a {
  color: var(--text-secondary);
  transition: color var(--t-fast);
}
.footer-links a:hover { color: var(--text); }

/* ==========================================================================
   Login — a única página sem sidebar e sem topbar.
   ========================================================================== */

.auth {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: var(--sp-4);
  overflow: hidden;
}

/* A mesma luz de lente do dashboard, atrás do cartão. */
.auth::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 900px;
  height: 900px;
  max-width: 150vw;
  background: radial-gradient(circle at center, var(--primary-glow), transparent 60%);
  pointer-events: none;
}

.auth__card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-pop), var(--shadow-inset);
  padding: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.auth__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  text-align: center;
}

/* A lente, em tamanho grande. */
.auth__mark {
  width: 56px;
  height: 56px;
  border-radius: var(--r-pill);
  border: 3px solid var(--primary);
  display: grid;
  place-items: center;
}
.auth__mark::after {
  content: '';
  width: 18px;
  height: 18px;
  border-radius: var(--r-pill);
  background: var(--primary);
}

.auth__name {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-semibold);
  letter-spacing: -.02em;
}
.auth__name span { color: var(--primary-hover); }

.auth__tagline {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: var(--fw-medium);
}

.auth__footer {
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.auth__footer a { color: var(--text-secondary); }
.auth__footer a:hover { color: var(--primary-hover); }

/* Campos maiores: é a porta de entrada, tem que ser confortável. */
.auth .input { height: 48px; font-size: var(--fs-md); }
.auth .btn   { height: 48px; font-size: var(--fs-md); }

@media (max-width: 480px) {
  .auth { padding: var(--sp-3); }
  .auth__card { padding: var(--sp-4); }
}
