.mall-admin-app {
  background:
    radial-gradient(circle at 68% 0%, rgba(var(--blue-rgb), 0.055), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.active-menu {
  background: var(--blue-soft);
  color: var(--blue-deep) !important;
  font-weight: 800;
}

.points-top-actions {
  gap: 12px;
}

.points-top-actions .toolbar-btn {
  height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: #0f172a;
  font-weight: 800;
}

.points-top-actions svg,
.points-tabbar svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.points-tabbar {
  gap: 8px;
  padding: 0 16px;
}

.points-tabbar .tab {
  height: 38px;
  padding: 0 13px;
  background: transparent;
  color: #64748b;
  font-weight: 700;
}

.points-tabbar .active-tab {
  background: #f1f5fb;
  color: var(--blue-ink);
}

.mall-admin-page {
  min-height: calc(100vh - var(--app-chrome-height, 131px));
  padding: clamp(28px, 2.8vw, 38px) clamp(22px, 3vw, 54px) 84px;
}

.mall-admin-shell {
  width: 100%;
  max-width: 1540px;
  margin: 0 auto;
}

.mall-admin-heading,
.product-table-toolbar,
.filter-actions,
.toolbar-left,
.table-footer,
.table-footer-left,
.form-title-row,
.inline-section-title,
.combo-row,
.side-title,
.side-switch-row,
.side-actions,
.back-link,
.compact-tool-group,
.language-tabs,
.check-row,
.segmented {
  display: flex;
  align-items: center;
}

.mall-admin-heading {
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.mall-admin-heading h1 {
  margin: 0;
  color: #0f172a;
  font-size: 32px;
  line-height: 1.1;
  font-weight: 900;
}

.mall-admin-heading p {
  margin: 8px 0 0;
  color: #64748b;
}

.mall-metric-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.mall-metric-strip span {
  min-width: 116px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  color: #64748b;
  font-weight: 800;
}

.mall-metric-strip strong {
  color: #0f172a;
  font-size: 20px;
}

.mall-subnav {
  width: fit-content;
  max-width: 100%;
  display: flex;
  gap: 4px;
  padding: 5px;
  margin-bottom: 18px;
  overflow-x: auto;
  border-radius: 10px;
  background: #f1f5f9;
  scrollbar-width: none;
}

.mall-subnav::-webkit-scrollbar {
  display: none;
}

.mall-subnav button,
.mall-subnav a {
  min-width: 100px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #64748b;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}

.mall-subnav button.active,
.mall-subnav a.active {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.product-filter-panel,
.product-table-card,
.form-card,
.empty-state {
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.product-filter-panel {
  display: grid;
  grid-template-columns: minmax(320px, 1.05fr) minmax(220px, 0.85fr) minmax(220px, 0.85fr) auto;
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
  padding: 18px 20px;
}

.product-filter-panel label,
.field,
.field-set,
.rich-text-section {
  min-width: 0;
}

.product-filter-panel span,
.field > span,
.field-set legend,
.rich-text-section > span {
  display: block;
  margin-bottom: 8px;
  color: #0f172a;
  font-weight: 850;
}

.product-filter-panel input,
.product-filter-panel select,
.field input,
.field select,
.field textarea,
.editor-toolbar select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  color: #0f172a;
  font: inherit;
}

.product-filter-panel input,
.product-filter-panel select,
.field input,
.field select {
  height: 42px;
  padding: 0 12px;
}

.filter-actions,
.toolbar-left {
  gap: 10px;
  flex-wrap: wrap;
}

.primary-action,
.secondary-action,
.text-action {
  width: auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
}

.primary-action,
.secondary-action {
  height: 40px;
  gap: 8px;
  padding: 0 15px;
}

.primary-action {
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #fff;
  box-shadow: 0 10px 20px rgba(var(--blue-rgb), 0.17);
}

.secondary-action {
  border: 1px solid #bfdbfe;
  background: #fff;
  color: var(--blue-ink);
}

.secondary-action.ghost-reset {
  color: #64748b;
}

.text-action {
  height: 30px;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue-ink);
}

.primary-action svg,
.secondary-action svg,
.text-action svg,
.compact-tool-group svg,
.back-link svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.product-table-card {
  overflow: hidden;
}

.product-table-toolbar {
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid #edf1f7;
}

.compact-tool-group {
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: #fff;
}

.compact-tool-group button {
  width: 46px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-right: 1px solid #cbd5e1;
  background: transparent;
  color: #334155;
}

.compact-tool-group button:last-child {
  border-right: 0;
}

.product-table-wrap {
  overflow: auto;
  scrollbar-color: #c8cdd4 transparent;
  scrollbar-width: thin;
}

.product-table-wrap::-webkit-scrollbar {
  height: 9px;
}

.product-table-wrap::-webkit-scrollbar-thumb {
  background: #c7ccd4;
  border-radius: 99px;
}

.product-table {
  width: 100%;
  min-width: 1380px;
  border-collapse: collapse;
}

.product-table th,
.product-table td {
  padding: 17px 16px;
  border-bottom: 1px solid #edf1f7;
  text-align: left;
  vertical-align: middle;
}

.product-table th {
  color: #475569;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.product-table th button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 900;
}

.product-table tr:last-child td {
  border-bottom: 0;
}

.product-table tbody tr:hover {
  background: #f8fbff;
}

.product-table th:last-child,
.product-table td:last-child {
  position: sticky;
  right: 0;
  min-width: 132px;
  background: #fff;
  box-shadow: -10px 0 18px rgba(15, 23, 42, 0.06);
}

.product-table th:last-child {
  z-index: 4;
  background: #f8fafc;
}

.product-table td:last-child {
  z-index: 3;
}

.product-name-cell {
  display: grid;
  gap: 5px;
  min-width: 210px;
}

.product-name-cell strong {
  color: #0f172a;
  font-size: 14px;
}

.product-name-cell small,
.muted {
  color: #64748b;
  font-weight: 750;
}

.status-pill,
.type-pill,
.tag-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.status-pill,
.type-pill {
  min-height: 27px;
  padding: 0 10px;
  font-size: 12px;
}

.status-pill.green,
.type-pill.blue {
  background: #ecfdf5;
  color: #047857;
}

.status-pill.slate {
  background: #f1f5f9;
  color: #475569;
}

.status-pill.amber {
  background: #fffbeb;
  color: #b45309;
}

.type-pill.blue {
  background: #eff6ff;
  color: var(--blue-deep);
}

.type-pill.orange {
  background: #fff7ed;
  color: #c2410c;
}

.switch-control {
  width: 52px;
  height: 32px;
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.switch-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-control i {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.15s ease;
}

.switch-control i::after {
  content: "";
  width: 26px;
  height: 26px;
  position: absolute;
  top: 3px;
  left: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
  transition: transform 0.15s ease;
}

.switch-control input:checked + i {
  background: #4ade80;
}

.switch-control input:checked + i::after {
  transform: translateX(20px);
}

.operator-cell {
  display: grid;
  gap: 5px;
}

.operator-cell strong {
  color: #0f172a;
  font-size: 13px;
}

.operator-cell span {
  color: #64748b;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 800;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.table-actions button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue-ink);
  font-weight: 850;
}

.table-actions button.danger {
  color: #dc2626;
}

.empty-state {
  margin: 14px 16px 0;
  padding: 18px;
  color: #64748b;
  font-weight: 850;
  text-align: center;
}

.empty-state[hidden],
.product-list-view[hidden],
.product-form-view[hidden] {
  display: none !important;
}

.table-footer {
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-top: 1px solid #edf1f7;
  background: #fbfdff;
}

.table-footer-left {
  gap: 14px;
  flex-wrap: wrap;
  color: #64748b;
  font-weight: 800;
}

.page-size {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.page-size select {
  width: 64px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  color: #0f172a;
  font-weight: 850;
}

.pager {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.pager button {
  min-width: 38px;
  height: 36px;
  border: 0;
  border-right: 1px solid var(--border);
  background: #fff;
  color: #64748b;
  font-weight: 800;
}

.pager button:last-child {
  border-right: 0;
}

.pager button.active {
  background: var(--blue);
  color: #fff;
}

.pager button:disabled {
  color: #cbd5e1;
  background: #f8fafc;
}

.back-link {
  gap: 7px;
  margin-bottom: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #0f172a;
  font-weight: 850;
}

.back-link:hover {
  color: var(--blue-ink);
}

.product-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 18px;
  align-items: start;
}

.form-main,
.form-side {
  min-width: 0;
}

.form-side {
  position: sticky;
  top: calc(var(--app-chrome-height, 131px) + 20px);
  display: grid;
  gap: 16px;
}

.form-card {
  padding: 24px;
}

.product-editor-card {
  padding: clamp(22px, 2.2vw, 32px);
}

.form-title-row {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.form-title-row h2,
.side-card h3 {
  margin: 0;
  color: #0f172a;
  font-size: 24px;
  line-height: 1.15;
  font-weight: 900;
}

.side-card h3 {
  font-size: 18px;
}

.form-title-row p {
  margin: 7px 0 0;
  color: #64748b;
}

.form-code-pill {
  height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--blue-deep);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 900;
}

.language-tabs {
  gap: 22px;
  margin-bottom: 24px;
  overflow-x: auto;
  scrollbar-width: none;
}

.language-tabs::-webkit-scrollbar {
  display: none;
}

.language-tabs button {
  position: relative;
  flex: 0 0 auto;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #64748b;
  font-weight: 850;
}

.language-tabs button.active {
  color: var(--blue-ink);
}

.language-tabs button.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  border-radius: 999px;
  background: var(--blue-ink);
}

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

.full {
  grid-column: 1 / -1;
}

.field {
  position: relative;
  display: grid;
  gap: 0;
}

.field.required > span::after,
.field-set legend::after {
  content: "";
}

.field small,
.upload-section small {
  margin-top: 7px;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.45;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.product-filter-panel input:focus,
.product-filter-panel select:focus {
  outline: 0;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.field-set {
  margin: 0;
  padding: 0;
  border: 0;
}

.check-row {
  gap: 18px;
  flex-wrap: wrap;
}

.check-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #0f172a;
  font-weight: 850;
}

.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}

.inline-section-title {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.inline-section-title strong {
  color: #0f172a;
  font-size: 14px;
  font-weight: 900;
}

.inline-section-title span {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 800;
}

.combo-list {
  display: grid;
  gap: 10px;
}

.combo-row {
  gap: 8px;
}

.combo-row input {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  color: #0f172a;
  font: inherit;
}

.combo-row span {
  color: #64748b;
  font-weight: 900;
}

.combo-row em {
  min-width: 44px;
  color: #334155;
  font-style: normal;
  font-weight: 850;
}

.combo-row button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 0;
  border-radius: 7px;
  background: #fef2f2;
  color: #dc2626;
  font-size: 18px;
  line-height: 1;
}

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

.segmented {
  width: fit-content;
  max-width: 100%;
  gap: 4px;
  padding: 4px;
  overflow-x: auto;
  border-radius: 9px;
  background: #f1f5f9;
}

.segmented button {
  min-width: 92px;
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #64748b;
  font-weight: 850;
  white-space: nowrap;
}

.segmented button.active {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 8px 15px rgba(var(--blue-rgb), 0.16);
}

.muted-segmented button.active {
  background: #fff;
  color: var(--blue-ink);
}

.upload-section {
  display: grid;
  gap: 6px;
}

.image-uploader {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.image-tile,
.upload-tile {
  width: 104px;
  height: 88px;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #dbe5f3;
  border-radius: 9px;
  background: #f8fafc;
}

.image-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-tile span {
  position: absolute;
  left: 8px;
  bottom: 7px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.9);
  color: #fff;
  font-size: 12px;
  font-weight: 850;
}

.image-remove {
  width: 21px;
  height: 21px;
  position: absolute;
  z-index: 2;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 50%;
  background: #fff;
  color: #334155;
  line-height: 1;
}

.upload-tile {
  border-style: dashed;
  color: #64748b;
}

.upload-tile svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.select-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.compact-action {
  min-width: 96px;
}

.tag-select {
  min-height: 44px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
}

.tag-pill {
  min-height: 27px;
  padding: 0 10px;
  background: #eff6ff;
  color: var(--blue-deep);
  font-size: 12px;
}

.tag-select input {
  flex: 1 1 180px;
  min-width: 150px;
  height: 30px;
  padding: 0;
  border: 0;
  outline: 0;
}

.editor-shell {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.editor-toolbar {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  padding: 8px 12px;
  border-bottom: 1px solid #edf1f7;
  background: #fbfdff;
}

.editor-toolbar select {
  width: auto;
  height: 32px;
  padding: 0 26px 0 10px;
}

.editor-toolbar button {
  min-width: 30px;
  height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--blue-deep);
  font-size: 16px;
  font-weight: 900;
}

.editor-toolbar button:hover {
  background: var(--blue-soft);
}

.editor-shell textarea {
  width: 100%;
  min-height: 420px;
  display: block;
  padding: 16px;
  border: 0;
  outline: 0;
  resize: vertical;
  color: #0f172a;
  font: inherit;
}

.side-card {
  display: grid;
  gap: 16px;
}

.side-title {
  justify-content: space-between;
  gap: 12px;
}

.side-switch-row {
  justify-content: space-between;
  gap: 12px;
  color: #0f172a;
  font-weight: 850;
}

.side-info-list {
  display: grid;
  gap: 11px;
  padding-top: 4px;
}

.side-info-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #64748b;
}

.side-info-list strong {
  color: #0f172a;
  font-size: 13px;
  text-align: right;
}

.preview-card {
  display: grid;
  gap: 10px;
  overflow: hidden;
}

.preview-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  display: block;
  object-fit: cover;
  border: 1px solid #dbe5f3;
  border-radius: 9px;
  background: #f8fafc;
}

.preview-card strong {
  color: #0f172a;
  font-size: 15px;
}

.preview-card span {
  color: #f97316;
  font-size: 18px;
  font-weight: 950;
}

.side-actions {
  gap: 10px;
}

.side-actions .primary-action,
.side-actions .secondary-action {
  flex: 1;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 80;
  max-width: 420px;
  padding: 13px 16px;
  border-radius: 10px;
  background: #0f172a;
  color: #fff;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1180px) {
  .product-filter-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-form {
    grid-template-columns: 1fr;
  }

  .form-side {
    position: static;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .mall-admin-page {
    padding: 24px 16px 48px;
  }

  .mall-admin-heading,
  .product-table-toolbar,
  .table-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .mall-metric-strip {
    justify-content: flex-start;
  }

  .product-filter-panel,
  .form-grid,
  .two-field-grid,
  .form-side {
    grid-template-columns: 1fr;
  }

  .filter-actions .primary-action,
  .filter-actions .secondary-action,
  .toolbar-left .primary-action,
  .toolbar-left .secondary-action,
  .pager {
    width: 100%;
  }

  .pager button {
    flex: 1;
  }

  .compact-tool-group {
    align-self: flex-start;
  }

  .combo-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto auto;
  }
}

@media (max-width: 640px) {
  .mall-admin-page {
    width: 100vw;
    padding: 22px 12px 34px;
    overflow: hidden;
  }

  .mall-admin-shell {
    max-width: calc(100vw - 24px);
  }

  .mall-admin-page * {
    max-width: 100%;
  }

  .mall-admin-heading h1 {
    font-size: 26px;
  }

  .mall-metric-strip span {
    width: calc(50% - 5px);
    min-width: 0;
  }

  .mall-subnav {
    width: 100%;
  }

  .product-table-card,
  .form-card,
  .product-filter-panel {
    border-radius: 10px;
  }

  .form-card {
    padding: 18px;
  }

  .form-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .language-tabs {
    gap: 16px;
  }

  .editor-shell textarea {
    min-height: 300px;
  }

  .combo-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .combo-row span,
  .combo-row em {
    display: none;
  }

  .select-action-row,
  .side-actions {
    grid-template-columns: 1fr;
    display: grid;
  }
}
