:root {
  --preto: #172127;
  --preto-2: #222e35;
  --ouro: #D4A332;
  --ouro-claro: #E7BD6F;
  --ouro-fundo: #FCF5E6;
  --azul: #013A71;
  --azul-fundo: #E6EEF7;
  --vermelho: #C8102E;
  --vermelho-fundo: #FBE7EA;
  --verde: #18794E;
  --verde-fundo: #E3F4EA;
  --cinza-fundo: #EEF0F3;
  --fundo: #F1F4F6;
  --cartao: #FFFFFF;
  --texto: #202E38;
  --texto-2: #52616B;
  --texto-3: #62717D;
  --borda: #E0E6EA;
  --raio: 14px;
  --sombra: 0 3px 12px rgba(28, 45, 58, .025);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--texto);
  background: var(--fundo);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ouro); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- Login ---------- */
.login {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(12,22,29,.94) 0%, rgba(12,22,29,.74) 48%, rgba(12,22,29,.38) 100%),
    url("assets/navio.webp") center right / cover no-repeat,
    var(--preto);
}
.login-topo {
  height: 80px;
  display: flex;
  align-items: center;
  padding: 0 max(16px, calc((100vw - 1200px) / 2));
  background: rgba(12,22,29,.38); border-bottom: 1px solid rgba(255,255,255,.12);
  justify-content: space-between; gap: 20px;
}
.login-topo img { height: 44px; width: auto; }
.login-topo > span { color: #c4cdd3; font-size: 12px; }
.login-corpo {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 72px 16px;
  display: grid;
  grid-template-columns: 1.2fr minmax(320px, 400px);
  gap: 48px;
  align-items: center;
}
.login h1 {
  margin: 0 0 20px;
  font-size: clamp(40px, 6vw, 76px);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -.045em;
  text-transform: uppercase;
}
.login-sub { font-size: 16px; line-height: 1.8; max-width: 490px; margin: 0; color: #d3dbe0; }
.login-frentes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; padding: 0; list-style: none; }
.login-frentes li {
  font-size: 13px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.28); background: rgba(255,255,255,.06);
}
.cartao-login {
  background: rgba(19,31,39,.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(231,189,111,.24);
  border-radius: 20px;
  padding: 36px;
  box-shadow: 0 32px 80px rgba(0,0,0,.2);
}
.cartao-login h2 { margin: 0 0 4px; font-size: 22px; font-weight: 600; }
.cartao-login p { margin: 0 0 24px; font-size: 14px; color: rgba(255,255,255,.7); }
.campo { display: block; margin-bottom: 16px; }
.campo span { display: block; font-size: 13px; margin-bottom: 6px; color: rgba(255,255,255,.85); }
.campo input {
  width: 100%; height: 50px; padding: 0 14px;
  border-radius: 8px; border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.04); color: #fff;
  transition: border-color .2s, background .2s;
}
.campo input::placeholder { color: rgba(255,255,255,.45); }
.campo input:focus { outline: none; border-color: var(--ouro); background: rgba(255,255,255,.12); }
.botao-ouro {
  width: 100%; height: 50px; border: 0; border-radius: 8px; cursor: pointer;
  background: var(--ouro-claro); color: #172127; font-weight: 600;
  position: relative; overflow: hidden; transition: background .2s, box-shadow .2s;
}
.botao-ouro:hover { background: #f0c984; box-shadow: 0 4px 22px rgba(231,189,111,.18); }
.botao-ouro:disabled { opacity: .6; cursor: wait; }
.login-rodape { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; margin-top: 20px; font-size: 11px; color: #b7c1c8; }
.login-rodape a { color: rgba(255,255,255,.8); }
.selo-prototipo {
  display: inline-block; margin-top: 20px; font-size: 12px; padding: 6px 10px; border-radius: 6px;
  background: rgba(253, 200, 69, .14); color: var(--ouro-claro);
}

/* ---------- Painel: topo ---------- */
.topo {
  position: sticky; top: 0; z-index: 10;
  background: var(--preto); color: #fff; border-bottom: 1px solid #354047;
}
.topo-linha {
  max-width: 1600px; margin: 0 auto; height: 80px; padding: 0 28px;
  display: flex; align-items: center; gap: 24px;
}
.topo-linha img { height: 34px; width: auto; flex-shrink: 0; }
.abas { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.abas::-webkit-scrollbar { display: none; }
.abas a {
  white-space: nowrap; text-decoration: none; font-size: 13px; padding: 10px 12px; border-radius: 7px;
  color: #bbc5cb; transition: color .2s, background .2s;
}
.abas a:hover { color: #fff; background: rgba(255,255,255,.06); }
.abas a[aria-current="page"] { color: #f2d194; background: #354039; font-weight: 500; box-shadow: inset 0 -2px var(--ouro-claro); }
.usuario { display: flex; align-items: center; gap: 12px; font-size: 14px; flex-shrink: 0; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: #3d463e; color: #f2d194; border: 1px solid #63705b; font-weight: 600; font-size: 14px;
}
.sair { background: none; border: 1px solid rgba(255,255,255,.25); color: #fff; border-radius: 8px; padding: 6px 12px; cursor: pointer; font-size: 13px; }
.sair:hover { border-color: #fff; }
.faixa-prototipo {
  background: #E9EEF1; color: #52616B; font-size: 11px; text-align: center; padding: 9px 16px;
  border-bottom: 1px solid var(--borda);
}

/* ---------- Painel: conteúdo ---------- */
main { max-width: 1320px; margin: 0 auto; padding: 36px 32px 64px; }
.cabeca { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 28px; }
.cabeca h1 { margin: 0; font-size: clamp(26px, 2.4vw, 34px); font-weight: 600; letter-spacing: -.04em; line-height: 1.25; }
.cabeca p { margin: 8px 0 0; color: var(--texto-2); font-size: 13px; line-height: 1.7; max-width: 66ch; }
.grade-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0; margin-bottom: 28px; border: 1px solid var(--borda); border-radius: var(--raio); background: #fff; overflow: hidden; }
.kpi { background: var(--cartao); border-right: 1px solid var(--borda); padding: 22px; }
.kpi:last-child { border-right: 0; }
.kpi-rotulo { font-size: 13px; color: var(--texto-2); }
.kpi-valor { font-size: 36px; font-weight: 500; letter-spacing: -.05em; line-height: 1.2; margin-top: 10px; font-variant-numeric: tabular-nums; }
.kpi-nota { font-size: 12px; color: var(--texto-3); margin-top: 2px; }
.kpi.alerta .kpi-valor { color: var(--vermelho); }
.kpi.ouro { background: #FCF8EF; }
.colunas { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: start; }
/* Itens de grade e flex encolhem; as tabelas rolam dentro do bloco, não a página. */
.colunas > *, .login-corpo > *, .abas { min-width: 0; }
.bloco { background: var(--cartao); border: 1px solid var(--borda); border-radius: var(--raio); box-shadow: var(--sombra); margin-bottom: 24px; overflow: hidden; }
.bloco-cabeca { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 20px 22px; border-bottom: 1px solid var(--borda); }
.bloco-cabeca h2 { margin: 0; font-size: 16px; font-weight: 600; }
.bloco-cabeca span { font-size: 12px; color: var(--texto-3); }
.lista { list-style: none; margin: 0; padding: 0; }
.lista li { display: flex; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--borda); font-size: 14px; line-height: 1.45; }
.lista li:last-child { border-bottom: 0; }
.lista .ref { font-weight: 600; white-space: nowrap; }
.lista .quando { margin-left: auto; color: var(--texto-3); font-size: 12px; white-space: nowrap; }
.ponto { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex-shrink: 0; background: var(--texto-3); }
.ponto.vermelho { background: var(--vermelho); }
.ponto.ouro { background: var(--ouro); }
.ponto.verde { background: var(--verde); }
.ponto.azul { background: var(--azul); }

/* Tabelas */
.rolagem { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; font-weight: 500; font-size: 11px; color: var(--texto-2);
  padding: 13px 20px; background: #F8FAFB; border-bottom: 1px solid var(--borda); white-space: nowrap;
}
td { padding: 18px 20px; border-bottom: 1px solid var(--borda); vertical-align: middle; transition: background .2s; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.clicavel { cursor: pointer; }
tbody tr:hover td { background: #F8FAFB; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.forte { font-weight: 600; white-space: nowrap; }
.fraco { color: var(--texto-3); font-size: 12px; }
.nowrap { white-space: nowrap; }
.atraso { color: var(--vermelho); font-size: 12px; font-weight: 500; }

/* Etiquetas */
.etq { display: inline-block; font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.etq.ouro { background: var(--ouro-fundo); color: #7A5A0C; }
.etq.azul { background: var(--azul-fundo); color: var(--azul); }
.etq.verde { background: var(--verde-fundo); color: var(--verde); }
.etq.vermelho { background: var(--vermelho-fundo); color: var(--vermelho); }
.etq.cinza { background: var(--cinza-fundo); color: var(--texto-2); }

/* Filtros */
.filtros { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--borda); }
.chip { border: 1px solid var(--borda); background: #fff; border-radius: 999px; padding: 6px 14px; font-size: 13px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--preto); color: #fff; border-color: var(--preto); }
.busca { margin-left: auto; height: 36px; border: 1px solid var(--borda); border-radius: 8px; padding: 0 12px; min-width: 220px; font-size: 14px; }
.seletor { height: 40px; border: 1px solid var(--borda); border-radius: 8px; padding: 0 12px; background: #fff; font-size: 14px; min-width: 220px; }

/* Gaveta de detalhe */
.veu { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 20; }
.gaveta {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100vw); z-index: 21;
  background: #fff; box-shadow: -8px 0 24px rgba(0,0,0,.12); overflow-y: auto; padding: 24px;
}
.gaveta h2 { margin: 0; font-size: 20px; }
.gaveta .fechar { float: right; border: 0; background: var(--cinza-fundo); border-radius: 8px; width: 36px; height: 36px; cursor: pointer; font-size: 18px; }
.ficha { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin: 20px 0; font-size: 14px; }
.ficha dt { font-size: 12px; color: var(--texto-3); }
.ficha dd { margin: 2px 0 0; font-weight: 500; }
.linha-tempo { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--borda); margin-left: 6px; }
.linha-tempo li { position: relative; padding: 0 0 18px 20px; font-size: 14px; }
.linha-tempo li::before {
  content: ""; position: absolute; left: -7px; top: 4px; width: 12px; height: 12px; border-radius: 50%;
  background: #fff; border: 2px solid var(--ouro);
}
.linha-tempo li.feito::before { background: var(--verde); border-color: var(--verde); }
.caixa-status { background: var(--ouro-fundo); border-left: 4px solid var(--ouro); border-radius: 8px; padding: 12px 14px; font-size: 14px; margin-top: 16px; }
.caixa-atencao { background: var(--azul-fundo); border-left: 4px solid var(--azul); border-radius: 8px; padding: 12px 14px; font-size: 14px; margin-top: 12px; }

/* Mural */
.mural { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-bottom: 24px; }
.area { background: var(--cartao); border: 1px solid var(--borda); border-radius: var(--raio); box-shadow: var(--sombra); padding: 18px 20px; }
.area h3 { margin: 0 0 14px; font-size: 15px; font-weight: 600; }
.area h4 { margin: 14px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.area h4.feito { color: var(--verde); }
.area h4.fazendo { color: #9A6B00; }
.area h4.travado { color: var(--vermelho); }
.area ul { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.5; }
.area .vazio { font-size: 13px; color: var(--texto-3); margin: 0; }

/* Prestação de contas */
.detalhe-contas td { background: #FCFCFD; }
.detalhe-grade { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 4px 0; }
.detalhe-grade h4 { margin: 0 0 8px; font-size: 13px; font-weight: 600; }
.detalhe-grade table td, .detalhe-grade table th { padding: 8px 10px; }

/* Mapa da operação */
.mapa-grade { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start; }
.mapa-grade > * { min-width: 0; }
.mapa-tela { height: calc(100vh - 260px); min-height: 480px; background: radial-gradient(circle at 50% 40%, #1d2230, #0d0f14 70%); }
.mapa-grupos { list-style: none; margin: 0; padding: 8px 0; max-height: calc(100vh - 420px); overflow-y: auto; }
.mapa-grupos button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 20px; border: 0; background: none;
  font-size: 13px; text-align: left; cursor: pointer; color: var(--texto);
}
.mapa-grupos button:hover { background: #FAFAFB; }
.mapa-grupos button[aria-pressed="true"] { background: var(--ouro-fundo); font-weight: 500; }
.mapa-grupos .qtd { margin-left: auto; color: var(--texto-3); font-size: 12px; }
.mapa-cor { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.vizinhos { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.vizinhos li { border-bottom: 1px solid var(--borda); }
.vizinhos button { display: flex; gap: 10px; align-items: center; width: 100%; padding: 10px 0; border: 0; background: none; text-align: left; cursor: pointer; }
.vizinhos button:hover { color: var(--azul); }
.vizinhos .fraco { margin-left: auto; white-space: nowrap; }

/* Automações: menu do gestor, sem alterar as abas operacionais. */
.painel-corpo { max-width: 1600px; margin: 0 auto; display: flex; align-items: flex-start; }
.painel-corpo:has(.lateral:not([hidden])) { background: linear-gradient(to right, var(--preto) 224px, transparent 224px); }
.painel-corpo main { min-width: 0; flex: 1; width: 100%; }
.lateral { position: sticky; top: 81px; width: 224px; flex-shrink: 0; padding: 36px 18px 24px; min-height: calc(100dvh - 81px); background: var(--preto); color: #c0cbd2; }
.lateral h2 { margin: 0 10px 22px; display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 500; color: #d2dce1; }
.lateral a { display: flex; gap: 10px; align-items: center; text-decoration: none; padding: 14px 12px; border: 1px solid transparent; border-radius: 10px; font-size: 12px; line-height: 1.6; transition: background .2s, border-color .2s; }
.lateral a:hover { background: #24313a; }
.lateral a[aria-current="page"] { color: #f3ce8c; background: #343b32; border-color: #575840; }
.acao { display: inline-flex; gap: 12px; align-items: center; justify-content: center; padding: 11px 16px; border: 1px solid var(--borda); border-radius: 8px; background: #fff; color: var(--texto); cursor: pointer; font-size: 12px; font-weight: 500; text-decoration: none; transition: border-color .2s, background .2s, box-shadow .2s; }
.acao:hover { border-color: #bf9141; background: #fcf8f0; box-shadow: 0 3px 8px #1721270a; }
.acao.principal { background: var(--preto); color: #f3ce8c; border-color: var(--preto); }
.acao.principal:hover { background: #2b3b43; }
.acoes { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.estado-vazio { padding: 24px; text-align: center; color: var(--texto-2); font-size: 14px; }
.lista-premissas { padding: 8px 20px 16px 38px; font-size: 14px; line-height: 1.7; }
.lista-premissas li { padding: 5px 0; overflow-wrap: anywhere; }
.texto-copia { white-space: pre-wrap; overflow-wrap: anywhere; padding: 20px; margin: 0; font: inherit; font-size: 14px; line-height: 1.7; }
.gaveta .texto-copia { margin: 16px 0; padding: 14px; background: var(--fundo); border-radius: 8px; }
.passos-simulacao { padding-left: 22px; font-size: 14px; line-height: 1.7; }
.passos-simulacao li { margin: 12px 0; }
.nota-simulacao { padding: 0 20px 16px; }
.erro-login { color: #FFC3CB; font-size: 13px; }
body:has(.gaveta:not([hidden])) { overflow: hidden; }

/* Rotas marítimas: ilustração da marca, sem representar tracking real. */
.rota-mar { position: absolute; z-index: -1; width: 100%; height: 100%; inset: 0; pointer-events: none; opacity: .2; }
.rota-mar path, .visao-mar path { fill: none; stroke: var(--ouro-claro); stroke-width: 1.5; }
.rota-mar circle, .visao-mar circle { fill: var(--ouro-claro); stroke: #172127; stroke-width: 3; }
.login-assinatura { display: flex; align-items: center; gap: 12px; margin-top: 64px; font-size: 12px; color: #c0cbd2; }
.linha-mar { width: 32px; height: 1px; background: var(--ouro-claro); }
.login-acesso { display: flex; align-items: center; gap: 8px; color: #e7bd6f; font-size: 11px; margin-bottom: 24px; }
.login-acesso svg, .lateral h2 svg, .lateral a svg, .fluxo-simulacao svg { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.seta-menu { margin-left: auto; font-size: 20px; }
.lateral-nota { margin: 100px 10px 0; border-top: 1px solid #344149; padding-top: 20px; }
.lateral-nota > svg { width: 120px; height: 86px; display: block; margin: 0 auto 20px; fill: none; stroke: #728376; stroke-width: 1; }
.lateral-nota > svg path { stroke: #d4b273; stroke-width: 1.5; }
.lateral-nota strong { font-size: 11px; color: #d2dce1; font-weight: 500; }
.lateral-nota p { font-size: 11px; line-height: 1.8; color: #acbac2; margin: 8px 0; }
.cabeca-visao { position: relative; isolation: isolate; align-items: center; min-height: 260px; padding: 32px 36px; overflow: hidden; border-radius: 16px; background: #1b2d37; color: #fff; }
.visao-texto { position: relative; z-index: 1; width: 64%; }
.cabeca-visao h1 { font-size: clamp(30px, 3.3vw, 44px); line-height: 1.1; letter-spacing: -.05em; font-weight: 500; margin: 12px 0; }
.cabeca-visao p { font-size: 12px; color: #d0dce2; max-width: 40ch; }
.cabeca-visao .saudacao { color: #efca88; margin-top: 0; font-size: 12px; }
.cabeca-visao .acao { margin-top: 20px; background: #e7bd6f; border-color: #e7bd6f; color: #172127; }
.cabeca-visao .acao:hover { background: #f2d194; }
.visao-mar { position: absolute; inset: 0 0 0 40%; z-index: -1; background: linear-gradient(90deg, #1b2d37 0%, #1b2d3759 50%, #1b2d3720), url('assets/navio.webp') 70% 54% / cover; }
.visao-mar svg { width: 100%; height: 100%; opacity: .8; }
.visao-data { position: absolute; bottom: 20px; right: 24px; font-size: 10px; color: #e3eaf0; }
.cabeca-simulacoes { padding: 4px 0 0; }
.cabeca-simulacoes .etq { margin-bottom: 12px; }
.cabeca-simulacoes h1 { max-width: 22ch; }
.fluxo-simulacao { display: flex; gap: 18px; align-items: center; margin: 0 0 32px; padding: 22px 0; border-top: 1px solid var(--borda); border-bottom: 1px solid var(--borda); color: var(--texto-2); }
.fluxo-simulacao > span:not(.fluxo-linha) { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.fluxo-simulacao svg { color: #9a742f; }
.fluxo-linha { flex: 1; min-width: 16px; height: 1px; background: #cbd5db; }
.vazio-simulacoes { padding: 42px 20px 48px; }
.vazio-simulacoes svg { display: block; width: 88px; height: 88px; margin: 0 auto 20px; stroke: #9b7940; stroke-width: 1.4; fill: #fcf8ef; }
.vazio-simulacoes strong { display: block; color: var(--texto); font-size: 18px; font-weight: 500; letter-spacing: -.02em; }
.vazio-simulacoes p { font-size: 13px; line-height: 1.8; margin: 10px auto 0; max-width: 50ch; }
.kpi-custo .kpi-valor { font-size: clamp(24px, 3vw, 36px); overflow-wrap: anywhere; }
.botao-ouro::after { content: ''; position: absolute; width: 30%; height: 100%; left: -40%; top: 0; background: linear-gradient(90deg, transparent, #fff5, transparent); transform: skewX(-20deg); }
.botao-ouro:hover::after { animation: brilho-botao .65s ease-out; }
@keyframes brilho-botao { to { left: 120%; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media (max-width: 1200px) {
  .topo-linha { gap: 16px; padding-inline: 20px; }
  .abas a { padding-inline: 10px; font-size: 12px; }
  .usuario { gap: 8px; }
  .usuario .nome { max-width: 100px; overflow: hidden; text-overflow: ellipsis; }
  main { padding-inline: 24px; }
}
@media (max-width: 960px) {
  .painel-corpo { flex-direction: column; }
  .painel-corpo:has(.lateral:not([hidden])) { background: none; }
  .lateral { position: static; width: 100%; min-height: 0; padding: 16px 24px; display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; border-top: 1px solid #354047; }
  .lateral h2 { margin: 0; }
  .lateral a { padding: 8px 12px; }
  .lateral a br { display: none; }
  .lateral-nota { display: none; }
  .mapa-grade { grid-template-columns: 1fr; }
  .mapa-tela { height: 70vh; }
  .login-corpo { grid-template-columns: 1fr; gap: 32px; padding-top: 32px; }
  .colunas { grid-template-columns: 1fr; }
  .detalhe-grade { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  main { padding: 24px 16px 48px; }
  .lateral { padding: 12px 16px; gap: 8px 16px; }
  .lateral h2 { font-size: 11px; }
  .lateral h2 svg { width: 16px; }
  .lateral a { font-size: 11px; }
  .lateral a svg { display: none; }
  .cabeca-visao { min-height: 306px; padding: 24px; }
  .visao-texto { width: 100%; }
  .cabeca-visao h1 { font-size: 34px; }
  .visao-mar { inset: 0 0 0 10%; opacity: .35; }
  .visao-data { right: auto; left: 24px; bottom: 14px; }
  .grade-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { padding: 18px 16px; border-bottom: 1px solid var(--borda); }
  .kpi-rotulo { font-size: 11px; }
  .kpi-nota { font-size: 10px; }
  .kpi:last-child { border-bottom: 0; }
  .kpi:only-child { grid-column: 1 / -1; }
  .fluxo-simulacao { gap: 18px; align-items: flex-start; flex-direction: column; padding: 18px 0; }
  .fluxo-linha { display: none; }
  .vazio-simulacoes { padding-inline: 0; }
  .vazio-simulacoes strong { font-size: 16px; }
  .login-corpo { padding-bottom: 40px; }
  .login-assinatura { margin-top: 28px; font-size: 11px; }
  .login-topo > span { font-size: 10px; }
  .login-topo { height: 64px; }
  .login-topo img { height: 34px; }
  .login-sub { font-size: 16px; }
  .cartao-login { padding: 24px; }
  .topo-linha { flex-wrap: wrap; height: auto; padding-top: 12px; padding-bottom: 8px; gap: 10px; }
  .abas { order: 3; flex-basis: 100%; }
  .usuario { margin-left: auto; }
  .usuario .nome { display: none; }
  .busca { margin-left: 0; min-width: 0; width: 100%; }
  .ficha { grid-template-columns: 1fr; }
}
