
/* =========================
   RESET BÁSICO
========================= */
* {
  box-sizing: border-box;
  font-family: 'Montserrat', sans-serif;
}

body {
  margin: 0;
  background: #2f6b4a;
  color: #FFFFFF;
}

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

button {
  font-family: inherit;
}

/* =========================
   LAYOUT
========================= */
.layout {
  display: flex;
  min-height: 100vh;
}

/* =========================
   SIDEBAR
========================= */
.sidebar {
  width: 240px;
  background: #1f4a33;
  padding: 16px;
  transition: width 0.3s;
  display: flex;
  flex-direction: column;
}

.sidebar.collapsed {
  width: 90px;
}

.toggle-btn {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 22px;
  cursor: pointer;
  margin-bottom: 24px;
}

/* MENU */
.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;

}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: #fff;
  font-size: 14px;
  border-bottom: solid 1px #051a0848;

  transition: background 0.2s ease, color 0.2s ease;
}

.sidebar nav a:hover,
.sidebar nav a.active {
  background: #ffffff;
  color: #2f6b4a;
}

/* TEXTO SOME AO COLAPSAR */
.sidebar.collapsed nav a span {
  display: none;
}

/* =========================
   CONTEÚDO
========================= */
.content {
  flex: 1;
  padding: 48px;
  background: linear-gradient(180deg, #2f6b4a, #2f6b4a);
}

/* =========================
   CARD
========================= */
.card {
  background: linear-gradient(135deg, #f7f2df, #f7f2df);
  padding: 5px 36px 36px 36px;
  border-radius: 18px;
  
}

/* =========================
   TÍTULOS
========================= */
h1 {
  color: #ffffff;
  font-size: 26px;
  margin-bottom: 28px;
}

h4 {
  color: #2f6b4a;
  font-size: 26px;
  margin-bottom: 28px;
}

h2 {
  color: #ffffff;
  margin: 32px 0 16px;
  font-size: 18px;
}

h3 {
  margin-bottom: 12px;
  font-size: 15px;
}

/* =========================
   SELEÇÃO DE TIPO
========================= */
.type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.type-grid button {
  background: #131A22;
  border: 2px solid #CA8F16;
  color: #FFFFFF;
  padding: 16px 20px;
  border-radius: 10px;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.25s ease;
}

.type-grid button:hover {
  background: #CA8F16;
  color: #131A22;
  transform: translateY(-2px);
}

/* =========================
   FORMULÁRIO
========================= */
.form {
  margin-top: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
}

.field-group {
  display: flex;
  gap: 16px;
  width: 100%;
}

.half {
  width: 50%;
}

label {
  font-size: 13px;
  margin-bottom: 6px;
  color: #ffffff;
}

input,
select {
  padding: 12px;
  border-radius: 8px;
  border: none;
  background: #ffffff;
  color: #2f6b4a;
}

input:focus,
select:focus {
  outline: 2px solid #CA8F16;
}

/* =========================
   INGREDIENTES ATIVOS
========================= */
.ingredient-title {
  font-size: 14px;
  font-weight: 600;
  color: #2f6b4a;
  margin-bottom: 6px;
}

.ingredients-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ingredient-item {
  background: #ffffff;
  border: 1px solid #ffffff;
  padding: 16px;
  border-radius: 14px;
  position: relative;
}

.ingredient-item select {
  background: #ffffff;
  border: 1px solid #2f6b4a;
}

.remove-ingredient {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  color: #E05A5A;
  font-size: 18px;
  cursor: pointer;
}

.add-ingredient {
  margin-top: 8px;
  background: #fff;
  border: 1px solid #ffffff;
  color: #2f6b4a;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
}

/* =========================
   AÇÕES
========================= */
.actions {
  margin-top: 32px;
  display: flex;
  gap: 16px;
}

.btn-primary {
  background: #ffffff;
  color: #131A22;
  border: none;
  padding: 12px 26px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
}

.btn-secondary {
  background: transparent;
  border: 1px solid #ffffff;
  color: #ffffff;
  padding: 11px 24px;
  border-radius: 8px;
  cursor: pointer;
}

.hidden {
  display: none;
}

/* SUBMENU */
.submenu {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.25s ease;
  padding-left: 8px;
}

.submenu.open {
  max-height: 200px;
  opacity: 1;
}

.products-toggle {
  display: flex;
  justify-content: space-between;
  cursor: pointer;
}

.products-toggle.active {
  background: #1E2A38;
  color: #CA8F16;
}

.products-toggle .arrow {
  transition: transform 0.3s ease;
}

.products-toggle.active .arrow {
  transform: rotate(90deg);
}
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1E2A38;
  color: #fff;
  padding: 14px 20px;
  border-radius: 10px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 9999;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* =========================
   TABELA - LISTAGEM DE PRODUTOS
========================= */

.table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin-top: 16px;
}

/* Tabela base */
.products-table {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
}

/* Cabeçalho */
.products-table thead {
  background: #0F151C;
}

.products-table thead th {
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #CA8F16;
  text-align: left;
  border-bottom: 1px solid #1E2A38;
}

/* Corpo */
.products-table tbody td {
  padding: 14px 16px;
  font-size: 14px;
  color: #FFFFFF;
  border-bottom: 1px solid #1E2A38;
}

/* Hover da linha */
.products-table tbody tr:hover {
  background: rgba(202, 143, 22, 0.08);
}

/* Colunas específicas */
.products-table th:nth-child(1),
.products-table td:nth-child(1) {
  width: 20%;
}

.products-table th:nth-child(2),
.products-table td:nth-child(2) {
  width: 35%;
}

.products-table th:nth-child(3),
.products-table td:nth-child(3) {
  width: 20%;
  text-transform: capitalize;
}

.products-table th:nth-child(4),
.products-table td:nth-child(4) {
  width: 15%;
  text-align: right;
}

/* Ações */
.table-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.table-actions a,
.table-actions button {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #BFC6D1;
  transition: color 0.2s ease, transform 0.2s ease;
}

.table-actions a:hover,
.table-actions button:hover {
  color: #CA8F16;
  transform: scale(1.15);
}

/* Paginação */
.pagination {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.pagination button {
  min-width: 36px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
}
/* Alinhamento explícito das colunas */
.products-table th,
.products-table td {
  text-align: left;
}

/* Ações continuam à direita */
.products-table th:last-child,
.products-table td:last-child {
  text-align: left;
}
.table-wrapper {
  background: linear-gradient(135deg, #2f6b4a, #2f6b4a);
  border-radius: 14px;
  padding: 8px;
  margin-top: 20px;
  
}

.products-table tbody tr {
  transition: background 0.2s ease;
}

.products-table tbody tr:nth-child(even) {
  background: rgba(246, 194, 194, 0.17);
  border-radius: 20px;
}

.products-table thead th {
  padding-top: 18px;
  padding-bottom: 18px;
}

/* Corpo da tabela */
.products-table tbody td {
  padding-top: 16px;
  padding-bottom: 16px;
}

.products-table tbody tr {
  height: 56px;
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.metric-card {
  background: linear-gradient(135deg, #1d462f, #1d462f);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.metric-card span {
  font-size: 13px;
  color: #BFC6D1;
}

.metric-card strong {
  font-size: 28px;
  color: #ffffff;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: auto auto;
  gap: 24px;
  margin-top: 24px;
}

/* Boxes */
.dashboard-box {
  background: linear-gradient(135deg, #2f6b4a, #2f6b4a);
  border-radius: 16px;
  padding: 24px;
}

/* Primeira linha (destaque) */
.main-box {
  min-height: 260px;
}

/* Segunda linha */
.secondary-box {
  min-height: 200px;
}

/* Título interno */
.dashboard-box h3 {
  margin-bottom: 20px;
  color: #ffffff;
  font-size: 18px;
}

/* Placeholder visual */
.placeholder {
  opacity: 0.45;
  border: 1px dashed #1E2A38;
}

/* Ajuste métricas dentro do box */
.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.dashboard-full {
  min-height: calc(100vh - 96px); /* desconta padding/header */
  display: flex;
  flex-direction: column;
}

/* Grid ocupar todo o espaço */
.dashboard-grid {
  flex: 1;
}

/* Mini listagem no dashboard */
.dashboard-products-list {
  margin-top: 24px;
  background: rgba(15, 21, 28, 0.6);
  border-radius: 12px;
  padding: 12px;
}

.dashboard-products-list table {
  width: 100%;
  border-collapse: collapse;
}

.dashboard-products-list th {
  text-align: left;
  font-size: 12px;
  color: #BFC6D1;
  padding-bottom: 8px;
}

.dashboard-products-list td {
  font-size: 13px;
  padding: 8px 0;
  border-top: 1px solid #1E2A38;
}

.dashboard-products-list td:last-child {
  text-transform: capitalize;
}

.card-dashboard {
  max-width: none;
  width: 100%;
  min-height: calc(100vh - 64px);
  padding: 5px 36px 36px 36px;
}

/* =========================
   CADASTRO DE PRODUTOS - SPLIT VIEW
========================= */

.product-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  margin-top: 24px;
}

/* MENU DE TIPO */
.product-type-menu {
  background: linear-gradient(135deg, #2f6b4a, #2f6b4a);
  border-radius: 18px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.product-type-menu .type-btn {
  background: transparent;
  border: 2px solid #ffffff;
  color: #FFFFFF;
  padding: 16px;
  border-radius: 12px;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.25s ease;
}

.product-type-menu .type-btn:hover {
  background: #ffffff;
  color: #131A22;
}

.product-type-menu .type-btn.active {
  background: #ffffff;
  color: #131A22;
}

/* FORMULÁRIO */
.product-form-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* RESPONSIVO */
@media (max-width: 1024px) {
  .product-layout {
    grid-template-columns: 1fr;
  }

  .product-type-menu {
    flex-direction: row;
  }

  .product-type-menu .type-btn {
    flex: 1;
    justify-content: center;
  }
}

/* =========================
   DIFERENCIAÇÃO DE BACKGROUND POR FORM
========================= */

/* QUÍMICOS */
.form-chemical {
  background: linear-gradient(
    135deg,
    #2f6b4a 0%,
    #2f6b4a 100%
  );
  box-shadow: inset 0 0 0 1px rgba(110, 190, 120, 0.18);
}

/* SEMENTES */
.form-seeds {
  background: linear-gradient(
    135deg,
    #2f6b4a 0%,
    #2f6b4a 100%
  );
  box-shadow: inset 0 0 0 1px rgba(110, 190, 120, 0.18);
}

/* ADUBOS */
.form-fertilizer {
  background: linear-gradient(
    135deg,
    #2f6b4a 0%,
    #2f6b4a 100%
  );
  box-shadow: inset 0 0 0 1px rgba(110, 190, 120, 0.18);
}
/* =========================
   LOGO SIDEBAR
========================= */

.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 0 24px;
}

.sidebar-logo img {
  max-width: 70px;
  border-radius: 10px;
  transition: all 0.3s ease;
}