* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: #223026;
  background: linear-gradient(180deg, #eef4ee 0%, #f7faf6 100%);
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.admin-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.side-nav {
  padding: 28px 20px;
  background: #203323;
  color: #f3f8f2;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 8px 6px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark {
  display: inline-flex;
  width: 52px;
  height: 52px;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  color: #203323;
  background: linear-gradient(135deg, #dff1df, #b8ddbe);
  font-weight: 800;
}

.brand h1,
.brand p,
.workspace-topbar h2,
.workspace-topbar p,
.section-head h3,
.section-head p,
.section-head h4 {
  margin: 0;
}

.brand h1 {
  font-size: 24px;
}

.brand p {
  margin-top: 6px;
  color: rgba(243, 248, 242, 0.72);
  font-size: 13px;
}

.nav-list {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.nav-item {
  height: 48px;
  padding: 0 14px;
  border: 0;
  border-radius: 14px;
  color: rgba(243, 248, 242, 0.78);
  background: transparent;
  text-align: left;
}

.nav-item.is-active {
  color: #203323;
  background: #e4f4e5;
  font-weight: 700;
}

.workspace {
  padding: 24px;
}

.workspace-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 18px;
}

.workspace-topbar h2 {
  font-size: 30px;
}

.workspace-topbar p {
  margin-top: 8px;
  color: #708172;
}

.top-actions {
  display: flex;
  gap: 10px;
}

.top-actions button,
.actions button,
.primary {
  height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
}

.top-actions button,
.actions button {
  color: #2f7d5c;
  background: #e7f0ea;
  font-weight: 700;
}

.primary {
  width: 100%;
  color: #ffffff;
  background: #2f7d5c;
  font-weight: 700;
}

.content-panel {
  display: none;
}

.content-panel.is-active {
  display: block;
}

.card {
  padding: 22px;
  background: #ffffff;
  border-radius: 22px;
  box-shadow: 0 16px 38px rgba(42, 67, 50, 0.08);
}

.split-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 18px;
  align-items: start;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.section-head p {
  margin-top: 8px;
  color: #7a897b;
  font-size: 14px;
}

.section-head.compact {
  margin-bottom: 12px;
}

.count-pill {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  color: #2f7d5c;
  background: #edf7ef;
  font-size: 13px;
  font-weight: 700;
}

label {
  display: block;
  margin-bottom: 14px;
  color: #526054;
  font-size: 14px;
}

input {
  display: block;
  width: 100%;
  height: 44px;
  margin-top: 6px;
  padding: 0 12px;
  border: 1px solid #dce6df;
  border-radius: 12px;
  color: #223026;
  background: #fbfdfb;
}

select {
  display: block;
  width: 100%;
  height: 44px;
  margin-top: 6px;
  padding: 0 12px;
  border: 1px solid #dce6df;
  border-radius: 12px;
  color: #223026;
  background: #fbfdfb;
}

input[type="file"] {
  padding: 9px 12px;
}

.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  margin-top: 6px;
  padding: 0 12px;
  border: 1px solid #dce6df;
  border-radius: 12px;
  background: #fbfdfb;
}

.switch-row input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.preview {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 4px 0 18px;
}

.preview.stack {
  align-items: flex-start;
  flex-direction: column;
}

.preview small {
  color: #7d8a7f;
}

.preview-copy {
  display: grid;
  gap: 4px;
}

.hint-line {
  color: #2f7d5c !important;
  font-weight: 600;
}

.bead-preview,
.thumb {
  display: block;
  background-size: cover;
  background-position: center;
}

.bead-preview,
.thumb,
.hero-preview,
.card-preview,
.contact-preview {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #eef3ef;
  box-shadow: inset -8px -10px 16px rgba(0, 0, 0, 0.15), inset 8px 8px 18px rgba(255, 255, 255, 0.5), 0 8px 18px rgba(36, 55, 41, 0.12);
}

.bead-preview.type-inlineAccessory,
.thumb.type-inlineAccessory {
  width: 82px;
  height: 48px;
  border-radius: 14px;
}

.bead-preview.type-charm,
.thumb.type-charm {
  width: 56px;
  height: 82px;
  border-radius: 16px;
  background-color: #eef3ef;
  box-shadow: inset -4px -5px 10px rgba(0, 0, 0, 0.08), 0 8px 18px rgba(36, 55, 41, 0.1);
}

.hero-preview,
.card-preview,
.contact-preview {
  width: 100%;
  border-radius: 18px;
  background-color: #f3f7f1;
}

.hero-preview {
  height: 170px;
}

.card-preview {
  height: 120px;
}

.contact-preview {
  height: 260px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

.tag-chip {
  padding: 6px 12px;
  border-radius: 999px;
  color: #2f7d5c;
  background: #e7f0ea;
  font-size: 13px;
  font-weight: 700;
}

.material-list,
.orders,
.users {
  display: grid;
  gap: 14px;
}

.material-item,
.order-item,
.user-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
  padding: 16px;
  border: 1px solid #e2ebe3;
  border-radius: 18px;
  background: #fbfdfb;
}

.material-item.is-offline {
  background: #faf8f7;
}

.material-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.material-head h4,
.order-main h4 {
  margin: 0;
  font-size: 17px;
}

.material-main p,
.order-main p {
  margin: 6px 0 0;
  color: #6e7d70;
  font-size: 13px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-badge.is-online {
  color: #2f7d5c;
  background: #e7f3ea;
}

.status-badge.is-offline {
  color: #b04f43;
  background: #f8ebe8;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.actions .danger {
  color: #b8443c;
  background: #f7e8e6;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.featured-item {
  padding: 16px;
  border: 1px solid #e3ece4;
  border-radius: 18px;
  background: #fbfdfb;
}

.order-item {
  grid-template-columns: 1fr auto;
}

.user-item {
  grid-template-columns: 58px 1fr;
}

.user-avatar {
  display: flex;
  width: 58px;
  height: 58px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
  color: #ffffff;
  background: #2f7d5c;
  font-weight: 800;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-main p {
  margin: 6px 0 0;
  color: #6e7d70;
  font-size: 13px;
}

.login-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(20, 32, 23, 0.62);
}

.login-modal.is-visible {
  display: flex;
}

.login-panel {
  width: min(420px, 94vw);
  padding: 26px;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(12, 25, 16, 0.24);
}

.login-panel h2,
.login-panel p {
  margin: 0;
}

.login-panel h2 {
  font-size: 26px;
}

.login-panel p {
  margin-top: 8px;
  margin-bottom: 18px;
  color: #708172;
}

.login-error {
  min-height: 20px;
  margin: 12px 0 0 !important;
  color: #b8443c !important;
  font-size: 13px;
}

.order-beads {
  align-content: start;
}

.order-preview-button {
  display: grid;
  gap: 8px;
  justify-items: center;
  min-width: 142px;
  padding: 10px;
  border: 0;
  border-radius: 16px;
  color: #2f7d5c;
  background: #edf7ef;
  font-size: 13px;
  font-weight: 700;
}

.admin-preview-stage {
  position: relative;
  overflow: visible;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #ffffff 0%, #f8fbf8 72%, #eef5ee 100%);
}

.admin-preview-ring {
  position: absolute;
  border: 3px solid rgba(196, 216, 198, 0.92);
  border-radius: 50%;
}

.admin-preview-bead {
  position: absolute;
  transform-origin: center center;
}

.admin-preview-bead.type-bead {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.84);
  border-radius: 50%;
  background: linear-gradient(145deg, #f7faf5, #e8eee6);
  box-shadow: inset -4px -5px 8px rgba(0, 0, 0, 0.13), inset 4px 4px 8px rgba(255, 255, 255, 0.42), 0 4px 8px rgba(36, 55, 41, 0.12);
}

.admin-preview-bead.type-inlineAccessory {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.84);
  border-radius: 8px;
  background: linear-gradient(145deg, #f7faf5, #e8eee6);
  box-shadow: inset -3px -4px 7px rgba(0, 0, 0, 0.11), inset 3px 3px 7px rgba(255, 255, 255, 0.42), 0 4px 8px rgba(36, 55, 41, 0.1);
}

.admin-preview-bead.type-charm {
  overflow: visible;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(145deg, #f7faf5, #e8eee6);
  box-shadow: 0 4px 8px rgba(36, 55, 41, 0.1);
}

.order-preview-modal[hidden] {
  display: none;
}

.order-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.order-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(21, 35, 24, 0.62);
}

.order-preview-panel {
  position: relative;
  z-index: 1;
  width: min(760px, 96vw);
  max-height: 92vh;
  overflow: auto;
  padding: 22px;
  background: #ffffff;
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(12, 25, 16, 0.22);
}

.order-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.order-preview-head h3,
.order-preview-head p {
  margin: 0;
}

.order-preview-head h3 {
  font-size: 24px;
}

.order-preview-head p {
  margin-top: 6px;
  color: #708172;
}

.order-preview-head button {
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  color: #2f7d5c;
  background: #e7f0ea;
  font-weight: 700;
}

#adminBraceletPreview {
  display: flex;
  justify-content: center;
}

.admin-preview-details {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.admin-detail-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f7faf6;
  color: #526054;
}

.admin-detail-row strong {
  color: #223026;
}

.empty {
  margin: 0;
  padding: 12px 0 4px;
  color: #748274;
}

@media (max-width: 1120px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .side-nav {
    padding-bottom: 18px;
  }

  .nav-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .workspace-topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .split-layout,
  .featured-grid {
    grid-template-columns: 1fr;
  }

  .order-item {
    grid-template-columns: 1fr;
  }
}
