/* Estilos gerais do sistema */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", sans-serif;
  background-color: #f0f2f5;
  color: #333;
}
/* Login */
.pagina-login {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
}

.login-box {
  background: white;
  border-radius: 15px;
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.login-logo {
  font-size: 48px;
  margin-bottom: 12px;
}

.login-box h1 {
  font-size: 24px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 6px;
}

.login-subtitulo {
  color: #888;
  font-size: 14px;
  margin-bottom: 32px;
}

/* Formulario */
.campo {
  text-align: left;
  margin-bottom: 18px;
}
.campo label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-bottom: 6px;
}

.campo input,
.campo select,
.campo textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  transition: border 0.2s;
  outline: none;
}

.campo input:focus,
.campo select:focus {
  border-color: #007fff;
}

/* ===== BOTÕES ===== */
.btn-primario {
  width: 100%;
  padding: 12px;
  background: #007fff;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 8px;
}

.btn-primario:hover {
  background: #0c4b8a;
}

/* ===== ALERTAS ===== */
.alerta {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 20px;
  text-align: left;
}

.alerta.erro {
  background: #ffeaea;
  color: #c0392b;
  border: 1px solid #f5c6cb;
}

.alerta.sucesso {
  background: #eafaf1;
  color: #1e8449;
  border: 1px solid #a9dfbf;
}

/* ===== DASHBOARD ===== */
/* ===== TOPO / MENU ===== */
.topo {
  background: #1a1a2e;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.topo-esquerda {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topo-logo {
  font-size: 24px;
}

.topo-titulo {
  color: #007fff;
  font-size: 18px;
  font-weight: 700;
}

.topo-menu {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topo-menu a {
  color: #aaa;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.topo-menu a:hover,
.topo-menu a.ativo {
  color: #007fff;
  background: rgba(240, 165, 0, 0.1);
}

.btn-sair {
  color: #f85149 !important;
}

.btn-sair:hover {
  background: rgba(248, 81, 73, 0.1) !important;
}

/* ===== CONTAINER ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* ===== TÍTULOS ===== */
.pagina-titulo {
  margin-bottom: 28px;
}

.pagina-titulo h2 {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a2e;
}

.pagina-titulo p {
  color: #888;
  font-size: 14px;
  margin-top: 4px;
}

.secao-titulo {
  font-size: 16px;
  font-weight: 700;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 32px 0 16px;
}

/* ===== CARDS RESUMO ===== */
.cards-resumo {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 8px;
}

.card {
  background: white;
  border-radius: 12px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border-left: 4px solid transparent;
}

.card-verde {
  border-left-color: #3fb950;
}
.card-vermelho {
  border-left-color: #f85149;
}

.card-icone {
  font-size: 28px;
  font-weight: 900;
  opacity: 0.3;
}

.card-verde .card-icone {
  color: #3fb950;
}
.card-vermelho .card-icone {
  color: #f85149;
}

.card-info {
  display: flex;
  flex-direction: column;
}

.card-label {
  font-size: 12px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-valor {
  font-size: 22px;
  font-weight: 800;
  color: #1a1a2e;
  margin-top: 2px;
}

/* ===== CARDS CAMINHÕES ===== */
.cards-caminhoes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.card-caminhao {
  background: white;
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s;
}

.card-caminhao:hover {
  transform: translateY(-2px);
}

.caminhao-topo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.caminhao-placa {
  font-size: 16px;
  font-weight: 800;
  color: #007fff;
  letter-spacing: 1px;
}

.caminhao-motorista {
  font-size: 12px;
  color: #888;
  margin-top: 2px;
}

.caminhao-saldo {
  font-size: 16px;
  font-weight: 800;
}

.caminhao-saldo.positivo {
  color: #3fb950;
}
.caminhao-saldo.negativo {
  color: #f85149;
}

.caminhao-valores {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.caminhao-entrada,
.caminhao-saida {
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
}

.caminhao-entrada {
  background: rgba(63, 185, 80, 0.08);
}

.caminhao-saida {
  background: rgba(248, 81, 73, 0.08);
}

.caminhao-entrada span,
.caminhao-saida span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.caminhao-entrada span {
  color: #3fb950;
}
.caminhao-saida span {
  color: #f85149;
}

.caminhao-entrada strong,
.caminhao-saida strong {
  font-size: 13px;
  font-weight: 700;
  color: #1a1a2e;
}

/* ===== FILTROS ===== */
.filtros {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  margin-bottom: 24px;
}

.filtro-grupo {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filtro-grupo label {
  font-size: 12px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filtro-grupo select {
  padding: 9px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  cursor: pointer;
  min-width: 200px;
}

.btn-filtrar {
  padding: 9px 20px;
  background: #1a1a2e;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-filtrar:hover {
  background: #2d2d4e;
}

.btn-limpar {
  padding: 9px 16px;
  background: transparent;
  color: #888;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-limpar:hover {
  border-color: #aaa;
  color: #555;
}

.btn-novo {
  padding: 9px 18px;
  background: #007fff;
  color: white;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  margin-left: auto;
  transition: background 0.2s;
}

.btn-novo:hover {
  background: #0c4b8a;
}

/* ===== TABELA ===== */
.tabela-wrapper {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.tabela {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.tabela thead tr {
  background: #f8f9fa;
  border-bottom: 2px solid #eee;
}

.tabela th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tabela td {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  color: #333;
}

.tabela tbody tr:hover {
  background: #fafafa;
}

.tabela-vazia {
  text-align: center;
  color: #aaa;
  padding: 40px !important;
}

/* ===== BADGES ===== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.badge-entrada {
  background: rgba(63, 185, 80, 0.12);
  color: #2da44e;
}

.badge-saida {
  background: rgba(248, 81, 73, 0.12);
  color: #d73a49;
}

/* ===== VALORES ===== */
.valor-entrada {
  color: #2da44e;
  font-weight: 700;
}

.valor-saida {
  color: #d73a49;
  font-weight: 700;
}

/* ===== AÇÕES ===== */
.acoes {
  display: flex;
  gap: 6px;
}

.btn-editar,
.btn-deletar {
  padding: 4px 10px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  border: 1px solid #eee;
  transition: all 0.2s;
}

.btn-editar:hover {
  background: #fff3cd;
  border-color: #007fff;
}
.btn-deletar:hover {
  background: #ffeaea;
  border-color: #f85149;
}

/* ===== FORMULÁRIO DE LANÇAMENTO ===== */
.form-card {
  background: white;
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.campo-largo {
  grid-column: span 2;
}

.form-acoes {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid #f0f0f0;
}

/* ===== USUÁRIOS ===== */
.usuarios-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
  align-items: start;
}

.form-titulo {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
}

.badge-admin {
  background: rgba(240, 165, 0, 0.12);
  color: #007fff;
}

.badge-visitante {
  background: rgba(100, 100, 100, 0.1);
  color: #666;
}

/* ===== BOTÃO EXPORTAR ===== */
.btn-exportar {
  padding: 9px 18px;
  background: #1a7a4a;
  color: white;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-exportar:hover {
  background: #155f3a;
}

/* ===================================
   RESPONSIVO — CELULAR
   =================================== */

@media (max-width: 768px) {

    /* MENU SUPERIOR */
    .topo {
        height: auto;
        flex-direction: column;
        padding: 12px 16px;
        gap: 10px;
    }

    .topo-menu {
        width: 100%;
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
    }

    .topo-menu a {
        font-size: 13px;
        padding: 6px 10px;
    }

    /* CONTAINER */
    .container {
        padding: 16px;
    }

    /* CARDS RESUMO */
    .cards-resumo {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* CARDS CAMINHÕES */
    .cards-caminhoes {
        grid-template-columns: 1fr;
    }

    /* FILTROS */
    .filtros {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .filtro-grupo select {
        min-width: 100%;
        width: 100%;
    }

    .btn-filtrar,
    .btn-limpar,
    .btn-novo,
    .btn-exportar {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    /* TABELA — vira cards no celular */
    .tabela-wrapper {
        overflow-x: auto;
    }

    .tabela thead {
        display: none;
    }

    .tabela tbody tr {
        display: block;
        background: white;
        border-radius: 10px;
        margin-bottom: 12px;
        padding: 14px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        border-left: 4px solid #eee;
    }

    .tabela tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px 0;
        border-bottom: 1px solid #f5f5f5;
        font-size: 13px;
    }

    .tabela tbody td:last-child {
        border-bottom: none;
    }

    .tabela tbody td::before {
        content: attr(data-label);
        font-weight: 700;
        font-size: 11px;
        color: #888;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        flex-shrink: 0;
        margin-right: 12px;
    }

    .acoes {
        justify-content: flex-end;
    }

    /* FORMULÁRIOS */
    .form-grid {
        grid-template-columns: 1fr;
    }

    .campo-largo {
        grid-column: span 1;
    }

    .form-acoes {
        flex-direction: column;
    }

    .btn-primario {
        width: 100%;
    }

    .btn-limpar {
        width: 100%;
        text-align: center;
    }

    /* USUÁRIOS */
    .usuarios-grid {
        grid-template-columns: 1fr;
    }

    /* LOGIN */
    .login-box {
        margin: 16px;
        padding: 32px 24px;
    }
}
