:root {
  color-scheme: dark;
  --bg: #070a10;
  --surface: #11151e;
  --surface-2: #171c27;
  --border: #293141;
  --text: #f5f7fb;
  --muted: #8992a5;
  --cyan: #00d8ff;
  --pink: #ff35ab;
  --violet: #8c63ff;
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}
button,
input,
textarea,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
.hidden {
  display: none !important;
}
.glow {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.1;
  pointer-events: none;
}
.glow-cyan {
  background: var(--cyan);
  top: -180px;
  left: -180px;
}
.glow-pink {
  background: var(--pink);
  right: -180px;
  bottom: -180px;
}
.shell {
  width: min(1320px, calc(100% - 36px));
  margin: 0 auto;
  padding: 34px 0 80px;
  position: relative;
  min-width: 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 70px;
  letter-spacing: 0.08em;
}
.brand .mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--cyan);
  border-radius: 14px;
  color: var(--cyan);
  font-weight: 950;
  box-shadow: 0 0 24px #00d8ff25;
}
.brand strong,
.brand span {
  display: block;
}
.brand span {
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
  letter-spacing: 0.18em;
}
.card {
  background: linear-gradient(145deg, #151a24, #0d1118);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 28px;
}
.login {
  width: min(440px, 100%);
  margin: 0 auto;
}
h1 {
  font-size: clamp(28px, 4vw, 44px);
  margin: 4px 0 8px;
}
h2 {
  margin: 0 0 8px;
}
.eyebrow {
  color: var(--cyan);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.18em;
  margin: 0;
}
.muted {
  color: var(--muted);
}
label {
  color: #cbd1dd;
  font-size: 13px;
  font-weight: 700;
  display: grid;
  gap: 8px;
}
input,
textarea,
select {
  width: 100%;
  color: var(--text);
  background: #090d14;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 14px;
  outline: none;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px #00d8ff16;
}
textarea {
  min-height: 100px;
  resize: vertical;
}
form {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}
.primary {
  color: #04070c;
  font-weight: 950;
  border: 0;
  border-radius: 13px;
  padding: 14px 18px;
  background: linear-gradient(100deg, var(--cyan), var(--violet), var(--pink));
}
.primary.compact {
  padding: 11px 15px;
}
.ghost,
.danger {
  border-radius: 12px;
  padding: 10px 14px;
  background: transparent;
}
.ghost {
  color: var(--text);
  border: 1px solid var(--border);
}
.danger {
  color: #ff6c87;
  border: 1px solid #632c3d;
}
.error {
  min-height: 18px;
  margin: 0;
  color: #ff6c87;
  font-size: 13px;
}
.dashboard {
  display: grid;
  gap: 26px;
  min-width: 0;
}
.topbar,
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  width: 100%;
  min-width: 0;
  border-bottom: 1px solid var(--border);
}
.tab {
  flex: 0 0 auto;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 12px 14px;
  font-weight: 850;
}
.tab.active {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
}
.tab-count {
  display: inline-grid;
  place-items: center;
  min-width: 21px;
  height: 21px;
  margin-left: 6px;
  padding: 0 6px;
  color: #070a10;
  background: var(--pink);
  border-radius: 999px;
  font-size: 11px;
}
.panel {
  display: none;
}
.panel.active {
  display: block;
}
.mission-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 20px;
}
.mission {
  text-align: left;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
}
.mission:hover {
  transform: translateY(-2px);
  border-color: #48536a;
}
.mission.inactive {
  opacity: 0.55;
}
.mission-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.badge {
  color: var(--cyan);
  background: #00d8ff12;
  border: 1px solid #00d8ff35;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}
.mission h3 {
  margin: 18px 0 8px;
}
.mission-reward {
  color: var(--pink);
  font-weight: 900;
  margin-top: 18px;
}
.promo-import {
  margin-top: 20px;
}
.case-editor {
  display: grid;
  gap: 22px;
  margin-top: 22px;
}
.case-config {
  overflow: hidden;
}
.case-config-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.case-config-head h2 {
  margin-top: 10px;
}
.key-condition-editor {
  margin: 0 0 20px;
  padding: 18px;
  background: linear-gradient(135deg, #00d8ff0b, #8c63ff0b);
  border: 1px solid #00d8ff35;
  border-radius: 18px;
}
.condition-heading h3 {
  margin: 0 0 5px;
  color: var(--cyan);
}
.condition-heading p {
  margin: 0 0 16px;
}
.condition-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 12px;
}
.chance-total {
  color: #56e6ad;
  font-size: 26px;
}
.chance-total.invalid {
  color: #ff6c87;
}
.prize-editor {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}
.prize-row {
  display: grid;
  grid-template-columns: 120px minmax(
      180px,
      2fr
    ) 100px 150px 110px 120px minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 14px;
  background: #090d14;
  border: 1px solid var(--border);
  border-radius: 16px;
}
.prize-picture {
  display: grid;
  justify-items: center;
  gap: 7px;
}
.prize-picture img {
  width: 62px;
  height: 62px;
  object-fit: cover;
  border-radius: 12px;
}
.prize-picture span {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 12px;
}
.upload-button {
  color: var(--cyan);
  cursor: pointer;
  font-size: 11px;
}
.upload-button input {
  display: none;
}
@media (max-width: 1100px) {
  .prize-row {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 850px) {
  .condition-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.reward-list {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}
.reward-card {
  display: grid;
  gap: 18px;
  color: inherit;
  background: var(--surface);
  border: 1px solid #ff35ab55;
  border-radius: 18px;
  padding: 20px;
}
.reward-card.fulfilled {
  opacity: 0.65;
  border-color: var(--border);
}
.reward-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.reward-card h3 {
  margin: 14px 0 7px;
}
.reward-card p {
  margin: 5px 0;
}
.notification-card {
  grid-template-columns: 1fr auto;
  align-items: center;
}
.template-help {
  display: grid;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
  padding: 14px;
  background: #090d14;
  border: 1px solid var(--border);
  border-radius: 14px;
}
.template-help strong {
  color: var(--cyan);
}
.template-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.template-tags button {
  color: var(--cyan);
  background: #00d8ff10;
  border: 1px solid #00d8ff40;
  border-radius: 999px;
  padding: 7px 10px;
  font-family: ui-monospace, monospace;
}
.reward-value {
  color: var(--pink);
  font-size: 22px;
  font-weight: 950;
  white-space: nowrap;
}
.badge.pending {
  color: var(--pink);
  background: #ff35ab12;
  border-color: #ff35ab35;
}
.badge.done {
  color: #56e6ad;
  background: #56e6ad12;
  border-color: #56e6ad35;
}
.client-id {
  overflow-wrap: anywhere;
}
.fulfill-reward {
  justify-self: end;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.reward-editor { display: grid; gap: 10px; }
.referral-reward-row { display: grid; grid-template-columns: 1fr 1.4fr .65fr 1fr auto; gap: 10px; align-items: end; }
.referral-reward-row label { min-width: 0; }
.referral-reward-row .remove-referral-reward { min-height: 44px; }
@media (max-width: 900px) { .referral-reward-row { grid-template-columns: 1fr 1fr; } }
.wide {
  grid-column: 1 / -1;
}
.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
}
.toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--cyan);
}
.empty-state {
  text-align: center;
  padding: 70px 30px;
}
.empty-icon {
  color: var(--pink);
  font-size: 46px;
}
.content-editor {
  display: grid;
  gap: 22px;
  margin-top: 22px;
}
.content-section {
  display: grid;
  gap: 20px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.section-head p {
  margin: 4px 0 0;
}
.managed-list {
  display: grid;
  gap: 14px;
}
.managed-item {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  padding: 16px;
  background: #090d14;
  border: 1px solid var(--border);
  border-radius: 18px;
}
.managed-item.faq-item {
  grid-template-columns: 1fr;
}
.managed-image {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  min-height: 145px;
  color: var(--muted);
  text-align: center;
  background: #06090f;
  border: 1px dashed #354056;
  border-radius: 14px;
  overflow: hidden;
}
.managed-image img {
  width: 100%;
  height: 145px;
  object-fit: cover;
}
.managed-fields {
  display: grid;
  gap: 13px;
}
.managed-controls {
  display: flex;
  align-items: end;
  gap: 14px;
  padding-top: 4px;
}
.managed-controls .order-field {
  width: 105px;
}
.managed-empty {
  color: var(--muted);
  text-align: center;
  padding: 30px;
  border: 1px dashed var(--border);
  border-radius: 16px;
}
.documents-editor textarea {
  min-height: 240px;
  line-height: 1.5;
}
dialog {
  width: min(650px, calc(100% - 28px));
  color: var(--text);
  background: #10151e;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 0;
}
dialog::backdrop {
  background: #02040ad9;
  backdrop-filter: blur(7px);
}
dialog form {
  padding: 26px;
  margin: 0;
}
.dialog-head,
.dialog-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.dialog-actions {
  justify-content: flex-end;
}
.icon-button {
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 30px;
}
.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  background: #15231f;
  border: 1px solid #2f725c;
  border-radius: 13px;
  padding: 13px 18px;
  transform: translateY(100px);
  opacity: 0;
  transition: 0.25s;
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

@media (max-width: 650px) {
  .brand {
    margin-bottom: 35px;
  }
  .topbar,
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .wide {
    grid-column: auto;
  }
  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
  }
  .reward-main {
    align-items: flex-start;
    flex-direction: column;
  }
  .notification-card {
    grid-template-columns: 1fr;
  }
  .fulfill-reward {
    width: 100%;
    justify-self: stretch;
  }
  .section-head,
  .managed-controls {
    align-items: stretch;
    flex-direction: column;
  }
  .managed-item {
    grid-template-columns: 1fr;
  }
  .managed-controls .order-field {
    width: 100%;
  }
  .condition-grid {
    grid-template-columns: 1fr;
  }
}
