:root {
  color-scheme: light;
  --bg: #f6f1e7;
  --panel: #fffdfa;
  --panel-alt: #f2ead9;
  --line: #dacfb8;
  --text: #2f2419;
  --muted: #7d6a54;
  --accent: #9d1b22;
  --accent-strong: #7b0e16;
  --success: #0d7b55;
  --warning: #996f00;
  --danger: #b2261d;
  --shadow: 0 24px 48px rgba(58, 43, 23, 0.1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.6), transparent 28%),
    repeating-linear-gradient(
      90deg,
      rgba(149, 121, 79, 0.06) 0,
      rgba(149, 121, 79, 0.06) 1px,
      transparent 1px,
      transparent 64px
    ),
    var(--bg);
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 380px 1fr;
}

.sidebar,
.content {
  padding: 24px;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: rgba(255, 252, 246, 0.86);
  backdrop-filter: blur(18px);
}

.brand h1,
.panel h2 {
  margin: 0;
  font-size: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.muted {
  color: var(--muted);
}

.panel {
  margin-top: 18px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stats-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  padding: 14px;
  border-radius: 16px;
  background: var(--panel-alt);
  border: 1px solid rgba(154, 122, 77, 0.18);
}

.stat-label {
  color: var(--muted);
  font-size: 13px;
}

.stat-value {
  margin-top: 8px;
  font-size: 26px;
  font-weight: 700;
}

.quick-form,
.filters {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.quick-form textarea,
.quick-form input,
.quick-form select,
.filters input,
.filters select {
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  font: inherit;
  color: inherit;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.content {
  display: grid;
  grid-template-rows: minmax(260px, auto) 1fr;
  gap: 18px;
}

.orders-list {
  margin-top: 14px;
  display: grid;
  gap: 10px;
  max-height: 340px;
  overflow: auto;
}

.order-card {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.order-card:hover,
.order-card.active {
  transform: translateY(-1px);
  border-color: rgba(157, 27, 34, 0.55);
  box-shadow: 0 12px 26px rgba(80, 52, 25, 0.08);
}

.order-top,
.order-meta,
.detail-grid,
.file-list,
.log-list,
.item-list {
  display: grid;
  gap: 8px;
}

.order-top {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.order-no {
  font-weight: 700;
}

.badges,
.actions,
.shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #efe6d5;
  color: var(--muted);
}

.badge.order-approved,
.badge.review-approved,
.badge.payment-paid {
  background: rgba(13, 123, 85, 0.12);
  color: var(--success);
}

.badge.order-review_rejected,
.badge.review-rejected {
  background: rgba(178, 38, 29, 0.12);
  color: var(--danger);
}

.badge.order-paid_pending_review,
.badge.review-pending,
.badge.payment-paying {
  background: rgba(153, 111, 0, 0.12);
  color: var(--warning);
}

.detail-panel {
  min-height: 420px;
}

.detail-empty,
.empty-state {
  display: grid;
  place-items: center;
  min-height: 180px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.5);
}

.detail-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.detail-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.detail-card strong {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.subsection {
  margin-top: 16px;
}

.subsection h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.item-card,
.file-card,
.log-card {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.file-card a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.file-card a:hover {
  color: var(--accent-strong);
}

button {
  border: 0;
  border-radius: 14px;
  padding: 11px 14px;
  font: inherit;
  cursor: pointer;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.primary-btn {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

.secondary-btn {
  color: var(--text);
  background: #ead8b7;
}

.ghost-btn {
  color: var(--muted);
  background: #f7f1e7;
  border: 1px solid var(--line);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: 420px;
  padding: 14px 16px;
  color: #fff;
  background: rgba(47, 36, 25, 0.94);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

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

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .sidebar,
  .content {
    padding: 16px;
  }

  .two-col,
  .detail-grid {
    grid-template-columns: 1fr;
  }
}
