:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: #18211d;
  background: #f4f6f5;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: #f4f6f5;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

[hidden] {
  display: none !important;
}

.login-layout {
  display: grid;
  grid-template-columns: minmax(360px, 1.05fr) minmax(420px, 0.95fr);
  min-height: 100vh;
}

.brand-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 56px;
  color: #fff;
  background: #12563f;
}

.brand-mark {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 6px;
  color: #12563f;
  background: #fff;
  font-family: SimSun, serif;
  font-size: 38px;
  font-weight: 700;
}

.brand-kicker {
  margin: 0 0 10px;
  color: #b9d3c8;
  font-size: 12px;
}

.brand-panel h1 {
  margin: 0;
  font-size: 42px;
  font-weight: 600;
  letter-spacing: 0;
}

.brand-description {
  margin: 10px 0 0;
  color: #dbe8e3;
  font-size: 18px;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 48px;
  background: #fff;
}

.login-form {
  width: min(100%, 380px);
}

.login-heading {
  margin-bottom: 32px;
}

.login-heading p {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 600;
}

.login-heading span {
  color: #78807c;
  font-size: 14px;
}

.login-form label {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
  color: #4b5550;
  font-size: 14px;
}

.login-form input,
.search-form input {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border: 1px solid #d9dedb;
  border-radius: 5px;
  outline: none;
  color: #18211d;
  background: #fff;
}

.login-form input:focus,
.search-form input:focus {
  border-color: #12805c;
  box-shadow: 0 0 0 3px rgba(18, 128, 92, 0.1);
}

.primary-button {
  width: 100%;
  height: 44px;
  border: 0;
  border-radius: 5px;
  color: #fff;
  background: #087f5b;
  font-weight: 600;
}

.primary-button:hover {
  background: #086c4f;
}

.primary-button:disabled {
  background: #8bb5a6;
}

.form-error {
  min-height: 22px;
  margin: -4px 0 10px;
  color: #c2413a;
  font-size: 13px;
}

.app-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  padding: 22px 14px;
  color: #dbe8e3;
  background: #17352b;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px 26px;
}

.brand-mark.small {
  width: 38px;
  height: 38px;
  border: 0;
  font-size: 20px;
}

.sidebar-brand strong,
.sidebar-brand span {
  display: block;
}

.sidebar-brand strong {
  color: #fff;
  font-size: 16px;
}

.sidebar-brand span {
  margin-top: 3px;
  color: #9db5ab;
  font-size: 11px;
}

.sidebar nav {
  display: grid;
  gap: 5px;
}

.nav-item,
.logout-button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 11px;
  height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 5px;
  color: #bdcec7;
  background: transparent;
  text-align: left;
}

.nav-item:hover:not(:disabled),
.nav-item.active {
  color: #fff;
  background: #28634e;
}

.nav-item:disabled {
  opacity: 0.45;
}

.nav-icon {
  width: 18px;
  font-size: 18px;
  text-align: center;
}

.logout-button {
  margin-top: auto;
  color: #9db5ab;
}

.logout-button:hover {
  color: #fff;
  background: #23483b;
}

.workspace {
  min-width: 0;
}

.topbar {
  display: flex;
  min-height: 88px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  border-bottom: 1px solid #e4e8e6;
  background: #fff;
}

.topbar p,
.topbar h2 {
  margin: 0;
}

.topbar p {
  margin-bottom: 5px;
  color: #68736d;
  font-size: 12px;
}

.topbar h2 {
  font-size: 19px;
  font-weight: 600;
}

.admin-profile {
  display: grid;
  justify-items: end;
  gap: 3px;
}

.admin-profile span:first-child {
  font-size: 14px;
  font-weight: 600;
}

.admin-profile span:last-child {
  color: #7b847f;
  font-size: 11px;
}

.content-view {
  padding: 28px 32px 40px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 16px;
}

.metric {
  min-height: 128px;
  padding: 20px;
  border: 1px solid #e1e6e3;
  border-radius: 6px;
  background: #fff;
}

.metric span,
.metric small,
.metric strong {
  display: block;
}

.metric span {
  color: #657069;
  font-size: 13px;
}

.metric strong {
  margin: 11px 0 8px;
  color: #153b2d;
  font-size: 28px;
  font-weight: 650;
}

.metric small {
  color: #98a09c;
  font-size: 11px;
}

.section-block,
.table-wrap {
  margin-top: 22px;
  border: 1px solid #e1e6e3;
  border-radius: 6px;
  background: #fff;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid #edf0ee;
}

.section-heading p,
.section-heading h3 {
  margin: 0;
}

.section-heading p {
  margin-bottom: 4px;
  color: #7d8681;
  font-size: 11px;
}

.section-heading h3 {
  font-size: 16px;
}

.text-button {
  border: 0;
  color: #087f5b;
  background: transparent;
}

.order-list {
  min-height: 210px;
}

.recent-order {
  display: grid;
  grid-template-columns: 1.2fr 1.6fr 0.7fr 0.7fr;
  gap: 18px;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid #edf0ee;
}

.recent-order:last-child {
  border-bottom: 0;
}

.recent-order strong,
.recent-order span,
.recent-order small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-order strong {
  margin-bottom: 5px;
  font-size: 13px;
}

.recent-order span,
.recent-order small {
  color: #77807b;
  font-size: 12px;
}

.order-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.status-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid #dfe4e1;
  border-radius: 6px;
  background: #fff;
}

.status-tab {
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 4px;
  color: #68716c;
  background: transparent;
}

.status-tab.active {
  color: #fff;
  background: #1e6b4f;
}

.search-form {
  display: grid;
  grid-template-columns: minmax(220px, 300px) 64px;
}

.search-form input {
  height: 42px;
  border-radius: 5px 0 0 5px;
}

.search-form button {
  border: 0;
  border-radius: 0 5px 5px 0;
  color: #fff;
  background: #2e4038;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  padding: 15px 16px;
  border-bottom: 1px solid #edf0ee;
  text-align: left;
  vertical-align: middle;
}

th {
  color: #68716c;
  background: #fafbfa;
  font-size: 12px;
  font-weight: 500;
}

td {
  color: #303a35;
  font-size: 13px;
}

th:nth-child(1) { width: 18%; }
th:nth-child(2) { width: 26%; }
th:nth-child(3) { width: 17%; }
th:nth-child(4) { width: 11%; }
th:nth-child(5) { width: 12%; }
th:nth-child(6) { width: 16%; }

.cell-primary,
.cell-secondary {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-primary {
  margin-bottom: 4px;
  font-weight: 600;
}

.cell-secondary {
  color: #8a928e;
  font-size: 11px;
}

.status-badge {
  display: inline-flex;
  height: 25px;
  align-items: center;
  padding: 0 8px;
  border-radius: 4px;
  color: #5e6762;
  background: #eef1ef;
  font-size: 11px;
}

.status-badge.pending_shipment,
.status-badge.refund_pending {
  color: #98551d;
  background: #fff1e2;
}

.status-badge.shipped,
.status-badge.completed {
  color: #0c684b;
  background: #e5f5ee;
}

.empty-state {
  padding: 70px 20px;
  color: #8a928e;
  text-align: center;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  color: #78817c;
  font-size: 12px;
}

.pagination button {
  width: 34px;
  height: 34px;
  border: 1px solid #d9dfdc;
  color: #34423b;
  background: #fff;
  font-size: 20px;
}

.pagination button:first-child {
  border-radius: 4px 0 0 4px;
}

.pagination button:last-child {
  margin-left: -1px;
  border-radius: 0 4px 4px 0;
}

.pagination button:disabled {
  color: #bdc4c0;
  background: #f3f5f4;
}

.loading,
.inline-empty {
  padding: 72px 20px;
  color: #8a928e;
  text-align: center;
}

@media (max-width: 980px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .order-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .login-layout {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    justify-content: flex-start;
    min-height: 220px;
    padding: 34px 24px;
  }

  .brand-panel h1 {
    font-size: 32px;
  }

  .login-panel {
    align-items: start;
    padding: 38px 24px;
  }

  .app-layout {
    grid-template-columns: 66px minmax(0, 1fr);
  }

  .sidebar {
    padding: 18px 9px;
  }

  .sidebar-brand > div:last-child,
  .nav-item span:last-child,
  .logout-button {
    display: none;
  }

  .sidebar-brand {
    justify-content: center;
    padding: 0 0 24px;
  }

  .nav-item {
    justify-content: center;
    padding: 0;
  }

  .topbar,
  .content-view {
    padding-right: 18px;
    padding-left: 18px;
  }

  .admin-profile {
    display: none;
  }

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

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

  .recent-order > :nth-child(2),
  .recent-order > :nth-child(4) {
    display: none;
  }
}
