:root {
  --bg: #070b16;
  --panel: rgba(15, 23, 42, 0.86);
  --panel2: rgba(17, 34, 64, 0.78);
  --line: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #94a3b8;
  --blue: #38bdf8;
  --blue2: #2563eb;
  --red: #ef4444;
  --green: #22c55e;
  --amber: #f59e0b;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  background: radial-gradient(circle at top, #0f172a 0, #070b16 45%, #030712 100%);
  color: var(--text);
}

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

.bg-glow {
  position: fixed;
  width: 360px;
  height: 360px;
  border-radius: 999px;
  filter: blur(80px);
  opacity: 0.22;
  pointer-events: none;
  z-index: -1;
}

.bg-glow-1 {
  top: 70px;
  left: -120px;
  background: var(--blue);
}

.bg-glow-2 {
  right: -120px;
  bottom: 80px;
  background: var(--blue2);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 16px 28px;
  background: rgba(3, 7, 18, 0.74);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--blue), var(--blue2));
  color: white;
  font-weight: 900;
  box-shadow: var(--shadow);
}

.brand b {
  display: block;
  font-size: 16px;
}

.brand small {
  color: var(--muted);
}

.topnav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topnav a:not(.btn) {
  color: var(--muted);
  padding: 10px 12px;
  border-radius: 12px;
}

.topnav a:not(.btn):hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.page {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 34px 0 70px;
}

.hero {
  min-height: 300px;
  display: flex;
  align-items: center;
  padding: 38px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(56, 189, 248, 0.16), rgba(37, 99, 235, 0.08)),
    var(--panel);
  box-shadow: var(--shadow);
  margin-bottom: 26px;
}

.hero h1,
.page-head h1 {
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1;
  margin: 10px 0 14px;
  letter-spacing: -1.5px;
}

.hero p,
.page-head p {
  max-width: 750px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.badge,
.required-mark,
.user-pill,
.count {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #bae6fd;
  background: rgba(56, 189, 248, 0.08);
  font-size: 12px;
}

.user-pill {
  border-color: rgba(148, 163, 184, 0.28);
  color: var(--text);
  background: rgba(148, 163, 184, 0.08);
}

.required-mark {
  border-color: rgba(245, 158, 11, 0.35);
  color: #fde68a;
  background: rgba(245, 158, 11, 0.08);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 14px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  background: linear-gradient(135deg, var(--blue), var(--blue2));
  color: white;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 14px 35px rgba(37, 99, 235, 0.26);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-big {
  min-height: 52px;
  padding: 13px 22px;
  font-size: 16px;
}

.btn-secondary {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.24);
  color: var(--text);
  box-shadow: none;
}

.btn-ghost {
  background: transparent;
  box-shadow: none;
  color: var(--muted);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.32);
  color: #fecaca;
  box-shadow: none;
}

.btn-small {
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 11px;
  font-size: 13px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.card,
.form-card,
.admin-card,
.empty-box {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 24px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.card-head,
.admin-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.card h2,
.admin-card h2,
.nested-card h3 {
  margin: 0 0 8px;
}

.muted,
.help,
.meta,
.empty {
  color: var(--muted);
}

.sub-list {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.sub-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.sub-link:hover {
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.08);
}

.sub-link small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.sub-link em,
.field-line em {
  color: #fde68a;
  font-style: normal;
  font-size: 12px;
}

.page-head {
  margin-bottom: 24px;
}

.back {
  color: var(--blue);
  font-weight: 700;
}

.alert {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  margin: 16px 0;
}

.alert-success {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.3);
  color: #bbf7d0;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fecaca;
}

.form-card {
  max-width: 860px;
}

.admin-form {
  max-width: 980px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-weight: 800;
  margin-bottom: 8px;
}

.star {
  color: #f87171;
}

input,
textarea,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 15px;
  padding: 12px 14px;
  background: rgba(2, 6, 23, 0.62);
  color: var(--text);
  outline: none;
}

textarea {
  min-height: 130px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(56, 189, 248, 0.58);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.08);
}

.choice-list {
  display: grid;
  gap: 9px;
}

.choice,
.switch-line {
  display: flex !important;
  align-items: center;
  gap: 10px;
  margin: 0 !important;
  padding: 12px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
}

.choice input,
.switch-line input {
  width: 18px;
  min-height: 18px;
}

.two-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.dropzone {
  position: relative;
  border: 2px dashed rgba(56, 189, 248, 0.38);
  background: rgba(56, 189, 248, 0.06);
  border-radius: 18px;
  min-height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 18px;
  overflow: hidden;
}

.dropzone.dragover {
  border-color: var(--green);
  background: rgba(34, 197, 94, 0.08);
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  min-height: 100%;
}

.drop-content {
  display: grid;
  gap: 6px;
  pointer-events: none;
}

.drop-content b {
  font-size: 18px;
}

.drop-content span,
.drop-content small {
  color: var(--muted);
}

.file-list {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
  color: #dbeafe;
  font-size: 13px;
  pointer-events: none;
}

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

.admin-actions,
.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.row-actions form {
  margin: 0;
}

.admin-list,
.nested,
.submissions {
  display: grid;
  gap: 18px;
}

.nested {
  margin-top: 18px;
}

.nested-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  border-radius: 20px;
  padding: 16px;
}

.field-table {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.field-line {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 11px 12px;
  background: rgba(2, 6, 23, 0.38);
}

.field-line span {
  color: var(--blue);
  margin-left: 8px;
  font-size: 13px;
}

details {
  margin-top: 14px;
}

summary {
  cursor: pointer;
  color: var(--blue);
  font-weight: 700;
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(2, 6, 23, 0.72);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 14px;
  color: #dbeafe;
  overflow: auto;
}

.empty-box {
  text-align: center;
  padding: 44px 24px;
}

.footer {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto 30px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}

@media (max-width: 860px) {
  .topbar,
  .admin-head,
  .admin-row,
  .card-head,
  .field-line {
    flex-direction: column;
    align-items: stretch;
  }

  .topnav,
  .admin-actions,
  .row-actions {
    justify-content: flex-start;
  }

  .grid,
  .two-cols {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 24px;
  }
}
