:root {
  --azul-primario: #1a2ed6;
  --azul-primario-hover: #1526b4;
  --azul-primario-ativo: #1120a0;
  --navy: #0f2c5c;
  --azul-logo-claro: #4cb8e8;

  --texto: #0f2c5c;
  --texto-suave: #64748b;
  --texto-placeholder: #94a3b8;

  --fundo: #f6f8fb;
  --superficie: #ffffff;
  --campo: #f8fafc;
  --borda: #e2e8f0;
  --borda-forte: #cbd5e1;

  --erro: #dc2626;

  --raio-sm: 8px;
  --raio-md: 12px;
  --raio-lg: 16px;

  --sombra-sm: 0 1px 2px rgba(15, 44, 92, .06);
  --sombra-md: 0 4px 16px rgba(15, 44, 92, .07);
  --sombra-lg: 0 10px 32px rgba(15, 44, 92, .10);

  --largura-max: 940px;
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0;
}

html, body { 
    margin: 0; 
    padding: 0; 
}

body {
  min-height: 100vh;
  background: var(--fundo);
  color: var(--texto);
  font-family: "Poppins", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* =========================================
   ESTILOS DO DASHBOARD / PAINEL
========================================= */
.topo {
  background: var(--superficie);
  border-bottom: 1px solid var(--borda);
  box-shadow: var(--sombra-sm);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topo--legado { display: none; }

.topo__interno {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.marca {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.marca__svg { display: block; }

.marca__texto {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .5px;
  color: var(--navy);
}

.marca__texto span {
  color: var(--azul-logo-claro);
  font-weight: 600;
}

.nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  width: min(900px, calc(100% - 300px));
  justify-content: center;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav::-webkit-scrollbar { display: none; }

.nav__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--raio-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--texto-suave);
  text-decoration: none;
  transition: background .15s, color .15s;
}

.nav__item:hover {
  background: var(--campo);
  color: var(--navy);
}

.nav__item[aria-current="page"] {
  background: rgba(26, 46, 214, .08);
  color: var(--azul-primario);
  font-weight: 600;
}

.nav__item svg { flex-shrink: 0; }

.conteudo {
  max-width: var(--largura-max);
  margin: 0 auto;
  padding: 36px 24px 64px;
}

.cabecalho-home {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--borda);
}

.cabecalho-home h1 {
  margin: 0;
  color: var(--navy);
  font-size: 28px;
}

.usuario {
  color: var(--texto-suave);
}

.dashboard {
  padding: 28px 32px 32px;
  background: var(--superficie);
  border: 1px solid var(--borda);
  border-radius: var(--raio-lg);
  box-shadow: var(--sombra-md);
}

.dashboard h2 {
  margin: 0 0 8px;
  color: var(--navy);
}

#form-lancamento {
  display: grid;
  gap: 18px;
}

#form-lancamento .campo {
  gap: 8px;
}

#form-lancamento select,
#form-lancamento input[type="number"],
#form-lancamento textarea {
  width: 100%;
  padding: 11px 14px;
  background: var(--campo);
  border: 1px solid var(--borda);
  border-radius: var(--raio-sm);
  color: var(--texto);
  font: inherit;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

#form-lancamento select:focus,
#form-lancamento input[type="number"]:focus,
#form-lancamento textarea:focus {
  outline: none;
  background: var(--superficie);
  border-color: var(--azul-primario);
  box-shadow: 0 0 0 3px rgba(26, 46, 214, .12);
}

#form-lancamento textarea {
  min-height: 96px;
  resize: vertical;
}

#form-lancamento .produto-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px auto;
  gap: 10px;
  align-items: start;
  margin-bottom: 14px;
}

#form-lancamento .produto-item__info {
  grid-column: 1 / -1;
  font-size: 12.5px;
  margin-top: -2px;
  line-height: 1.4;
}

#form-lancamento .produto-item__info .dica-estoque {
  color: var(--texto-suave);
}

#form-lancamento .produto-item__info .dica-estoque strong {
  color: var(--texto);
}

#form-lancamento .produto-item__info .erro-estoque {
  color: #dc2626;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}

#form-lancamento .produto-item.com-erro select,
#form-lancamento .produto-item.com-erro input[type="number"] {
  border-color: #ef4444;
  background-color: #fef2f2;
}

#form-lancamento .botao-remover {
  padding: 10px 14px;
  border: 1px solid #fecaca;
  border-radius: var(--raio-sm);
  background: #fef2f2;
  color: #b91c1c;
  font: inherit;
  cursor: pointer;
}

#form-lancamento .botao-remover:hover { background: #fee2e2; }

.cabecalho-pagina { margin-bottom: 24px; }

.cabecalho-pagina--com-acao {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.cabecalho-pagina__titulo {
  margin: 0 0 4px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.3px;
  color: var(--navy);
}

.cabecalho-pagina__descricao {
  margin: 0;
  font-size: 14.5px;
  color: var(--texto-suave);
}

.cartao {
  background: var(--superficie);
  border: 1px solid var(--borda);
  border-radius: var(--raio-lg);
  box-shadow: var(--sombra-md);
  padding: 28px 32px 32px;
}

.cartao__titulo {
  margin: 0 0 2px;
  font-size: 17px;
  font-weight: 600;
  color: var(--navy);
}

.cartao__legenda {
  margin: 0 0 24px;
  font-size: 13.5px;
  color: var(--texto-suave);
}

.perfil-pagina { max-width: var(--largura-max); }

.perfil-resumo {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 18px;
  padding: 24px;
}

.perfil-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border: 1px solid var(--borda);
  border-radius: 50%;
  background: var(--campo);
  color: var(--texto-suave);
  font-size: 20px;
  font-weight: 700;
}

.perfil-resumo h2 { margin: 0 0 2px; color: var(--navy); font-size: 17px; }
.perfil-resumo p { margin: 0 0 6px; color: var(--texto-suave); font-size: 13.5px; }

.perfil-tipo {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(26, 46, 214, .08);
  color: var(--azul-primario);
  font-size: 12px;
  font-weight: 600;
}

.formulario {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
}

.campo {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.campo--largo { grid-column: 1 / -1; }

.campo__rotulo {
  font-size: 13px;
  font-weight: 500;
  color: var(--navy);
}

.obrigatorio {
  color: var(--erro);
  margin-left: 2px;
}

.campo__controle {
  width: 100%;
  padding: 11px 14px;
  background: var(--campo);
  border: 1px solid var(--borda);
  border-radius: var(--raio-sm);
  font-family: inherit;
  font-size: 14.5px;
  color: var(--texto);
  transition: border-color .15s, box-shadow .15s, background .15s;
}

.campo__controle::placeholder { color: var(--texto-placeholder); }

.campo__controle:hover:not(:focus) { border-color: var(--borda-forte); }

.campo__controle:focus {
  outline: none;
  background: var(--superficie);
  border-color: var(--azul-primario);
  box-shadow: 0 0 0 3px rgba(26, 46, 214, .12);
}

select.campo__controle {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 38px;
  cursor: pointer;
}

textarea.campo__controle {
  min-height: 96px;
  resize: vertical;
  line-height: 1.55;
}

.campo__ajuda {
  font-size: 12.5px;
  color: var(--texto-suave);
}

[hidden] { display: none !important; }

.campo--erro .campo__controle {
  border-color: var(--erro);
  background: #fef2f2;
}

.campo--erro .campo__controle:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .12);
}

.campo__erro {
  display: none;
  font-size: 12.5px;
  color: var(--erro);
}

.campo--erro .campo__erro { display: block; }

.acoes {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 10px;
  padding-top: 22px;
  border-top: 1px solid var(--borda);
}

.botao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 132px;
  padding: 11px 22px;
  border: 1px solid transparent;
  border-radius: var(--raio-sm);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .05s;
}

.botao:active { transform: translateY(1px); }

.botao--primario {
  background: var(--azul-primario);
  color: #fff;
}

.botao--primario:hover { background: var(--azul-primario-hover); }
.botao--primario:active { background: var(--azul-primario-ativo); }

.botao--secundario {
  background: var(--superficie);
  border-color: var(--borda-forte);
  color: var(--texto-suave);
}

.botao--secundario:hover {
  border-color: var(--texto-suave);
  color: var(--navy);
}

.botao--perigo {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}

.botao--perigo:hover { background: #b91c1c; }
.botao--perigo:active { background: #991b1b; }

.botao--sucesso {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}

.botao--sucesso:hover { background: #15803d; }
.botao--sucesso:active { background: #166534; }

.formulario--exclusao {
  display: flex;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--borda);
}

.aviso {
  display: none;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
  padding: 13px 16px;
  border-radius: var(--raio-sm);
  font-size: 14px;
  border: 1px solid;
}

.aviso.visivel { display: flex; }

.aviso--sucesso {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
}

.resumo-alertas {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  padding: 18px 20px;
  border: 1px solid;
  border-radius: var(--raio-md);
}

.resumo-alertas--atencao {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}

.resumo-alertas--regular {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.resumo-alertas__rotulo {
  display: block;
  margin-bottom: 3px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.resumo-alertas h2 {
  margin: 0 0 2px;
  font-size: 17px;
}

.resumo-alertas p { margin: 0; font-size: 13px; }

.botao--alerta {
  background: #ea580c;
  color: #fff;
}

.botao--alerta:hover { background: #c2410c; }

.lista-alertas { display: grid; gap: 12px; }

.alerta-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border: 1px solid;
  border-radius: var(--raio-sm);
}

.alerta-item--vazio { background: #fef2f2; border-color: #fecaca; }
.alerta-item--abaixo-minimo { background: #fffbeb; border-color: #fde68a; }

.alerta-item__produto { color: var(--navy); font-weight: 600; }
.alerta-item__detalhe { margin-top: 3px; color: var(--texto-suave); font-size: 13px; }

.alerta-item__situacao { text-align: right; font-size: 13px; font-weight: 700; }
.alerta-item--vazio .alerta-item__situacao { color: #b91c1c; }
.alerta-item--abaixo-minimo .alerta-item__situacao { color: #a16207; }

.aviso svg { flex-shrink: 0; margin-top: 2px; }

.mensagem-modal {
  margin-bottom: 20px;
  padding: 16px 18px;
  border: 1px solid;
  border-radius: var(--raio-md);
  box-shadow: var(--sombra-sm);
}

.mensagem-sucesso {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.mensagem-erro {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.mensagem-conteudo strong { display: block; margin-bottom: 4px; }
.mensagem-conteudo p { margin: 0; font-size: 13.5px; }
.mensagem-conteudo button {
  margin-top: 12px;
  padding: 8px 18px;
  border: 1px solid currentColor;
  border-radius: var(--raio-sm);
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.mensagem-conteudo button:hover { background: rgba(255, 255, 255, .55); }

/* =========================================
   MODAL OVERLAY (AVISOS / SUCESSO / ERRO)
========================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 44, 92, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: modalFadeIn 0.2s ease-out;
}

.modal-card {
  background: var(--superficie);
  border-radius: var(--raio-lg);
  max-width: 440px;
  width: 100%;
  box-shadow: 0 20px 40px rgba(15, 44, 92, 0.22);
  border: 1px solid var(--borda);
  padding: 32px 28px 24px;
  text-align: center;
  animation: modalScaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-icone {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.modal-overlay--sucesso .modal-icone {
  background: #dcfce7;
  color: #16a34a;
}

.modal-overlay--erro .modal-icone {
  background: #fee2e2;
  color: #dc2626;
}

.modal-titulo {
  font-size: 20px;
  font-weight: 700;
  color: var(--texto);
  margin-bottom: 10px;
  line-height: 1.3;
}

.modal-texto {
  font-size: 14.5px;
  color: var(--texto-suave);
  line-height: 1.5;
  margin-bottom: 24px;
  word-break: break-word;
}

.modal-botao {
  width: 100%;
  padding: 13px 20px;
  border: none;
  border-radius: var(--raio-sm);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.modal-overlay--sucesso .modal-botao {
  background: #16a34a;
  color: #ffffff;
}

.modal-overlay--sucesso .modal-botao:hover {
  background: #15803d;
}

.modal-overlay--erro .modal-botao {
  background: #dc2626;
  color: #ffffff;
}

.modal-overlay--erro .modal-botao:hover {
  background: #b91c1c;
}

.modal-botao:active {
  transform: scale(0.98);
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalScaleIn {
  from { opacity: 0; transform: scale(0.92) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.rodape {
  max-width: var(--largura-max);
  margin: 0 auto;
  padding: 0 24px 40px;
  font-size: 12.5px;
  color: var(--texto-placeholder);
  text-align: center;
}

.grade-modulos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.modulo {
  display: block;
  padding: 26px 24px;
  background: var(--superficie);
  border: 1px solid var(--borda);
  border-radius: var(--raio-lg);
  box-shadow: var(--sombra-sm);
  text-decoration: none;
  color: inherit;
  transition: box-shadow .18s, border-color .18s, transform .18s;
}

.modulo:hover {
  border-color: rgba(26, 46, 214, .35);
  box-shadow: var(--sombra-lg);
  transform: translateY(-2px);
}

.modulo__icone {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-bottom: 16px;
  border-radius: var(--raio-md);
  background: rgba(26, 46, 214, .08);
  color: var(--azul-primario);
}

.modulo__titulo {
  margin: 0 0 6px;
  font-size: 16.5px;
  font-weight: 600;
  color: var(--navy);
}

.modulo__descricao {
  margin: 0;
  font-size: 13.5px;
  color: var(--texto-suave);
}

.cartao--produtos { padding: 24px 24px 28px; }

.filtros {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 18px;
}

.campo--filtro-categoria { flex: 0 0 220px; }

.filtros .botao { flex-shrink: 0; }

.badge-categoria {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(26, 46, 214, .08);
  color: var(--azul-primario);
  font-size: 12px;
  font-weight: 600;
}

.badge-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-status--disponivel {
  background: #ecfdf3;
  color: #15803d;
}

.badge-status--baixo {
  background: #fffbeb;
  color: #a16207;
}

.badge-status--zerado {
  background: #fef2f2;
  color: #b91c1c;
}

.tabela-scroll {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--borda);
  border-radius: var(--raio-md);
}

.tabela-container,
.tabela-rolagem {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--borda);
  border-radius: var(--raio-md);
}

.tabela {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  color: var(--texto);
  font-size: 13.5px;
}

.tabela th,
.tabela td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--borda);
  text-align: left;
  vertical-align: middle;
}

.tabela th {
  background: var(--campo);
  color: var(--navy);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .3px;
  text-transform: uppercase;
}

.tabela tbody tr:last-child td { border-bottom: 0; }
.tabela tbody tr:hover td { background: #fbfdff; }
.tabela__vazio { padding: 28px 14px !important; text-align: center !important; color: var(--texto-suave); }

.table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  table-layout: fixed;
  color: var(--texto);
  font-size: 13.5px;
}

.table th,
.table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--borda);
  text-align: left;
  vertical-align: middle;
}

.table th {
  background: var(--campo);
  color: var(--navy);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  white-space: normal;
}

.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fbfdff; }

.table--produtos th:first-child,
.table--produtos td:first-child { width: 7%; }

.table--produtos th:nth-child(2),
.table--produtos td:nth-child(2) { width: 22%; }

.table--produtos th:nth-child(3),
.table--produtos td:nth-child(3) { width: 16%; }

.table--produtos th:nth-child(4),
.table--produtos td:nth-child(4) { width: 16%; }

.table--produtos th:nth-child(5),
.table--produtos td:nth-child(5) { width: 16%; }

.table--produtos th:nth-child(6),
.table--produtos td:nth-child(6) { width: 11%; }

.table--produtos th:nth-child(7),
.table--produtos td:nth-child(7) { width: 12%; }

.table--usuarios th:first-child,
.table--usuarios td:first-child { width: 7%; }

.table--usuarios th:nth-child(2),
.table--usuarios td:nth-child(2) { width: 23%; }

.table--usuarios th:nth-child(3),
.table--usuarios td:nth-child(3) { width: 25%; }

.table--usuarios th:nth-child(4),
.table--usuarios td:nth-child(4) { width: 13%; }

.table--usuarios th:nth-child(5),
.table--usuarios td:nth-child(5) { width: 14%; }

.table--usuarios th:nth-child(6),
.table--usuarios td:nth-child(6) { width: 18%; min-width: 170px; }

.table td {
  overflow-wrap: anywhere;
}

.table td .botao {
  min-width: 0;
  width: 100%;
  padding: 9px 12px;
  font-size: 13px;
}

/* Ações em linha dentro de tabelas */
.tabela-acoes {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
}

.tabela-acoes form {
  display: inline-flex !important;
  margin: 0 !important;
  padding: 0 !important;
}

.table td .tabela-acoes .botao,
.tabela-acoes .botao {
  width: auto !important;
  min-width: 0 !important;
  padding: 6px 12px !important;
  font-size: 12.5px !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.botao--pequeno {
  min-width: 0 !important;
  padding: 6px 12px !important;
  font-size: 12.5px !important;
}

/* =========================================
   ESTILOS DAS TELAS DE ACESSO (LOGIN/CADASTRO)
========================================= */

/* Classe específica para colocar na tag <body> das páginas de login */
.pagina-login {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    /* O background e o min-height já são herdados do body global */
}

.login-container {
    background-color: var(--superficie);
    padding: 42px 40px 38px;
    border-radius: var(--raio-lg);
    width: 100%;
    max-width: 400px;
    box-shadow: var(--sombra-lg);
}

.logo {
    text-align: center;
    margin-bottom: 28px;
}

.logo img {
    width: 120px;
    height: auto;
    display: inline-block;
}

.titulo-formulario {
    text-align: center;
    font-size: 20px;
    margin-bottom: 26px;
    font-family: 'Space Grotesk', 'Poppins', sans-serif;
    font-weight: 600;
    color: var(--navy);
}

.grupamento {
    margin-bottom: 20px;
}

.grupamento label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--texto-suave);
    font-family: 'Inter', 'Poppins', sans-serif;
}

.grupamento input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    background-color: var(--campo);
    border: 1px solid var(--borda);
    border-radius: var(--raio-sm);
    font-size: 14px;
    color: var(--texto);
    font-family: 'Inter', 'Poppins', sans-serif;
    transition: all 0.2s;
}

.grupamento input:focus {
    outline: none;
    border-color: var(--azul-primario);
    background-color: var(--superficie);
    box-shadow: 0 0 0 3px rgba(26, 46, 214, .12);
}

.button-submit {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    background-color: var(--azul-primario);
    color: white;
    border: none;
    border-radius: var(--raio-sm);
    font-size: 15px;
    font-family: 'Space Grotesk', 'Poppins', sans-serif;
    font-weight: 600;
    cursor: pointer;
    margin-top: 4px;
    transition: background-color 0.2s;
}

.button-submit:hover {
    background-color: var(--azul-primario-hover);
}

.footer-links {
    display: flex;
    justify-content: center;
    margin-top: 24px;
    font-size: 13px;
    font-family: 'Inter', 'Poppins', sans-serif;
}

.footer-links a {
    color: var(--texto-suave);
    text-decoration: none;
    font-weight: 500;
}

.footer-links a:hover {
    color: var(--azul-primario);
}

.formulario-acesso {
    display: grid;
    gap: 20px;
}

.formulario-acesso .grupamento {
    margin-bottom: 0;
}

.campo-select {
    width: 100%;
    height: 48px;
    padding: 0 42px 0 14px;
    background-color: var(--campo);
    border: 1px solid var(--borda);
    border-radius: var(--raio-sm);
    font-size: 14px;
    color: var(--texto);
    font-family: 'Inter', 'Poppins', sans-serif;
    transition: all 0.2s;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.campo-select:focus {
    outline: none;
    border-color: var(--azul-primario);
    background-color: var(--superficie);
    box-shadow: 0 0 0 3px rgba(26, 46, 214, .12);
}

.mensagem-formulario {
    margin-bottom: 20px;
    padding: 12px 14px;
    border-radius: var(--raio-sm);
    font-size: 13px;
    font-weight: 500;
    border: 1px solid transparent;
}

.mensagem-sucesso {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #15803d;
}

.mensagem-erro {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

/* =========================================
   GRID.JS (TABELAS DO DASHBOARD)
========================================= */
.gridjs-container { font-family: "Poppins", "Segoe UI", system-ui, sans-serif; background: transparent;}

.gridjs-wrapper {
  border: 1px solid var(--borda);
  border-radius: var(--raio-md);
  box-shadow: none;
}

.gridjs-table { font-size: 14px; }

.gridjs-th {
  background: var(--campo);
  color: var(--texto-suave);
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  border-bottom: 1px solid var(--borda);
}

.gridjs-td {
  color: var(--texto);
  border-bottom: 1px solid var(--borda);
}

.gridjs-tr:hover .gridjs-td { background: var(--campo); }

.gridjs-search-input {
  border-radius: var(--raio-sm);
  border-color: var(--borda);
  font-family: inherit;
}

.gridjs-search-input:focus {
  border-color: var(--azul-primario);
  box-shadow: 0 0 0 3px rgba(26, 46, 214, .12);
}

.gridjs-pagination .gridjs-pages button {
  border-radius: var(--raio-sm);
  border-color: var(--borda);
  color: var(--texto-suave);
}

.gridjs-pagination .gridjs-pages button:hover {
  background: var(--campo);
  color: var(--navy);
}

.gridjs-pagination .gridjs-pages button.gridjs-currentPage {
  background: var(--azul-primario);
  border-color: var(--azul-primario);
  color: #fff;
}

/* =========================================
   RESPONSIVO GERAL
========================================= */
@media (max-width: 720px) {
  .topo__interno {
    height: auto;
    padding: 14px 18px;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .nav {
    margin-left: 0;
    overflow-x: auto;
  }

  .nav__item { white-space: nowrap; }

  .conteudo { padding: 26px 18px 48px; }

  .cartao { padding: 22px 20px 26px; }

  .formulario { grid-template-columns: 1fr; }

  .cabecalho-pagina--com-acao {
    align-items: flex-start;
    flex-direction: column;
  }

  .acoes { flex-direction: column-reverse; }

  .botao { width: 100%; }

  .filtros {
    flex-direction: column;
    align-items: stretch;
  }

  .campo--filtro-categoria { flex: 1 1 auto; }

  .gridjs-wrapper { overflow-x: auto; }

  #form-lancamento .produto-item {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
    .pagina-login {
        padding: 16px;
    }

    .login-container {
        padding: 35px 25px 30px;
    }

    .logo img {
        width: 150px;
    }

    .titulo-formulario {
        font-size: 19px;
    }

    .footer-links {
        font-size: 12px;
    }
}

/* =========================================
   MENU DO USUÁRIO (AVATAR E DROPDOWN)
========================================= */
.user-menu {
  display: flex;
  align-items: center;
  cursor: pointer;
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--borda);
  background-color: var(--superficie);
  transition: border-color 0.2s, transform 0.2s;
}

.user-menu:hover .avatar {
  border-color: var(--azul-primario);
  transform: scale(1.05);
}

.dropdown-content {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  background-color: var(--superficie);
  min-width: 200px;
  border: 1px solid var(--borda);
  border-radius: var(--raio-md);
  box-shadow: var(--sombra-lg);
  padding: 8px 0;
  z-index: 100;
  
 
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.25s ease;
}


.dropdown-content::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 14px;
  width: 10px;
  height: 10px;
  background-color: var(--superficie);
  border-top: 1px solid var(--borda);
  border-left: 1px solid var(--borda);
  transform: rotate(45deg);
}

.user-menu:hover .dropdown-content {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-content a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: var(--texto);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  transition: background-color 0.15s, color 0.15s;
}

.dropdown-content a i {
  color: var(--texto-suave);
  width: 16px;
  text-align: center;
  transition: color 0.15s;
}

.dropdown-content a:hover {
  background-color: var(--campo);
  color: var(--azul-primario);
}

.dropdown-content a:hover i {
  color: var(--azul-primario);
}

.avatar--iniciais {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--texto-suave);
  font-size: 15px;
  font-weight: 600;
}

.dropdown-notificacao { justify-content: space-between; }

.notificacao-contador {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 11px;
  font-weight: 700;
}

.dropdown-content hr {
  border: none;
  border-top: 1px solid var(--borda);
  margin: 6px 0;
}


.dropdown-content a.sair-link {
  color: var(--erro);
}
.dropdown-content a.sair-link i {
  color: var(--erro);
}
.dropdown-content a.sair-link:hover {
  background-color: #fef2f2;
  color: #b91c1c;
}
.dropdown-content a.sair-link:hover i {
  color: #b91c1c;
}

@media (max-width: 720px) {
  .topo__interno {
    height: auto;
    padding: 14px 18px;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;   
    align-items: center;
    gap: 14px 0;
  }

  .marca { grid-column: 1; grid-row: 1; }
  
  .user-menu {
    position: static;
    grid-column: 2;
    grid-row: 1;
    margin-left: 0;
    transform: none;
    justify-self: end;
  }

  .nav {
    position: static;
    transform: none;
    grid-column: 1 / -1;
    grid-row: 2;
    margin-left: 0;
    width: auto;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 6px; 

}

/* Efeito de Upload no Avatar */
.avatar-upload-label {
  position: relative;
  display: inline-block;
  cursor: pointer;
  border-radius: 50%;
}

.avatar-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background-color: rgba(15, 44, 92, 0.7);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.avatar-upload-label:hover .avatar-overlay {
  opacity: 1;
}
}


/* Formulários de senha: nova credencial primeiro, identidade em bloco separado. */
.cartao--senha { margin-top: 28px; margin-bottom: 28px; scroll-margin-top: 110px; }
.cartao--senha > p { margin-top: 10px; color: var(--texto-suave); }
.formulario.formulario--senha { margin-top: 28px; gap: 24px; }
.formulario--senha .senha-confirmacao { grid-column: 1; padding-top: 12px; }
.senha-confirmacao .campo { max-width: none; }
.formulario--senha .senha-acoes { grid-column: 2; display: flex; align-items: flex-end; }
.formulario--senha .senha-acoes .botao { width: 100%; min-height: 46px; }
@media (max-width: 768px) {
    .formulario.formulario--senha { grid-template-columns: 1fr; gap: 20px; }
    .senha-confirmacao .campo { max-width: none; }
    .formulario--senha .senha-confirmacao, .formulario--senha .senha-acoes { grid-column: 1 / -1; }
    .senha-acoes .botao { width: 100%; }
}

/* Controle compartilhado: o botão nunca submete o formulário. */
.senha-controle { position: relative; width: 100%; min-width: 0; }
.senha-controle > input { width: 100%; box-sizing: border-box; padding-right: 52px !important; }
.senha-controle .senha-visibilidade {
    position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; padding: 8px; margin: 0;
    background: transparent; border: 0; border-radius: 8px;
    color: var(--texto-suave, #536784); cursor: pointer;
}
.senha-controle .senha-visibilidade:hover { background: #eaf0fa; }
.senha-controle .senha-visibilidade:focus-visible { outline: 2px solid #252bd9; outline-offset: 1px; }
.senha-visibilidade svg { width: 22px; height: 22px; pointer-events: none; }
.senha-visibilidade .senha-risco { display: none; }
.senha-visibilidade[aria-pressed="true"] .senha-risco { display: block; }

.formulario--senha .senha-confirmacao input { min-height: 46px; }


/* Consulta independente entre nome e permissões da conta. */
.consulta-email { grid-column: 1 / -1; padding: 22px 0; border-top: 1px solid var(--borda, #dce5f2); border-bottom: 1px solid var(--borda, #dce5f2); scroll-margin-top: 110px; }
.consulta-email > p { margin: 10px 0 18px; color: var(--texto-suave); }
.consulta-email__campos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: end; }
.consulta-email__campos .campo__controle, .consulta-email__campos > .botao { min-height: 46px; }
.consulta-email__campos > .botao { width: 100%; }
.consulta-email__autorizada { margin: 0; align-self: center; }
.consulta-email .consulta-email__resultado { margin-bottom: 0; overflow-wrap: anywhere; }
#email-protegido { scroll-margin-top: 110px; }
@media (max-width: 768px) {
    .consulta-email__campos { grid-template-columns: 1fr; }
}
