.admin-body {
  --container: 1440px;
  background:
    radial-gradient(circle at 92% 0%, rgba(38, 208, 124, 0.07), transparent 28rem),
    radial-gradient(circle at 8% 0%, rgba(47, 140, 255, 0.09), transparent 30rem),
    #07090b;
}

.admin-body::before {
  opacity: .55;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}

.admin-site-header {
  background: rgba(7, 9, 11, 0.9);
}

.admin-header-label {
  margin-left: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.admin-header-actions {
  margin-left: auto;
}

.admin-main {
  min-height: 100vh;
  padding: calc(var(--header-h) + 34px) 0 70px;
}

.admin-shell {
  width: min(calc(100% - 40px), var(--container));
  margin: 0 auto;
}

.admin-shell[hidden],
.admin-gate[hidden],
.admin-gate [hidden],
.admin-modal[hidden],
.admin-toast[hidden] {
  display: none;
}

.admin-gate {
  min-height: calc(100vh - var(--header-h) - 68px);
  display: grid;
  place-items: center;
  padding: 24px;
}

.admin-gate-panel {
  width: min(430px, 100%);
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: rgba(13, 15, 18, 0.95);
  box-shadow: var(--shadow);
  text-align: center;
}

.admin-gate-panel h1 {
  margin: 0;
  font-size: 30px;
  letter-spacing: 0;
}

.admin-gate-panel p {
  margin: -6px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.admin-gate-panel .steam-auth-btn {
  width: 100%;
}

.admin-loader {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(255,255,255,.1);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: adminSpin .8s linear infinite;
}

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

.admin-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 28px;
}

.admin-heading h1 {
  margin: 7px 0 0;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.08;
  letter-spacing: 0;
}

.admin-heading p,
.admin-panel-head p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.admin-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.025);
}

.admin-identity img,
.admin-user img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  object-fit: cover;
  background: #050607;
}

.admin-identity span,
.admin-user span {
  min-width: 0;
  display: grid;
}

.admin-identity small,
.admin-user small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-family: JetBrains Mono, monospace;
  font-size: 11px;
  text-overflow: ellipsis;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-block: 1px solid var(--line);
  margin-bottom: 24px;
}

.admin-stats article {
  min-width: 0;
  padding: 20px 22px;
  border-right: 1px solid var(--line);
}

.admin-stats article:last-child {
  border-right: 0;
}

.admin-stats span,
.admin-stats small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.admin-stats strong {
  display: block;
  margin: 8px 0 7px;
  overflow: hidden;
  font-family: JetBrains Mono, monospace;
  font-size: clamp(23px, 2.4vw, 34px);
  line-height: 1;
  text-overflow: ellipsis;
}

.admin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  padding: 4px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.025);
}

.admin-tabs button {
  min-width: 125px;
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.admin-tabs button:hover {
  color: var(--text);
  background: rgba(255,255,255,.045);
}

.admin-tabs button.is-active {
  color: white;
  background: rgba(47, 140, 255, .16);
  box-shadow: inset 0 0 0 1px rgba(47, 140, 255, .3);
}

.admin-panel {
  min-width: 0;
}

.admin-panel[hidden] {
  display: none;
}

.admin-panel-head {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}

.admin-panel-head h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.admin-panel-head p {
  font-size: 14px;
}

.admin-toolbar {
  min-height: 58px;
  display: flex;
  align-items: end;
  gap: 10px;
  margin-bottom: 12px;
}

.admin-toolbar label,
.admin-modal-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-toolbar select,
.admin-toolbar input,
.admin-modal-card select,
.admin-modal-card input,
.admin-modal-card textarea {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  background: rgba(10, 12, 15, .9);
  color: var(--text);
  padding: 0 12px;
  font: inherit;
}

.admin-toolbar select:focus,
.admin-toolbar input:focus,
.admin-modal-card select:focus,
.admin-modal-card input:focus,
.admin-modal-card textarea:focus {
  border-color: rgba(47, 140, 255, .6);
  box-shadow: 0 0 0 3px rgba(47, 140, 255, .1);
}

.admin-search {
  position: relative;
  width: min(390px, 100%);
}

.admin-search > span {
  position: absolute;
  z-index: 1;
  left: 13px;
  bottom: 10px;
  color: var(--muted);
  font-size: 18px;
}

.admin-search input {
  width: 100%;
  padding-left: 38px;
}

.admin-icon-btn {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,.035);
  color: var(--muted);
  font-size: 20px;
}

.admin-icon-btn:hover {
  border-color: var(--line-strong);
  color: white;
  background: rgba(255,255,255,.07);
}

.admin-inventory {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.admin-inventory span {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255,255,255,.025);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.admin-inventory b {
  color: var(--text);
}

.admin-release {
  display: grid;
  gap: 14px;
  margin-bottom: 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.022);
}

.admin-release-version {
  display: grid;
  grid-template-columns: minmax(240px, 430px) auto 1fr;
  align-items: end;
  gap: 10px;
}

.admin-release-version label,
.admin-release-card {
  display: grid;
  gap: 7px;
}

.admin-release-version label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-release-version input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  background: rgba(10, 12, 15, .9);
  color: var(--text);
  font: inherit;
}

.admin-release-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-release-card {
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0,0,0,.17);
}

.admin-release-card > div {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.admin-release-card small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-file-picker {
  position: relative;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.admin-file-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.admin-release-card .admin-form-message {
  grid-column: 1 / -1;
}

.admin-upload-progress {
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.admin-upload-progress[hidden] {
  display: none;
}

.admin-upload-progress > span {
  height: 8px;
  overflow: hidden;
  border: 1px solid rgba(47, 140, 255, .28);
  border-radius: 999px;
  background: rgba(47, 140, 255, .08);
}

.admin-upload-progress i {
  width: 0;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #4db8ff);
  box-shadow: 0 0 18px rgba(47, 140, 255, .5);
  transition: width .16s ease;
}

.admin-upload-progress small {
  min-width: 44px;
  color: var(--text);
  font-family: JetBrains Mono, monospace;
  text-align: right;
}

.admin-table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(10, 12, 15, .72);
}

.admin-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

.admin-table-wrap th,
.admin-table-wrap td {
  height: 58px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,.065);
  text-align: left;
  vertical-align: middle;
}

.admin-table-wrap th {
  height: 44px;
  background: rgba(255,255,255,.025);
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.admin-table-wrap tbody tr:last-child td {
  border-bottom: 0;
}

.admin-table-wrap tbody tr:hover td {
  background: rgba(255,255,255,.018);
}

.admin-cell-actions {
  text-align: right !important;
}

.admin-empty {
  height: 150px !important;
  color: var(--muted);
  text-align: center !important;
}

.admin-table-footer {
  min-height: 32px;
  padding: 10px 3px 0;
  color: var(--muted);
  font-size: 12px;
}

.admin-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,.025);
  font-size: 11px;
  font-weight: 850;
}

.admin-status.is-success {
  border-color: rgba(38, 208, 124, .28);
  background: rgba(38, 208, 124, .09);
  color: #75e7ab;
}

.admin-status.is-warning {
  border-color: rgba(255, 176, 32, .28);
  background: rgba(255, 176, 32, .09);
  color: #ffd07a;
}

.admin-status.is-danger {
  border-color: rgba(255, 77, 94, .28);
  background: rgba(255, 77, 94, .09);
  color: #ff8792;
}

.admin-status.is-info {
  border-color: rgba(47, 140, 255, .28);
  background: rgba(47, 140, 255, .09);
  color: #8fc2ff;
}

.admin-row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.admin-action {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.035);
  color: #dce3eb;
  font-size: 12px;
  font-weight: 800;
}

.admin-action:hover {
  border-color: var(--line-strong);
  background: rgba(255,255,255,.075);
}

.admin-action.is-danger {
  color: #ff8792;
}

.admin-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-user b {
  overflow: hidden;
  max-width: 220px;
  text-overflow: ellipsis;
}

.admin-code {
  font-family: JetBrains Mono, monospace;
  font-weight: 800;
}

.admin-muted {
  color: var(--muted);
}

@media (max-width: 900px) {
  .admin-release-version,
  .admin-release-card {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .admin-release-grid {
    grid-template-columns: 1fr;
  }
}

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}

.admin-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(12px);
}

.admin-modal-card {
  position: relative;
  width: min(520px, 100%);
  max-height: calc(100vh - 40px);
  display: grid;
  gap: 18px;
  overflow: auto;
  padding: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: #101317;
  box-shadow: var(--shadow);
  animation: modalIn .2s ease-out;
}

.admin-modal-wide {
  width: min(900px, 100%);
}

.admin-modal-card h2 {
  margin: -5px 0 0;
  font-size: 28px;
  letter-spacing: 0;
}

.admin-modal-card textarea {
  min-height: 220px;
  resize: vertical;
  padding: 12px;
  font-family: JetBrains Mono, monospace;
  line-height: 1.55;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.admin-field-wide {
  grid-column: 1 / -1;
}

.admin-check {
  display: flex !important;
  align-items: center;
  grid-template-columns: auto 1fr;
}

.admin-check input {
  width: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: var(--blue);
}

.admin-form-message {
  min-height: 18px;
  color: var(--muted);
  line-height: 1.5;
}

.admin-form-message.is-success {
  color: #75e7ab;
}

.admin-form-message.is-error {
  color: #ff8792;
}

.admin-toast {
  position: fixed;
  z-index: 140;
  right: 22px;
  bottom: 22px;
  max-width: min(420px, calc(100vw - 44px));
  padding: 14px 17px;
  border: 1px solid rgba(38, 208, 124, .34);
  border-radius: 11px;
  background: rgba(12, 22, 18, .96);
  color: #b8f6d4;
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
  font-weight: 750;
}

.admin-toast.is-error {
  border-color: rgba(255, 77, 94, .38);
  background: rgba(28, 13, 16, .96);
  color: #ffb2b9;
}

@media (max-width: 1080px) {
  .admin-stats {
    grid-template-columns: repeat(3, 1fr);
  }
  .admin-stats article:nth-child(3) {
    border-right: 0;
  }
  .admin-stats article:nth-child(n + 4) {
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 720px) {
  .admin-header-label,
  .admin-header-actions [data-admin-profile] {
    display: none;
  }
  .admin-header-actions {
    gap: 6px;
  }
  .admin-header-actions .small {
    min-width: 40px;
    padding-inline: 10px;
  }
  .admin-main {
    padding-top: calc(var(--header-h) + 22px);
  }
  .admin-shell {
    width: min(calc(100% - 24px), var(--container));
  }
  .admin-heading {
    align-items: start;
    flex-direction: column;
  }
  .admin-identity {
    width: 100%;
  }
  .admin-stats {
    grid-template-columns: 1fr 1fr;
  }
  .admin-stats article,
  .admin-stats article:nth-child(3) {
    border-top: 1px solid var(--line);
    border-right: 1px solid var(--line);
  }
  .admin-stats article:nth-child(odd) {
    border-right: 1px solid var(--line);
  }
  .admin-stats article:nth-child(even) {
    border-right: 0;
  }
  .admin-stats article:first-child,
  .admin-stats article:nth-child(2) {
    border-top: 0;
  }
  .admin-stats article:last-child {
    grid-column: 1 / -1;
    border-right: 0;
  }
  .admin-panel-head,
  .admin-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .admin-panel-head > button {
    width: 100%;
  }
  .admin-search {
    width: 100%;
  }
  .admin-toolbar label select {
    width: 100%;
  }
  .admin-form-grid {
    grid-template-columns: 1fr;
  }
  .admin-field-wide {
    grid-column: auto;
  }
  .admin-modal {
    padding: 10px;
  }
  .admin-modal-card {
    max-height: calc(100vh - 20px);
    padding: 24px 18px;
  }
}
