/* =========================================================================
   App da DMG
   Estilo: preto real, elevação só por luminosidade (#050505 fundo, #121212
   cartão, #1f1f1f dentro do cartão), sem borda nem sombra em cartão. A cor da
   marca (lima #D4FF2A) só aparece em dado: sistema no ar, dinheiro recebido,
   a linha do gráfico. Botão principal = branco com texto preto.

   Grade
   Celular: margem 16 + conteúdo + 16. Em 390 px: 16 + 358 + 16 = 390.
   Desktop (>= 1000 px): coluna de 1112 px no centro, 3 colunas de 360 com
   vão de 16 (3 x 360 + 2 x 16 = 1112). Cartão largo = 2 colunas = 736.
   Metade = (1112 - 16) / 2 = 548.
   Escala de tipo: 11 / 13 / 15 / 24 / 36 (título 28 no desktop). Base de 4 px.
   ========================================================================= */

@font-face {
  font-family: 'Inter';
  src: url('/fontes/inter.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: 'Sora';
  src: url('/fontes/sora.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ground: #050505;
  --surface: #121212;
  --raised: #1f1f1f;
  --active: #2a2a2a;
  --rule: #222222;
  --border: #1a1a1a;
  --control: #3a3a3a;
  --text: #ffffff;
  --body: #e5e7eb;
  --muted: #b4b4b4;
  --faint: #949494;
  --off: #4a4a4a;

  --accent: #d4ff2a;
  --positive: var(--accent);
  --pill-positive-bg: #1c2408;
  --pill-positive-ink: #d4ff2a;
  --negative: #ff6b6b;
  --pill-negative-bg: #2c1618;
  --pill-negative-ink: #ff8f8f;
  --warning: #f2b33d;
  --pill-warning-bg: #2a2111;
  --pill-warning-ink: #f5c25e;

  /* charts.js lê estes */
  --chart-1: var(--accent);
  --chart-muted: #4a4a4a;
  --chart-mark: #ffffff;
  --chart-span: 0.12;
  --chart-track: #262626;
  --grid: #222222;
  --axis-ink: #949494;
  --ink: #ffffff;

  --fonte: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --fonte-figura: 'Sora', 'Inter', system-ui, sans-serif;

  --raio-cartao: 16px;
  --raio-dentro: 10px;
  --vao: 16px;
  --margem: 16px;
  --largura: 1112px;
  --barra: 52px;
  --abas: 56px;
  --topo-seguro: env(safe-area-inset-top, 0px);
  --base-segura: env(safe-area-inset-bottom, 0px);
  --suave: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html {
  background: var(--ground);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-gutter: stable;
}
body {
  background: var(--ground);
  color: var(--body);
  font: 400 15px/20px var(--fonte);
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
  min-height: 100vh;
  min-height: 100dvh;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: none; border: 0; cursor: pointer; touch-action: manipulation; }
img, svg { display: block; }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid #ffffff; outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent); color: #000; }
[hidden] { display: none !important; }

/* ---------- barra do topo ---------- */

.barra {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--ground);
  padding-top: var(--topo-seguro);
  box-shadow: 0 1px 0 0 transparent;
  transition: box-shadow .2s;
}
.barra.rolou { box-shadow: 0 1px 0 0 var(--border); }
.barra-coluna {
  height: var(--barra);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px 0 var(--margem);
  max-width: calc(var(--largura) + 2 * var(--margem));
  margin: 0 auto;
}
.marca { display: flex; align-items: center; height: 44px; margin-right: auto; }
.marca img { width: 42px; height: 20px; }
.nav-topo { display: none; }
.barra-acoes { display: flex; align-items: center; gap: 0; }
.frescor { font-size: 13px; line-height: 16px; color: var(--faint); padding-right: 4px; white-space: nowrap; }
.frescor.erro { color: var(--pill-warning-ink); }
.botao-icone {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 999px;
  color: var(--muted);
  transition: background .15s, color .15s, transform .15s var(--suave);
}
.botao-icone svg { width: 22px; height: 22px; }
.botao-icone:active { background: var(--surface); transform: scale(.94); }
@media (hover: hover) { .botao-icone:hover { color: var(--text); background: var(--surface); } }
.botao-icone.girando svg { animation: girar .8s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

/* ---------- tela ---------- */

.tela {
  display: block;
  max-width: calc(var(--largura) + 2 * var(--margem));
  margin: 0 auto;
  padding: 8px var(--margem) calc(var(--abas) + var(--base-segura) + 32px);
  outline: none;
}
.cabeca { margin-bottom: 24px; }
.cabeca h1 {
  font: 600 24px/30px var(--fonte-figura);
  letter-spacing: -0.02em;
  color: var(--text);
  text-wrap: balance;
}
.cabeca .linha-titulo { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cabeca p { margin-top: 4px; color: var(--muted); font-size: 15px; line-height: 20px; text-wrap: pretty; }
.cabeca p .ok { color: var(--accent); }
.cabeca p .ruim { color: var(--negative); }

.voltar {
  display: inline-flex; align-items: center; gap: 2px;
  height: 44px; margin: -4px 0 4px -8px; padding: 0 12px 0 4px;
  color: var(--muted); font-weight: 500; border-radius: 999px;
}
.voltar svg { width: 22px; height: 22px; }
.voltar:active { background: var(--surface); }

.grade { display: grid; gap: var(--vao); grid-template-columns: minmax(0, 1fr); align-items: start; }
.secao-titulo {
  font-size: 13px; line-height: 16px; font-weight: 500;
  color: var(--faint);
  margin: 4px 0 -8px 16px;
}

/* ---------- cartões ---------- */

.cartao {
  background: var(--surface);
  border-radius: var(--raio-cartao);
  padding: 16px;
  min-width: 0;
}
.cartao.lista { padding: 4px 0; }
.cartao-cabeca {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-bottom: 12px;
}
.cartao.lista .cartao-cabeca { padding: 12px 16px 0; margin-bottom: 4px; }
.cartao-cabeca h2 { font-size: 15px; line-height: 20px; font-weight: 600; color: var(--text); letter-spacing: -0.01em; }
.cartao-cabeca .lado { font-size: 13px; line-height: 16px; color: var(--faint); white-space: nowrap; }
a.mais {
  display: inline-flex; align-items: center; gap: 0;
  height: 32px; margin: -6px -8px -6px 0; padding: 0 4px 0 10px;
  font-size: 15px; line-height: 20px; font-weight: 500; color: var(--muted);
  border-radius: 999px; white-space: nowrap;
}
a.mais svg { width: 18px; height: 18px; }
a.mais:active { background: var(--raised); }
@media (hover: hover) { a.mais:hover { color: var(--text); } }

a.cartao, button.cartao { display: block; width: 100%; text-align: left; transition: background .15s, transform .2s var(--suave); }
a.cartao:active, button.cartao:active { background: #161616; transform: scale(.992); }

/* ---------- linhas de lista ---------- */

.linha {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  column-gap: 12px;
  min-height: 60px;
  padding: 10px 12px 10px 16px;
  width: 100%;
  text-align: left;
  --inicio-texto: 36px;
}
.linha.sem-marca { grid-template-columns: minmax(0, 1fr) auto auto; --inicio-texto: 16px; }
.linha.com-avatar { --inicio-texto: 64px; min-height: 64px; }
.linha.com-icone { --inicio-texto: 48px; min-height: 52px; }
.linha + .linha::before {
  content: '';
  position: absolute;
  top: 0; right: 0; left: var(--inicio-texto);
  height: 1px;
  background: var(--rule);
}
a.linha, button.linha { transition: background .12s; }
a.linha:active, button.linha:active { background: var(--raised); }
@media (hover: hover) { a.linha:hover, button.linha:hover { background: #171717; } }
.cartao.lista > .linha:first-child { border-radius: var(--raio-cartao) var(--raio-cartao) 0 0; }
.cartao.lista > .linha:last-child { border-radius: 0 0 var(--raio-cartao) var(--raio-cartao); }

.linha-texto { min-width: 0; }
.linha-titulo { display: block; font-size: 15px; line-height: 20px; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linha-sub { display: block; margin-top: 2px; font-size: 13px; line-height: 16px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linha-valor { text-align: right; white-space: nowrap; }
.linha-valor b { display: block; font-size: 15px; line-height: 20px; font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; }
.linha-valor span { display: block; margin-top: 2px; font-size: 13px; line-height: 16px; color: var(--faint); font-variant-numeric: tabular-nums; }
.linha-valor span.ok { color: var(--accent); }
.linha-valor span.ruim { color: var(--negative); }
.linha-valor span.aviso { color: var(--pill-warning-ink); }
.seta { width: 20px; height: 20px; color: var(--off); margin-left: -4px; }
.linha .icone-linha { width: 20px; height: 20px; color: var(--faint); }

.ponto { width: 8px; height: 8px; border-radius: 50%; background: var(--off); flex: none; }
.ponto.no-ar { background: var(--accent); }
.ponto.lento { background: var(--warning); }
.ponto.fora { background: var(--negative); }
.ponto.neutro { background: var(--faint); }
.ponto.aviso { background: var(--warning); }
.ponto.negativo { background: var(--negative); }

.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: #262626; display: grid; place-items: center; overflow: hidden; flex: none;
}
.avatar img { width: 30px; height: 30px; object-fit: contain; }
.avatar.letra { background: #2a2a2a; color: var(--text); font: 600 14px/1 var(--fonte); }

.pilula {
  display: inline-flex; align-items: center; flex: none;
  height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: 0;
  white-space: nowrap;
  background: var(--raised); color: var(--muted);
}
.pilula.no-ar, .pilula.positivo { background: var(--pill-positive-bg); color: var(--pill-positive-ink); }
.pilula.fora, .pilula.negativo { background: var(--pill-negative-bg); color: var(--pill-negative-ink); }
.pilula.lento, .pilula.aviso { background: var(--pill-warning-bg); color: var(--pill-warning-ink); }

/* ---------- o que pede atenção ---------- */

.atencao .linha { grid-template-columns: auto minmax(0, 1fr) auto; }
.vazio { padding: 4px 16px 16px; color: var(--muted); }

.pilha { display: grid; gap: var(--vao); align-content: start; min-width: 0; }
.pilha-lateral { min-width: 0; }
.subtitulo-lista { padding: 14px 16px 6px; font-size: 13px; line-height: 16px; font-weight: 500; color: var(--faint); }
.cartao-cabeca + .subtitulo-lista { padding-top: 4px; }
.icone-inline { display: inline-block; width: 16px; height: 16px; vertical-align: -3px; margin: 0 1px; color: var(--muted); }
.linha .linha-valor > span:only-child { margin-top: 0; }

/* ---------- placa dos sistemas (a peça da DMG) ---------- */

.placa-topo { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.figura { font: 500 36px/40px var(--fonte-figura); letter-spacing: -0.035em; color: var(--text); font-variant-numeric: tabular-nums; }
.figura small { font: 400 15px/20px var(--fonte); letter-spacing: -0.006em; color: var(--muted); margin-left: 6px; }
.figura-lado { text-align: right; padding-bottom: 2px; }
.figura-lado b { display: block; font-size: 15px; line-height: 20px; font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; }
.figura-lado span { display: block; font-size: 13px; line-height: 16px; color: var(--faint); }
.placa { display: grid; gap: 14px; }
.trilha-rotulo { display: flex; justify-content: space-between; font-size: 13px; line-height: 16px; color: var(--faint); margin-bottom: 6px; }
.trilha-rotulo b { color: var(--muted); font-weight: 500; }
.trilha svg { width: 100%; height: 20px; overflow: visible; }
.trilha .fio { stroke: #333333; stroke-width: 1.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.trilha .pad { stroke: var(--surface); stroke-width: 3; }
.trilha .pad.no-ar { fill: var(--accent); }
.trilha .pad.lento { fill: var(--warning); }
.trilha .pad.fora { fill: var(--negative); }
.trilha .pad.verificando { fill: var(--off); }
.trilha .alvo { fill: transparent; cursor: pointer; }
.trilha a:focus-visible { outline: none; }
.trilha a:focus-visible .pad { stroke: #ffffff; stroke-width: 2; }
.placa-falhas { margin-top: 14px; font-size: 13px; line-height: 16px; color: var(--pill-negative-ink); }
.placa-falhas + .placa-falhas { margin-top: 4px; }
.placa-falhas.neutro { color: var(--faint); }

/* ---------- dinheiro ---------- */

.valor-grande { font: 500 24px/28px var(--fonte-figura); letter-spacing: -0.03em; color: var(--text); font-variant-numeric: tabular-nums; }
.valor-grande small { font: 400 15px/20px var(--fonte); letter-spacing: -0.006em; color: var(--muted); margin-left: 6px; }
.nota-valor { margin-top: 2px; font-size: 13px; line-height: 16px; color: var(--faint); }

.plano { position: relative; height: 8px; border-radius: 4px; background: var(--raised); overflow: hidden; margin: 16px 0 0; display: flex; }
.plano i { display: block; height: 100%; }
.plano .recebido { background: var(--accent); }
.plano .emitido { background: #6f8a14; }
.plano i + i { box-shadow: -2px 0 0 0 var(--surface); }

/* a legenda é a própria tabela de valores: cada quadradinho é o pedaço da barra */
.legenda-valores { margin-top: 12px; }
.legenda-valores > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 28px; }
.legenda-valores dt { display: flex; align-items: center; font-size: 13px; line-height: 16px; color: var(--muted); }
.legenda-valores dd { font-size: 15px; line-height: 20px; font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.legenda { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 8px; box-shadow: inset 0 0 0 1.5px #4a4a4a; }
.legenda.recebido { background: var(--accent); box-shadow: none; }
.legenda.emitido { background: #6f8a14; box-shadow: none; }

.proxima {
  display: flex; justify-content: space-between; gap: 12px;
  margin: 16px -16px -16px; padding: 14px 16px;
  box-shadow: 0 -1px 0 0 var(--rule);
  font-size: 15px; line-height: 20px;
}
.proxima span:first-child { color: var(--muted); }
.proxima b { font-weight: 500; color: var(--text); white-space: nowrap; }

/* ---------- medidores da VPS ---------- */

.medidores { display: grid; gap: 14px; }
.medidor-topo { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.medidor-topo span { font-size: 13px; line-height: 16px; color: var(--muted); }
.medidor-topo b { font-size: 15px; line-height: 20px; font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; }
.medidor-topo b small { font-size: 13px; font-weight: 400; color: var(--faint); margin-left: 4px; }
.barra-fina { height: 4px; border-radius: 2px; background: var(--raised); overflow: hidden; }
.barra-fina i { display: block; height: 100%; border-radius: 2px; background: var(--muted); min-width: 2px; }
.barra-fina i.aviso { background: var(--warning); }
.barra-fina i.negativo { background: var(--negative); }
.rodape-cartao { margin-top: 16px; font-size: 13px; line-height: 16px; color: var(--faint); }

/* ---------- KPIs divididos ---------- */

.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); background: var(--surface); border-radius: var(--raio-cartao); }
.kpis > div { padding: 16px; min-width: 0; }
.kpis > div:nth-child(2n) { box-shadow: -1px 0 0 0 var(--rule); }
.kpis > div:nth-child(n + 3) { border-top: 1px solid var(--rule); }
.kpis dt { font-size: 13px; line-height: 16px; color: var(--faint); }
.kpis dd { margin-top: 6px; font: 500 24px/28px var(--fonte-figura); letter-spacing: -0.03em; color: var(--text); font-variant-numeric: tabular-nums; }
.kpis dd small { display: block; margin-top: 4px; font: 400 13px/16px var(--fonte); letter-spacing: 0; color: var(--muted); }

/* ---------- fatos (chave e valor) ---------- */

.fatos { padding: 4px 0; }
.fato { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 44px; padding: 10px 16px; position: relative; }
.fato + .fato::before { content: ''; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--rule); }
.fato dt { color: var(--muted); white-space: nowrap; }
.fato dd { color: var(--text); font-weight: 500; text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fato dd a { color: var(--text); }
.fato dd .cinza { color: var(--faint); font-weight: 400; }

/* ---------- gráficos ---------- */

.grafico { height: 180px; position: relative; }
.grafico svg text { font-family: var(--fonte); }
.grafico-vazio { height: 180px; display: grid; place-items: center; color: var(--faint); font-size: 13px; }

/* ---------- controles ---------- */

.botao {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 999px;
  font-size: 15px; line-height: 20px; font-weight: 600; letter-spacing: -0.01em;
  white-space: nowrap;
  transition: background .15s, transform .15s var(--suave), opacity .15s;
}
.botao:active { transform: scale(.97); }
.botao[disabled] { opacity: .55; cursor: default; }
.botao svg { width: 18px; height: 18px; }
.botao.principal { background: #ffffff; color: #050505; }
.botao.principal:active { background: #e3e3e3; }
.botao.secundario { color: var(--text); box-shadow: inset 0 0 0 1px var(--control); }
.botao.secundario:active { background: var(--surface); }
.botao.perigo { color: var(--negative); }
.botao.cheio { width: 100%; }
.botoes { display: grid; gap: 12px; }
@media (hover: hover) {
  .botao.principal:hover { background: #ececec; }
  .botao.secundario:hover { background: var(--surface); }
}

.segmentos {
  display: flex; gap: 2px; padding: 2px; border-radius: 999px; background: var(--surface);
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  width: max-content; max-width: 100%;
}
.segmentos::-webkit-scrollbar { display: none; }
.segmentos button {
  flex: none; height: 36px; padding: 0 14px; border-radius: 999px;
  font-size: 14px; line-height: 20px; font-weight: 500; color: var(--muted); white-space: nowrap;
  transition: background .15s, color .15s;
}
.segmentos button span { color: var(--faint); margin-left: 4px; font-variant-numeric: tabular-nums; }
.segmentos button[aria-pressed="true"] { background: var(--active); color: var(--text); }
.segmentos button[aria-pressed="true"] span { color: var(--muted); }
.segmentos.cheio { width: 100%; }
.segmentos.filtros { margin: -8px 0 20px; }
@media (max-width: 699px) {
  .segmentos.filtros { width: 100%; }
  .segmentos.filtros button { flex: 1 1 auto; padding: 0 8px; }
}
.segmentos.cheio button { flex: 1 1 0; padding: 0 8px; }

.mes {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin: -8px 0 16px;
}
.mes b { font-size: 15px; line-height: 20px; font-weight: 600; color: var(--text); }
.mes .botao-icone { color: var(--text); }
.mes .botao-icone[disabled] { color: var(--off); }

.campo { display: grid; gap: 8px; }
.campo label { font-size: 13px; line-height: 16px; font-weight: 500; color: var(--muted); }
.entrada {
  display: flex; align-items: center; gap: 8px;
  height: 48px; padding: 0 14px; border-radius: 12px; background: var(--raised);
  transition: box-shadow .15s;
}
.entrada:focus-within { box-shadow: inset 0 0 0 1px #6a6a6a; }
.entrada span { color: var(--faint); }
.entrada input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: none; font-size: 17px; color: var(--text); font-variant-numeric: tabular-nums; }
.entrada input::placeholder { color: var(--faint); }

.chave { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; cursor: pointer; }
.chave input { position: absolute; opacity: 0; pointer-events: none; }
.chave .trilho { width: 51px; height: 31px; border-radius: 999px; background: var(--active); position: relative; flex: none; transition: background .2s; }
.chave .trilho::after { content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #ffffff; transition: transform .25s var(--suave); }
.chave input:checked + .trilho { background: #ffffff; }
.chave input:checked + .trilho::after { background: #050505; transform: translateX(20px); }
.chave input:focus-visible + .trilho { outline: 2px solid #ffffff; outline-offset: 2px; }

.codigo {
  display: block; padding: 12px 14px; border-radius: 12px; background: var(--raised);
  font: 500 13px/18px ui-monospace, 'SF Mono', Menlo, monospace; color: var(--text);
  word-break: break-all; user-select: all; -webkit-user-select: all;
}

/* ---------- folha (sheet) ---------- */

.folha {
  margin: auto auto 0;
  width: 100%; max-width: 560px; max-height: calc(100dvh - var(--topo-seguro) - 24px);
  border: 0; padding: 0;
  background: #161616; color: var(--body);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, .5);
  overflow: auto; overscroll-behavior: contain;
}
.folha[open] { animation: subir .32s var(--suave); }
.folha::backdrop { background: rgba(0, 0, 0, .62); }
.folha[open]::backdrop { animation: aparecer .25s ease; }
@keyframes subir { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes aparecer { from { opacity: 0; } to { opacity: 1; } }
.folha-corpo { padding: 8px 16px calc(var(--base-segura) + 20px); }
.puxador { width: 36px; height: 5px; border-radius: 3px; background: #3a3a3a; margin: 0 auto 12px; }
.folha-topo { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.folha-topo h2 { font: 600 20px/26px var(--fonte-figura); letter-spacing: -0.02em; color: var(--text); }
.folha-topo p { margin-top: 2px; font-size: 13px; line-height: 16px; color: var(--muted); }
.folha-topo .botao-icone { margin: -8px -10px 0 0; background: #222222; width: 32px; height: 32px; }
.folha-topo .botao-icone svg { width: 18px; height: 18px; }
.folha .pilha { display: grid; gap: 20px; }
.folha .cartao { background: #1f1f1f; }
.folha .linha + .linha::before, .folha .fato + .fato::before { background: #2c2c2c; }
.texto-ajuda { font-size: 13px; line-height: 18px; color: var(--faint); }
.mensagem-erro { font-size: 13px; line-height: 18px; color: var(--pill-negative-ink); min-height: 18px; }

/* ---------- abas de baixo ---------- */

.abas {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--abas) + var(--base-segura));
  padding: 0 8px var(--base-segura);
  background: var(--ground);
  box-shadow: 0 -1px 0 0 var(--border);
  -webkit-user-select: none; user-select: none;
}
.abas a {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 3px;
  padding-top: 7px;
  font-size: 11px; line-height: 13px; font-weight: 500; letter-spacing: 0;
  color: #8f8f8f;
  transition: color .15s;
}
.abas a:active .aba-icone { transform: scale(.9); }
.aba-icone { width: 26px; height: 26px; display: grid; place-items: center; transition: transform .15s var(--suave); }
.aba-icone svg { width: 25px; height: 25px; }
.abas a[aria-current="page"] { color: #ffffff; font-weight: 600; }
.abas a[aria-current="page"] .aba-icone svg [data-cheio] { fill: currentColor; }

/* ---------- entrada (login) ---------- */

.entrar {
  min-height: calc(100dvh - var(--barra) - var(--topo-seguro) - 40px);
  display: flex; flex-direction: column; justify-content: center;
  max-width: 400px; margin: 0 auto; padding-bottom: 48px;
}
.entrar .selo { width: 72px; height: 72px; border-radius: 18px; background: var(--surface); display: grid; place-items: center; margin-bottom: 28px; }
.entrar .selo img { width: 46px; height: 22px; }
.entrar h1 { font: 600 28px/34px var(--fonte-figura); letter-spacing: -0.025em; color: var(--text); }
.entrar p { margin-top: 8px; color: var(--muted); font-size: 15px; line-height: 22px; }
.entrar .botoes { margin-top: 32px; }
.entrar .mensagem-erro { margin-top: 12px; }
.app.sem-sessao .abas, .app.sem-sessao .barra-acoes, .app.sem-sessao .nav-topo { display: none; }
.app.sem-sessao .tela { padding-bottom: calc(var(--base-segura) + 24px); }

.dica {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: start;
  background: var(--surface); border-radius: var(--raio-cartao); padding: 14px 8px 14px 16px;
}
.dica b { display: block; color: var(--text); font-weight: 600; }
.dica span { display: block; margin-top: 2px; font-size: 13px; line-height: 18px; color: var(--muted); }
.dica .botao-icone { width: 36px; height: 36px; margin-top: -6px; }
.dica .botao-icone svg { width: 18px; height: 18px; }

/* ---------- carregando ---------- */

.esqueleto { display: block; background: var(--raised); border-radius: 6px; }
.esqueleto.t36 { height: 36px; width: 140px; }
.esqueleto.t24 { height: 24px; width: 120px; }
.esqueleto.t15 { height: 14px; width: 60%; margin-top: 3px; }
.esqueleto.t13 { height: 12px; width: 40%; margin-top: 2px; }
.cartao.carregando { min-height: 160px; }

.aviso-sem-js { padding: 32px 0; color: var(--muted); }

/* ---------- tablet ---------- */

@media (min-width: 700px) {
  :root { --margem: 24px; }
  .grade.inicio { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grade.inicio > .largo, .grade.inicio > .inteiro { grid-column: 1 / -1; }
  .grade.duas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpis > div + div { box-shadow: -1px 0 0 0 var(--rule); }
  .kpis > div:nth-child(n + 3) { border-top: 0; }
  .folha { margin: auto; border-radius: 20px; max-width: 480px; }
  .folha[open] { animation: aparecer .2s ease; }
  .folha-corpo { padding-bottom: 24px; }
  .puxador { display: none; }
}

/* ---------- desktop ---------- */

@media (min-width: 1000px) {
  :root { --margem: 32px; --barra: 56px; }
  .abas { display: none; }
  .tela { padding-bottom: 64px; padding-top: 16px; }
  .barra-coluna { padding: 0 var(--margem); gap: 24px; }
  .marca { margin-right: 8px; }
  .nav-topo { display: flex; gap: 4px; margin-right: auto; }
  .nav-topo a {
    height: 36px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 999px;
    font-size: 15px; font-weight: 500; color: var(--faint); transition: color .15s, background .15s;
  }
  .nav-topo a:hover { color: var(--text); }
  .nav-topo a[aria-current="page"] { color: var(--text); background: var(--surface); }
  .barra-acoes { margin-right: -10px; }
  .cabeca { margin-bottom: 28px; }
  .cabeca h1 { font-size: 28px; line-height: 34px; }
  /* 3 x 360 + 2 x 16 = 1112 */
  .grade.inicio { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grade.inicio > .largo { grid-column: span 2; }
  .grade.inicio > .inteiro { grid-column: 1 / -1; }
  /* no desktop os cartões de uma linha terminam juntos: o rodapé de cada um desce até a base */
  .grade.inicio { align-items: stretch; }
  .grade.inicio > .cartao { display: flex; flex-direction: column; }
  .grade.inicio .dinheiro .legenda-valores, .grade.inicio .vps .medidores { margin-bottom: 16px; }
  .grade.inicio .dinheiro .proxima, .grade.inicio .vps .rodape-cartao { margin-top: auto; }
  .atalhos .linha.com-icone { min-height: 64px; }
  /* atalhos em 2 colunas de 3 linhas: a 4a linha abre a coluna da direita, sem fio em cima */
  .atalhos-grade { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(3, auto); grid-auto-flow: column; column-gap: 0; }
  .atalhos-grade > .linha:nth-child(4)::before { display: none; }
  .atalhos-grade > .linha { border-radius: 0 !important; }
  .grade.sistemas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grade.detalhe { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grade.detalhe > .largo { grid-column: span 2; }
  .grade.servidor { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grade.servidor > .inteiro { grid-column: 1 / -1; }
  .grade.servidor > .pilha { grid-column: span 2; }
  .grade.cobrancas { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grade.cobrancas > .largo { grid-column: span 2; }
  .secao-titulo { margin-left: 16px; }
  .grafico { height: 200px; }
  .entrar { min-height: calc(100dvh - var(--barra) - 80px); }
}

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