/* =========================================
   FONTEI GESTÃO - Layout Corporativo Global
   Paleta: dourado (#C6A74D), azul marinho (#1C2541),
           cinza grafite (#444), branco (#FFF)
   ========================================= */

/* ---------- Reset e base ---------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  
}

a {
    text-decoration: none !important;
    color: inherit;
}

html, body {
  height: 100%;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  background-color: #f5f6fa;
  color: #333;
  display: flex;
  flex-direction: column;
}

/* ---------- Cabeçalho ---------- */
header.topbar {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  border-bottom: 3px solid #C6A74D;
}

header.topbar .logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

header.topbar .logo img {
  width: 50px;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
}

header.topbar .logo span {
  font-size: 20px;
  font-weight: 700;
  color: #1C2541;
  letter-spacing: 0.5px;
}

header.topbar .user {
  font-size: 14px;
  color: #444;
}

header.topbar .user span {
  color: #1C2541;
  font-weight: bold;
}

header.topbar .user-area {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* ---------- Conteúdo principal ---------- */
main.conteudo {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 30px auto;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  padding: 30px;
}

/* ---------- Rodapé ---------- */
footer.rodape {
  background: #fff;
  border-top: 3px solid #C6A74D;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
  padding: 12px 20px;
}

.rodape-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.rodape-container p {
  font-size: 13px;
  color: #666;
}

/* ---------- Botões gerais ---------- */
button, .btn {
  background: #1C2541;
  color: white;
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  text-decoration: none;
}

button:hover, .btn:hover {
  background: #C6A74D;
  color: #1C2541;
}

/* ---------- Inputs e Selects ---------- */
input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
input[type="date"],
select, textarea {
  width: 100%;
  padding: 10px 12px;
  margin: 6px 0 16px 0;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  color: #333;
  transition: 0.2s;
  background: #fff;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #1C2541;
  box-shadow: 0 0 0 3px rgba(28,37,65,0.2);
}

/* ---------- Estilo do select com seta ---------- */
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #1C2541 50%), 
                    linear-gradient(135deg, #1C2541 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(1em + 2px), calc(100% - 13px) calc(1em + 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

/* ---------- Tabelas ---------- */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 14px;
}

table th {
  background: #1C2541;
  color: white;
  padding: 10px;
  text-align: left;
}

table td {
  padding: 10px;
  border-bottom: 1px solid #ddd;
}

table tr:hover {
  background: #f8f8f8;
}

/* ---------- Mensagens ---------- */
.alert, .ok, .erro {
  padding: 10px 15px;
  border-radius: 6px;
  margin-bottom: 12px;
  font-weight: 500;
}

.ok {
  background: #E8F8F0;
  border: 1px solid #A3E4C9;
  color: #1E8449;
}

.erro {
  background: #FDEDEC;
  border: 1px solid #E6B0AA;
  color: #922B21;
}

.alert {
  background: #FFF6E0;
  border: 1px solid #F5CBA7;
  color: #9A7D0A;
}

/* ---------- Responsividade ---------- */
@media (max-width: 768px) {
  header.topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .rodape-container {
    flex-direction: column;
    gap: 8px;
  }

  main.conteudo {
    margin: 20px 10px;
    padding: 20px;
  }

  table th, table td {
    font-size: 13px;
  }
}

/* ---------- Login page ---------- */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background: linear-gradient(135deg, #1C2541 0%, #C6A74D 100%);
}

.login-box {
  background: #fff;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
  text-align: center;
  width: 100%;
  max-width: 380px;
}

.login-box img {
  width: 80px;
  margin-bottom: 20px;
}

.login-box h2 {
  color: #1C2541;
  margin-bottom: 25px;
}

.login-box input {
  width: 100%;
  padding: 10px;
  margin: 10px 0;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}

.login-box button {
  width: 100%;
  background: #1C2541;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 10px;
  font-weight: bold;
  transition: 0.2s;
}

.login-box button:hover {
  background: #C6A74D;
  color: #1C2541;
}

/* ---------- Módulos (ícones do painel) ---------- */
.modulos-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
}

.modulo {
  width: 160px;
  height: 160px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
  text-decoration: none;
  color: #1C2541;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.modulo img {
  width: 64px;
  height: 64px;
  margin-bottom: 10px;
}

.modulo:hover {
  transform: translateY(-5px);
  background: #F9F9F9;
  border: 1px solid #C6A74D;
  box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.modulo p {
  font-size: 15px;
  font-weight: bold;
}

/* ---------- PÁGINA DE LOGIN ---------- */
body.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background: linear-gradient(135deg, #1C2541 0%, #C6A74D 100%);
  flex-direction: column;
}

.login-box {
  background: #fff;
  border-radius: 12px;
  padding: 40px 35px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
  text-align: center;
  width: 100%;
  max-width: 400px;
}

.login-box img {
  width: 90px;
  height: auto;
  margin-bottom: 15px;
  border-radius: 8px;
}

.login-box h2 {
  color: #1C2541;
  font-size: 22px;
  margin-bottom: 5px;
}

.login-container .slogan {
  color: #888;
  font-size: 13px;
  margin-bottom: 25px;
}

.login-box input {
  width: 100%;
  padding: 10px;
  margin: 8px 0;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  transition: 0.2s;
}

.login-box input:focus {
  border-color: #1C2541;
  box-shadow: 0 0 0 3px rgba(28,37,65,0.2);
  outline: none;
}

.login-box button {
  width: 100%;
  background: #1C2541;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 10px;
  font-weight: bold;
  transition: 0.3s;
  margin-top: 10px;
}

.login-box button:hover {
  background: #C6A74D;
  color: #1C2541;
}

.links-login {
  margin-top: 15px;
}

.links-login a {
  font-size: 13px;
  color: #1C2541;
  text-decoration: none;
}

.links-login a:hover {
  color: #C6A74D;
}

.login-footer {
  margin-top: 30px;
  text-align: center;
  font-size: 12px;
  color: #f8f8f8;
}

.login-box .ok a {
  color: #1C2541;
  font-weight: bold;
}

.login-box .ok a:hover {
  color: #C6A74D;
}

/* ---------- Painel de Módulos (Cards) ---------- */
.titulo-painel {
  color: #1C2541;
  margin-bottom: 8px;
  font-size: 26px;
}

.descricao-painel {
  color: #555;
  font-size: 14px;
  margin-bottom: 25px;
}

.modulos-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 25px;
  margin-top: 10px;
}

.card-modulo {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.07);
  text-decoration: none;
  color: #1C2541;
  padding: 25px 20px;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  border-top: 4px solid #C6A74D;
}

.card-modulo:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.12);
  border-color: #1C2541;
}

.card-modulo .icon-area {
  background: #f5f6fa;
  border-radius: 10px;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
}

.card-modulo .icon-area img {
  width: 40px;
  height: 40px;
}

.card-modulo h3 {
  margin-bottom: 8px;
  font-size: 18px;
  color: #1C2541;
}

.card-modulo p {
  font-size: 13px;
  color: #555;
  line-height: 1.4em;
}

/* ---------- Responsivo ---------- */
@media (max-width: 768px) {
  .titulo-painel {
    font-size: 22px;
    text-align: center;
  }
  .descricao-painel {
    text-align: center;
  }
  .card-modulo {
    align-items: center;
    text-align: center;
  }
}

/* ---------- MÓDULO RECEBIMENTO ---------- */
.cards-acoes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 25px;
  margin-top: 25px;
}

.card-acao {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.07);
  text-decoration: none;
  color: #1C2541;
  padding: 25px 20px;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-top: 4px solid #C6A74D;
  text-align: center;
}

.card-acao:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.12);
  border-color: #1C2541;
}

.card-acao img {
  width: 60px;
  height: 60px;
  margin-bottom: 15px;
}

.card-acao h3 {
  font-size: 18px;
  margin-bottom: 6px;
  color: #1C2541;
}

.card-acao p {
  font-size: 13px;
  color: #555;
  line-height: 1.4em;
}

@media (max-width: 768px) {
  .cards-acoes {
    gap: 18px;
  }

  .card-acao img {
    width: 50px;
    height: 50px;
  }

  .card-acao h3 {
    font-size: 16px;
  }

  .card-acao p {
    font-size: 12px;
  }
}

/* ---------- Página de Fornecedores ---------- */
.form-pesquisa {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 25px;
}

.form-pesquisa input[type="text"] {
  flex: 1;
  min-width: 250px;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}

.form-pesquisa .btn {
  background: #1C2541;
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s;
}

.form-pesquisa .btn:hover {
  background: #C6A74D;
  color: #1C2541;
}

.form-pesquisa .btn-novo {
  background: #C6A74D;
  color: #1C2541;
}

.form-pesquisa .btn-novo:hover {
  background: #1C2541;
  color: #fff;
}

.lista-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.card-fornecedor {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border-radius: 10px;
  padding: 15px 20px;
  text-decoration: none;
  color: #1C2541;
  border-left: 4px solid #C6A74D;
  box-shadow: 0 3px 8px rgba(0,0,0,0.07);
  transition: all 0.25s;
}

.card-fornecedor:hover {
  transform: translateY(-4px);
  box-shadow: 0 5px 14px rgba(0,0,0,0.1);
  border-left-color: #1C2541;
}

.card-fornecedor .info h3 {
  font-size: 16px;
  margin-bottom: 5px;
  color: #1C2541;
}

.card-fornecedor .info p {
  font-size: 13px;
  color: #555;
}

.card-fornecedor .frete {
  text-align: right;
}

.card-fornecedor .frete p {
  margin: 0;
  font-weight: bold;
  font-size: 15px;
  color: #1C2541;
}

.card-fornecedor .frete span {
  font-size: 12px;
  color: #777;
}

.nenhum-registro {
  text-align: center;
  color: #777;
  font-size: 14px;
  margin-top: 20px;
}

/* ---------- Responsividade ---------- */
@media (max-width: 768px) {
  .form-pesquisa {
    flex-direction: column;
  }

  .form-pesquisa input {
    width: 100%;
  }

  .card-fornecedor {
    flex-direction: column;
    align-items: flex-start;
  }

  .card-fornecedor .frete {
    text-align: left;
    margin-top: 10px;
  }
}

/* ---------- Formulário de Cadastro de Fornecedor ---------- */
.form-cadastro {
  background: #fff;
  border-radius: 10px;
  padding: 25px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.07);
  margin-top: 20px;
  max-width: 700px;
}

.campo-form {
  margin-bottom: 18px;
}

.campo-form label {
  display: block;
  font-weight: 600;
  color: #1C2541;
  margin-bottom: 5px;
  font-size: 14px;
}

.campo-form input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  transition: 0.2s;
}

.campo-form input:focus {
  border-color: #1C2541;
  box-shadow: 0 0 0 3px rgba(28,37,65,0.15);
  outline: none;
}

.botoes-form {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.btn-voltar {
  background: #C6A74D;
  color: #1C2541;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 6px;
  font-weight: bold;
  transition: 0.3s;
}

.btn-voltar:hover {
  background: #1C2541;
  color: #fff;
}

.card-fornecedor.inativo {
  opacity: 0.6;
  background: #f8f8f8;
}

.card-fornecedor.inativo:hover {
  opacity: 0.9;
}

.status-inativo {
  font-size: 12px;
  color: #b10000;
  font-weight: bold;
  margin-top: 5px;
}

.ok, .erro {
  margin-bottom: 15px;
  padding: 10px 15px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
}

.ok {
  background: #eaf7ea;
  color: #1a5d1a;
  border: 1px solid #1a5d1a33;
}

.erro {
  background: #fde8e8;
  color: #a30000;
  border: 1px solid #a3000022;
}

.btn-danger {
  background-color: #b10000;
  color: #fff;
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-danger:hover {
  background-color: #d10000;
}

/* ---------- Cards de módulos internos ---------- */
.cards-modulos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 25px;
  margin-top: 30px;
}

.card-modulo {
  background: #ffffff;
  border-radius: 15px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  text-align: center;
  padding: 25px 20px;
  transition: all 0.25s ease;
  text-decoration: none;
  color: #1C2541;
  position: relative;
  overflow: hidden;
}

.card-modulo:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 18px rgba(0,0,0,0.12);
}

.card-modulo.desativado {
  opacity: 0.5;
  cursor: not-allowed;
}

.card-modulo h2 {
  margin-top: 15px;
  font-size: 20px;
  color: #1C2541;
  font-weight: 700;
}

.card-modulo p {
  font-size: 14px;
  color: #555;
  margin-top: 8px;
}

.icone-modulo {
  width: 80px;
  height: 80px;
  margin: 0 auto;
  background: #EAF1FB;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icone-img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  filter: drop-shadow(0 0 1px rgba(0,0,0,0.1));
}

/* -------- Rodapé -------- */
.rodape-sistema {
  background: linear-gradient(90deg, #1C2541, #243B55);
  color: #f0f0f0;
  padding: 12px 25px;
  text-align: center;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  z-index: 1000;
}

.rodape-conteudo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.rodape-sistema span {
  font-size: 13px;
  color: #e0e0e0;
}

/* -------- Botão de sair -------- */
.btn-sair {
  background: linear-gradient(90deg, #b38e00, #d4af37);
  color: #fff;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
  text-decoration: none;
}

.btn-sair:hover {
  background: linear-gradient(90deg, #d4af37, #b38e00);
  transform: translateY(-2px);
}

.btn-sair i {
  margin-right: 6px;
}

.checkbox-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 5px;
}

.checkbox-container label {
  background: rgba(28,37,65,0.1);
  border: 1px solid #ccc;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.checkbox-container input[type="checkbox"] {
  margin-right: 5px;
}

.checkbox-container label:hover {
  background: rgba(28,37,65,0.15);
  transform: scale(1.03);
}

.checkbox-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 5px;
}

.checkbox-container label {
  background: rgba(28,37,65,0.1);
  border: 1px solid #ccc;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.checkbox-container input[type="checkbox"] {
  margin-right: 5px;
}
.checkbox-container label:hover {
  background: rgba(28,37,65,0.15);
  transform: scale(1.03);
}

.info-usuario-logado {
  background: rgba(28,37,65,0.05);
  border-left: 4px solid #1C2541;
  padding: 10px 15px;
  margin-bottom: 20px;
  border-radius: 6px;
}
.info-usuario-logado p {
  margin: 3px 0;
  color: #1C2541;
  font-size: 14px;
}

label input[type="checkbox"] {
  transform: scale(1.2);
  margin-right: 8px;
  accent-color: #1C2541;
}

.popup-area {
  position: fixed;
  left:0; top:0; right:0; bottom:0;
  background: rgba(0,0,0,0.5);
  display:none;
  justify-content:center;
  align-items:center;
  z-index:9999;
}

.popup-box {
  background:#fff;
  width:420px;
  padding:20px;
  border-radius:12px;
  box-shadow:0 0 15px rgba(0,0,0,0.3);
}

.popup-box select, .popup-box input {
  width:100%;
  padding:10px;
  margin-top:6px;
  border:1px solid #ccc;
  border-radius:6px;
}

/* Fundo escurecido cobrindo a tela */
#popup-area {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.45);
    display: none; /* começa escondido */
    align-items: center;
    justify-content: center;
    z-index: 99999; 
    backdrop-filter: blur(3px);
}

/* Caixa do pop-up */
.popup-box {
    background: #ffffff;
    padding: 28px;
    border-radius: 12px;
    width: 450px;
    max-width: 95%;
    box-shadow: 0 10px 25px rgba(0,0,0,0.25);
    animation: popupFade .25s ease-out;
}

/* Animação suave */
@keyframes popupFade {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}

.tabela-container {
    overflow-x: auto;
    background: #fff;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    margin-top: 20px;
}

#tabelaContas {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

#tabelaContas thead th {
    background: #1C2541;
    color: #fff;
    padding: 10px;
    text-align: left;
    cursor: pointer;
    user-select: none;
}

#tabelaContas tbody td {
    padding: 10px;
    border-bottom: 1px solid #eee;
}

#tabelaContas thead th:hover {
    background: #2a3b61;
}

.linha-clique:hover {
    background: #f6f6f8;
}
