:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #182230;
  --muted: #627083;
  --border: #dbe3ee;
  --accent: #2458e6;
  --accent-dark: #1a43b1;
  --soft: #eef3ff;
  --danger: #b42318;
  --success: #027a48;
  --shadow: 0 20px 50px rgba(17, 30, 54, 0.09);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #dfe9ff 0, transparent 35%), var(--bg);
  color: var(--text);
  line-height: 1.5;
}

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

.narrow { width: min(680px, calc(100% - 32px)); }

.card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.hero, .admin-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 34px;
  margin-bottom: 24px;
}

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

h1, h2 { line-height: 1.15; margin: 0 0 12px; }
h1 { font-size: clamp(2rem, 4vw, 4rem); max-width: 760px; }
h2 { font-size: 1.35rem; }

.lead {
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 720px;
  margin: 0;
}

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

.hero-badge {
  flex: 0 0 220px;
  background: var(--soft);
  border: 1px solid #ccdaff;
  border-radius: 20px;
  padding: 20px;
}

.hero-badge span { color: var(--muted); display: block; font-size: 0.92rem; }
.hero-badge strong { display: block; margin-top: 6px; font-size: 1.2rem; }

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
}

.form-card, .side-card, .token-card, .table-card, .center-card { padding: 28px; }

label {
  display: block;
  margin: 18px 0;
  font-weight: 700;
}

input, select, textarea {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 14px 15px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

input:focus, select:focus, textarea:focus {
  outline: 3px solid rgba(36, 88, 230, 0.18);
  border-color: var(--accent);
}

textarea { resize: vertical; }

button, .button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 14px;
  padding: 13px 18px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  font: inherit;
}

button:hover, .button-link:hover { background: var(--accent-dark); }
button:disabled { opacity: 0.65; cursor: wait; }
button.secondary, .muted-link {
  background: #edf2f7;
  color: var(--text);
}
button.secondary:hover, .muted-link:hover { background: #e1e8f0; }

.secondary-link {
  display: inline-flex;
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
  margin-top: 18px;
}

.check-list {
  padding-left: 0;
  list-style: none;
}

.check-list li {
  padding: 10px 0 10px 30px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: 900;
}

.status { min-height: 24px; font-weight: 700; }
.status.error { color: var(--danger); }
.status.success { color: var(--success); }
.hidden-field, .hidden { display: none !important; }
.center-card { text-align: center; margin-top: 10vh; }

.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.table-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.table-tools input { max-width: 320px; margin-top: 0; }
.responsive-table { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

th, td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  font-size: 0.92rem;
}

th { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; }
td.message-cell { max-width: 320px; white-space: pre-wrap; }

@media (max-width: 880px) {
  .hero, .admin-header { align-items: flex-start; flex-direction: column; padding: 24px; }
  .hero-badge { flex: auto; width: 100%; }
  .grid { grid-template-columns: 1fr; }
  .page-shell { padding: 24px 0; }
  .table-tools { flex-direction: column; align-items: stretch; }
  .table-tools input { max-width: none; }
}
