:root {
  --bg: #05060a;
  --panel: rgba(12, 14, 22, 0.78);
  --panel-solid: #0c0e16;
  --line: rgba(255,255,255,0.11);
  --line-strong: rgba(255,255,255,0.22);
  --text: #f7f8ff;
  --muted: #9ba0b7;
  --cyan: #35dcff;
  --pink: #ff4fc8;
  --purple: #895dff;
  --success: #55e39a;
  --warning: #ffce63;
  --danger: #ff657e;
  --tenant-accent: #35dcff;
  --tenant-accent-2: #ff4fc8;
  --tenant-bg-image: none;
  --radius: 22px;
  --shadow: 0 24px 70px rgba(0,0,0,.38);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(rgba(5,6,10,.88), rgba(5,6,10,.94)),
    var(--tenant-bg-image),
    var(--bg);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  overflow-x: hidden;
}

button, input, textarea, select { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }

.ambient {
  position: fixed;
  pointer-events: none;
  z-index: -1;
  width: 34rem;
  height: 34rem;
  filter: blur(100px);
  opacity: .16;
  border-radius: 50%;
}
.ambient-one { top: -14rem; right: -8rem; background: var(--purple); }
.ambient-two { bottom: -16rem; left: -10rem; background: var(--pink); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 78px;
  padding: 14px clamp(18px, 4vw, 54px);
  border-bottom: 1px solid var(--line);
  background: rgba(5,6,10,.78);
  backdrop-filter: blur(22px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
}
.brand strong {
  display: block;
  letter-spacing: .16em;
  font-size: .94rem;
}
.brand small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: .72rem;
}

.gem-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(53,220,255,.13), rgba(255,79,200,.1));
  box-shadow: inset 0 0 18px rgba(255,255,255,.025);
}
.gem-mark svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: url(#gemGradient);
  stroke: var(--tenant-accent);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.topnav::-webkit-scrollbar { display: none; }

.nav-btn, .ghost-btn, .primary-btn, .danger-btn {
  border: 1px solid transparent;
  cursor: pointer;
  transition: .18s ease;
}
.nav-btn {
  white-space: nowrap;
  border-radius: 999px;
  padding: 10px 13px;
  background: transparent;
  color: var(--muted);
}
.nav-btn:hover, .nav-btn.active {
  color: var(--text);
  border-color: var(--line);
  background: rgba(255,255,255,.045);
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 54px 0 70px;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 6vw, 68px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.06), rgba(255,255,255,.015)),
    var(--panel);
  box-shadow: var(--shadow);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 10% 10%, color-mix(in srgb, var(--tenant-accent) 22%, transparent), transparent 36%),
    radial-gradient(circle at 92% 16%, color-mix(in srgb, var(--tenant-accent-2) 18%, transparent), transparent 35%);
}
.hero > * { position: relative; z-index: 1; }

.eyebrow {
  margin: 0 0 12px;
  color: var(--tenant-accent);
  font-size: .77rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.hero h1, .section-title {
  margin: 0;
  line-height: .98;
  letter-spacing: -.045em;
}
.hero h1 {
  max-width: 850px;
  font-size: clamp(2.5rem, 7vw, 6.1rem);
}
.hero p.lead {
  max-width: 720px;
  margin: 22px 0 0;
  color: #c6c9d8;
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  line-height: 1.7;
}
.hero-actions, .inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.primary-btn, .ghost-btn, .danger-btn {
  min-height: 46px;
  padding: 11px 16px;
  border-radius: 13px;
  font-weight: 800;
}
.primary-btn {
  color: #05060a;
  background: linear-gradient(135deg, var(--tenant-accent), var(--tenant-accent-2));
  box-shadow: 0 10px 30px color-mix(in srgb, var(--tenant-accent) 20%, transparent);
}
.primary-btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.ghost-btn {
  border-color: var(--line);
  background: rgba(255,255,255,.035);
}
.ghost-btn:hover {
  border-color: var(--line-strong);
  background: rgba(255,255,255,.07);
}
.danger-btn {
  color: #fff;
  border-color: rgba(255,101,126,.3);
  background: rgba(255,101,126,.12);
}

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

.section { margin-top: 34px; }
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}
.section-title {
  font-size: clamp(1.7rem, 3vw, 2.7rem);
}
.section-copy {
  max-width: 660px;
  color: var(--muted);
  line-height: 1.65;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
  backdrop-filter: blur(18px);
}
.card.pad { padding: 22px; }
.card h3 { margin: 0 0 8px; letter-spacing: -.02em; }
.card p { margin: 0; color: var(--muted); line-height: 1.6; }

.stat {
  padding: 22px;
}
.stat-label {
  color: var(--muted);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.stat-value {
  margin-top: 8px;
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -.04em;
}
.stat-note {
  margin-top: 5px;
  color: var(--muted);
  font-size: .85rem;
}

.reward-rail {
  position: relative;
  padding: 25px;
  overflow: hidden;
}
.reward-rail::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -70px;
  bottom: -85px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--tenant-accent) 16%, transparent);
  filter: blur(30px);
}
.progress-shell {
  height: 12px;
  margin: 18px 0 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.04);
}
.progress-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--tenant-accent), var(--tenant-accent-2));
  transition: width .4s ease;
}

.form-card { padding: clamp(22px, 4vw, 32px); }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.field { display: grid; gap: 8px; }
.field.full { grid-column: 1 / -1; }
.field label {
  color: #d9dbea;
  font-size: .82rem;
  font-weight: 750;
}
.field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 13px 14px;
  outline: none;
  color: var(--text);
  background: rgba(255,255,255,.04);
  transition: .18s ease;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: color-mix(in srgb, var(--tenant-accent) 64%, white 5%);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--tenant-accent) 10%, transparent);
}
.field textarea { min-height: 110px; resize: vertical; }
.helper {
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.45;
}
.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.45;
}
.checkbox-row input { margin-top: 3px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: max-content;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--muted);
  background: rgba(255,255,255,.035);
  font-size: .75rem;
  font-weight: 800;
}
.badge.success { color: var(--success); }
.badge.warning { color: var(--warning); }
.badge.danger { color: var(--danger); }

.notice {
  padding: 18px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--tenant-accent);
  border-radius: 15px;
  color: #c9ccda;
  background: rgba(255,255,255,.028);
  line-height: 1.6;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
}
table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}
th, td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: .88rem;
}
th {
  color: var(--muted);
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .09em;
}
tr:last-child td { border-bottom: 0; }

.code-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 13px;
  border: 1px dashed var(--line-strong);
  border-radius: 13px;
  background: rgba(255,255,255,.025);
}
.code-box code {
  overflow-wrap: anywhere;
  color: #e8e9f4;
}

.admin-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
}
.admin-sidebar {
  position: sticky;
  top: 98px;
  height: fit-content;
  padding: 14px;
}
.admin-sidebar button {
  width: 100%;
  margin: 2px 0;
  padding: 12px;
  text-align: left;
}
.admin-content { min-width: 0; }

.lock-panel {
  min-height: 420px;
  display: grid;
  place-items: center;
  text-align: center;
}
.lock-panel .inner { max-width: 540px; }
.lock-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.04);
  font-size: 1.5rem;
}

.empty-state {
  padding: 34px;
  text-align: center;
}
.empty-state h2 { margin: 0 0 8px; }
.empty-state p {
  max-width: 620px;
  margin: 0 auto;
  color: var(--muted);
  line-height: 1.65;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 76px;
  padding: 18px;
  border-top: 1px solid var(--line);
  color: #7f849a;
  font-size: .78rem;
}
.dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--tenant-accent);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: 390px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(12,14,22,.96);
  box-shadow: var(--shadow);
  color: var(--text);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: .2s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }

.kicker {
  color: var(--muted);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .12em;
}
.divider {
  height: 1px;
  margin: 22px 0;
  background: var(--line);
}
.small { font-size: .82rem; color: var(--muted); }
.muted { color: var(--muted); }
.success-text { color: var(--success); }
.warning-text { color: var(--warning); }

@media (max-width: 900px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .topnav { width: 100%; }
  .grid.three, .grid.two, .form-grid, .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; }
}

@media (max-width: 620px) {
  .app-shell { width: min(100% - 20px, 1180px); padding-top: 26px; }
  .topbar { padding-inline: 14px; }
  .hero { padding: 26px 20px; border-radius: 20px; }
  .hero h1 { font-size: clamp(2.2rem, 13vw, 4.4rem); }
  .section-head { align-items: flex-start; flex-direction: column; }
  .form-card { padding: 18px; }
}
