/* ===== Reset & Base ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Inter", Arial, sans-serif;
  background-color: #f3f3f3;
  display: flex;
  min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
  background-color: #000;
  color: #fff;
  width: 280px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  left: 0; top: 0;
  padding: 20px 0;
  overflow-y: auto;
}

.header-logo { text-align: center; margin-bottom: 20px; }
.header-logo img { width: 80px; height: auto; margin-bottom: 10px; }
.header-logo h3 { margin: 0; font-size: 14px; font-weight: 600; color: #fff; line-height: 1.4; padding: 0 20px; }

/* Bloco de boas-vindas */
.user-welcome {
  text-align: center;
  padding: 18px 16px 14px;
  margin: 8px 12px 5px;
  background: linear-gradient(165deg, #0f4b16 0%, #176625 100%);
  border-radius: 12px;
  box-shadow: 0 5px 16px rgba(0,0,0,0.32);
  border: 1px solid rgba(255,255,255,0.14);
  position: relative;
  overflow: hidden;
}

.user-welcome::before {
  content: '';
  position: absolute;
  top: -25px; right: -25px;
  width: 90px; height: 90px;
  background: rgba(255,255,255,0.03);
  border-radius: 50%;
}

.user-welcome::after {
  content: '';
  position: absolute;
  bottom: -15px; left: -15px;
  width: 60px; height: 60px;
  background: rgba(255,255,255,0.02);
  border-radius: 50%;
}

.user-avatar-wrapper { margin-bottom: 12px; position: relative; display: inline-block; }

.user-avatar-ring {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.22);
  pointer-events: none;
  opacity: 0.9;
}

.user-avatar {
  width: 80px; height: 80px;
  border-radius: 50%; object-fit: cover;
  border: 2px solid rgba(255,255,255,0.78);
  box-shadow: 0 3px 10px rgba(0,0,0,0.38);
  display: block;
}

.user-welcome .welcome-label {
  margin: 0 0 2px;
  font-size: 10px;
  color: rgba(255,255,255,0.75);
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.user-welcome .user-name {
  font-size: 16px; font-weight: 600; color: #fff;
  margin: 4px 0 0; display: block;
  text-shadow: none;
  letter-spacing: 0.15px;
}

.user-welcome .user-email-tag {
  display: inline-block;
  margin-top: 8px;
  font-size: 10px;
  color: rgba(255,255,255,0.86);
  background: rgba(255,255,255,0.11);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 20px;
  padding: 3px 10px;
  max-width: 220px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.menu-navigation { width: 90%; margin-top: 15px; }

.menu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 15px; margin-bottom: 8px;
  border-radius: 8px; color: #e0e0e0;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer; font-size: 14px;
}

.menu-item:hover { background-color: #1a3a1a; color: #fff; }
.menu-item.active { background-color: #039c00; color: #fff; }
.menu-item i { font-size: 18px; width: 20px; }

.menu-divider { margin-top: 20px; border-top: 1px solid #333; padding-top: 20px; }

.sidebar .logo { text-align: center; margin-top: 20px; padding-bottom: 20px; }
.sidebar .logo img { width: 90px; }
.sidebar .logo p { margin: 5px 0 0; font-weight: bold; font-size: 15px; }
.sidebar .logo small {
  background-color: #006400; color: #fff;
  padding: 3px 8px; border-radius: 5px;
  display: inline-block; margin-top: 5px; font-size: 12px;
}

/* ===== Main Content ===== */
.main-content { margin-left: 280px; padding: 30px; flex: 1; min-width: 0; }

/* ===== Page header ===== */
.page-header { text-align: center; margin-bottom: 20px; }
.page-header img { width: 130px; height: auto; margin-bottom: 12px; }

.page-title {
  color: #fff; margin-bottom: 10px;
  text-align: center; position: relative;
  display: inline-block; width: 100%;
  padding: 12px 0; font-size: 22px; font-weight: 700;
}

.page-title::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #013a00, #026b00);
  border-radius: 10px;
  width: 100%; height: 100%;
  z-index: -1; max-width: 700px;
}

/* ===== Buttons ===== */
.btn {
  padding: 14px 40px; border: none;
  border-radius: 8px; font-weight: 600; font-size: 16px;
  cursor: pointer; transition: all 0.3s ease;
  display: flex; align-items: center; gap: 8px;
}

.btn-primary { background-color: #039c00; color: #fff; }
.btn-primary:hover { background-color: #04b800; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(3,156,0,0.3); }

.btn-secondary { background-color: #4a6b4a; color: #fff; }
.btn-secondary:hover { background-color: #5a7b5a; }

.btn-small {
  padding: 8px 16px; font-size: 13px;
  border: none; border-radius: 6px;
  cursor: pointer; transition: all 0.3s ease;
  display: flex; align-items: center; gap: 6px;
}

.btn-view { background-color: #039c00; color: #fff; }
.btn-view:hover { background-color: #04b800; }
.btn-edit { background-color: #007bff; color: #fff; }
.btn-edit:hover { background-color: #0056b3; }

/* ===== Modal ===== */
.modal {
  display: none; position: fixed;
  z-index: 1000; left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  justify-content: center; align-items: center;
}

.modal-content {
  background: #fff; border-radius: 12px;
  padding: 40px; text-align: center;
  max-width: 500px; width: 90%;
  animation: slideIn 0.3s ease;
  position: relative; max-height: 90vh; overflow-y: auto;
}

@keyframes slideIn {
  from { transform: translateY(-50px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

.modal-content i.fa-check-circle { font-size: 60px; color: #039c00; margin-bottom: 20px; }
.modal-content h3 { color: #024d00; margin-bottom: 15px; font-size: 24px; }
.modal-content p  { color: #666; margin-bottom: 25px; line-height: 1.6; }

.close-btn { position: absolute; top: 15px; right: 20px; background: none; border: none; font-size: 24px; cursor: pointer; color: #666; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  /* body é flex-row no desktop (sidebar | conteúdo); no mobile empilha em coluna
     para o conteúdo cair ABAIXO da sidebar, não ser empurrado pra fora da tela. */
  body { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: relative; }
  .main-content { margin-left: 0; padding: 20px; width: 100%; }
  .btn { width: 100%; justify-content: center; }
}
