:root {
  --purple: #6b3dff;
  --purple-deep: #5F1BFA;
  --ink: #16141f;
  --muted: #8b8798;
  --line: #e6e3ee;
  --bg: #f6f5f8;
  --ok: #1b9e5a;
  --warn: #c47a12;
  --bad: #c0392b;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: Nunito, ui-sans-serif, system-ui, sans-serif;
}
.wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 22px 18px 72px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.brand strong {
  font-family: Montserrat, Nunito, sans-serif;
  font-size: 20px;
  font-style: italic;
  letter-spacing: -0.4px;
  text-transform: uppercase;
}
.mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--purple-deep);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 18px;
}
h1 { margin: 0 0 8px; font-size: 28px; letter-spacing: -.4px; }
h2 { margin: 0 0 12px; font-size: 18px; }
.sub { margin: 0 0 18px; color: var(--muted); line-height: 1.5; }
.card {
  background: #fff;
  border-radius: 22px;
  padding: 22px;
  box-shadow: 0 8px 28px rgba(22, 20, 40, .06);
  margin: 0 0 16px;
}

.field {
  display: block;
  position: relative;
  margin: 0 0 16px;
  border: 1.5px solid #d8d6e0;
  border-radius: 12px;
  background: #fff;
}
.field > span {
  position: absolute;
  left: 12px;
  top: -8px;
  padding: 0 6px;
  background: #fff;
  font-size: 11px;
  font-weight: 500;
  color: #8b8896;
  text-transform: uppercase;
  letter-spacing: .3px;
  z-index: 1;
}
.field input,
.field textarea,
.field select {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 18px 14px 12px;
  font: 500 16px Nunito, ui-sans-serif, sans-serif;
  color: #5a5768;
  outline: none;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
  resize: none;
}
.field input,
.field select {
  height: 54px;
  padding-top: 16px;
  padding-bottom: 10px;
}
.field.is-area textarea {
  min-height: 96px;
  font-weight: 400;
  padding-top: 18px;
}
.field input::placeholder,
.field textarea::placeholder {
  color: #A8ADC0;
  font-weight: 400;
  opacity: 1;
}
.field:focus-within {
  border-color: #8B6CFF;
  box-shadow: 0 0 0 3px rgba(95, 27, 250, .12);
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 14px;
  border: 1.5px solid #d8d6e0;
  border-radius: 12px;
  background: #fff;
  color: #8b8798;
}
.search:focus-within {
  border-color: #8B6CFF;
  box-shadow: 0 0 0 3px rgba(95, 27, 250, .12);
}
.search input {
  flex: 1;
  min-width: 0;
  height: 50px;
  border: 0;
  background: none;
  outline: none;
  font: 500 16px Nunito, sans-serif;
  color: #5a5768;
}
.search input::placeholder { color: #A8ADC0; }

.file-pick {
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  min-height: 72px;
  margin: 0 0 16px;
  padding: 16px 14px 12px;
  border: 1.5px dashed #cfc9dc;
  border-radius: 12px;
  background: #faf9fc;
  cursor: pointer;
  overflow: hidden;
}
.file-pick > span {
  position: absolute;
  left: 12px;
  top: -8px;
  padding: 0 6px;
  background: #faf9fc;
  font-size: 11px;
  font-weight: 500;
  color: #8b8896;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.file-pick em {
  font-style: normal;
  font-weight: 700;
  font-size: 14px;
  color: #5F1BFA;
}
.file-pick small {
  display: block;
  margin-top: 4px;
  color: #8b8896;
  font-size: 12px;
}
.file-pick.is-on {
  border-style: solid;
  border-color: #8B6CFF;
  background: #f4f0ff;
}
.file-pick.is-on > span { background: #f4f0ff; }
.file-pick input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  font-size: 16px;
}

.checks {
  display: flex;
  gap: 12px;
  margin: 4px 0 16px;
  flex-wrap: wrap;
}
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  margin: 0;
  font: 600 15px Nunito, sans-serif;
  color: #5a5768;
  cursor: pointer;
  user-select: none;
}
.check input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.check i {
  width: 22px;
  height: 22px;
  border: 1.5px solid #d8d6e0;
  border-radius: 6px;
  background: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.check i:after {
  content: "";
  width: 11px;
  height: 7px;
  border: 2px solid #fff;
  border-top: 0;
  border-right: 0;
  transform: rotate(-45deg) scale(0);
  margin-top: -2px;
}
.check input:checked + i {
  background: #8B6CFF;
  border-color: #8B6CFF;
}
.check input:checked + i:after { transform: rotate(-45deg) scale(1); }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row .field, .row .file-pick { margin-bottom: 16px; }

button, .btn {
  border: 0;
  border-radius: 999px;
  background: var(--purple-deep);
  color: #fff;
  font: 800 14px Nunito, sans-serif;
  padding: 12px 18px;
  cursor: pointer;
}
button.ghost { background: #ececef; color: var(--ink); }
button.danger { background: #fde8e6; color: var(--bad); }
button.ok { background: #e7f7ee; color: var(--ok); }
.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.gate { max-width: 420px; margin: 8vh auto 0; }
.msg { display: none; margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; font-size: 14px; }
.msg.is-on { display: block; }
.msg.err { background: #fde8e6; color: var(--bad); }
.msg.ok { background: #e7f7ee; color: var(--ok); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 0 0 18px; }
.stats article {
  background: #fff;
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 6px 20px rgba(22, 20, 40, .05);
}
.stats span { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
.stats strong { font-size: 20px; }
.list { display: flex; flex-direction: column; gap: 10px; }
.item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  background: #fff;
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: 0 4px 16px rgba(22, 20, 40, .05);
}
.item em { display: block; color: var(--muted); font-style: normal; font-size: 13px; margin-top: 3px; }
.item .meta { color: var(--muted); font-size: 12px; margin-top: 6px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  background: #ececef;
  margin-right: 6px;
}
.badge.hot { background: #efe8ff; color: var(--purple); }
.badge.off { background: #fde8e6; color: var(--bad); }
.badge.ok { background: #e7f7ee; color: var(--ok); }
.hidden { display: none !important; }
.foot { margin-top: 18px; color: var(--muted); font-size: 12px; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.topbar h1 { margin: 0; font-size: 26px; }
.back {
  width: 40px;
  height: 40px;
  border: 0;
  background: none;
  color: var(--ink);
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 12px;
}
.menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.menu-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  background: #fff;
  color: inherit;
  border-radius: 18px;
  padding: 16px 14px;
  box-shadow: 0 4px 16px rgba(22, 20, 40, .05);
}
.menu-ico {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 50%;
  background: var(--purple);
  color: #fff;
  display: grid;
  place-items: center;
}
.menu-copy { flex: 1; min-width: 0; }
.menu-copy strong { display: block; font-size: 16px; }
.menu-copy em {
  display: block;
  font-style: normal;
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}
.chev { color: #c8c5d1; }
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.switch-row:last-child { border-bottom: 0; }
.switch-row strong { display: block; font-size: 15px; }
.switch-row span { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.toggle {
  position: relative;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle i {
  position: absolute;
  inset: 0;
  background: #d9d6e2;
  border-radius: 999px;
  transition: .2s;
}
.toggle i:before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: .2s;
}
.toggle input:checked + i { background: var(--purple-deep); }
.toggle input:checked + i:before { transform: translateX(20px); }

.dlg {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(11, 16, 40, .45);
}
.dlg[hidden] { display: none !important; }
.dlg-bg {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.dlg-card {
  position: relative;
  z-index: 1;
  width: 86%;
  max-width: 320px;
  background: #fff;
  border: 1px solid #E8E6F2;
  border-radius: 20px;
  box-shadow: 0 16px 40px rgba(40, 30, 90, .18);
  overflow: hidden;
  font-family: Montserrat, Nunito, sans-serif;
}
.dlg-inner {
  padding: 24px 22px 8px;
}
.dlg-title {
  display: block;
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 800;
  color: #0B1028;
  line-height: 1.25;
}
.dlg-text {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: #7A8099;
  line-height: 1.45;
}
.dlg-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 12px 16px 16px;
}
.dlg-btn {
  min-width: 88px;
  height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  font: 700 14px Montserrat, Nunito, sans-serif;
  cursor: pointer;
}
.dlg-ok {
  background: #7B4DFF;
  color: #fff;
}
.dlg-ok:active { background: #5F1BFA; }
.dlg-cancel {
  background: transparent;
  color: #7B4DFF;
  border: 1.5px solid #7B4DFF;
}
.dlg-cancel:active { background: rgba(123, 77, 255, .08); }
#dlg-cancel[hidden] { display: none !important; }

@media (max-width: 720px) {
  .row, .stats { grid-template-columns: 1fr 1fr; }
  .item { grid-template-columns: 1fr; }
}
