/* ===== BASIC RESET ===== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: #0f172a; /* Solid dark background, no looping */
  color: #e5e7eb;
  font-size: 16px; /* Stable base size */
}

/* ===== LAYOUT ===== */
.centered {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

/* Fluid card */
.card {
  width: 100%;
  max-width: 500px;
  background: #111827;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.card h2,
.card h3 {
  margin-top: 0;
  font-size: 1.4rem;
}

/* ===== FORM ELEMENTS ===== */
input,
select,
button {
  width: 100%;
  padding: 0.75rem;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  border-radius: 8px;
  border: 1px solid #374151;
  background: #020617;
  color: #e5e7eb;
  font-size: 1rem;
}

input:focus,
select:focus {
  outline: none;
  border-color: #3b82f6;
}

button {
  background: #3b82f6;
  border: none;
  font-weight: 600;
  cursor: pointer;
}

button:hover {
  background: #1d4ed8;
}

/* ===== MESSAGES ===== */
.error {
  color: #ef4444;
}
.success {
  color: #22c55e;
}

/* ===== TOPBAR ===== */
.topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #1f2937;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.topbar-nav a {
  color: #9ca3af;
  text-decoration: none;
}

.topbar-nav a:hover {
  color: #e5e7eb;
}

/* ===== PAGE ===== */
.page {
  padding: 1rem;
  max-width: 900px;
  margin: 0 auto;
}

/* ===== LIST ===== */
.list {
  list-style: none;
  padding: 0;
  margin-top: 1rem;
}

.list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #020617;
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  margin-bottom: 0.5rem;
}

.delete {
  color: #ef4444;
  text-decoration: none;
}

/* ===== TABLE ===== */
.scroll-x {
  overflow-x: auto;
}

.table {
  width: 100%;
  min-width: 500px; /* Forces scroll on small screens */
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 0.6rem;
  border-bottom: 1px solid #1f2937;
  text-align: left;
}

.table th {
  color: #9ca3af;
}

/* ===== DASHBOARD ===== */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.metric {
  font-size: 1.6rem;
  font-weight: 600;
}

/* ===== BUTTON ROW ===== */
.button-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.btn {
  display: inline-block;
  text-align: center;
  padding: 0.75rem;
  border-radius: 8px;
  background: #3b82f6;
  color: #e5e7eb;
  text-decoration: none;
  font-weight: 600;
}

.btn.secondary {
  background: #020617;
  border: 1px solid #374151;
}

/* ===== TABLET / DESKTOP ===== */
@media (min-width: 640px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .button-row {
    flex-direction: row;
  }
}
