:root {
  --brand: #4d6545;
  --brand-dark: #354b30;
  --surface: #f7f6f1;
  --panel: #ffffff;
  --ink: #243027;
  --muted: #747b72;
  --soft: #e9ede3;
  --line: #e1e3da;
  --danger: #9a4139;
  --warning: #806135;
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: var(--ink);
  background: var(--surface);
  font-size: 14px;
  line-height: 1.6;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: wait;
  opacity: 0.5;
}
a {
  color: var(--brand);
  text-underline-offset: 4px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 28px;
  line-height: 1.35;
  letter-spacing: -0.7px;
  font-weight: 650;
}
h2 {
  font-size: 21px;
  line-height: 1.45;
  font-weight: 650;
  letter-spacing: -0.3px;
}
h3 {
  font-size: 16px;
  font-weight: 600;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #9cad8d;
  outline-offset: 3px;
}
[hidden] {
  display: none;
}
.initial-state {
  min-height: 70vh;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.app-shell {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 30px 20px 20px;
  background: #edf0e7;
  border-right: 1px solid var(--line);
}
.brand {
  display: flex;
  gap: 9px;
  align-items: center;
}
.brand img {
  width: 28px;
  height: 28px;
}
.brand-name {
  font-size: 25px;
  line-height: 1;
  font-weight: 750;
  letter-spacing: -0.5px;
}
.brand-context {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 2px;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 30px;
}
.nav-button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 10px 15px;
  border: 0;
  border-radius: 9px;
  color: #596451;
  background: transparent;
  text-align: left;
  font-weight: 500;
}
.nav-button:hover {
  background: #e1e7d8;
}
.nav-button.is-active {
  background: var(--brand);
  color: white;
}
.nav-group-label {
  margin: 21px 15px 6px;
  color: var(--muted);
  font-size: 12px;
}
.sidebar-footer {
  margin-top: auto;
  padding: 24px 12px 0;
  color: var(--muted);
  font-size: 12px;
}
.workspace {
  min-width: 0;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 80px;
  padding: 16px 40px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 246, 241, 0.97);
}
.topbar-title {
  font-weight: 600;
}
.account-menu {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--muted);
}
.account-name {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mobile-menu {
  display: none;
}
.workspace-main {
  max-width: 1550px;
  margin: 0 auto;
  padding: 32px 40px 64px;
}
.environment-note {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  padding: 12px 16px;
  margin-bottom: 26px;
  border: 1px solid #dfd7c2;
  border-radius: 9px;
  background: #f2eddf;
  color: #6f5c35;
  font-size: 13px;
}
.capabilities {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-left: auto;
}
.capability {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.capability::before {
  content: '';
  width: 6px;
  height: 6px;
  background: #8c7757;
  border-radius: 50%;
}
.capability.is-ready::before {
  background: var(--brand);
}
.page-heading {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.page-heading p {
  margin-top: 7px;
  color: var(--muted);
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--brand);
  color: white;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
  text-decoration: none;
  transition:
    background-color 0.12s,
    opacity 0.12s;
}
.button:hover {
  background: var(--brand-dark);
}
.button-secondary {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--line);
}
.button-secondary:hover {
  background: var(--soft);
}
.button-quiet {
  padding: 8px 12px;
  background: transparent;
  color: var(--muted);
}
.button-quiet:hover {
  color: var(--brand);
  background: var(--soft);
}
.button-danger {
  background: #fff;
  color: var(--danger);
  border-color: #ddc9c4;
}
.button-danger:hover {
  background: #f7eae7;
}
.button-link {
  padding-left: 0;
  padding-right: 0;
  min-width: 44px;
  justify-content: flex-start;
  border: 0;
  background: none;
  color: var(--brand);
}
.button-link:hover {
  background: transparent;
  text-decoration: underline;
}
.inline-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.toolbar .search-input {
  width: min(100%, 330px);
}
.toolbar .select {
  min-width: 150px;
  width: auto;
}
.input {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--ink);
  line-height: 1.5;
  font-size: 14px;
}
.input::placeholder {
  color: #8e958b;
}
.input:read-only {
  color: var(--muted);
  background: var(--surface);
}
.input[type='checkbox'] {
  display: inline-block;
  width: 18px;
  min-height: 18px;
  height: 18px;
  padding: 0;
  accent-color: var(--brand);
}
.textarea {
  resize: vertical;
  min-height: 100px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}
.field-label {
  font-weight: 500;
  color: var(--ink);
}
.field-help {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
}
.full-width {
  grid-column: 1 / -1;
}
.space-top {
  margin-top: 20px;
}
.upload-error {
  color: var(--danger);
  font-size: 13px;
  margin-top: 8px;
}
.form-section + .form-section {
  margin-top: 26px;
  padding-top: 23px;
  border-top: 1px solid var(--line);
}
.form-section h3 {
  margin-bottom: 15px;
}
.check-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
  padding: 10px 0;
}
.check-field input {
  margin-top: 3px;
}
.check-copy {
  display: flex;
  flex-direction: column;
}
.check-copy small {
  color: var(--muted);
  font-size: 12px;
}
.panel {
  padding: 24px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid #e8e9e1;
}
.panel + .panel {
  margin-top: 20px;
}
.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
.panel-heading p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  white-space: nowrap;
}
.data-table th {
  height: 48px;
  padding: 13px 18px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  background: #fbfcf8;
}
.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid #edf0e8;
  vertical-align: middle;
  font-size: 13px;
}
.data-table tbody tr:last-child td {
  border-bottom: 0;
}
.data-table tbody tr:hover {
  background: #fafbf7;
}
.data-table .cell-wrap {
  white-space: normal;
  min-width: 180px;
  max-width: 340px;
}
.data-table .cell-number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.data-table .cell-actions {
  min-width: 130px;
}
.data-table .table-empty {
  padding: 56px 20px;
  color: var(--muted);
  text-align: center;
}
.product-cell {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 200px;
}
.product-cell img {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 7px;
  background: var(--surface);
}
.product-cell strong {
  display: block;
  font-size: 14px;
  font-weight: 550;
  white-space: normal;
}
.product-cell small,
.cell-secondary {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}
.status {
  display: inline-flex;
  align-items: center;
  border-radius: 5px;
  padding: 3px 8px;
  font-size: 12px;
  background: #f0f1ed;
  color: #64705e;
}
.status-published,
.status-paid,
.status-completed,
.status-refunded {
  color: var(--brand);
  background: var(--soft);
}
.status-pending_payment,
.status-requested,
.status-processing,
.status-returned {
  color: var(--warning);
  background: #f5efdf;
}
.status-cancelled,
.status-archived,
.status-rejected {
  color: var(--muted);
  background: #efefed;
}
.status-shipped,
.status-return_required {
  color: #536f7e;
  background: #eaf0f3;
}
.development-tag {
  color: #85643a;
  font-size: 12px;
  margin-top: 4px;
}
.pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
}
.empty-state,
.loading-state {
  padding: 60px 24px;
  text-align: center;
  color: var(--muted);
}
.empty-state h3 {
  color: var(--ink);
  margin-bottom: 8px;
}
.empty-state .button {
  margin-top: 20px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.metric {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.metric-label {
  color: var(--muted);
  font-size: 13px;
}
.metric-value {
  margin-top: 12px;
  font-size: 30px;
  font-weight: 650;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.6px;
}
.metric-detail {
  color: var(--muted);
  font-size: 12px;
  margin-top: 10px;
}
.dashboard-work {
  padding: 24px 28px;
  margin-bottom: 25px;
  border-left: 3px solid var(--brand);
  background: #eef1e8;
}
.dashboard-work h2 {
  margin-bottom: 7px;
  font-size: 19px;
}
.dashboard-work p {
  color: var(--muted);
  font-size: 13px;
}
.dialog {
  max-height: 92dvh;
  width: min(570px, calc(100% - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: var(--panel);
  box-shadow: 0 18px 80px rgba(30, 45, 25, 0.16);
}
.dialog-wide {
  width: min(860px, calc(100% - 32px));
}
.dialog::backdrop {
  background: rgba(25, 34, 25, 0.32);
}
.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 26px 20px;
  border-bottom: 1px solid var(--line);
}
.dialog-heading p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}
.dialog-content {
  padding: 24px 26px;
}
.dialog-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 26px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}
.form-error {
  padding: 13px 16px;
  margin: 0 26px 22px;
  border-radius: 7px;
  color: var(--danger);
  background: #f8eeeb;
  font-size: 13px;
  white-space: pre-wrap;
}
.sku-editor {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(90px, 1fr) minmax(80px, 0.8fr) 44px;
  gap: 10px;
  align-items: end;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.sku-editor .field-label {
  font-size: 12px;
  color: var(--muted);
}
.sku-editor-list {
  margin-bottom: 12px;
}
.image-upload {
  display: flex;
  gap: 18px;
  align-items: center;
}
.image-upload img {
  display: block;
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 9px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.image-upload img[hidden],
.image-upload input[type='file'][hidden] {
  display: none;
}
.image-upload-tools {
  flex: 1;
  min-width: 0;
}
.image-upload-tools .field-help {
  margin-top: 8px;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}
.detail-grid dt {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}
.detail-grid dd {
  margin: 0;
  word-break: break-word;
  font-size: 14px;
}
.detail-grid dd p + p {
  margin-top: 3px;
}
.detail-section {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.detail-section h3 {
  margin-bottom: 12px;
}
.order-totals {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
}
.order-totals strong {
  color: var(--brand);
  font-size: 20px;
}
.note-box {
  padding: 13px 16px;
  border-radius: 7px;
  background: var(--surface);
  font-size: 13px;
  color: var(--muted);
  white-space: pre-wrap;
}
.settings-form {
  max-width: 980px;
}
.settings-form .panel {
  margin-bottom: 22px;
}
.settings-save {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: flex-end;
}
.messages {
  position: fixed;
  z-index: 100;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 32px);
  pointer-events: none;
}
.notice {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 12px 16px;
  border-radius: 9px;
  box-shadow: 0 7px 30px #24302720;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  pointer-events: auto;
}
.notice-error {
  background: #813e37;
}
.notice-close {
  min-height: 32px;
  padding: 0 3px;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 12px;
}
.dialog-feedback .notice {
  margin: 0 26px 20px;
  box-shadow: none;
}
.login-page {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(440px, 1.05fr);
  min-height: 100vh;
}
.login-scene {
  position: relative;
  overflow: hidden;
  background: #e8e9df;
}
.login-scene > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 64% center;
}
.login-brand {
  position: absolute;
  top: 42px;
  left: 44px;
}
.login-brand .brand-context {
  color: #52654b;
}
.login-area {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 44px;
}
.login-card {
  width: 100%;
  max-width: 370px;
}
.login-eyebrow {
  margin-bottom: 14px;
  color: var(--brand);
  font-size: 12px;
  letter-spacing: 2px;
}
.login-card h1 {
  font-size: 30px;
}
.login-intro {
  margin: 12px 0 32px;
  color: var(--muted);
}
.login-card .field {
  margin-bottom: 20px;
}
.login-submit {
  width: 100%;
  margin-top: 7px;
}
.login-help {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.9;
}
.login-error {
  margin: 18px 0 0;
}
.readonly-list {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 13px;
}
.readonly-list li + li {
  margin-top: 8px;
}
@media (max-width: 1150px) {
  .workspace-main {
    padding: 28px 24px 48px;
  }
  .topbar {
    padding-left: 24px;
    padding-right: 24px;
  }
  .app-shell {
    grid-template-columns: 192px minmax(0, 1fr);
  }
  .sidebar {
    padding-left: 14px;
    padding-right: 14px;
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .metric {
    padding: 20px;
  }
}
@media (max-width: 760px) {
  .app-shell {
    display: block;
  }
  .sidebar {
    display: none;
    position: fixed;
    z-index: 60;
    width: 224px;
    box-shadow: 12px 0 40px #24302725;
  }
  .sidebar.is-open {
    display: flex;
  }
  .mobile-menu {
    display: inline-flex;
  }
  .topbar {
    padding: 12px 16px;
    min-height: 68px;
  }
  .topbar-title {
    display: none;
  }
  .account-menu {
    gap: 4px;
  }
  .account-name {
    max-width: 150px;
    font-size: 12px;
  }
  .workspace-main {
    padding: 24px 16px 44px;
  }
  h1 {
    font-size: 25px;
  }
  .page-heading {
    gap: 14px;
    align-items: flex-start;
  }
  .page-heading p {
    font-size: 13px;
  }
  .page-heading .button {
    padding-left: 13px;
    padding-right: 13px;
  }
  .capabilities {
    margin-left: 0;
  }
  .environment-note {
    gap: 8px;
  }
  .toolbar .search-input {
    width: 100%;
  }
  .toolbar .select {
    flex: 1;
    min-width: 120px;
  }
  .form-grid,
  .detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .metrics {
    gap: 10px;
  }
  .metric {
    padding: 16px;
  }
  .metric-value {
    font-size: 25px;
  }
  .metric-detail {
    font-size: 12px;
  }
  .dashboard-work {
    padding: 20px;
  }
  .panel {
    padding: 20px 16px;
  }
  .dialog-heading,
  .dialog-content {
    padding: 20px 18px;
  }
  .dialog-footer {
    padding: 14px 18px;
  }
  .form-error {
    margin-left: 18px;
    margin-right: 18px;
  }
  .sku-editor {
    grid-template-columns: minmax(0, 1fr) minmax(80px, 1fr) 44px;
  }
  .sku-editor > .field:first-child {
    grid-column: 1 / -1;
  }
  .login-page {
    display: block;
  }
  .login-scene {
    height: 230px;
  }
  .login-scene > img {
    object-position: 65% 58%;
  }
  .login-brand {
    top: 28px;
    left: 24px;
  }
  .login-area {
    padding: 32px 24px 44px;
  }
  .login-card {
    max-width: 450px;
  }
  .login-card h1 {
    font-size: 27px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto;
    transition: none;
  }
}
