:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #111827;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #1d4ed8;
  --primary-dark: #1e40af;
  --danger: #b91c1c;
  --success: #047857;
  --shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(29, 78, 216, 0.10), transparent 35rem),
    var(--bg);
}

.page {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 56px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 24px;
}

.hero {
  display: grid;
  gap: 8px;
  padding: 34px;
}

.eyebrow {
  margin: 0;
  color: var(--primary);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

h1, h2, p { margin-top: 0; }

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  letter-spacing: -0.05em;
}

h2 { font-size: 1.25rem; }

.hero p:not(.eyebrow), .hint, .record p, dd {
  color: var(--muted);
}

.form-section-title {
  margin: 8px 0 10px;
  padding-top: 8px;
}

.section-hint {
  margin-bottom: 20px;
}

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

label {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  font-weight: 700;
}

input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  padding: 14px 16px;
  font: inherit;
  background: #ffffff;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.12);
}

input[type="file"] {
  background: #f8fafc;
  border-style: dashed;
}

.hint {
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.4;
}

.checkbox {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-weight: 600;
}

.checkbox input {
  width: auto;
  margin-top: 3px;
}

button {
  border: 0;
  border-radius: 14px;
  padding: 14px 18px;
  font: inherit;
  font-weight: 800;
  color: #ffffff;
  background: var(--primary);
  cursor: pointer;
  transition: transform 0.15s, background 0.15s, opacity 0.15s;
}

button:hover { background: var(--primary-dark); transform: translateY(-1px); }
button:disabled { opacity: 0.65; cursor: not-allowed; transform: none; }

button.secondary {
  background: #eff6ff;
  color: var(--primary);
  border: 1px solid #bfdbfe;
}

button.secondary:hover {
  background: #dbeafe;
}

.message {
  display: none;
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  font-weight: 700;
}

.message.show { display: block; }
.message.success { color: var(--success); background: #ecfdf5; border: 1px solid #a7f3d0; }
.message.error { color: var(--danger); background: #fef2f2; border: 1px solid #fecaca; }

.admin-token-form {
  display: grid;
  gap: 18px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.records {
  display: grid;
  gap: 18px;
}

.record {
  margin-bottom: 0;
}

.record-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.record h2 { margin-bottom: 6px; }
.record p { margin-bottom: 0; }

dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 20px;
}

dt {
  font-weight: 800;
  margin-bottom: 4px;
}

dd {
  margin: 0;
  word-break: break-word;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th, td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: #f8fafc;
  color: #334155;
}

.compact table {
  box-shadow: none;
}

.empty {
  text-align: center;
}

@media (max-width: 760px) {
  .page { width: min(100% - 20px, 1120px); padding-top: 18px; }
  .card { padding: 20px; border-radius: 20px; }
  .grid, dl { grid-template-columns: 1fr; }
  .actions { flex-direction: column; }
  button { width: 100%; }
}

.hidden {
  display: none !important;
}

button.danger {
  background: #fee2e2;
  color: var(--danger);
  border: 1px solid #fecaca;
}

button.danger:hover {
  background: #fecaca;
}

.edit-panel {
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.edit-panel form {
  margin-top: 8px;
}
