.empty-state {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px;
  text-align: center;
  color: var(--muted);
  background: var(--paper);
}

.empty-state svg {
  width: 34px;
  height: 34px;
  color: var(--green);
}

.empty-state strong {
  color: var(--ink);
  font-size: 17px;
}

.panel-head > .actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.danger-action {
  color: var(--red);
}

.danger-action:hover {
  background: var(--red-soft);
}

.password-alert {
  margin: 18px 22px 0;
}

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

.dashboard-page {
  overscroll-behavior-y: contain;
}

.dashboard-refresh-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #ccd5d0;
  border-radius: 6px;
  background: #fff;
  color: var(--green);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-weight: 700;
  cursor: pointer;
}

.dashboard-refresh-button:hover,
.dashboard-refresh-button:focus-visible {
  background: #f6fbf8;
  border-color: #9cc7b7;
  outline: 0;
}

.dashboard-platform-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.dashboard-platform-button.pdd {
  background: #e5484d;
}

.dashboard-platform-button.douyin {
  background: #20252a;
}

.dashboard-platform-button:hover,
.dashboard-platform-button:focus-visible {
  filter: brightness(.94);
  outline: 0;
}

.dashboard-platform-button:disabled {
  opacity: .55;
  cursor: wait;
}

.commerce-poster-modal {
  width: min(940px, calc(100vw - 24px));
  max-width: none;
  max-height: 94vh;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(9, 27, 20, .3);
}

.commerce-poster-modal::backdrop {
  background: rgba(10, 25, 19, .68);
}

.commerce-poster-dialog > header {
  min-height: 80px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.commerce-poster-dialog > header h2 {
  margin-top: 5px;
  font-size: 20px;
}

.commerce-poster-dialog > header button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.commerce-poster-loading {
  min-height: 360px;
  display: grid;
  place-items: center;
  padding: 30px;
  color: var(--muted);
  font-weight: 700;
}

.commerce-poster-dialog > img {
  display: block;
  width: min(100%, 720px);
  max-height: calc(94vh - 175px);
  margin: 0 auto;
  object-fit: contain;
  background: var(--paper);
}

.commerce-poster-actions {
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.dashboard-refresh-button.is-refreshing svg,
.pull-refresh-indicator.is-refreshing svg {
  animation: dashboard-refresh-spin 700ms linear infinite;
}

.pull-refresh-indicator {
  --pull-distance: 0px;
  position: fixed;
  z-index: 30;
  top: 6px;
  left: calc(50% + 112px);
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: #fff;
  color: var(--green);
  box-shadow: 0 8px 22px rgba(18, 36, 29, .14);
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(-52px + var(--pull-distance)));
  transition: opacity 120ms ease, transform 80ms linear;
}

.pull-refresh-indicator.is-visible,
.pull-refresh-indicator.is-refreshing {
  opacity: 1;
}

.pull-refresh-indicator.is-ready svg {
  transform: rotate(180deg);
}

@keyframes dashboard-refresh-spin {
  to { transform: rotate(360deg); }
}

.metric-board.five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.metric-board.five article,
.metric-board.five article:nth-child(4n),
.metric-board.five article:nth-last-child(-n+4) {
  border-right: 1px solid var(--line);
  border-bottom: 0;
}

.metric-board.five article:nth-child(5n) {
  border-right: 0;
}

.metric-board.six {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.metric-board.six article,
.metric-board.six article:nth-child(4n),
.metric-board.six article:nth-last-child(-n+4) {
  border-right: 1px solid var(--line);
  border-bottom: 0;
}

.metric-board.six article:nth-child(6n) {
  border-right: 0;
}

.store-link {
  display: inline-block;
  color: var(--green);
}

.store-link:hover strong {
  text-decoration: underline;
}

.wechat-login {
  min-height: 62px;
  padding: 10px 16px;
  border-radius: 7px;
  background: #16835f;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.login-method > p {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.login-method-wechat .wechat-login {
  min-height: 68px;
  justify-content: flex-start;
  padding: 12px 17px;
  box-shadow: 0 5px 14px rgba(18, 131, 95, .16);
}

.login-method-wechat .login-method-arrow {
  width: 18px;
  height: 18px;
  margin-left: auto;
}

.login-method-password .stack-form {
  margin-top: 10px;
}

.login-action-row {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(96px, 1fr);
  gap: 10px;
  width: 100%;
}

.login-action-row.password-only {
  grid-template-columns: 1fr;
}

.login-action-row .wechat-login,
.login-action-row .primary {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  white-space: nowrap;
  border: 1px solid var(--green);
  border-radius: 6px;
  background: var(--green);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.login-action-row .wechat-login {
  justify-content: center;
  box-shadow: none;
}

.login-action-row .wechat-login > svg {
  width: 20px;
  height: 20px;
}

.wechat-login > svg {
  width: 25px;
  height: 25px;
}

.wechat-login > span {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.wechat-login small {
  color: #cce7dc;
  font-size: 11px;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.login-divider::before,
.login-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

@media (max-width: 1100px) {
  .metric-board.five {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-board.five article,
  .metric-board.five article:nth-child(5n) {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .metric-board.five article:nth-child(2n) {
    border-right: 0;
  }

  .metric-board.five article:last-child {
    border-bottom: 0;
  }

  .metric-board.six {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .metric-board.six article,
  .metric-board.six article:nth-child(4n),
  .metric-board.six article:nth-child(6n),
  .metric-board.six article:nth-last-child(-n+4) {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .metric-board.six article:nth-child(3n) {
    border-right: 0;
  }

  .metric-board.six article:nth-last-child(-n+3) {
    border-bottom: 0;
  }
}

@media (max-width: 760px) {
  .metric-board.five {
    grid-template-columns: 1fr;
  }

  .metric-board.five article,
  .metric-board.five article:nth-child(2n),
  .metric-board.five article:nth-child(5n) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .panel-head > .actions {
    width: 100%;
    justify-content: stretch;
  }

  .panel-head > .actions a {
    flex: 1;
  }
}

/* Compact mobile admin dashboard */
.metric-board article.metric-card-action {
  padding: 0;
  min-height: 0;
}

.metric-card-action > a {
  position: relative;
  display: block;
  min-height: 118px;
  padding: 22px;
  transition: background-color 160ms ease, box-shadow 160ms ease;
}

.metric-card-action > a > i {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 17px;
  height: 17px;
  color: #8a948f;
}

.metric-card-action > a:hover,
.metric-card-action > a:focus-visible {
  background: #f6fbf8;
  box-shadow: inset 0 -3px var(--green);
  outline: 0;
}

.metric-card-action > a:hover > i,
.metric-card-action > a:focus-visible > i {
  color: var(--green);
}

.latest-store-table {
  width: 100%;
  table-layout: fixed;
}

.latest-store-table th,
.latest-store-table td {
  padding: 10px 8px;
  white-space: nowrap;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.latest-store-table th:first-child,
.latest-store-table td:first-child {
  width: 14%;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
}

.latest-store-table th:nth-child(2),
.latest-store-table td:nth-child(2) {
  width: 6%;
}

.latest-store-table th:nth-child(3),
.latest-store-table td:nth-child(3) {
  width: 9%;
}

.latest-store-table th:nth-child(4),
.latest-store-table td:nth-child(4) {
  width: 13%;
}

.latest-store-table th:nth-child(5),
.latest-store-table td:nth-child(5) {
  width: 8%;
}

.latest-store-table th:nth-child(6),
.latest-store-table td:nth-child(6) {
  width: 11%;
}

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

  .admin-body .sidebar {
    display: none;
  }

  .admin-body .admin-main {
    width: 100%;
    margin-left: 0;
  }

  .dashboard-page,
  .dashboard-page .admin-main,
  .dashboard-page .topbar,
  .dashboard-page .admin-content,
  .dashboard-page .stat-grid,
  .dashboard-page .metric-board,
  .dashboard-page .latest-store-panel,
  .dashboard-page .split-layout,
  .dashboard-page .split-layout > .grow {
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  .dashboard-page {
    overflow-x: hidden;
  }

  .admin-body .topbar {
    height: 58px;
    padding: 0 13px;
  }

  .admin-body .topbar .eyebrow,
  .admin-body .user-chip div {
    display: none;
  }

  .admin-body .topbar h1 {
    margin: 0;
    font-size: 18px;
  }

  .admin-body .topbar-actions {
    gap: 8px;
  }

  .admin-body .dashboard-refresh-button {
    min-height: 34px;
    padding: 0 10px;
    font-size: 12px;
  }

  .dashboard-page .pull-refresh-indicator {
    left: 50%;
  }

  .admin-body .user-chip > span {
    width: 32px;
    height: 32px;
  }

  .admin-body .admin-content {
    padding: 10px 12px 32px;
  }

  .admin-body .stat-grid.four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .admin-body .stat-card {
    min-height: 78px;
    padding: 10px;
    gap: 9px;
  }

  .admin-body .stat-icon {
    width: 32px;
    height: 32px;
  }

  .admin-body .stat-icon svg {
    width: 16px;
    height: 16px;
  }

  .admin-body .stat-card p {
    font-size: 11px;
  }

  .admin-body .stat-card strong {
    margin: 3px 0 0;
    font-size: 20px;
  }

  .admin-body .stat-card small {
    display: none;
  }

  .admin-body .main-gap {
    margin-top: 8px;
  }

  .admin-body .metric-board.five {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-body .metric-board.five article,
  .admin-body .metric-board.five article:nth-child(2n),
  .admin-body .metric-board.five article:nth-child(5n) {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .admin-body .metric-board.five article:nth-child(2n) {
    border-right: 0;
  }

  .admin-body .metric-board.five article:last-child {
    grid-column: 1 / -1;
    border-right: 0;
    border-bottom: 0;
  }

  .admin-body .metric-board.six {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-body .metric-board.six article,
  .admin-body .metric-board.six article:nth-child(3n),
  .admin-body .metric-board.six article:nth-child(6n),
  .admin-body .metric-board.six article:nth-last-child(-n+3) {
    min-height: 0;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .admin-body .metric-board.six article:nth-child(2n) {
    border-right: 0;
  }

  .admin-body .metric-board.six article:nth-last-child(-n+2) {
    border-bottom: 0;
  }

  .dashboard-page .metric-board.six {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-page .metric-board.six article,
  .dashboard-page .metric-board.six article:nth-child(2n),
  .dashboard-page .metric-board.six article:nth-last-child(-n+2) {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .dashboard-page .metric-board.six article:nth-child(3n) {
    border-right: 0;
  }

  .dashboard-page .metric-board.six article:nth-last-child(-n+3) {
    border-bottom: 0;
  }

  .metric-card-action > a {
    min-height: 72px;
    padding: 9px 11px;
  }

  .metric-card-action > a > i {
    top: 10px;
    right: 10px;
    width: 14px;
    height: 14px;
  }

  .metric-board .metric-card-action span {
    font-size: 12px;
  }

  .metric-board .metric-card-action small {
    font-size: 11px;
  }

  .metric-board .metric-card-action strong {
    margin: 3px 0 2px;
    font-size: 20px;
  }

  .admin-body .latest-store-panel .panel-head {
    padding: 9px 10px;
  }

  .admin-body .latest-store-panel .panel-head h2,
  .admin-body .latest-store-panel .text-action {
    font-size: 12px;
  }

  .admin-body .latest-store-table {
    min-width: 0;
    font-size: 12px;
  }

  .admin-body .latest-store-table th,
  .admin-body .latest-store-table td {
    padding: 10px 3px;
    font-size: 12px;
  }

  .admin-body .latest-store-table th:first-child,
  .admin-body .latest-store-table td:first-child {
    width: 14%;
  }

  .admin-body .latest-store-table th:nth-child(2),
  .admin-body .latest-store-table td:nth-child(2) {
    width: 6%;
  }

  .admin-body .latest-store-table th:nth-child(3),
  .admin-body .latest-store-table td:nth-child(3) {
    width: 9%;
  }
}

@media (max-width: 520px) {
  .admin-body {
    min-width: 0;
  }
}
/* Mobile admin bottom navigation */
@media (max-width: 760px) {
  .admin-body {
    padding-bottom: 70px;
  }

  .admin-body .sidebar {
    inset: auto 0 0 0;
    width: 100%;
    height: 70px;
    padding: 5px 8px;
    display: flex;
    flex-direction: row;
    align-items: center;
    background: rgba(16, 35, 29, 0.98);
    border-top: 1px solid #28433a;
  }

  .admin-body .brand-mark {
    display: none;
  }

  .admin-body .side-nav {
    min-width: 0;
    flex: 1;
    flex-direction: row;
    gap: 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .admin-body .side-nav::-webkit-scrollbar {
    display: none;
  }

  .admin-body .side-nav a,
  .admin-body .side-nav a.active {
    border-left: 0;
  }

  .admin-body .side-nav a {
    width: 68px;
    min-width: 68px;
    height: 58px;
    padding: 5px 3px 4px;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    border-radius: 6px;
  }

  .admin-body .side-nav a svg {
    width: 19px;
    height: 19px;
  }

  .admin-body .side-nav span {
    display: block;
    max-width: 100%;
    overflow: hidden;
    color: #d8e4df;
    font-size: 10px;
    line-height: 1.1;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .admin-body .side-nav a.active span {
    color: #fff;
  }

  .admin-body .side-nav a[data-menu-key="dashboard"] { order: -40; }
  .admin-body .side-nav a[data-menu-key="expense_claims"] { order: -30; }
  .admin-body .side-nav a[data-menu-key="finance"] { order: -20; }
  .admin-body .side-nav a[data-menu-key="commerce"] { order: -10; }

  .admin-body .sidebar-foot span {
    display: none;
  }

  .admin-body .sidebar-foot {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 2px;
    margin: 0 0 0 4px;
    padding: 0 0 0 4px;
    border-top: 0;
    border-left: 1px solid #28433a;
  }

  .admin-body .sidebar-foot form {
    margin: 0;
  }

  .admin-body .sidebar-foot a,
  .admin-body .link-button {
    width: 34px;
    min-width: 34px;
    height: 42px;
    padding: 0;
    justify-content: center;
  }
}
