:root {
  --bg: #0b0e14;
  --bg-2: #121724;
  --card: #141926;
  --border: #232a3b;
  --text: #e6e9f0;
  --muted: #8b93a7;
  --accent: #4f8cff;
  --accent-h: #6ba0ff;
  --ok: #2fbf71;
  --bad: #ff5c5c;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(79, 140, 255, .14), transparent 60%),
    radial-gradient(900px 500px at 90% 0%, rgba(47, 191, 113, .08), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.center {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 560px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
}

.page {
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 16px 64px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.page .card { max-width: none; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}

.brand {
  font-weight: 700;
  letter-spacing: .2px;
  color: var(--accent);
}

h1 { margin: 8px 0 4px; font-size: 24px; }
h2 { margin: 0 0 14px; font-size: 19px; }

.muted { color: var(--muted); }
.link { color: var(--accent); text-decoration: none; }
.link:hover { color: var(--accent-h); }

.input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  outline: none;
}

.input:focus { border-color: var(--accent); }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 14px; }

#code-form, #login-form, .grant-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.grant-row {
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
}

.grant-row .input { width: 110px; }

.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}

.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-h); }

.btn-danger {
  background: rgba(255, 92, 92, .1);
  border-color: rgba(255, 92, 92, .35);
  color: var(--bad);
}
.btn-danger:hover { background: rgba(255, 92, 92, .2); }

.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.check input { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }

.btn-block { width: 100%; }

.link-row {
  display: flex;
  gap: 8px;
  margin: 6px 0 12px;
}
.link-row .input { flex: 1; }

.label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin: 12px 0 4px;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  margin-top: 14px;
}

.alert {
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 600;
  margin-top: 12px;
}
.alert.ok { background: rgba(47, 191, 113, .12); color: var(--ok); }
.alert.error { background: rgba(255, 92, 92, .12); color: var(--bad); }

.hidden { display: none; }

/* user: инфо о доступе после ввода кода */

.info-list {
  margin: 14px 0 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 9px 12px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--muted); white-space: nowrap; }
.info-value { font-weight: 600; text-align: right; }
.st-ok { color: var(--ok); }
.st-bad { color: var(--bad); }

.traf { margin: 8px 0 4px; }

.traf-track {
  height: 8px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.traf-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 999px;
  transition: width .3s ease;
}

.traf-bottom {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-top: 5px;
}

/* admin table */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th, .table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table tr:last-child td { border-bottom: none; }
.table th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.col-check { width: 34px; }
.col-actions { width: 210px; text-align: right; }

.col-actions .btn { padding: 6px 10px; font-size: 13px; margin-left: 6px; }

.toolbar {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  justify-content: space-between;
}

code, .cell-code { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }

@media (max-width: 560px) {
  .card { padding: 18px; }
  .col-actions { width: auto; white-space: nowrap; }
}