:root {
  --bg: #0b0e11;
  --panel: #11161d;
  --panel-2: #161d26;
  --line: #27313f;
  --muted: #8793a2;
  --text: #e7edf3;
  --yellow: #f0b90b;
  --green: #0ecb81;
  --red: #f6465d;
  --blue: #3d8bff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

button,
input {
  font: inherit;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .34);
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--yellow);
  color: #11161d;
  font-weight: 900;
  font-size: 18px;
}

.brand strong {
  display: block;
  font-size: 18px;
}

.brand span,
.muted {
  color: var(--muted);
  font-size: 13px;
}

h1 {
  margin: 0 0 8px;
  font-size: 22px;
  line-height: 1.3;
}

p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.6;
}

label {
  display: block;
  margin: 14px 0 7px;
  color: var(--muted);
  font-size: 13px;
}

input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0f141a;
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

input:focus {
  border-color: rgba(240, 185, 11, .72);
  box-shadow: 0 0 0 3px rgba(240, 185, 11, .12);
}

.primary {
  width: 100%;
  height: 42px;
  border: 0;
  border-radius: 6px;
  margin-top: 18px;
  background: var(--yellow);
  color: #11161d;
  font-weight: 800;
  cursor: pointer;
}

.primary:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
  padding: 0 10px;
  cursor: pointer;
}

.compact {
  width: auto;
  min-width: 128px;
}

.danger {
  color: #fff;
  background: rgba(246, 70, 93, .16);
  border-color: rgba(246, 70, 93, .4);
}

.success {
  color: #06160f;
  background: var(--green);
  border-color: var(--green);
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
}

a {
  color: var(--yellow);
  text-decoration: none;
}

.message {
  min-height: 22px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.message.ok {
  color: var(--green);
}

.message.err {
  color: var(--red);
}

.admin-page {
  min-height: 100vh;
  padding: 18px;
  background: var(--bg);
}

.admin-shell {
  max-width: 1120px;
  margin: 0 auto;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.admin-stack {
  display: grid;
  gap: 16px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.panel-body {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) 120px minmax(190px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.form-grid label {
  margin: 0;
}

.form-grid label span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
}

.generated-code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(240, 185, 11, .34);
  border-radius: 8px;
  background: rgba(240, 185, 11, .08);
}

.generated-code strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
  letter-spacing: .08em;
  color: var(--yellow);
}

.table-wrap {
  overflow: auto;
}

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

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(39, 49, 63, .76);
  text-align: left;
  font-size: 13px;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-weight: 600;
  background: #0f141a;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(61, 139, 255, .16);
  color: #9dc2ff;
  font-size: 12px;
  font-weight: 700;
}

.badge.pending {
  background: rgba(240, 185, 11, .16);
  color: var(--yellow);
}

.badge.approved,
.badge.active,
.badge.admin {
  background: rgba(14, 203, 129, .16);
  color: var(--green);
}

.badge.rejected,
.badge.suspended,
.badge.disabled,
.badge.used {
  background: rgba(246, 70, 93, .16);
  color: var(--red);
}

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

@media (max-width: 720px) {
  .auth-page,
  .admin-page {
    padding: 12px;
  }

  .auth-card {
    padding: 18px;
  }

  .admin-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel-head,
  .generated-code {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .compact {
    width: 100%;
  }
}
