* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  background: #f3f4f6;
  color: #151515;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
}

body.is-uploading {
  cursor: wait;
}

.admin-shell {
  width: 100%;
  min-height: 100vh;
  display: flex;
}

.login-view {
  width: 100%;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #f3f4f6;
}

.login-panel {
  width: min(100%, 400px);
  padding: 32px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 36px rgba(20, 20, 20, 0.12);
}

.login-brand {
  color: #111216;
  font-size: 24px;
  font-weight: 800;
}

.login-error {
  min-height: 20px;
  color: #c6264f;
  margin: 0;
}

.login-panel .primary-btn {
  width: 100%;
  margin-top: 8px;
}

button,
input,
select,
textarea {
  font: inherit;
}

.sidebar {
  width: 220px;
  min-height: 100vh;
  padding: 28px 18px;
  background: #111216;
  color: #fff;
}

.brand {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 30px;
}

nav {
  display: grid;
  gap: 10px;
}

.nav-item {
  width: 100%;
  height: 42px;
  border: 0;
  border-radius: 8px;
  background: #f42b62;
  color: #fff;
  cursor: pointer;
}

.nav-item:not(.active) {
  background: #24262d;
}

.hidden {
  display: none !important;
}

.main {
  flex: 1;
  min-width: 0;
  padding: 30px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
}

p {
  margin-top: 8px;
  color: #777;
}

.workspace {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.panel {
  background: #fff;
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 10px 30px rgba(20, 20, 20, 0.06);
}

.form-panel {
  position: sticky;
  top: 24px;
}

form {
  margin-top: 18px;
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  color: #444;
}

.label-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.link-btn {
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #f42b62;
  cursor: pointer;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #d9dce2;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  outline: none;
}

.category-picker {
  position: relative;
}

.category-select-btn {
  width: 100%;
  height: 44px;
  padding: 0 40px 0 12px;
  border: 1px solid #d9dce2;
  border-radius: 8px;
  background: #fff;
  color: #151515;
  text-align: left;
  cursor: pointer;
  position: relative;
}

.category-select-btn::after {
  content: "";
  position: absolute;
  right: 15px;
  top: 17px;
  width: 9px;
  height: 9px;
  border-right: 2px solid #222;
  border-bottom: 2px solid #222;
  transform: rotate(45deg);
}

.category-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  max-height: 248px;
  overflow-y: auto;
  border: 1px solid #d9dce2;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(20, 20, 20, 0.14);
}

.category-option {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 0;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.category-option.create {
  color: #f42b62;
  font-weight: 700;
  border-bottom: 1px solid #f0f0f0;
}

.category-option:hover,
.category-option.active {
  background: #f42b62;
  color: #fff;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #f42b62;
}

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

.inline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inline input {
  width: 18px;
  height: 18px;
}

.hint {
  margin-top: 6px;
  font-size: 13px;
  color: #888;
}

.upload-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.upload-row img {
  width: 92px;
  height: 92px;
  border-radius: 8px;
  object-fit: cover;
  background: #eee;
}

.form-actions,
.list-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.primary-btn,
.ghost-btn,
.danger-btn {
  height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
}

.primary-btn {
  background: #f42b62;
  color: #fff;
}

.ghost-btn {
  background: #f1f2f4;
  color: #333;
}

.danger-btn {
  background: #fff1f4;
  color: #f42b62;
}

.list-head input {
  max-width: 260px;
}

.product-list {
  margin-top: 18px;
  display: grid;
  gap: 14px;
}

.category-list {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.category-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border: 1px solid #eceef2;
  border-radius: 8px;
}

.category-item img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  background: #eee;
}

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

.product-item {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 16px;
  padding: 14px;
  border: 1px solid #eceef2;
  border-radius: 8px;
}

.player-list,
.order-list,
.user-list {
  margin-top: 18px;
  display: grid;
  gap: 14px;
}

.player-item {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 16px;
  padding: 14px;
  border: 1px solid #eceef2;
  border-radius: 8px;
}

.player-item img {
  width: 76px;
  height: 76px;
  border-radius: 8px;
  object-fit: cover;
  background: #eee;
}

.user-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border: 1px solid #eceef2;
  border-radius: 8px;
  background: #fff;
}

.user-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  background: #eee;
}

.empty-state {
  padding: 34px;
  border: 1px dashed #d9dce2;
  border-radius: 8px;
  color: #888;
  text-align: center;
}

.admin-order-item {
  padding: 16px;
  border: 1px solid #eceef2;
  border-radius: 8px;
  background: #fff;
}

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

.admin-order-body {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 16px;
  margin-top: 14px;
}

.admin-order-body img {
  width: 92px;
  height: 92px;
  border-radius: 8px;
  object-fit: cover;
  background: #eee;
}

.order-admin-actions {
  justify-content: flex-end;
}

.product-item img {
  width: 92px;
  height: 92px;
  border-radius: 8px;
  object-fit: cover;
  background: #eee;
}

.product-title {
  font-weight: 700;
  line-height: 1.4;
}

.meta {
  margin-top: 8px;
  color: #777;
  font-size: 14px;
}

.price {
  margin-top: 10px;
  color: #f42b62;
  font-weight: 800;
}

.item-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.status {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e8f8ef;
  color: #22a466;
  font-size: 12px;
}

.status.off {
  background: #eee;
  color: #777;
}

.notice-editor {
  margin-top: 18px;
}

.notice-actions {
  justify-content: flex-start;
  margin-top: 12px;
}

.banner-list {
  margin-top: 18px;
  display: grid;
  gap: 14px;
}

.banner-item {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  padding: 14px;
  border: 1px solid #eceef2;
  border-radius: 8px;
}

.banner-item img {
  width: 220px;
  aspect-ratio: 2.4 / 1;
  border-radius: 8px;
  object-fit: cover;
  background: #eee;
}

.banner-upload-row {
  grid-template-columns: 150px minmax(0, 1fr);
}

.banner-upload-row img {
  width: 150px;
  height: auto;
  aspect-ratio: 2.4 / 1;
  border-radius: 8px;
}

.banner-actions .ghost-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .form-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  body {
    display: block;
  }

  .sidebar {
    width: 100%;
    min-height: auto;
  }

  .main {
    padding: 18px;
  }

  .topbar,
  .form-actions,
  .list-head {
    align-items: stretch;
    flex-direction: column;
  }

  .product-item,
  .banner-item,
  .player-item,
  .user-item,
  .admin-order-body {
    grid-template-columns: 1fr;
  }

.banner-item img {
  width: 100%;
}

.id-card-link {
  color: #f42b62;
  text-decoration: underline;
}
}
