.top {
  box-shadow: 0 8px 24px rgba(15, 23, 42, .04);
}

.staticPreviewNotice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 14px;
  color: #78350f;
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  font-size: 12px;
  text-align: center;
}

.staticPreviewNotice strong {
  flex: 0 0 auto;
  color: #92400e;
}

body.isStaticPreview .topin {
  grid-template-columns: 1fr;
  min-height: 58px;
}

body.isStaticPreview .topLeft,
body.isStaticPreview .topTools {
  display: none;
}

.topin {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 10px 14px;
}

body[data-view="front"] .topin,
body[data-view="history"] .topin,
body[data-view="boss"] .topin {
  max-width: 560px;
  margin: 0 auto;
}

.topLeft {
  min-width: 0;
}

.pageTitle {
  justify-self: center;
  color: #111827;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.topTools {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  justify-self: end;
  min-width: 0;
}

.topTools .tabs {
  background: #f1f5f9;
  padding: 3px;
}

.topTools .tab {
  padding: 7px 11px;
}

body[data-role="buyer"] .topTools .tabs,
body[data-role="boss"] .topTools .tabs {
  display: none;
}

.authbar {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 0;
  color: #475569;
  font-size: 12px;
  flex-wrap: wrap;
}

.authbar strong {
  color: #0f172a;
}

.accountChip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
  padding: 5px 10px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .04);
}

.accountChip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #16a34a;
}

.accountChip.isGuest::before {
  background: #94a3b8;
}

.accountLabel {
  color: #64748b;
  font-weight: 700;
}

.authbar .btn {
  padding: 8px 11px;
  border-radius: 999px;
}

.filePickBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  min-height: 40px;
  line-height: 1;
  cursor: pointer;
}

.fileInput,
.up input.fileInput,
.filePickBtn input.fileInput {
  display: block !important;
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  border: 0 !important;
  margin: -1px !important;
  opacity: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

.pcell.isUploading img {
  filter: grayscale(.22) saturate(.86);
}

.pcell.isUploadError img {
  filter: grayscale(.45) saturate(.72);
  opacity: .82;
}

.pcell.isUploading .x,
.pcell.isUploadError .x,
.pcell.isUploading .badge,
.pcell.isUploadError .badge {
  z-index: 3;
}

.uploadOverlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px;
  text-align: center;
  color: #fff;
  background: rgba(15, 23, 42, .16);
}

.uploadRing {
  --p: 0deg;
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: conic-gradient(rgba(255, 255, 255, .96) var(--p), rgba(255, 255, 255, .22) 0);
  box-shadow: 0 8px 18px rgba(15, 23, 42, .18);
}

.uploadRing::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: inherit;
  background: rgba(15, 23, 42, .42);
  border: 1px solid rgba(255, 255, 255, .28);
}

.uploadRing span {
  position: relative;
  z-index: 1;
  font-size: 11px;
  font-weight: 900;
}

.uploadText {
  max-width: 100%;
  border-radius: 999px;
  padding: 3px 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: rgba(15, 23, 42, .54);
  font-size: 11px;
  font-weight: 900;
}

.uploadFallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #64748b;
  background: #f1f5f9;
  font-size: 12px;
  font-weight: 900;
}

.hero .sec {
  align-items: flex-start;
  gap: 12px;
}

.hero .sec > span {
  min-width: 0;
  line-height: 1.35;
}

.frontHeroActions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.bossOnly {
  display: none;
}

body[data-role="boss"] .bossOnly {
  display: inline-flex;
  align-items: center;
}

.heroHistoryBtn {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, .34);
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  box-shadow: none;
  white-space: nowrap;
}

.heroHistoryBtn:active {
  transform: translateY(1px);
}

.loginMask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .55);
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.loginMask.show {
  display: flex;
}

.loginBox {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 22px 80px rgba(15, 23, 42, .28);
  padding: 18px;
}

.loginBox .title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 6px;
}

.loginBox .hint {
  color: #64748b;
  font-size: 13px;
  margin-bottom: 14px;
}

.loginGrid {
  display: grid;
  gap: 10px;
}

.disabled {
  opacity: .55;
  pointer-events: none;
}

.formSec {
  gap: 10px;
}

.smartBtn {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
}

.smartParseMask {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 14px;
  background: rgba(15, 23, 42, .48);
}

.smartParseMask.show {
  display: flex;
}

.smartParseBox {
  width: min(560px, 100%);
  max-height: calc(100vh - 28px);
  overflow: auto;
  border-radius: 18px;
  border: 1px solid #e5e7eb;
  background: #fff;
  padding: 16px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, .28);
}

.smartParseHead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}

.smartParseTitle {
  font-size: 18px;
  font-weight: 950;
}

.smartParseHint {
  margin-top: 4px;
  color: #64748b;
  font-size: 13px;
}

.smartParseClose {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #0f172a;
  font-size: 20px;
  line-height: 1;
}

.smartParseBox textarea {
  min-height: 122px;
  resize: vertical;
}

.smartParseActions,
.smartParseFooter {
  display: grid;
  grid-template-columns: 1fr 96px;
  gap: 10px;
  margin-top: 10px;
}

.smartParseFooter {
  grid-template-columns: 96px 1fr;
  margin-top: 12px;
}

.smartParseResult {
  margin-top: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #f8fafc;
  padding: 10px;
}

.smartParseEmpty {
  color: #64748b;
  text-align: center;
  padding: 14px 8px;
  font-size: 13px;
}

.smartResultGrid {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 8px 10px;
  align-items: start;
}

.smartResultLabel {
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.smartResultValue {
  min-width: 0;
  color: #0f172a;
  font-size: 14px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

button:disabled {
  opacity: .65;
  cursor: not-allowed;
}

.emptyBox.error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.readonlyField {
  background: #f8fafc;
  color: #475569;
  cursor: not-allowed;
}

.historyFilters {
  display: grid;
  grid-template-columns: 1fr 130px;
  gap: 8px;
}

.historyFilters input,
.historyFilters select {
  min-width: 0;
  height: 44px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 700;
}

.historyFilters input {
  grid-column: 1 / -1;
}

.historyPager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0 96px;
}

.bossHead {
  position: sticky;
  top: 0;
  z-index: 34;
  padding: 12px;
  background: rgba(248, 250, 252, .96);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 26px rgba(15, 23, 42, .08);
}

.bossHeadRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.bossReportBtn {
  min-width: 50px;
  min-height: 42px;
  border-radius: 999px;
  padding: 0 11px;
  font-size: 13px;
  white-space: nowrap;
}

.bossSwitch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 4px;
  border-radius: 16px;
  background: #f1f5f9;
}

.bossSwitch .pill {
  width: 100%;
  border-radius: 12px;
  text-align: center;
}

.bossFilters {
  display: grid;
  grid-template-columns: 1fr 118px;
  gap: 8px;
}

.bossFilters input,
.bossFilters select {
  min-width: 0;
  height: 44px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 700;
}

.bossFilters input {
  grid-column: 1 / -1;
}

.bossFilterCard {
  padding: 10px 14px;
}

.bossFilterTop {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.bossFilterTop .btn {
  border-radius: 999px;
  padding: 9px 13px;
}

.bossFilterTop .meta {
  margin: 0;
  text-align: right;
  overflow-wrap: anywhere;
}

.bossFilters {
  margin-top: 10px;
}

.bossFilters.isCollapsed {
  display: none;
}

.bossBulkBar {
  position: fixed;
  left: max(12px, calc((100vw - 560px) / 2 + 12px));
  right: max(12px, calc((100vw - 560px) / 2 + 12px));
  bottom: calc(10px + env(safe-area-inset-bottom));
  z-index: 35;
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr;
  gap: 8px;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 14px 36px rgba(15, 23, 42, .16);
}

.bossBulkBar .btn {
  padding: 11px 8px;
  border-radius: 12px;
  white-space: nowrap;
}

.itemActions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.itemActions .btn {
  width: 100%;
  padding: 9px 7px;
  font-size: 12px;
  white-space: nowrap;
}

.userCreate {
  display: grid;
  grid-template-columns: 1fr 1fr 140px 1fr auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.userCreate input,
.userCreate select {
  height: 44px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 700;
}

.userList {
  display: grid;
  gap: 8px;
}

.userRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 90px auto;
  gap: 10px;
  align-items: center;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 10px;
  background: #fff;
}

.userRow.userDisabled {
  opacity: .7;
  background: #f8fafc;
}

.userMain {
  min-width: 0;
}

.userName {
  font-weight: 900;
  overflow-wrap: anywhere;
}

.userAccount {
  color: #64748b;
  font-size: 12px;
  margin-top: 2px;
}

.userActions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.userActions .btn {
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 12px;
}

.item {
  grid-template-columns: 84px minmax(0, 1fr);
}

.item > div {
  min-width: 0;
}

.item .photos {
  grid-template-columns: repeat(auto-fill, minmax(34px, 42px)) !important;
  max-width: 100%;
}

@media(max-width:800px) {
  .topin {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-height: 0;
  }

  .topTools {
    width: auto;
    align-items: flex-end;
  }

  .authbar {
    justify-content: flex-end;
  }

  .userCreate,
  .userRow {
    grid-template-columns: 1fr;
  }

  .userActions {
    justify-content: flex-start;
  }

  .historyFilters {
    grid-template-columns: 1fr;
  }

  .bossFilters {
    grid-template-columns: 1fr 1fr;
  }

  .item {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .item.sel {
    grid-template-columns: 26px 72px minmax(0, 1fr);
  }
}

@media(max-width:420px) {
  .pageTitle {
    font-size: 20px;
  }

  .hero .sec {
    gap: 8px;
  }

  .heroHistoryBtn {
    padding: 7px 10px;
    font-size: 12px;
  }

  .formSec {
    align-items: center;
  }

  .smartBtn {
    padding: 7px 10px;
    font-size: 12px;
  }

  .smartParseBox {
    padding: 14px;
    border-radius: 16px;
  }

  .accountLabel {
    display: none;
  }

  .authbar {
    gap: 6px;
  }

  .authbar .btn {
    padding: 8px 9px;
  }

  .bossBulkBar {
    grid-template-columns: 1.15fr .9fr .9fr;
    gap: 6px;
    padding: 8px;
  }

  .bossBulkBar .btn {
    font-size: 12px;
    padding: 10px 5px;
  }
}

@media(max-width:560px) {
  .accountLabel {
    display: none;
  }

  body:not([data-role="buyer"]):not([data-role="boss"]) .topin {
    grid-template-rows: auto auto;
    row-gap: 8px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  body:not([data-role="buyer"]):not([data-role="boss"]) .pageTitle {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  body:not([data-role="buyer"]):not([data-role="boss"]) .topTools {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  body:not([data-role="buyer"]):not([data-role="boss"]) .topTools .tabs {
    flex: 0 0 auto;
    width: auto;
  }

  body:not([data-role="buyer"]):not([data-role="boss"]) .topTools .tab {
    flex: 0 0 auto;
    padding: 7px 10px;
    white-space: nowrap;
  }

  body:not([data-role="buyer"]):not([data-role="boss"]) .authbar {
    flex: 0 0 auto;
  }

  body:not([data-role="buyer"]):not([data-role="boss"]) .accountChip {
    display: none;
  }
}

@media(max-width:380px) {
  body:not([data-role="boss"]) .accountChip {
    display: none;
  }

  body[data-role="boss"] .accountChip {
    display: inline-flex;
    padding: 5px 8px;
  }

  body[data-role="boss"] .authbar .btn {
    padding: 8px 8px;
  }
}

.miniOnly {
  display: none !important;
}

body.isMiniProgram .authbar .btn,
body.isMiniProgram .loginMask {
  display: none !important;
}

body.isMiniProgram[data-role="buyer"] .top,
body.isMiniProgram[data-role="boss"] .top {
  display: none;
}

body.isMiniProgram:not([data-role="buyer"]):not([data-role="boss"]) .topin {
  display: flex;
  min-height: 0;
  padding: 8px 14px;
}

body.isMiniProgram:not([data-role="buyer"]):not([data-role="boss"]) .topLeft,
body.isMiniProgram:not([data-role="buyer"]):not([data-role="boss"]) .pageTitle {
  display: none;
}

body.isMiniProgram:not([data-role="buyer"]):not([data-role="boss"]) .topTools {
  width: 100%;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

body.isMiniProgram .sticky {
  padding: 8px 12px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
}

body.isMiniProgram .stickyin {
  padding-bottom: 0;
}

body.isMiniProgram .sticky .btn {
  min-height: 48px;
  padding: 11px 13px;
  font-size: 16px;
}

body.isMiniProgram .wrap.mobile {
  padding-bottom: calc(70px + env(safe-area-inset-bottom));
}
