.admin-body {
  --admin-panel-padding: 30px;
  --admin-sticky-offset: 24px;
  min-height: 100vh;
  background: #f6f5fa;
  color: #25232b;
}
.admin-body .admin {
  --font-body: 'Account Futura', 'Futura PT', Futura, 'Century Gothic', sans-serif;
  --font-display: var(--font-body);
  --account-font: var(--font-body);
  font-family: var(--font-body);
}
.admin-body .admin *,
.admin-body .admin *::before,
.admin-body .admin *::after {
  font-family: var(--font-body) !important;
}
body.admin-body {
  overflow: visible;
}
.admin-sky {
  position: fixed;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.admin-sky span {
  position: absolute;
  top: var(--y);
  left: var(--x);
  color: #9874c9;
  font-size: var(--size);
  line-height: 1;
  text-shadow:
    0 0 6px #ffffff,
    0 0 16px #b998e080;
  animation: admin-star-twinkle var(--duration) ease-in-out var(--delay) infinite;
}
.admin-sky span:nth-child(4n) {
  color: #ba935c;
  text-shadow:
    0 0 6px #fff4d8,
    0 0 16px #ba935c66;
}
@keyframes admin-star-twinkle {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(0.8) rotate(-8deg);
  }
  50% {
    opacity: 1;
    transform: scale(1.2) rotate(10deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .admin-sky span {
    animation: none;
    opacity: 0.6;
  }
}
.admin {
  padding-top: 116px;
  overflow: visible;
}
.admin .account__layout {
  align-items: start;
}
.admin-eye {
  position: fixed;
  top: 50%;
  left: calc(clamp(24px, 4vw, 64px) + 140px);
  width: min(104vw, 1520px);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.admin-sidebar {
  position: relative;
  align-self: start;
  margin: 0;
  min-height: calc(100vh - 140px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e4e2ea;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 70px rgba(42, 31, 68, 0.08);
  backdrop-filter: blur(18px);
}
.admin-nav {
  display: grid;
  gap: 5px;
  padding: 14px;
}
.admin-nav__link {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 11px;
  border-radius: 9px;
  color: #403b4b;
  font-size: 14px;
  transition:
    color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}
.admin-nav__link:hover {
  background: #f6f4fb;
  color: #5438c5;
  transform: translateX(2px);
}
.admin-nav__link.is-active {
  background: #6248d6;
  color: #fff;
  font-weight: 600;
}
.admin-nav__number {
  color: #91899e;
  font-size: 10px;
  letter-spacing: 0.08em;
}
.admin-nav__link.is-active .admin-nav__number {
  color: rgba(255, 255, 255, 0.68);
}
.admin-sidebar__account {
  margin-top: auto;
  padding: 20px 22px;
}
.admin-sidebar__footer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 20px 22px 22px;
  border-top: 1px solid #ebe8f0;
}
.admin-sidebar__footer a {
  color: #6248d6;
  font-size: 14px;
}
.admin-sidebar__account p {
  margin: 0 0 6px;
  overflow-wrap: anywhere;
  color: #837c8e;
  font-size: 12px;
  line-height: 1.5;
}
.admin-main {
  display: flow-root;
  padding-bottom: 110px;
}
.admin-main .admin-panel {
  position: relative;
  z-index: 0;
}
.admin-main > .admin-panel:first-of-type,
.admin-main form > .admin-panel:first-child {
  margin-top: 0;
}
.admin-kicker {
  margin: 0 0 8px;
  color: #735dc0;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.1em;
}
.admin-stat-word {
  font-size: 20px !important;
}
.admin-panel {
  margin: 28px 0;
  padding: var(--admin-panel-padding);
  background: #fff;
  color: #25232b;
  border: 1px solid #e4e2ea;
  border-radius: 14px;
  scroll-margin-top: 95px;
}
.admin-panel__head,
.admin-access-panel__head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 27px;
  padding-bottom: 22px;
  border-bottom: 1px solid #e9e7ee;
}
.admin-panel__head h2,
.admin-access-panel__head h2 {
  margin: 0;
  font-size: 25px;
  line-height: 1.15;
}
.admin-panel__head > a {
  color: #6248d6;
  white-space: nowrap;
  font-size: 14px;
}
.admin-panel__hint {
  max-width: 260px;
  margin: 0;
  color: #837c8e;
  font-size: 13px;
  line-height: 1.5;
  text-align: right;
}
.admin-fields {
  display: grid;
  gap: 20px;
}
.admin-fields--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.admin-fields__wide {
  grid-column: 1/-1;
}
.admin-fields label {
  min-width: 0;
  display: grid;
  gap: 8px;
  color: #615e6b;
  font-size: 14px;
}
.admin-fields input,
.admin-fields select,
.admin-fields textarea {
  width: 100%;
  min-height: 45px;
  padding: 11px 13px;
  border: 1px solid #dcd8e8;
  border-radius: 8px;
  outline: 0;
  background: #fbfaff;
  color: #25232b;
  font: inherit;
}
.admin-fields input,
.admin-fields select,
.admin-fields textarea {
  min-width: 0;
  max-width: 100%;
}
.admin-fields textarea {
  min-height: 110px;
  resize: vertical;
}
.admin-fields input:focus,
.admin-fields select:focus,
.admin-fields textarea:focus {
  border-color: #6248d6;
  box-shadow: 0 0 0 3px rgba(98, 72, 214, 0.12);
}
.admin-books {
  display: grid;
  gap: 20px;
}
.admin-book {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  padding: 20px;
  border: 1px solid #e9e7ee;
  border-radius: 12px;
  background: #fdfcff;
}
.admin-book__content {
  min-width: 0;
}
.admin-book__images {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.admin-image {
  min-width: 0;
  max-width: 100%;
  margin-bottom: 22px;
}
.admin-image__label {
  display: block;
  margin-bottom: 10px;
  color: #615e6b;
  font-size: 14px;
}
.admin-image__preview {
  display: grid;
  place-items: center;
  height: 180px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #e4e2ea;
  border-radius: 10px;
  background-color: #f6f5fa;
  background-image:
    linear-gradient(45deg, #ebe8f0 25%, transparent 25%, transparent 75%, #ebe8f0 75%),
    linear-gradient(45deg, #ebe8f0 25%, transparent 25%, transparent 75%, #ebe8f0 75%);
  background-size: 20px 20px;
  background-position:
    0 0,
    10px 10px;
}
.admin-image__preview img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}
.admin-image__preview span,
.admin-image p {
  color: #716a7f;
  font-size: 12px;
}
.admin-image p {
  margin: 8px 0 0;
}
.admin-image input {
  display: block;
  max-width: 100%;
  width: 100%;
  color: #615e6b;
  font-size: 12px;
}
.admin-image input::file-selector-button {
  margin-right: 8px;
  padding: 9px 12px;
  border: 1px solid #dcd8e8;
  border-radius: 8px;
  background: #eeeafb;
  color: #5438c5;
  font: inherit;
  cursor: pointer;
}
.admin-image__remove {
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #6248d6;
  font-size: 12px;
  cursor: pointer;
}
.admin-image .admin-image__error {
  color: #9b375b;
}
.admin-book__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  color: #766f85;
  font-size: 13px;
}
.admin-toggle {
  display: inline-flex !important;
  align-items: center;
  gap: 7px !important;
  cursor: pointer;
  color: #6248d6;
  white-space: nowrap;
}
.admin-toggle input {
  width: 17px;
  height: 17px;
  accent-color: #6248d6;
}
.admin-save {
  position: sticky;
  z-index: 5;
  bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 20px;
  border: 1px solid #ded9ec;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 15px 40px rgba(53, 39, 82, 0.12);
  backdrop-filter: blur(16px);
}
.admin-save p {
  margin: 0;
  color: #615e6b;
  font-size: 14px;
}
.admin-save button {
  border: 0;
  cursor: pointer;
  white-space: nowrap;
}
.admin-save button:disabled {
  opacity: 0.55;
  cursor: default;
}
.admin-refresh {
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: #6248d6;
  font: 14px/1.4 var(--font-body);
  cursor: pointer;
  white-space: nowrap;
}
.admin-refresh:disabled {
  opacity: 0.5;
  cursor: wait;
}
.admin-orders-note {
  margin: -7px 0 22px;
  color: #716a7f;
  font-size: 14px;
  line-height: 1.6;
}
.admin-orders-error {
  color: #9b375b;
  font-size: 14px;
}
.admin-orders-empty {
  padding: 36px 24px;
  border: 1px dashed #d6d0e7;
  border-radius: 12px;
  color: #716a7f;
  text-align: center;
  line-height: 1.6;
}
.admin-orders-list {
  display: grid;
  gap: 14px;
}
.admin-order {
  padding: 20px;
  border: 1px solid #e9e7ee;
  border-radius: 12px;
  background: #fdfcff;
}
.admin-order__top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e9e7ee;
}
.admin-order__number {
  color: #816da7;
  font-size: 12px;
}
.admin-order h3 {
  margin: 5px 0 0;
  font-size: 19px;
}
.admin-order__status {
  padding: 7px 10px;
  border-radius: 7px;
  background: #eeeafb;
  color: #6248d6;
  font-size: 12px;
  white-space: nowrap;
}
.admin-order dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 24px;
  margin: 18px 0 0;
}
.admin-order dl div {
  min-width: 0;
}
.admin-order dt {
  margin-bottom: 5px;
  color: #837c8e;
  font-size: 12px;
}
.admin-order dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
}
.admin-roles__notice {
  margin: 0 0 24px;
  padding: 16px 20px;
  border: 1px solid #ded9ec;
  border-radius: 10px;
  background: #eeeafb;
  color: #615077;
  font-size: 14px;
  line-height: 1.6;
}
.admin-panel.admin-access-panel {
  margin-top: 0;
  overflow: visible;
}
.admin-access-panel__head {
  flex-wrap: wrap;
}
.admin-access-panel__head p:not(.admin-kicker) {
  margin: 5px 0 0;
  color: #837c8e;
  font-size: 13px;
}
.admin-access-panel__head button {
  border: 0;
  font-size: 14px;
  cursor: pointer;
}
.admin-access-panel__create {
  border-bottom: 1px solid #e4e2ea;
  background: #fdfcff;
}
.admin-table-scroll {
  min-width: 0;
  border: 1px solid #e9e7ee;
  border-radius: 10px;
  background: #fff;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}
.admin-table {
  width: 100%;
  min-width: 660px;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}
.admin-table th,
.admin-table td {
  padding: 18px 20px;
  border-top: 1px solid #e9e7ee;
  vertical-align: middle;
  overflow-wrap: anywhere;
}
.admin-table thead {
  background: #f6f4fb;
  color: #837c8e;
  font-size: 12px;
}
.admin-table thead th {
  border-top: 0;
  font-weight: 600;
}
.admin-table tbody th {
  color: #40305c;
  font-weight: 600;
}
.admin-table .admin-table__role-name {
  width: 220px;
  min-width: 220px;
  white-space: normal;
  overflow-wrap: break-word;
}
.admin-table tbody td {
  color: #615e6b;
}
.admin-table tbody tr:not(.admin-table__editor):hover {
  background: #fdfcff;
}
.admin-table__action {
  padding: 7px 0;
  border: 0;
  background: transparent;
  color: #6248d6;
  font: inherit;
  white-space: nowrap;
  cursor: pointer;
}
.admin-table__action:hover {
  text-decoration: underline;
}
.admin-table__date {
  min-width: 130px;
  font-size: 12px;
}
.admin-table .admin-table__empty {
  padding: 36px 24px;
  color: #837c8e;
  text-align: center;
}
.admin-table__editor > td {
  padding: 0;
  background: #faf9fd;
}
.admin-table__editor .admin-role-form__fields {
  border-top: 0;
}
.admin-role-badge {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 6px;
  background: #eeeafb;
  color: #6248d6;
  font-size: 12px;
}
.admin-permission-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.admin-permission-badges .admin-role-badge {
  max-width: 100%;
  line-height: 1.5;
}
.admin-roles__heading,
.admin-role-form__permissions-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.admin-roles__heading h2,
.admin-role-form__permissions-head h3 {
  margin: 0;
  font-size: 19px;
}
.admin-roles__heading > span,
.admin-role-form__permissions-head > span {
  color: #837c8e;
  font-size: 13px;
}
.admin-role {
  margin: 16px 0;
  padding: 0;
}
.admin-role--new {
  margin: 0 0 30px;
  border-color: #cfc6ed;
}
.admin-role__summary {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px;
  border-radius: 14px;
  cursor: pointer;
  list-style: none;
}
.admin-role__summary::-webkit-details-marker {
  display: none;
}
.admin-role__summary > span:first-child {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.admin-role__summary strong {
  display: block;
  color: #40305c;
  font-size: 18px;
}
.admin-role__summary small {
  display: block;
  margin-top: 5px;
  color: #837c8e;
  font-size: 13px;
}
.admin-role__count {
  flex-shrink: 0;
  color: #735dc0;
  font-size: 12px;
}
.admin-role__expand {
  color: #6248d6;
  font-size: 23px;
  line-height: 1;
}
.admin-role[open] > summary .admin-role__expand {
  transform: rotate(45deg);
}
.admin-role-form {
  padding: 0 24px 24px;
}
.admin-role-form__fields {
  min-width: 0;
  margin: 0;
  padding: 24px 0 0;
  border: 0;
  border-top: 1px solid #e9e7ee;
}
.admin-role-form__permissions-head {
  margin-top: 28px;
}
.admin-role-form__hint {
  margin: 8px 0 18px;
  color: #837c8e;
  font-size: 13px;
}
.admin-permissions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.admin-permissions__group {
  min-width: 0;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid #e4e2ea;
  border-radius: 10px;
  background: #fdfcff;
}
.admin-permissions__group legend {
  padding: 0 6px;
  color: #615077;
  font-size: 13px;
  font-weight: 600;
}
.admin-permissions__option {
  display: flex;
  align-items: start;
  gap: 10px;
  padding: 7px 0;
  color: #615e6b;
  font-size: 14px;
  cursor: pointer;
}
.admin-permissions__option input {
  flex-shrink: 0;
  width: 17px;
  height: 17px;
  margin: 2px 0 0;
  accent-color: #6248d6;
}
.admin-role-form .admin-save {
  position: static;
  flex-wrap: wrap;
  margin-top: 24px;
  box-shadow: none;
}
@media (max-width: 1100px) {
  .admin-fields--two {
    grid-template-columns: 1fr;
  }
  .admin-permissions {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  .admin {
    padding-top: 90px;
  }
  .admin-sidebar {
    position: static;
  }
  .admin-sidebar {
    min-height: 0;
  }
  .admin-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 10px;
  }
  .admin-nav__link {
    grid-template-columns: 22px minmax(0, 1fr);
    min-height: 44px;
    font-size: 13px;
  }
  .admin-sidebar__account,
  .admin-sidebar__footer {
    padding: 16px 18px;
  }
  .admin-body {
    --admin-panel-padding: 20px;
  }
  .admin-panel.admin-role {
    padding: 0;
  }
  .admin-role__summary {
    padding: 20px;
  }
  .admin-role-form {
    padding: 0 20px 20px;
  }
  .admin-panel__head,
  .admin-access-panel__head {
    align-items: stretch;
    flex-direction: column;
  }
  .admin-panel__hint {
    max-width: none;
    text-align: left;
  }
  .admin-book {
    grid-template-columns: minmax(0, 1fr);
    gap: 15px;
    padding: 15px;
  }
  .admin-book__images {
    grid-template-columns: minmax(0, 1fr);
  }
  .admin-book__head {
    align-items: start;
    flex-direction: column;
  }
  .admin-order dl {
    grid-template-columns: 1fr;
  }
  .admin-save {
    bottom: 8px;
    flex-direction: column;
    align-items: stretch;
  }
  .admin-save button {
    width: 100%;
  }
}

@media (min-width: 761px) {
  .admin .admin-sticky-fit {
    position: sticky;
    top: var(--admin-sticky-offset);
    align-self: start;
  }
}
