* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #e3fbf5;
  color: #000;
}

button {
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

input,
select {
  font: inherit;
}

#app {
  min-height: 100svh;
  padding: 14px;
}

.admin-page {
  min-height: calc(100svh - 28px);
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  grid-template-rows: 64px minmax(0, 1fr);
  background: #e3fbf5;
  border: 2px solid rgba(0, 128, 112, 0.22);
  border-radius: 28px;
  overflow: hidden;
  transition: grid-template-columns 180ms ease;
}

.admin-page.menu-collapsed {
  grid-template-columns: 0 minmax(0, 1fr);
}

.admin-header {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  min-width: 0;
  border-bottom: 1px solid rgba(0, 128, 112, 0.18);
  transition: grid-template-columns 180ms ease;
}

.admin-page.menu-collapsed .admin-header {
  grid-template-columns: 56px minmax(0, 1fr);
}

.admin-header-menu,
.admin-header-main {
  min-width: 0;
}

.admin-header-menu {
  background: #c5eee4;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-right: 1px solid rgba(0, 128, 112, 0.18);
  overflow: hidden;
}

.admin-header-main {
  background: #e3fbf5;
}

.admin-side {
  min-height: calc(100svh - 92px);
  background: #c5eee4;
  border-right: 1px solid rgba(0, 128, 112, 0.18);
  padding: 12px;
  overflow: hidden;
}

.admin-page.menu-collapsed .admin-side {
  padding: 0;
  border-right: 0;
}

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

.admin-nav-group {
  display: grid;
  gap: 4px;
}

.admin-nav-item {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #000;
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 400;
  text-align: left;
}

.admin-nav-item.sub-item {
  min-height: 36px;
  padding-left: 28px;
  font-size: 13px;
}

.admin-nav-item:hover,
.admin-nav-item.active {
  background: rgba(0, 128, 112, 0.14);
}

.menu-toggle {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #111;
  display: grid;
  place-items: center;
}

.menu-toggle:hover {
  background: rgba(0, 128, 112, 0.12);
}

.hamburger-lines {
  width: 20px;
  display: grid;
  gap: 4px;
}

.hamburger-lines span {
  display: block;
  height: 2px;
  border-radius: 999px;
  background: #111;
}

.admin-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  display: block;
  flex: 0 0 auto;
}

.admin-header-title {
  color: #000;
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
}

.admin-main {
  min-width: 0;
  min-height: calc(100svh - 92px);
  background: #e3fbf5;
  padding: 12px;
}

.admin-layout {
  min-height: calc(100svh - 116px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.admin-inner-panel {
  min-height: 100%;
  background: rgba(239, 255, 251, 0.82);
  border: 2px solid rgba(0, 128, 112, 0.36);
  border-radius: 20px;
  padding: 14px;
}

.admin-panel-title {
  margin: 0 0 12px;
  color: #000;
  font-size: 14px;
  font-weight: 400;
}

.new-page-form {
  display: grid;
  gap: 10px;
}

.new-page-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.new-page-field {
  display: grid;
  gap: 5px;
}

.new-page-field span {
  color: #000;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
}

.new-page-field small {
  color: rgba(0, 0, 0, 0.58);
  font-size: 12px;
  font-weight: 400;
}

.new-page-input {
  width: 100%;
  height: 42px;
  border: 1px solid rgba(0, 128, 112, 0.32);
  border-radius: 12px;
  background: #fff;
  color: #000;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 400;
  outline: none;
}

.new-page-input:focus {
  border-color: rgba(0, 128, 112, 0.72);
}

textarea.new-page-input.admin-setting-textarea {
  min-height: 76px;
  height: 76px;
  padding: 10px 12px;
  line-height: 1.4;
  resize: vertical;
}

textarea.new-page-input.admin-setting-textarea.tall {
  min-height: 94px;
  height: 94px;
}

.admin-autosave-state {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid rgba(0, 128, 112, 0.22);
  border-radius: 12px;
  background: rgba(0, 128, 112, 0.08);
  color: #006d60;
  font-size: 12px;
}

.admin-autosave-state i {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #12a47f;
  box-shadow: 0 0 0 4px rgba(18, 164, 127, 0.12);
}

.admin-autosave-state.error {
  border-color: rgba(205, 39, 67, 0.28);
  background: rgba(205, 39, 67, 0.08);
  color: #b51f39;
}

.admin-autosave-state.error i {
  background: #d62745;
  box-shadow: 0 0 0 4px rgba(214, 39, 69, 0.12);
}

.new-page-save {
  width: 100%;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: rgba(0, 128, 112, 0.24);
  color: #000;
  font-size: 14px;
  font-weight: 400;
}

.new-page-save:hover {
  background: rgba(0, 128, 112, 0.32);
}

.admin-open-page {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.admin-page-summary { display: grid; gap: 14px; }
.admin-page-summary p { margin: 0; color: rgba(0,0,0,.68); line-height: 1.5; }
.admin-page-summary > div { display: grid; gap: 5px; padding: 12px; border-radius: 12px; background: rgba(0,128,112,.08); }
.admin-page-summary > div span { font-size: 12px; color: rgba(0,0,0,.58); }
.admin-page-summary > div b { color: #007f70; }
.admin-feature-list { display: grid; gap: 8px; }
.admin-feature-list span { padding: 11px 12px; border-radius: 10px; background: rgba(0,128,112,.08); }
.admin-live-description { margin: 0; max-width: 340px; font-size: 14px; line-height: 1.45; }

.admin-website-settings-page {
  display: grid;
  gap: 12px;
}

.admin-website-settings-page > .admin-layout {
  min-height: auto;
}

.admin-gallery-panel {
  min-height: 0;
}

.admin-gallery-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.admin-gallery-toolbar > div {
  min-width: 0;
}

.admin-gallery-toolbar .admin-panel-title {
  margin-bottom: 5px;
  font-size: 18px;
  font-weight: 700;
}

.admin-gallery-toolbar p {
  margin: 0;
  color: rgba(0, 0, 0, 0.62);
  font-size: 13px;
  line-height: 1.45;
}

.admin-gallery-upload-tools {
  display: flex;
  align-items: end;
  flex: 0 0 auto;
  gap: 10px;
}

.admin-gallery-upload-category {
  display: grid;
  min-width: 165px;
  gap: 5px;
}

.admin-gallery-upload-category > span {
  color: rgba(0, 0, 0, 0.62);
  font-size: 11px;
  font-weight: 700;
}

.admin-gallery-upload-category .new-page-input {
  height: 42px;
  padding: 0 10px;
}

.admin-gallery-upload-button {
  width: auto;
  min-width: 160px;
  flex: 0 0 auto;
  padding: 0 18px;
  background: #ff0878;
  color: #fff;
  font-weight: 700;
}

.admin-gallery-upload-button:hover {
  background: #e8006b;
}

.admin-gallery-panel > .admin-autosave-state {
  margin-bottom: 12px;
}

.admin-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}

.admin-gallery-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(0, 128, 112, 0.22);
  border-radius: 14px;
  background: #fff;
}

.admin-gallery-photo {
  position: relative;
  display: grid;
  height: 176px;
  padding: 10px;
  place-items: center;
  background: rgba(0, 128, 112, 0.08);
  box-sizing: border-box;
}

.admin-gallery-photo-frame {
  position: relative;
  width: 100%;
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(0, 86, 75, 0.12);
  aspect-ratio: 7 / 4;
}

.admin-gallery-photo[data-gallery-preview-category="lash"] .admin-gallery-photo-frame {
  width: auto;
  height: 100%;
  aspect-ratio: 21 / 25;
}

.admin-gallery-photo[data-gallery-preview-category="lash_nails"] .admin-gallery-photo-frame,
.admin-gallery-photo[data-gallery-preview-category="nail"] .admin-gallery-photo-frame {
  aspect-ratio: 7 / 4;
}

.admin-gallery-photo[data-gallery-preview-category="pedicure"] .admin-gallery-photo-frame {
  aspect-ratio: 7 / 2;
}

.admin-gallery-photo[data-gallery-preview-category="before_after"] .admin-gallery-photo-frame {
  aspect-ratio: 16 / 7;
  background: #f8f1ed;
}

.admin-gallery-photo[data-gallery-preview-category="before_after"] .admin-gallery-photo-frame > img {
  object-fit: contain;
}

.admin-gallery-photo-frame > img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: object-position 260ms ease;
}

.admin-gallery-frame-watermark {
  position: absolute;
  z-index: 2;
  top: 4px;
  left: 4px;
  width: 40px;
  height: 40px;
  max-width: calc(100% - 12px);
  max-height: calc(100% - 12px);
  display: grid;
  place-items: start;
  pointer-events: none;
}

.admin-gallery-frame-watermark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: left top;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.16));
}

.admin-gallery-preview-label {
  position: absolute;
  right: 8px;
  bottom: 6px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #006d60;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  pointer-events: none;
}

.admin-gallery-card-body {
  display: grid;
  gap: 9px;
  padding: 10px;
}

.admin-gallery-card-body label {
  display: grid;
  gap: 5px;
}

.admin-gallery-card-body label span {
  color: rgba(0, 0, 0, 0.6);
  font-size: 11px;
}

.admin-gallery-card-body .new-page-input {
  height: 36px;
  padding: 0 9px;
  font-size: 12px;
}

.admin-gallery-representative {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(0, 128, 112, 0.34);
  border-radius: 9px;
  background: rgba(0, 128, 112, 0.1);
  color: #006d60;
  font-size: 12px;
  font-weight: 700;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.admin-gallery-representative:hover {
  border-color: rgba(0, 128, 112, 0.5);
  background: rgba(0, 128, 112, 0.18);
}

.admin-gallery-representative:focus-visible {
  outline: 3px solid rgba(255, 8, 120, 0.22);
  outline-offset: 2px;
}

.admin-gallery-representative.is-featured {
  border-color: #007f70;
  background: #007f70;
  color: #fff;
  box-shadow: 0 5px 14px rgba(0, 109, 96, 0.2);
}

.admin-gallery-representative.is-featured::before {
  margin-right: 6px;
  content: "\2713";
}

.admin-gallery-representative.is-featured:hover {
  background: #006d60;
}

.admin-gallery-actions {
  display: grid;
  grid-template-columns: 38px 38px minmax(0, 1fr);
  gap: 6px;
}

.admin-gallery-actions button {
  height: 34px;
  border: 1px solid rgba(0, 128, 112, 0.28);
  border-radius: 9px;
  background: rgba(0, 128, 112, 0.08);
  color: #006d60;
  font-size: 13px;
}

.admin-gallery-actions button:hover:not(:disabled) {
  background: rgba(0, 128, 112, 0.17);
}

.admin-gallery-actions button:disabled {
  opacity: 0.35;
}

.admin-gallery-actions button.danger {
  border-color: rgba(205, 39, 67, 0.24);
  background: rgba(205, 39, 67, 0.07);
  color: #b51f39;
}

.admin-gallery-empty {
  grid-column: 1 / -1;
  padding: 28px 18px;
  border: 1px dashed rgba(0, 128, 112, 0.3);
  border-radius: 14px;
  color: rgba(0, 0, 0, 0.58);
  text-align: center;
}

@media (max-width: 820px) {
  .admin-gallery-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-gallery-upload-button {
    width: 100%;
  }

  .admin-gallery-upload-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-gallery-upload-category {
    width: 100%;
  }
}

.admin-save-toast {
  position: fixed;
  z-index: 1000;
  left: 50%;
  top: 50%;
  min-width: 230px;
  padding: 18px 28px;
  border: 2px solid rgba(0, 128, 112, 0.42);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  color: #007f70;
  box-shadow: 0 18px 50px rgba(0, 80, 70, 0.22);
  font-size: 20px;
  font-weight: 800;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.92);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.admin-save-toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.admin-save-toast.error {
  border-color: rgba(190, 30, 45, 0.48);
  color: #b51f31;
}

.page-context-menu {
  position: fixed;
  z-index: 20;
  width: 148px;
  padding: 6px;
  border: 1px solid rgba(0, 128, 112, 0.24);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.14);
}

.page-context-menu button {
  width: 100%;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #000;
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 14px;
  font-weight: 400;
  text-align: left;
}

.page-context-menu button:hover {
  background: rgba(0, 128, 112, 0.12);
}

.admin-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(0, 0, 0, 0.28);
  display: grid;
  place-items: center;
  padding: 20px;
}

.admin-modal {
  width: min(430px, 100%);
  border: 1px solid rgba(0, 128, 112, 0.24);
  border-radius: 18px;
  background: #effffb;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
  padding: 20px;
}

.admin-modal-title {
  margin-bottom: 12px;
  color: #000;
  font-size: 14px;
  font-weight: 400;
}

.admin-modal-input {
  width: 100%;
  height: 42px;
  border: 1px solid rgba(0, 128, 112, 0.32);
  border-radius: 12px;
  background: #fff;
  color: #000;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 400;
  outline: none;
}

.admin-modal-input:focus {
  border-color: rgba(0, 128, 112, 0.72);
}

.admin-modal-actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.admin-modal-button {
  height: 38px;
  border: 0;
  border-radius: 999px;
  padding: 0 20px;
  color: #000;
  font-size: 14px;
  font-weight: 400;
}

.admin-modal-button.primary {
  background: rgba(0, 128, 112, 0.28);
}

.admin-modal-button.secondary {
  background: rgba(0, 128, 112, 0.12);
}

.admin-modal-button:hover {
  filter: brightness(0.96);
}
