*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0f172a;
  color: #e5e7eb;
}

header {
  padding: 1.25rem 1.5rem;
  background: linear-gradient(to right, #0f172a, #1e293b);
  border-bottom: 1px solid #1f2937;
}

header h1 {
  margin: 0;
  font-size: 1.35rem;
}

main {
  max-width: 1100px;
  margin: 1.5rem auto 2.5rem;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}

.card {
  background: rgba(15, 23, 42, 0.95);
  border-radius: 0.75rem;
  padding: 1.25rem 1.3rem 1.3rem;
  border: 1px solid #1f2937;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

.card h2 {
  margin-top: 0;
  margin-bottom: 0.8rem;
  font-size: 1.1rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.86rem;
  color: #9ca3af;
}

input[type="text"],
input[type="file"] {
  border-radius: 0.45rem;
  border: 1px solid #374151;
  background: #020617;
  color: #e5e7eb;
  padding: 0.45rem 0.5rem;
  font-size: 0.9rem;
}

input[type="file"] {
  padding: 0.35rem 0.5rem;
}

button {
  align-self: flex-start;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: none;
  font-size: 0.9rem;
  cursor: pointer;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  color: white;
  font-weight: 500;
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.35);
  transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.1s ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 16px 40px rgba(37, 99, 235, 0.5);
}

button:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.9);
}

.status {
  margin-top: 0.3rem;
  font-size: 0.85rem;
  min-height: 1.2rem;
}

.status.ok {
  color: #22c55e;
}

.status.error {
  color: #f97373;
}

.faces-grid {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
  max-height: 420px;
  overflow-y: auto;
}

.face-card {
  background: #020617;
  border-radius: 0.7rem;
  padding: 0.55rem 0.55rem 0.7rem;
  border: 1px solid #111827;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.face-card img {
  width: 100%;
  border-radius: 0.55rem;
  object-fit: cover;
  aspect-ratio: 4 / 5;
  background: #020617;
}

.face-card-id {
  font-size: 0.8rem;
  color: #e5e7eb;
  word-break: break-all;
}

.face-card-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.25rem;
  align-items: center;
}

.face-card button {
  padding: 0.25rem 0.6rem;
  font-size: 0.78rem;
  border-radius: 999px;
  box-shadow: none;
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #f97316);
  box-shadow: 0 10px 25px rgba(239, 68, 68, 0.4);
}

footer {
  max-width: 1100px;
  margin: 0 auto 1.2rem;
  padding: 0 1rem;
  font-size: 0.8rem;
  color: #6b7280;
}

code {
  background: #020617;
  padding: 0.12rem 0.35rem;
  border-radius: 0.3rem;
  border: 1px solid #111827;
}

@media (max-width: 640px) {
  main {
    grid-template-columns: 1fr;
  }
}

