:root {
  --bg: #0f172a;
  --bg-alt: #141c31;
  --card: #182645;
  --accent: #4ade80;
  --accent-dark: #22c55e;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --danger: #f87171;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #1e2a47 0%, #0b1222 45%, #05080f 100%);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: rgba(10, 15, 28, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.top-bar nav a {
  color: var(--muted);
  text-decoration: none;
  margin-right: 1rem;
  font-weight: 500;
}

.top-bar nav a:hover {
  color: var(--text);
}

.top-bar form button {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
}

main {
  flex: 1;
  width: min(1100px, 100%);
  margin: 2rem auto;
  padding: 0 1.5rem 4rem;
}

h1, h2 {
  font-weight: 600;
}

.card {
  background: var(--card);
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: 0 25px 40px rgba(2, 6, 23, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.card.narrow {
  width: min(420px, 100%);
  margin: 3rem auto;
}

.flash {
  margin: 1rem auto;
  padding: 0.9rem 1.2rem;
  border-radius: 12px;
  background: rgba(74, 222, 128, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: var(--accent);
  width: min(600px, 100%);
}

.flash.error {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.45);
  color: var(--danger);
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
}

.table th,
.table td {
  text-align: left;
  padding: 0.8rem 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.table th {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.table-actions {
  display: flex;
  gap: 0.6rem;
}

.quick-edit {
  margin-top: 0.8rem;
}

.quick-edit summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.quick-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.8rem;
  margin-top: 0.5rem;
}

.quick-form label {
  font-size: 0.85rem;
  color: var(--muted);
}

.quick-form button {
  grid-column: 1 / -1;
  justify-self: flex-start;
}

.steps {
  counter-reset: step;
  padding-left: 1.2rem;
}

.steps li {
  margin-bottom: 0.35rem;
}

.button,
button,
input[type="submit"] {
  background: var(--accent);
  color: #04120b;
  border: none;
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

button.secondary,
.button.secondary {
  background: rgba(148, 163, 184, 0.2);
  color: var(--text);
}

button.danger,
.button.danger {
  background: rgba(248, 113, 113, 0.15);
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.4);
}

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

.form label {
  display: flex;
  flex-direction: column;
  font-size: 0.95rem;
  color: var(--muted);
}

.form input,
.form select,
.form textarea {
  margin-top: 0.35rem;
  background: var(--bg-alt);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  color: var(--text);
  font-size: 1rem;
}

.form textarea {
  min-height: 120px;
  resize: vertical;
}

.hint {
  font-size: 0.82rem;
  color: rgba(148, 163, 184, 0.8);
  margin-top: -0.4rem;
}

.actions-row {
  display: flex;
  justify-content: space-between;
  margin-top: 1.5rem;
}

.code-block {
  background: var(--bg-alt);
  padding: 1.2rem;
  border-radius: 12px;
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 0.9rem;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

footer {
  text-align: center;
  color: var(--muted);
  padding: 1rem 0 2rem;
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  .top-bar {
    flex-direction: column;
    gap: 0.8rem;
  }
  .table th,
  .table td {
    font-size: 0.85rem;
  }
}
