* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, sans-serif;
  background: #f1f5f9;
  color: #0f172a;
}

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

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #020617;
}

.login-card {
  position: relative;
  width: min(420px, 100%);
  background: #fff;
  padding: 28px;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
}

.back-arrow {
  position: absolute;
  top: 18px;
  left: 18px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  color: #0f172a;
  font-size: 24px;
  font-weight: 700;
}

.back-arrow:hover {
  background: #e2e8f0;
}

.login-card h1,
.toolbar h1,
.box h2 {
  margin: 0 0 8px;
}

.login-card p,
.toolbar p {
  margin: 0 0 22px;
  color: #64748b;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 12px 13px;
  font-size: 15px;
  background: #fff;
  color: #0f172a;
}

button,
.btn {
  border: 0;
  border-radius: 10px;
  padding: 11px 14px;
  background: #0f172a;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
}

button:hover,
.btn:hover {
  background: #1e293b;
}

.danger {
  background: #dc2626;
}

.danger:hover {
  background: #b91c1c;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 24px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar div,
.topbar nav {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.topbar span {
  color: #64748b;
  font-size: 14px;
}

.topbar a {
  font-weight: 700;
  color: #0f766e;
}

.painel {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.busca {
  display: flex;
  gap: 10px;
  width: min(520px, 100%);
}

.lista {
  display: grid;
  gap: 14px;
}

.cadastro,
.box,
.empty,
.alert {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px;
}

.cadastro-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.cadastro h2 {
  margin: 0 0 5px;
  font-size: 19px;
}

.cadastro p {
  margin: 0 0 6px;
  color: #334155;
}

.cadastro small {
  color: #64748b;
}

.acoes {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.acoes form {
  margin: 0;
}

pre {
  margin: 14px 0 0;
  padding: 14px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #0f172a;
  white-space: pre-wrap;
  line-height: 1.5;
  font-family: Consolas, monospace;
  font-size: 13px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  gap: 18px;
  margin-top: 24px;
}

.edit-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.edit-form label {
  margin: 0;
}

.edit-form .full,
.form-actions {
  grid-column: span 2;
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.usuarios {
  display: grid;
  gap: 10px;
}

.usuarios a {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-radius: 10px;
  background: #f8fafc;
}

.usuarios a:hover {
  background: #e0f2fe;
}

.usuarios span {
  color: #64748b;
  font-size: 14px;
}

.alert {
  margin-bottom: 16px;
  font-weight: 700;
}

.alert.ok {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.alert.erro {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

@media (max-width: 760px) {
  .topbar,
  .toolbar,
  .cadastro-head {
    align-items: stretch;
    flex-direction: column;
  }

  .painel {
    padding: 16px;
  }

  .busca,
  .admin-grid,
  .edit-form {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .edit-form .full,
  .form-actions {
    grid-column: span 1;
  }

  .busca {
    flex-direction: column;
  }

  .acoes {
    justify-content: stretch;
  }

  .acoes button,
  .acoes .btn,
  .acoes form {
    width: 100%;
  }
}
