:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --ink: #1c1917;
  --muted: #78716c;
  --line: #e7e5e4;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --accent-soft: #ccfbf1;
  --danger: #b91c1c;
  --ok: #047857;
  --warn: #b45309;
  --side: #1c1917;
  --side-line: rgba(255, 255, 255, .08);
  --shadow: 0 1px 2px rgba(28, 25, 23, .06), 0 8px 24px rgba(28, 25, 23, .04);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-dark); }

.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  background: #fff;
}
.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 56px;
  color: #fafaf9;
  background:
    linear-gradient(160deg, rgba(15, 118, 110, .28), transparent 42%),
    linear-gradient(180deg, #292524 0%, #1c1917 100%);
}
.login-panel h1 { margin: 18px 0 8px; font-size: 40px; letter-spacing: -0.03em; }
.login-panel p { margin: 0; max-width: 360px; color: #d6d3d1; font-size: 16px; }
.login-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 56px;
}
.login-card h2 { margin: 0 0 6px; font-size: 22px; }
.login-card .lead { margin: 0 0 28px; color: var(--muted); }
.login-card label { display: block; margin: 14px 0 6px; font-size: 13px; color: var(--muted); }
.login-card input, .field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 11px 12px;
  outline: none;
}
.login-card input:focus, .field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .15);
}
.login-card button { margin-top: 22px; }
.hint { margin-top: 16px; color: var(--muted); font-size: 12px; }

.mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}
.mark.lg { width: 48px; height: 48px; border-radius: 14px; font-size: 22px; }

.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side {
  background: var(--side);
  color: #fafaf9;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px 8px;
}
.brand strong { display: block; font-size: 16px; letter-spacing: .02em; }
.brand span { color: #a8a29e; font-size: 12px; }
.nav {
  flex: 1;
  overflow: auto;
  padding: 8px 12px 16px;
}
.nav-label {
  margin: 16px 8px 6px;
  color: #a8a29e;
  font-size: 11px;
  letter-spacing: .12em;
}
.nav-btn {
  width: 100%;
  text-align: left;
  background: transparent;
  color: #e7e5e4;
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
}
.nav-btn.active { background: var(--accent); color: #fff; }
.nav-btn:hover:not(.active) { background: rgba(255, 255, 255, .06); }
.side-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px;
  border-top: 1px solid var(--side-line);
}
.who { font-size: 13px; color: #d6d3d1; }
.side-foot button {
  border: 0;
  background: transparent;
  color: #d6d3d1;
  padding: 4px 0;
}

.main { min-width: 0; }
.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  padding: 22px 28px 0;
}
.top h2 { margin: 0; font-size: 22px; letter-spacing: -0.02em; }
.top .sub { color: var(--muted); margin-top: 4px; }
.content { padding: 18px 28px 40px; }

.btn {
  border: 0;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  padding: 8px 14px;
}
.btn:hover { background: var(--accent-dark); }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: #fafaf9; }
.btn.warn { background: var(--warn); }
.btn.warn:hover { background: #92400e; }
.btn.ok { background: var(--ok); }
.btn.ok:hover { background: #065f46; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.danger {
  background: #fff;
  color: var(--danger);
  border: 1px solid #fecaca;
}
.btn.danger:hover { background: #fef2f2; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat, .card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.stat span, .stat .help { color: var(--muted); font-size: 13px; }
.stat b { display: block; margin-top: 6px; font-size: 28px; letter-spacing: -0.03em; font-weight: 650; }
.stat .btn { margin-top: 12px; }
.note { color: var(--muted); }

.table-wrap {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: auto;
  box-shadow: var(--shadow);
}
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 12px; background: #fafaf9; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafaf9; }
td.ops { white-space: nowrap; text-align: right; }
th.ops { text-align: right; }
.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; background: #f5f5f4; display: block; }
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 12px;
  white-space: nowrap;
}
.tag.green { background: #d1fae5; color: var(--ok); }
.tag.gray { background: #f5f5f4; color: #57534e; }
.tag.amber { background: #fef3c7; color: var(--warn); }
.tag.red { background: #fee2e2; color: var(--danger); }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.filters .btn.ghost { background: transparent; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(28, 25, 23, .48);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 20;
}
.dialog {
  width: min(820px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  padding: 22px 22px 18px;
  box-shadow: 0 24px 60px rgba(28, 25, 23, .22);
}
.dialog h3 { margin: 0 0 14px; font-size: 18px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field span { font-size: 13px; color: var(--muted); }
.field textarea { min-height: 110px; resize: vertical; }
.help { color: var(--muted); font-size: 12px; line-height: 1.6; }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.split { display: grid; grid-template-columns: 1.4fr .8fr; gap: 16px; }
.goods-line { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); }

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  background: #1c1917;
  color: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: var(--shadow);
  max-width: 360px;
}

@media (max-width: 980px) {
  .login-wrap, .shell, .stats, .grid, .split { grid-template-columns: 1fr; }
  .login-panel { padding: 32px 24px; min-height: 220px; }
  .login-card { padding: 28px 24px 40px; }
  .side { position: relative; height: auto; }
  .nav { display: flex; gap: 12px; overflow: auto; }
  .nav-group { min-width: max-content; }
  .top, .content { padding-left: 16px; padding-right: 16px; }
}
