.admin-page {
  margin: 0;
  min-height: 100vh;
  background: #dbe2e8;
  color: #1e2a39;
}

.admin-page,
.admin-page button,
.admin-page input,
.admin-page textarea,
.admin-page select {
  font-family: "Montserrat", "Segoe UI", sans-serif;
}

.admin-page * {
  box-sizing: border-box;
}

.admin-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(19, 32, 52, 0.46);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
  z-index: 30;
}

.admin-layout {
  min-height: 100vh;
}

.admin-sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: min(84vw, 320px);
  background: linear-gradient(180deg, #1f3c66 0%, #224776 100%);
  color: #fff;
  transform: translateX(-102%);
  transition: transform 0.2s ease;
  z-index: 40;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.admin-brand {
  position: relative;
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.admin-sidebar-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.admin-brand__title {
  font-size: 28px;
  line-height: 1;
  font-weight: 700;
}

.admin-brand__subtitle {
  margin-top: 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.78);
}

.admin-nav {
  padding: 14px 10px;
  display: grid;
  gap: 8px;
  align-content: start;
  grid-auto-rows: max-content;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0,
    #000 18px,
    #000 calc(100% - 18px),
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0,
    #000 18px,
    #000 calc(100% - 18px),
    transparent 100%
  );
}

.admin-nav::-webkit-scrollbar {
  width: 8px;
}

.admin-nav::-webkit-scrollbar-track {
  background: transparent;
}

.admin-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.admin-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
  background-clip: padding-box;
}

.admin-nav__item {
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 12px;
  background: transparent;
  color: #fff;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-nav__item.is-active {
  background: rgba(255, 255, 255, 0.16);
}

.admin-nav__item.is-disabled {
  opacity: 0.68;
}

.admin-nav__badge {
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.2);
}

.admin-sidebar__footer {
  padding: 14px 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  display: grid;
  gap: 10px;
  justify-items: center;
}

.admin-user {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}

.admin-avatar {
  width: auto;
  height: auto;
  border-radius: 0;
  display: inline-block;
  background: transparent;
  border: 0;
  font-size: 24px;
  line-height: 1;
}

.admin-user__name {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.admin-logout-btn {
  width: auto;
  border: 1px solid rgba(255, 85, 85, 0.55);
  border-radius: 10px;
  padding: 6px 12px;
  background: rgba(7, 21, 40, 0.45);
  color: #ff5b5b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.admin-logout-btn:hover {
  background: rgba(12, 29, 54, 0.65);
  border-color: rgba(255, 90, 90, 0.9);
}

.admin-logout-btn:active {
  transform: translateY(1px);
}

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

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  background: rgba(226, 233, 241, 0.95);
  backdrop-filter: blur(8px);
}

.admin-topbar__left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.admin-menu-btn {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: #fff;
  color: #1f3f6d;
}

.admin-topbar__title h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1;
}

.admin-topbar__title p {
  margin: 3px 0 0;
  font-size: 12px;
  color: #53647b;
}

.admin-topbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-content {
  max-width: 1060px;
  margin: 0 auto;
  padding: 6px 12px 12px;
}

.admin-section-label {
  font-size: 34px;
  color: #4f72a7;
  margin-bottom: 10px;
}

.admin-accordion-list {
  display: grid;
  gap: 12px;
  margin-top: 4px;
}

.admin-accordion-item {
  border-radius: 14px;
}

.admin-accordion-head {
  background: #fff;
  border-radius: 14px;
  min-height: 72px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 5px 14px rgba(35, 52, 81, 0.08);
  transition: all 0.3s ease 0s;
}

.admin-accordion-head:hover {
  box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.12);
}

.admin-accordion-item.is-open .admin-accordion-head {
  box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.12);
}

.drag-handle {
  user-select: none;
  cursor: grab;
  color: #4f72a7;
  font-size: 22px;
  line-height: 1;
  padding: 0 2px;
  touch-action: none;
}

.admin-accordion-item.is-dragging,
.service-row.is-dragging {
  opacity: 0.12;
}

.category-inline-form {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.inline-title,
.service-title-edit,
.service-price-edit {
  border: 1px solid transparent;
  background: transparent;
  color: #1e2a39;
  border-radius: 8px;
  padding: 8px 10px;
}

textarea.inline-title,
textarea.service-title-edit,
textarea.admin-input {
  resize: none;
  overflow: hidden;
}

.inline-title {
  flex: 1;
  min-width: 0;
  font-size: 18px;
  font-weight: 600;
}

.inline-title[readonly],
.service-title-edit[readonly],
.service-price-edit[readonly],
.service-description-edit[readonly] {
  pointer-events: auto;
}

.inline-title.is-editing,
.service-title-edit.is-editing,
.service-price-edit.is-editing,
.service-description-edit.is-editing {
  border-color: #9db2cf;
  background: #f8fbff;
}

.toggle-btn {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: transparent !important;
  color: #5178ac;
  position: relative;
  box-shadow: none;
}

.toggle-btn:hover,
.toggle-btn:focus,
.toggle-btn:active {
  background: transparent !important;
  box-shadow: none;
}

.toggle-icon {
  position: relative;
  display: inline-block;
  width: 25px;
  height: 25px;
}

.toggle-icon:before {
  position: absolute;
  content: "";
  top: 10px;
  left: 0;
  width: 25px;
  height: 5px;
  border-radius: 2px;
  background: #5178ac;
  transition: all 0.3s ease 0s;
}

.toggle-icon:after {
  position: absolute;
  content: "";
  top: 0;
  left: 10px;
  width: 5px;
  height: 25px;
  border-radius: 2px;
  background: #5178ac;
  transition: all 0.3s ease 0s;
}

.toggle-btn.is-open .toggle-icon:after {
  transform: rotate(90deg);
}

.admin-accordion-body {
  padding: 0 14px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.26s ease, opacity 0.2s ease, padding 0.2s ease;
}

.admin-accordion-body.is-open {
  padding: 10px 14px 4px;
  opacity: 1;
}

.serviceSortList {
  display: grid;
  gap: 10px;
}

.service-row {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #556073;
  padding: 8px 0;
}

.service-inline-form {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 8px;
}

.service-main-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.service-title-edit {
  flex: 1;
  min-width: 0;
  font-size: 17px;
}

.service-description-edit {
  width: 100%;
  min-height: 52px;
  font-size: 14px;
  line-height: 1.35;
  color: #1f2f46;
  white-space: pre-wrap;
}

.service-price-edit {
  width: 100px;
  text-align: right;
  font-size: 17px;
}

.service-price-currency {
  font-size: 16px;
}

.service-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 13px;
}

.inline-check input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.inline-check span {
  cursor: pointer;
}

.inline-check:hover span {
  color: #27456f;
}

.icon-btn {
  border: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #4f72a7;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease, background-color 0.2s ease;
}

.icon-btn--danger {
  background: #dd4b4b;
  font-size: 0;
  line-height: 1;
  padding: 0;
}

.icon-cross {
  position: relative;
  width: 16px;
  height: 16px;
  display: inline-block;
}

.icon-cross:before,
.icon-cross:after {
  content: "";
  position: absolute;
  left: 7px;
  top: 0;
  width: 2px;
  height: 16px;
  border-radius: 2px;
  background: #fff;
}

.icon-cross:before {
  transform: rotate(45deg);
}

.icon-cross:after {
  transform: rotate(-45deg);
}

.icon-cross--sm {
  width: 14px;
  height: 14px;
  transform: translateY(-1px);
}

.icon-cross--sm:before,
.icon-cross--sm:after {
  left: 6px;
  height: 14px;
}

.icon-btn--add {
  background: #4f72a7;
  border-radius: 999px;
  width: 44px;
  min-width: 44px;
  height: 44px;
  font-size: 0;
  line-height: 1;
  padding: 0;
}

.icon-plus {
  position: relative;
  width: 18px;
  height: 18px;
  display: inline-block;
}

.icon-plus:before,
.icon-plus:after {
  content: "";
  position: absolute;
  left: 8px;
  top: 0;
  width: 2px;
  height: 18px;
  border-radius: 2px;
  background: #fff;
}

.icon-plus:after {
  transform: rotate(90deg);
}

.icon-btn:not(.toggle-btn):hover {
  filter: brightness(1.06);
  box-shadow: 0 4px 12px rgba(24, 41, 66, 0.2);
}

.icon-btn:not(.toggle-btn):active {
  transform: translateY(1px);
}

.add-service-form,
.add-category-form {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}

.add-service-form {
  display: grid;
  grid-template-columns: 1fr 220px auto;
  align-items: start;
}

.add-service-title {
  flex: 1;
  min-width: 0;
}

.add-service-price {
  width: 220px;
  max-width: 220px;
}

.add-service-description {
  grid-column: 1 / -1;
  min-height: 56px;
  font-size: 14px;
  line-height: 1.35;
  white-space: pre-wrap;
}

.admin-order-form {
  margin-top: 0;
}

.admin-btn {
  border: 0;
  border-radius: 10px;
  padding: 11px 16px;
  background: #4f72a7;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.admin-btn:hover {
  filter: brightness(1.06);
  box-shadow: 0 4px 14px rgba(28, 50, 82, 0.2);
}

.admin-btn:active {
  transform: translateY(1px);
}

.admin-btn--ghost {
  background: #f3f6fb;
  color: #27456f;
  border: 1px solid #b6c6dc;
}

.admin-btn--danger {
  background: #dd4b4b;
}

.admin-panel {
  margin-top: 14px;
  background: #fff;
  border: 1px solid #d7e0ee;
  border-radius: 14px;
  padding: 12px;
}

.admin-panel--compact {
  max-width: none;
  width: 100%;
  border: 0;
  padding: 10px;
  box-shadow: 0 5px 14px rgba(35, 52, 81, 0.08);
  overflow: hidden;
}

.admin-panel--compact .admin-subtitle {
  margin: 0 0 8px;
}

.admin-subtitle {
  margin: 0 0 10px;
  font-size: 22px;
}

.admin-subtitle--small {
  font-size: 16px;
}

.admin-input {
  width: 100%;
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid #b3c3db;
  background: #fff;
  padding: 8px 12px;
}

.admin-panel--compact .add-category-form {
  margin-top: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.admin-panel--compact .admin-input {
  min-height: 56px;
  border-radius: 12px;
}

.admin-alert {
  margin-bottom: 10px;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
}

.admin-alert--success {
  background: #e8f5ea;
  color: #1c6a2e;
}

.admin-alert--error {
  background: #fdeaea;
  color: #8b2323;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.confirm-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 22, 36, 0.54);
}

.confirm-modal__card {
  position: relative;
  z-index: 1;
  max-width: 380px;
  margin: 14vh auto 0;
  background: #fff;
  border-radius: 14px;
  padding: 14px;
}

.confirm-modal__card h3 {
  margin: 0 0 6px;
}

.confirm-modal__card p {
  margin: 0;
  color: #4f5f74;
}

.confirm-modal__actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.admin-auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}

.admin-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid #d7e0ee;
  border-radius: 14px;
  padding: 14px;
}

.admin-title {
  margin: 0 0 12px;
  font-size: 24px;
}

.admin-form {
  display: grid;
  gap: 8px;
}

.admin-label {
  font-size: 14px;
}

.admin-honeypot {
  position: absolute;
  left: -9999px;
}

.sidebar-open .admin-sidebar {
  transform: translateX(0);
}

.sidebar-open .admin-backdrop {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 720px) {
  body.sidebar-open {
    overflow: hidden;
  }
}

@media (min-width: 960px) {
  .admin-sidebar {
    transform: none;
    width: 280px;
    top: 0;
    height: auto;
  }

  .admin-backdrop,
  .admin-menu-btn {
    display: none;
  }

  .admin-main {
    margin-left: 280px;
    padding-top: 0;
  }

  .admin-content {
    padding: 18px;
  }

  .admin-sidebar-close {
    display: none;
  }
}

@media (max-width: 720px) {
  .admin-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
  }

  .admin-main {
    padding-top: 88px;
    position: relative;
  }

  .admin-sidebar {
    top: 62px;
    bottom: auto;
    height: calc(100vh - 62px);
  }

  .admin-topbar__title h1 {
    font-size: 18px;
  }

  .admin-content {
    padding: 10px;
  }

  .admin-topbar {
    align-items: flex-start;
  }

  .admin-topbar__title h1 {
    line-height: 1.05;
  }

  .admin-topbar__actions .admin-btn {
    padding: 8px 10px;
    font-size: 12px;
  }

  .admin-accordion-head {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr) auto auto;
    gap: 8px;
    align-items: center;
    min-height: 64px;
    padding: 8px;
  }

  .category-inline-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "title"
      "meta";
    gap: 6px;
    min-width: 0;
  }

  .inline-title {
    grid-area: title;
    width: auto;
    min-width: 0;
    padding: 4px 6px;
    font-size: 16px;
    line-height: 1.2;
    white-space: normal;
  }

  .category-inline-form .inline-check {
    grid-area: meta;
    justify-self: start;
  }

  .inline-check {
    font-size: 12px;
    gap: 4px;
    white-space: nowrap;
  }

  .icon-btn {
    width: 34px;
    height: 34px;
  }

  .toggle-btn {
    width: 40px;
    height: 40px;
  }

  .service-row {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: start;
    padding: 10px 0;
  }

  .service-inline-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "title title"
      "desc desc"
      "price meta";
    gap: 6px 8px;
    align-items: center;
    min-width: 0;
  }

  .service-main-row {
    display: contents;
  }

  .service-title-edit {
    grid-area: title;
    width: 100%;
    min-width: 0;
    font-size: 16px;
    line-height: 1.25;
    padding: 4px 6px;
    white-space: normal;
  }

  .service-description-edit {
    grid-area: desc;
    width: 100%;
    min-height: 56px;
    padding: 6px;
    font-size: 14px;
  }

  .service-price-edit {
    grid-area: price;
    width: 92px;
    min-width: 0;
    text-align: left;
    font-size: 16px;
    padding: 4px 6px;
  }

  .service-price-currency {
    font-size: 15px;
  }

  .service-meta {
    grid-area: meta;
    justify-self: end;
    gap: 8px;
  }

  .add-service-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: start;
    margin-top: 10px;
  }

  .add-service-title {
    grid-column: 1 / span 2;
  }

  .add-service-description {
    grid-column: 1 / span 2;
    grid-row: 3;
  }

  .add-service-price {
    grid-column: 1;
    width: auto;
    max-width: none;
  }

  .add-service-form .icon-btn--add {
    grid-column: 2;
    grid-row: 4;
    align-self: stretch;
  }

  .admin-panel--compact .add-category-form {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .admin-main,
  .admin-content,
  .admin-accordion-head,
  .service-row {
    overflow-x: hidden;
  }

  .admin-main::before,
  .admin-main::after {
    content: "";
    position: fixed;
    left: 0;
    right: 0;
    pointer-events: none;
    z-index: 46;
  }

  .admin-main::before {
    top: 62px;
    height: 24px;
    background: linear-gradient(to bottom, rgba(203, 211, 221, 0.98), rgba(203, 211, 221, 0));
  }

  .admin-main::after {
    bottom: 0;
    height: 28px;
    background: linear-gradient(to top, rgba(203, 211, 221, 0.98), rgba(203, 211, 221, 0));
  }

  .admin-brand__title {
    font-size: 24px;
  }

  .admin-brand__subtitle {
    font-size: 11px;
  }
}
