* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #f5f2ec;
  --bg-2: #efebe3;
  --white: #ffffff;
  --dark: #141318;
  --dark-2: #1c1b22;
  --text: #1a1714;
  --muted: #6d6963;
  --line: rgba(0, 0, 0, 0.08);
  --line-soft: #ece7df;
  --steel: #4e7a9b;
  --steel-2: #2c5470;
  --steel-hi: #7fb3d3;
  --success-bg: #e6f4ea;
  --success-line: #b7e1c1;
  --success-text: #245c32;
  --danger-bg: #fdecec;
  --danger-line: #f5c6cb;
  --danger-text: #a94442;
  --info-bg: #e7f2fb;
  --info-line: #cce1f1;
  --info-text: #255d85;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
}

.topbar {
  background: var(--dark);
  color: var(--white);
  padding: 18px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.topbar h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.topbar a {
  color: var(--white);
  text-decoration: none;
  background: linear-gradient(135deg, var(--steel-2), var(--steel));
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  box-shadow: 0 8px 24px rgba(78, 122, 155, 0.25);
}

.topbar a:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px;
}

.msg {
  background: var(--success-bg);
  border: 1px solid var(--success-line);
  color: var(--success-text);
  padding: 14px 16px;
  border-radius: 12px;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.6;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

.card h2 {
  font-family: 'Outfit', sans-serif;
  margin-bottom: 18px;
  font-size: 22px;
  line-height: 1.2;
  color: var(--text);
}

.form-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.form-title .cancel {
  text-decoration: none;
  font-size: 13px;
  color: #666;
  background: #f1efea;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #e4ded4;
  transition: background 0.2s ease, transform 0.2s ease;
}

.form-title .cancel:hover {
  background: #eae6de;
  transform: translateY(-1px);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
}

.field label {
  font-size: 13px;
  margin-bottom: 6px;
  color: #5a5752;
  font-weight: 500;
}

.field input,
.field textarea,
.field select {
  border: 1px solid #ddd;
  background: #faf9f7;
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--steel-hi);
  box-shadow: 0 0 0 3px rgba(127, 179, 211, 0.18);
  background: #fff;
}

.field textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.6;
}

.full {
  grid-column: 1 / -1;
}

button {
  border: none;
  background: linear-gradient(135deg, var(--steel-2), var(--steel));
  color: var(--white);
  padding: 12px 18px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  margin-top: 10px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  box-shadow: 0 10px 24px rgba(78, 122, 155, 0.24);
}

button:hover {
  transform: translateY(-1px);
  opacity: 0.98;
}

.list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.item {
  background: #faf9f7;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 16px;
}

.item strong {
  display: block;
  margin-bottom: 6px;
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  color: var(--text);
}

.small {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

.item-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.btn-edit,
.btn-del {
  display: inline-block;
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

.btn-edit {
  background: var(--info-bg);
  color: var(--info-text);
  border: 1px solid var(--info-line);
}

.btn-del {
  background: var(--danger-bg);
  color: var(--danger-text);
  border: 1px solid var(--danger-line);
}

.btn-edit:hover,
.btn-del:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

.photo-preview {
  width: 160px;
  height: 200px;
  border-radius: 20px;
  object-fit: cover;
  border: 1px solid #ddd;
  margin-top: 10px;
  display: block;
  background: #f0ede7;
}

input[type="file"] {
  padding: 10px 12px;
  background: #faf9f7;
}

textarea::placeholder {
  color: #9a948c;
}

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #8b8b8b 50%), linear-gradient(135deg, #8b8b8b 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(1em + 2px), calc(100% - 13px) calc(1em + 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

@media (max-width: 900px) {
  .wrap {
    padding: 20px;
  }

  .card {
    padding: 20px;
  }

  .card h2 {
    font-size: 20px;
  }
}

@media (max-width: 800px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    padding: 16px 18px;
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar h1 {
    font-size: 20px;
  }

  .wrap {
    padding: 16px;
  }

  .card {
    border-radius: 16px;
  }
}

@media (max-width: 520px) {
  .topbar a {
    width: 100%;
    text-align: center;
  }

  .item-actions {
    flex-direction: column;
  }

  .btn-edit,
  .btn-del {
    width: 100%;
    text-align: center;
  }

  .photo-preview {
    width: 100%;
    max-width: 220px;
    height: auto;
    aspect-ratio: 4 / 5;
  }
}

/* --- Estilos da tela de Login --- */
.login-body {
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(135deg, #141318, #1c1b22);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: #fff;
}

.login-box {
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 20px;
  padding: 32px;
  backdrop-filter: blur(16px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}

.login-box h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 28px;
  margin-bottom: 8px;
}

.login-box p {
  color: rgba(255, 255, 255, .65);
  margin-bottom: 24px;
  font-size: 14px;
}

.login-form label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: rgba(255, 255, 255, .8);
}

.login-form input {
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .06);
  color: #fff;
  outline: none;
  transition: 0.3s;
}

.login-form input:focus {
  border-color: #7fb3d3;
  background: rgba(255, 255, 255, .1);
}

.login-form button {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #2c5470, #4e7a9b);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
}

.login-form button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.erro-msg {
  background: rgba(255, 70, 70, .12);
  border: 1px solid rgba(255, 70, 70, .25);
  color: #ffb6b6;
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 14px;
}

.login-foot {
  margin-top: 16px;
  font-size: 12px;
  color: rgba(255, 255, 255, .45);
  text-align: center;
}