* {
  box-sizing: border-box;
}

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

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 22px;
  background: #111827;
  border-bottom: 1px solid #334155;
}

.topbar h1 {
  margin: 0;
  font-size: 28px;
}

.topbar p,
.hero p,
.app-card p {
  color: #cbd5e1;
}

button,
.app-card a,
.top-button {
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  background: #2563eb;
  color: white;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  display: inline-block;
}

button.secondary {
  background: #475569;
  margin-top: 8px;
}

button.danger {
  background: #dc2626;
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.top-actions form {
  margin: 0;
}

main {
  padding: 22px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.app-card,
.modal-card,
.notice {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  margin-bottom: 18px;
}

.notice.success {
  border-color: #22c55e;
}

.notice.error,
p.error {
  border-color: #ef4444;
  color: #fecaca;
}

.app-card img {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: #0f172a;
}

.app-card h3 {
  margin: 12px 0 4px;
}

.app-card .meta {
  color: #93c5fd;
  font-size: 14px;
  font-weight: 700;
}

footer {
  padding: 22px;
  color: #94a3b8;
}

input,
select,
textarea {
  width: 100%;
  padding: 13px;
  margin: 6px 0 14px;
  border-radius: 10px;
  border: 1px solid #475569;
  background: #0f172a;
  color: #f8fafc;
}

textarea {
  min-height: 90px;
}

label {
  display: block;
  font-weight: 700;
  color: #cbd5e1;
}

.modal[hidden] {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.72);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 9999;
}

.modal-card {
  max-width: 420px;
  width: 100%;
}

.modal-card ol {
  color: #cbd5e1;
  line-height: 1.7;
}

.admin-list {
  display: grid;
  gap: 12px;
}

.admin-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid #334155;
  border-radius: 14px;
  background: #0f172a;
}

.admin-row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.admin-row-actions form {
  margin: 0;
}

small {
  color: #94a3b8;
}

@media (max-width: 700px) {
  .topbar,
  .top-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  button,
  .app-card a,
  .top-button {
    width: 100%;
    text-align: center;
  }

  .admin-row {
    grid-template-columns: 1fr;
  }

  .admin-row-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
