﻿/* ==========================================
   🌐 RESET E BASE GERAL
   ========================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", "Segoe UI", Roboto, sans-serif;
  background-color: #f5f7fb;
  color: #1e293b;
  display: flex;
  height: 100vh;
}

/* ==========================================
   🧱 ESTRUTURA DE LAYOUT
   ========================================== */
.container {
  display: flex;
  width: 100%;
}

/* ======== SIDEBAR ======== */
.sidebar {
  width: 250px;
  background: linear-gradient(180deg, #1e3a8a, #1e40af);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: width 0.3s ease, transform 0.3s ease;
  box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
}

.sidebar h2 {
  text-align: center;
  padding: 22px 0;
  font-weight: 600;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar a {
  display: block;
  color: #fff;
  text-decoration: none;
  padding: 14px 24px;
  transition: background 0.2s ease, padding-left 0.2s;
  font-weight: 500;
}

.sidebar a:hover {
  background: rgba(255, 255, 255, 0.15);
  padding-left: 32px;
}

.sidebar a.active {
  background: rgba(255, 255, 255, 0.25);
  font-weight: 600;
}

.sidebar .logout {
  background: #ef4444;
  color: white;
  text-align: center;
  margin: 20px;
  padding: 10px;
  border-radius: 8px;
  transition: background 0.3s ease;
}

.sidebar .logout:hover {
  background: #dc2626;
}

/* ======== CONTEÚDO PRINCIPAL ======== */
.main-content {
  flex: 1;
  margin-left: 5px;
  padding: 30px;
  overflow-y: auto;
  transition: margin-left 0.3s ease;
  position: relative;
}

.header {
  background: #2563eb;
  color: #fff;
  padding: 18px 24px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
  margin-bottom: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header h1 {
  font-size: 1.6rem;
  margin: 0;
}

.header p {
  font-size: 0.95rem;
  opacity: 0.9;
}

/* ==========================================
   📱 MENU RESPONSIVO
   ========================================== */
.toggle-menu {
  display: none;
  background: #1e40af;
  color: white;
  border: none;
  padding: 10px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.2rem;
}

.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 99;
}

/* ==========================================
   🧾 CARDS DE RESUMO
   ========================================== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 25px;
}

.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.07);
  padding: 25px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, #2563eb, #1e40af);
}

.card h3 {
  font-size: 1.1rem;
  margin: 15px 0 10px;
  color: #1e293b;
}

.card p {
  font-size: 1.4rem;
  font-weight: 600;
  color: #2563eb;
}

/* ==========================================
   🔍 CAIXA DE PESQUISA
   ========================================== */
.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-box input {
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 5px;
  width: 250px;
}

/* ==========================================
   ⚠️ MENSAGENS (SUCESSO / ERRO)
   ========================================== */
.message,
.alert {
  padding: 12px;
  margin: 15px 0;
  border-radius: 5px;
  text-align: center;
  font-weight: 500;
  border: 1px solid transparent;
}

.message.success,
.alert.sucesso {
  background: #d4edda;
  color: #155724;
  border-color: #c3e6cb;
}

.message.error,
.alert.erro {
  background: #f8d7da;
  color: #721c24;
  border-color: #f5c6cb;
}

/* ==========================================
   📊 TABELAS DE DADOS
   ========================================== */
.table-container {
  margin-top: 20px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  background: #007bff;
  color: #fff;
  text-align: left;
  padding: 12px;
}

td {
  padding: 10px;
  border-bottom: 1px solid #ddd;
}

tr:hover {
  background: #f9f9f9;
}

/* ==========================================
   🔘 BOTÕES PADRÃO
   ========================================== */
.btn, button, a.button-voltar {
  display: inline-block;
  padding: 10px 15px;
  border: none;
  border-radius: 5px;
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
  transition: opacity 0.2s ease, background 0.3s ease;
}

.btn-add { background: #28a745; color: #fff; }
.btn-edit { background: #007bff; color: #fff; }
.btn-delete { background: #dc3545; color: #fff; }

button { background: #007bff; color: #fff; }
button:hover, .btn:hover { opacity: 0.95; }

a.button-voltar {
  color: #007bff;
  border: 1px solid #007bff;
  background: transparent;
}
a.button-voltar:hover { background: #f0f8ff; }

/* ==========================================
   📋 FORMULÁRIOS
   ========================================== */
.form-container {
  margin: 20px auto;
  max-width: 600px;
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.form-container h2 {
  margin-bottom: 15px;
  font-size: 20px;
  border-bottom: 2px solid #007bff;
  padding-bottom: 5px;
}

label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="file"],
select {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 5px;
}

/* ==========================================
   ✍️ CANVAS (ASSINATURA)
   ========================================== */
#canvasAssinatura {
  border: 1px dashed #ccc;
  border-radius: 5px;
  width: 100%;
  height: 150px;
}

.controls {
  margin-top: 5px;
  margin-bottom: 15px;
}

.assinatura-preview img {
  border: 1px solid #eee;
  border-radius: 4px;
  background: #f9f9f9;
}

/* ==========================================
   ⚙️ SCROLLBAR PERSONALIZADA
   ========================================== */
.main-content::-webkit-scrollbar { width: 8px; }
.main-content::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 6px;
}
.main-content::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* ==========================================
   📱 RESPONSIVIDADE GERAL
   ========================================== */
@media (max-width: 768px) {
  body {
    display: block;
    height: auto;
    overflow: auto;
  }

  .sidebar {
    position: fixed;
    width: 200px;
    height: 100vh;
    z-index: 100;
    transform: translateX(-200px);
  }

  .sidebar.active { transform: translateX(0); }
  .overlay.active { display: block; }

  .main-content {
    margin-left: 0;
    padding: 20px;
    width: 100%;
    overflow-y: visible;
  }

  .header {
    padding: 15px;
  }

  .header h1 { font-size: 1.3rem; }

  .toggle-menu {
    display: block;
    margin-left: 10px;
  }
}
.section-title {
      margin-top: 20px;
      font-size: 18px;
      font-weight: 600;
      color: #1e3a8a;
      border-bottom: 2px solid #2563eb;
      padding-bottom: 5px;
    }
    .form-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
      gap: 15px;
    }

/* --- Estilos para Seção de Peças --- */

/* Alinha os campos e o botão de remover na mesma linha */
.peca-linha {
    /* Assumindo que seu .form-grid já usa display: grid */
    grid-template-columns: 2fr 4fr 1fr 1fr; /* Ajuste as proporções conforme necessário */
    gap: 15px;
    align-items: flex-end; /* Alinha na parte de baixo */
}

.peca-acao {
    padding-bottom: 5px; /* Ajusta a altura do botão de remover */
}

/* Botão de Adicionar Peça */
.btn-add-peca {
    background-color: #007bff; /* Azul */
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
}
.btn-add-peca:hover {
    background-color: #0056b3;
}

/* Botão de Remover Peça */
.btn-remover {
    background-color: #dc3545; /* Vermelho */
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    width: 100%;
}
.btn-remover:hover {
    background-color: #c82333;
}
.btn-remover:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}
/* Estilos para a lista de fotos existentes */
    .fotos-existentes {
      display: flex;
      flex-wrap: wrap;
      gap: 15px;
      margin-top: 10px;
    }
    .foto-item {
      border: 1px solid #ddd;
      border-radius: 5px;
      padding: 10px;
      width: 150px;
      text-align: center;
      background: #f9f9f9;
    }
    .foto-item img {
      width: 100%;
      height: 100px;
      object-fit: cover;
      margin-bottom: 10px;
    }
    .foto-item label {
      font-size: 0.9em;
      color: #c00;
      cursor: pointer;
    }

/* --- Estilos do Gráfico no Dashboard --- */
.grafico-container {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    margin-top: 25px;
}

.grafico-container h2 {
    margin-top: 0;
    text-align: center;
}

.grafico-pizza {
    /* Limita o tamanho do gráfico */
    max-width: 450px;
    margin: 20px auto 0 auto;
}

.login-footer {
  text-align: center;
  margin-top: 30px;
  font-size: 0.9em;
  color: #888;
}