:root {
  --green-900: #12271a;
  --green-700: #1f5c3a;
  --green-500: #2f7d4f;
  --green-100: #e7efe8;
  --sand: #d8c7a8;
  --ink: #1b241e;
  --gray: #6d7b71;
  --line: #e4e9e3;
  --bg: #f4f6f2;
  --warn: #b4552d;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.55 -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

h1, h2, h3 { margin: 0; font-weight: 650; }

.hidden { display: none !important; }

.muted { color: var(--gray); font-size: 12.5px; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 20% 10%, #26523a, #12271a 60%);
  padding: 24px;
}

.login-card {
  width: 380px;
  background: #fff;
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.25);
}

.brand { display: flex; gap: 14px; align-items: center; margin-bottom: 26px; }

.brand h1 { font-size: 19px; letter-spacing: 0.5px; }

.brand p { margin: 2px 0 0; color: var(--gray); font-size: 12.5px; }

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: linear-gradient(150deg, #1f5c3a, #2f7d4f);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 700;
}

.login-card label {
  display: block;
  margin-bottom: 14px;
  font-size: 12.5px;
  color: var(--gray);
}

.login-card input, .field input, .field select, .field textarea {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  background: #fbfcfa;
  color: var(--ink);
}

.login-card input:focus, .field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--green-500);
  background: #fff;
}

.hint { margin-top: 14px; font-size: 12px; color: var(--gray); line-height: 1.6; }

.err { color: var(--warn); font-size: 12.5px; margin-top: 10px; min-height: 18px; }

/* ---------- 布局 ---------- */
.layout { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }

.sidebar {
  background: linear-gradient(180deg, #16301f, #1a3a26);
  color: #e8efe8;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.side-brand { display: flex; gap: 12px; align-items: center; padding: 0 6px 22px; }

.side-brand-text { display: flex; flex-direction: column; }

.side-brand-text strong { font-size: 15px; }

.side-brand-text span { font-size: 11.5px; color: #a9c2ae; }

nav { display: flex; flex-direction: column; gap: 4px; flex: 1; overflow: auto; }

nav button {
  all: unset;
  cursor: pointer;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13.5px;
  color: #cfe0d3;
  display: flex;
  align-items: center;
  gap: 9px;
}

nav button:hover { background: rgba(255, 255, 255, 0.07); }

nav button.active { background: var(--sand); color: #33270f; font-weight: 600; }

.side-foot { border-top: 1px solid rgba(255, 255, 255, 0.12); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }

.staff-info { font-size: 12px; color: #b9cdbe; }

.main { padding: 22px 26px 60px; min-width: 0; }

.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }

.topbar h2 { font-size: 21px; }

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

/* ---------- 组件 ---------- */
.btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 13px;
  cursor: pointer;
  transition: 0.15s;
}

.btn:hover { border-color: var(--green-500); color: var(--green-700); }

.btn.primary { background: var(--green-700); border-color: var(--green-700); color: #fff; }

.btn.primary:hover { background: var(--green-500); color: #fff; }

.btn.ghost { background: transparent; color: #cfe0d3; border-color: rgba(255, 255, 255, 0.25); }

.btn.small { padding: 5px 10px; font-size: 12px; }

.btn.block { width: 100%; }

.btn.danger { color: var(--warn); border-color: #efd6c8; }

.btn:disabled { opacity: 0.55; cursor: not-allowed; }

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

.grid { display: grid; gap: 14px; }

.kpi-grid { grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); }

.kpi { position: relative; overflow: hidden; }

.kpi .kpi-label { font-size: 12.5px; color: var(--gray); }

.kpi .kpi-value { font-size: 26px; font-weight: 700; margin-top: 6px; letter-spacing: -0.5px; }

.kpi .kpi-foot { font-size: 11.5px; color: var(--gray); margin-top: 6px; }

.kpi.accent { background: linear-gradient(150deg, #1c4429, #2f7d4f); color: #fff; border: none; }

.kpi.accent .kpi-label, .kpi.accent .kpi-foot { color: #cfe4d5; }

.two-col { grid-template-columns: 1.35fr 1fr; align-items: start; }

@media (max-width: 1080px) { .two-col { grid-template-columns: 1fr; } }

.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }

.section-head h3 { font-size: 15px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }

th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }

th { font-size: 12px; color: var(--gray); font-weight: 600; background: #fafbf9; white-space: nowrap; }

tr:hover td { background: #fbfcfa; }

td.nowrap, th.nowrap { white-space: nowrap; }

.table-wrap { overflow: auto; }

.pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  background: var(--green-100);
  color: var(--green-700);
  white-space: nowrap;
}

.pill.warn { background: #fdf0e6; color: var(--warn); }

.pill.gray { background: #eef1ee; color: var(--gray); }

.pill.dark { background: #e9ece8; color: #43554a; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }

.filters input, .filters select {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 13px;
  background: #fff;
}

.filters input[type="search"] { min-width: 240px; }

.bars { display: flex; align-items: flex-end; gap: 6px; height: 130px; padding-top: 10px; }

.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }

.bar {
  width: 100%;
  max-width: 26px;
  background: linear-gradient(180deg, #2f7d4f, #1f5c3a);
  border-radius: 6px 6px 0 0;
  min-height: 3px;
  transition: 0.3s;
}

.bar.alt { background: linear-gradient(180deg, #d8c7a8, #b9a37b); }

.bar-label { font-size: 10.5px; color: var(--gray); }

.legend { display: flex; gap: 16px; font-size: 12px; color: var(--gray); }

.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 5px; }

.dot.green { background: var(--green-700); }

.dot.sand { background: var(--sand); }

/* ---------- 弹窗 ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(12, 24, 16, 0.5);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 50;
}

.modal-box {
  background: #f6f8f4;
  width: min(960px, 100%);
  max-height: 88vh;
  overflow: auto;
  border-radius: 16px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 2;
}

.modal-head h3 { font-size: 16px; }

.modal-close {
  all: unset;
  cursor: pointer;
  font-size: 22px;
  color: var(--gray);
  line-height: 1;
}

.modal-body { padding: 18px 20px 26px; display: flex; flex-direction: column; gap: 14px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
  background: #1b241e;
  color: #fff;
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 13px;
  z-index: 90;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

/* ---------- 详情内容 ---------- */
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px 18px; }

.kv > div { font-size: 13px; }

.kv b { display: block; font-size: 11.5px; color: var(--gray); font-weight: 500; margin-bottom: 2px; }

.items-table td { font-size: 12.5px; }

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: end; }

.field { font-size: 12.5px; color: var(--gray); }

.field input, .field select { background: #fff; }

.actions-row { display: flex; flex-wrap: wrap; gap: 8px; }

.timeline { display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; }

.timeline div { display: flex; gap: 10px; }

.timeline time { color: var(--gray); white-space: nowrap; font-variant-numeric: tabular-nums; }

.price-list { display: flex; flex-direction: column; gap: 8px; }

.tier-row {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr 2fr auto;
  gap: 8px;
  align-items: center;
}

.tier-row input { width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; font-size: 12.5px; }

.cat-block { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fff; }

.cat-block + .cat-block { margin-top: 12px; }

.cat-block header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }

.cat-block header h4 { margin: 0; font-size: 14px; }

.badge { font-size: 11px; padding: 2px 8px; border-radius: 6px; background: var(--green-100); color: var(--green-700); }

.qr { width: 220px; height: 220px; border-radius: 12px; border: 1px solid var(--line); }

.switch-line { display: flex; align-items: center; gap: 8px; font-size: 13px; }

input[type="checkbox"] { width: 16px; height: 16px; accent-color: #1f5c3a; }
