/* ========== VARIABLES & GLOBAL STYLES ========== */
:root {
  --primary-color: #00371f;
  --primary-hover: #067e4a;
  --primary-light: #113821;
  --text-light: #00371f;
  --white: #fff;
  --light-gray: #f8f9fa;  
  --border-radius: 8px;
  --box-shadow: 0 0 10px rgba(0,0,0,0.3);
  --transition: all 0.3s ease;
}

body {
  align-items: center;
  padding: 1rem;
  /* Gradientes primeiro (sobrepostos) */
  background-image: 
    linear-gradient(to right, var(--primary-light) 0%, transparent 10%, transparent 90%, var(--primary-light) 100%),
    linear-gradient(to bottom, var(--primary-light) 0%, transparent 10%, transparent 90%, var(--primary-light) 100%);
  /* Imagem de fundo (embaixo dos gradientes) */
  background-image: url('../img/fundo_verde.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  background-attachment: fixed; /* Opcional - remove se quiser scroll normal */
  background-color: var(--primary-light);
  font-family: Arial, sans-serif;
  min-height: 100vh;
}

/* ========== TYPOGRAPHY ========== */
h1, h2, h4, h5, h6 {
  color: var(--primary-color);
  margin: 15px;
}

h1 {
  font-size: 2rem;
  margin-bottom: 15px;
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--primary-color);
  padding: 10px;
}

h4 {
  border-bottom: 1px solid var(--primary-color);
  padding: 0.5rem 0;
}

h5 {
  margin: 5px 15px;
}

h6 {
  font-size: 2rem;
  padding: 1rem;
}

header h4 {
  border-bottom: none;
}

/* ========== COMPONENTS ========== */
/* Logo */
#logo {
  width: 100%;
  background-color: var(--white);
  border-radius: var(--border-radius);
  padding: 0.5rem;
}

/* Form Containers */
#containerForm, 
#containerFormProposta,
.login-container {
  border-radius: var(--border-radius);
  background-color: rgba(255, 255, 255, 0.9);
  padding: 2rem;
  box-shadow: var(--box-shadow);
}

/* Forms */
form {
  margin: 0;
  border-radius: var(--border-radius);
}

/* Input placeholders */
::placeholder {
  color: #bbb;
  opacity: 1;
}

:placeholder-shown {
  opacity: 0.9 !important;
}

input[type="date"] {
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  border: 1px solid #ccc;
}

/* Form validation */
.was-validated .form-control:valid,
.form-control.is-valid, 
.form-select.is-valid {
  background-color: #e5ffea !important;
  border-color: #28a745 !important;
}

.was-validated .form-control:invalid,
.form-control.is-invalid {
  background-color: #f0c4cb !important;
  border-color: #dc3545 !important;
}

/* Sections */
.section {
  display: none;
}

.section.active {
  display: block;
}

/* ========== BUTTONS ========== */
#togglePassword,
.login-btn {
  background: var(--primary-color);
  color: var(--white);
  border: none;
  border-radius: var(--border-radius);
  transition: var(--transition);
}

#togglePassword {
  padding: 0.100rem 0.45rem;
}

.login-btn {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  margin-top: 10px;
}

#togglePassword:hover,
.login-btn:hover {
  background: var(--primary-hover);
  color: var(--white);
}

/* ========== NAVIGATION ========== */
.navbar-custom,
.footer-custom {
  background-color: var(--light-gray);
  border-radius: var(--border-radius);
  color: var(--text-light);
}

.nav-link,
.navbar-brand {
  color: var(--primary-color) !important;
}

.nav-link:hover {
  text-decoration: underline;
}

/* ========== CARDS & BOXES ========== */
.card-total {
  text-align: center;
  padding: 20px;
  box-shadow: 0 0 10px var(--white);
  border: none;
}

.card-total h2 {
  color: var(--white);
}

.link-box {
  transition: transform 0.2s;
}

.link-box:hover {
  transform: scale(1.03);
}

.link-box img {
  width: 100%;
  height: auto;
  border-radius: 10px;
}

.card {
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

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

/* ========== TABLES ========== */
.custom-rounded-table {
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid #dcdcdc;
  border-radius: 10px;
  overflow: hidden;
  background-color: #ffffff; /* Força fundo branco */
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

/* Cantos arredondados */
.custom-rounded-table thead tr:first-child th:first-child {
  border-top-left-radius: 10px;
}
.custom-rounded-table thead tr:first-child th:last-child {
  border-top-right-radius: 10px;
}
.custom-rounded-table tbody tr:last-child td:first-child {
  border-bottom-left-radius: 10px;
}
.custom-rounded-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 10px;
}

/* Cabeçalho */
.custom-rounded-table thead th {
  background-color:  #00371f; /* Verde mais claro no cabeçalho */
  color: white;
  font-weight: 600;
  font-size: 1.1rem;
}

/* Listras em linhas pares */
.custom-rounded-table tbody tr:nth-of-type(even) {
  background-color: #e6fbe6 !important; /* Verde bem claro */
}

/* Hover */
.custom-rounded-table tbody tr:hover {
  background-color: #d3e78b !important; /* Verde médio no hover */
  transition: background-color 0.3s ease;
  cursor: pointer;
}

/* ========== ICONS ========== */
i, a {
  font-size: 1.5rem;
  color: var(--light-gray);
  margin-bottom: 10px;
  text-decoration: none;
}

.fas.fa-eye { color: rgb(160, 225, 255); }
.fas.fa-pen { color: #eed66b; }
.fas.fa-trash-alt { color: #fc9797; }
.fas.fa-file-excel { color: #e8f1edea; }

.fas.fa-eye:hover, 
.fas.fa-pen:hover, 
.fas.fa-trash-alt:hover, 
.fas.fa-file-excel:hover { 
  color: var(--white);
}

/* ========== UTILITY CLASSES ========== */
.text-white { color: var(--white); }

/* ========== PAGINATION ========== */
.pagination .page-item.active .page-link {
  background-color: #2eb160;
  border-color: #2eb160;
  color: var(--white);
  
}
.pagination .page-item .page-link {
  background-color: #ffffff;
  border-color: #ffffff;
  color:#00371f;  
}


/* ========== LOGIN SPECIFIC STYLES ========== */
.login-container {
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.login-header {
  margin-bottom: 30px;
}

.login-header i {
  font-size: 3rem;
  color: var(--primary-color);
  margin-bottom: 15px;
}

.login-header h1 {
  margin-bottom: 10px;
}

.login-form .form-group {
  margin-bottom: 20px;
  text-align: left;
}

.login-form label {
  display: block;
  margin-bottom: 8px;
  color: #2c3e50;
  font-weight: 500;
}

.login-form input {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 1rem;
  transition: border-color 0.3s;
}

.login-form input:focus {
  border-color: var(--primary-color);
  outline: none;
}

.login-footer {
  margin-top: 20px;
  color: #7f8c8d;
  font-size: 0.9rem;
}

.error-message {
  color: #e74c3c;
  margin-top: 15px;
  font-size: 0.9rem;
  display: none;
}

/* ========== SWEETALERT ========== */
.swal2-smaller {
  background: var(--white);
  width: 400px !important;
  font-size: 0.9rem;
  border-radius: var(--border-radius);
}

.swal2-smaller h2 {
  border-bottom: none;
  background: var(--white);
  color: var(--primary-color);
}

.navbar-custom .dropdown-menu {
    background-color: #f8f9fa;
    border: 1px solid rgba(0,0,0,.15);
}

.navbar-custom .dropdown-item:hover {
    background-color: #00371f;
    color: white;
}

.navbar-custom .dropdown-divider {
    border-color: #dee2e6;
}

/* Menu aberto no mobile */
.navbar-collapse.show {
  background-color: var(--light-gray);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 1rem;
}

.nav-link.active {
  font-weight: bold;
  background-color: var(--primary-light);
  color: white !important;
  border-radius: var(--border-radius);
  padding: 0.5rem 1rem;
}

.nav-link,
.navbar-brand {
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--primary-hover) !important;
  text-decoration: none;
}

.link-box {
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.link-box:hover {
  transform: scale(1.1);
  background-color: var(--primary-hover) !important;
}

th.sortable::after {
  content: ' ⇅';
  font-size: 0.8em;
  color: #ccc;
}
th.sortable.asc::after {
  content: ' ↑';
  color: #fff;
}
th.sortable.desc::after {
  content: ' ↓';
  color: #fff;
}

/* barra lateral*/
/* Layout principal: sidebar + conteúdo */
.layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar inicialmente fechada */
.sidebar {
  width: 50px; /* só ícones visíveis */
  background-color: #fff; /* manter padrão */
  border-right: 1px solid #198754;
  position: fixed;
  top: 70px; /* abaixo do header */
  bottom: 0;
  left: 0;
  overflow: hidden;
  transition: width 0.3s ease;
  z-index: 1000;
  padding-top: 1rem;
}

/* Expande ao passar o mouse */
.sidebar:hover {
  width: 220px;
}

/* Links da sidebar */
.sidebar .list-group-item {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: none;
  padding: 10px 15px;
}

.sidebar .list-group-item i {
  min-width: 25px;
  text-align: center;
}

/* Conteúdo principal */
.content {
  flex: 1;
  margin-left: 50px; /* espaço da sidebar fechada */
  transition: margin-left 0.3s ease;
}

.sidebar:hover ~ .content {
  margin-left: 220px; /* empurra conteúdo quando sidebar abre */
}
