* { box-sizing: border-box; }
body {
  margin: 0;
  background: #f5f5f5;
  color: #243044;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}
button, input, select, textarea { font: inherit; }
button {
  height: 38px;
  padding: 0 20px;
  border: 0;
  border-radius: 4px;
  background: #109b4b;
  color: #fff;
  cursor: pointer;
}
button.secondary { background: #f08a32; }
button.purple, .purple { background: #087a3a; }
button.icon-btn { width: 38px; padding: 0; background: transparent; color: #222; }
input, select, textarea {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid #edf0f3;
  border-radius: 4px;
  background: #f7f7f7;
  color: #243044;
}
label { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 176px;
  padding: 28px 0;
  background: #fff;
  border-right: 1px solid #eef0f4;
}
.logo {
  display: grid;
  place-items: center;
  gap: 10px;
  margin-bottom: 24px;
}
.brand-logo {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 6px 18px rgba(7, 126, 57, 0.16);
}
.nav {
  display: block;
  width: 100%;
  height: 54px;
  padding: 0 24px;
  background: transparent;
  color: #222;
  text-align: left;
  border-radius: 0;
}
.nav.active {
  background: #eeeeee;
  color: #109b4b;
  border-right: 4px solid #109b4b;
}
.main {
  min-height: 100vh;
  margin-left: 176px;
  padding: 92px 14px 28px;
}
.topbar {
  position: fixed;
  z-index: 10;
  left: 176px;
  right: 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 92px;
  padding: 0 22px;
  background: #f5f5f5;
}
.tabs { display: flex; flex: 1; gap: 8px; overflow: auto; }
.tab {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border-radius: 4px;
  background: #fff;
  color: #3d4758;
  white-space: nowrap;
}
.tab.active { background: #7d7d7d; color: #fff; }
.user { display: flex; align-items: center; gap: 9px; color: #166534; font-weight: 700; }
.user img { width: 34px; height: 34px; border-radius: 9px; object-fit: cover; }
.view { display: none; }
.view.active { display: block; }
.cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 14px;
}
.card {
  margin-bottom: 14px;
  padding: 20px;
  border-radius: 8px;
  background: #fff;
}
.stat span { color: #9098a6; }
.stat strong { display: block; margin-top: 14px; font-size: 32px; }
.toolbar {
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 74px;
  margin-bottom: 14px;
  padding: 16px 20px;
  border-radius: 8px;
  background: #fff;
  flex-wrap: wrap;
}
.status-tabs {
  display: flex;
  align-items: center;
  gap: 52px;
  min-height: 52px;
  margin-bottom: 14px;
  padding: 0 32px;
  border-bottom: 1px solid #d7d9df;
}
.status-tab {
  height: auto;
  padding: 0 0 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #253247;
  cursor: pointer;
}
.status-tab.active {
  color: #111;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: #109b4b;
  text-decoration-thickness: 3px;
}
.badge {
  display: inline-flex;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #109b4b;
  color: #fff;
  font-size: 12px;
}
.table-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
}
.table { overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 980px; }
th, td {
  padding: 16px 14px;
  border-bottom: 1px dashed #d8dce3;
  text-align: center;
  vertical-align: middle;
}
th {
  background: #f7f7f7;
  color: #8a93a4;
  font-weight: 500;
}
.thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 4px;
  background: #eef0f3;
}
.price { color: #f06b22; font-weight: 800; }
.muted { color: #9aa1ac; }
.feedback-content { min-width: 320px; max-width: 520px; text-align: left; line-height: 1.65; }
.switch {
  display: inline-flex;
  width: 40px;
  height: 22px;
  padding: 3px;
  border-radius: 999px;
  background: #c6c8cc;
}
.switch.on { background: #109b4b; }
.switch::after {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
}
.switch.on::after { margin-left: 18px; }
.round-actions { display: inline-flex; gap: 8px; }
.table-action {
  height: 30px;
  margin: 2px;
  padding: 0 10px;
  background: #edf7f0;
  color: #087a3a;
  border: 1px solid #b9dfc6;
}
.table-action.danger { background: #fff1f0; color: #c43a31; border-color: #f3bbb7; }
.section-heading { margin: 28px 4px 8px; }
.section-heading h2 { margin: 0 0 6px; font-size: 20px; }
.section-heading p { margin: 0; color: #7a8492; }
.round {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid #dfe3ea;
  border-radius: 50%;
  color: #8d95a3;
  cursor: pointer;
}
.sort-btn {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ffa461;
  color: #fff;
  cursor: pointer;
}
dialog {
  width: min(720px, calc(100vw - 40px));
  border: 0;
  border-radius: 8px;
  padding: 0;
}
dialog::backdrop { background: rgba(0,0,0,.25); }
#editorForm { padding: 24px; }
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 18px 0;
}
.form-grid label { display: grid; align-items: start; font-weight: 600; }
.form-grid .full { grid-column: 1 / -1; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 12px; }
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: none;
  padding: 12px 16px;
  border-radius: 6px;
  background: #111827;
  color: #fff;
}
.toast.show { display: block; }
.database-table { max-height: 70vh; }
.brand-settings {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(320px, 1.4fr);
  gap: 36px;
  align-items: center;
}
.brand-preview {
  display: flex;
  align-items: center;
  gap: 18px;
}
.brand-preview img {
  width: 112px;
  height: 112px;
  border-radius: 18px;
  object-fit: cover;
  background: #eef0f3;
  border: 1px solid #e7e9ed;
}
.brand-preview strong { font-size: 18px; }
.brand-preview p { margin: 8px 0 14px; color: #8b93a0; font-size: 13px; }
.upload-button {
  display: inline-flex;
  min-height: 36px;
  padding: 0 16px;
  border-radius: 4px;
  background: #087a3a;
  color: #fff;
  cursor: pointer;
}
.upload-button input { display: none; }
.brand-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(210px, 1fr) 132px;
  gap: 14px;
  align-items: end;
}
.brand-form label { display: grid; gap: 8px; }
.brand-form button { width: 132px; padding: 0 12px; white-space: nowrap; }
.section-label { margin-bottom: 14px; font-size: 18px; font-weight: 700; }
@media (max-width: 980px) {
  .sidebar { position: static; width: auto; }
  .main { margin-left: 0; padding-top: 20px; }
  .topbar { position: static; height: auto; padding: 16px; }
  .cards, .form-grid, .brand-settings, .brand-form { grid-template-columns: 1fr; }
}
