:root {
  --bg: #070707;
  --panel: #111314;
  --panel-soft: #171a1b;
  --line: rgba(255, 255, 255, 0.13);
  --text: #f5f7f2;
  --muted: #a9b2a6;
  --green: #41ff9d;
  --blue: #4da3ff;
  --danger: #ff754a;
  --gold: #f5c75d;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    #070707;
  background-size: 72px 72px;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.admin-auth {
  display: grid;
  place-items: center;
  padding: 28px;
}

.auth-shell,
.dashboard-shell,
.admin-header {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.auth-shell {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 56px);
}

.auth-panel,
.edit-card,
.notice,
.dashboard-hero {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(17, 19, 20, 0.92);
}

.auth-panel {
  width: min(460px, 100%);
  padding: 30px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

.admin-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--text);
  overflow: hidden;
  isolation: isolate;
  background: conic-gradient(from 210deg, var(--green), var(--blue), var(--gold), var(--green));
  font-size: 13px;
  box-shadow: 0 0 22px rgba(65, 255, 157, 0.22);
}

.admin-mark::before {
  position: absolute;
  inset: 4px;
  z-index: -1;
  content: "";
  border: 1px solid rgba(245, 199, 93, 0.48);
  background: #070707;
  clip-path: polygon(50% 0, 90% 20%, 90% 67%, 50% 100%, 10% 67%, 10% 20%);
}

.admin-mark::after {
  position: absolute;
  inset: -35%;
  z-index: -2;
  content: "";
  background: conic-gradient(from 0deg, transparent, rgba(255, 255, 255, 0.82), transparent 24%);
  animation: adminSigilSpin 5.8s linear infinite;
}

.admin-mark span {
  text-shadow: 0 0 12px rgba(65, 255, 157, 0.86);
}

.admin-brand strong {
  display: grid;
  gap: 1px;
  line-height: 0.9;
}

.admin-brand strong span {
  color: var(--muted);
  font-size: 11px;
}

.admin-brand strong em {
  color: var(--text);
  font-family: "Arial Black", Impact, "Segoe UI Black", sans-serif;
  font-size: 18px;
  font-style: normal;
}

.auth-kicker,
.panel-kicker {
  margin: 28px 0 10px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 36px;
  line-height: 1.08;
}

h2 {
  font-size: 24px;
}

.auth-copy,
.dashboard-hero p,
label,
.notice {
  color: var(--muted);
  line-height: 1.6;
}

.auth-form {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

label {
  display: grid;
  gap: 8px;
  font-size: 14px;
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 12px;
  color: var(--text);
  background: #080909;
  font: inherit;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--green);
  outline: none;
  box-shadow: 0 0 0 3px rgba(65, 255, 157, 0.12);
}

.admin-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.admin-button.primary {
  color: #050506;
  border-color: var(--green);
  background: var(--green);
}

.admin-button.ghost:hover,
.admin-button.ghost:focus-visible {
  border-color: var(--green);
}

.admin-button.small {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 13px;
}

.notice {
  margin: 18px 0;
  padding: 12px 14px;
}

.notice.ok {
  color: var(--green);
  border-color: rgba(65, 255, 157, 0.32);
}

.notice.warn {
  color: var(--gold);
  border-color: rgba(245, 199, 93, 0.35);
}

.notice.error {
  color: #ffb19a;
  border-color: rgba(255, 117, 74, 0.35);
}

.admin-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  backdrop-filter: blur(16px);
}

.admin-header nav {
  display: flex;
  gap: 10px;
}

.admin-header nav a {
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(17, 19, 20, 0.76);
}

.dashboard-shell {
  padding: 24px 0 80px;
}

.dashboard-hero {
  padding: 26px;
  margin-bottom: 18px;
}

.dashboard-hero .panel-kicker {
  margin-top: 0;
}

.dashboard-hero p:last-child {
  max-width: 680px;
  margin-bottom: 0;
}

.editor-form {
  display: grid;
  gap: 18px;
}

.edit-card {
  padding: 22px;
}

.edit-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.edit-card-head .panel-kicker {
  margin-top: 0;
}

.form-grid {
  display: grid;
  gap: 16px;
}

.form-grid.two {
  grid-template-columns: repeat(2, 1fr);
}

.form-grid.three {
  grid-template-columns: repeat(3, 1fr);
}

.repeatable-list {
  display: grid;
  gap: 14px;
}

.repeat-row {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.repeatable[data-repeatable="stats"] .repeat-row,
.repeatable[data-repeatable="protocols"] .repeat-row {
  grid-template-columns: repeat(2, 1fr);
}

.remove-row {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 117, 74, 0.28);
  border-radius: var(--radius);
  color: #ffb19a;
  background: rgba(255, 117, 74, 0.08);
  cursor: pointer;
}

@keyframes adminSigilSpin {
  to {
    transform: rotate(360deg);
  }
}

.console-editor {
  display: grid;
  gap: 10px;
}

.console-row {
  position: relative;
  padding-right: 42px;
}

.console-row .remove-row {
  top: 8px;
  right: 0;
}

.sticky-save {
  position: sticky;
  bottom: 14px;
  display: flex;
  justify-content: flex-end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(7, 7, 7, 0.76);
  backdrop-filter: blur(14px);
}

.password-card {
  margin-top: 18px;
}

@media (max-width: 820px) {
  .admin-header {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    padding: 14px 0;
  }

  .form-grid.two,
  .form-grid.three,
  .repeat-row,
  .repeatable[data-repeatable="stats"] .repeat-row,
  .repeatable[data-repeatable="protocols"] .repeat-row {
    grid-template-columns: 1fr;
  }

  .edit-card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  h1 {
    font-size: 31px;
  }

  h2 {
    font-size: 21px;
  }
}

@media (max-width: 560px) {
  .admin-auth {
    padding: 14px;
  }

  .auth-shell,
  .dashboard-shell,
  .admin-header {
    width: min(100% - 24px, 1120px);
  }

  .auth-panel,
  .edit-card,
  .dashboard-hero {
    padding: 18px;
  }

  .admin-header nav {
    width: 100%;
  }

  .admin-header nav a {
    flex: 1;
    text-align: center;
  }

  .sticky-save .admin-button {
    width: 100%;
  }
}
