/* 邻打 · 运营后台样式 */
:root {
  --brand: #ff6b35;
  --brand-dark: #e0521f;
  --brand-soft: #fff0e9;
  --ink: #171a1f;
  --muted: #667085;
  --muted-2: #98a2b3;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --border: #e4e7ec;
  --green: #12b76a;
  --green-soft: #e7f8ef;
  --amber: #f79009;
  --amber-soft: #fff4e5;
  --red: #d92d20;
  --red-soft: #feecEB;
  --blue: #2563eb;
  --blue-soft: #e8f0fe;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px -12px rgba(16, 24, 40, .18);
  --sidebar: 232px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
button { font: inherit; }
input, select, textarea { font: inherit; color: inherit; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(1200px 600px at 50% -10%, #ffe6da 0%, var(--bg) 55%);
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow);
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.login-brand img { width: 44px; height: 44px; border-radius: 12px; }
.login-brand h1 { font-size: 18px; margin: 0; }
.login-brand p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }

/* ---------- 布局 ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar);
  flex: 0 0 var(--sidebar);
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 18px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.sidebar-brand img { width: 34px; height: 34px; border-radius: 9px; }
.sidebar-brand strong { font-size: 15px; display: block; line-height: 1.2; }
.sidebar-brand span { font-size: 11px; color: var(--muted); }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  color: #344054;
  cursor: pointer;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  font-size: 14px;
}
.nav-item:hover { background: var(--surface-2); }
.nav-item.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.nav-item .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .55; }

.sidebar-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.sidebar-foot button { margin-top: 8px; }

.main { flex: 1; min-width: 0; padding: 22px 26px 48px; }

.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.topbar h1 { font-size: 20px; margin: 0; }
.topbar .spacer { flex: 1; }
.topbar .who { color: var(--muted); font-size: 12px; }

/* ---------- 卡片 ---------- */
.grid { display: grid; gap: 14px; }
.grid.kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.two { grid-template-columns: 1.6fr 1fr; }
@media (max-width: 1100px) { .grid.kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid.two { grid-template-columns: 1fr; } }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 12px; font-size: 14px; color: #344054; }

.kpi .label { color: var(--muted); font-size: 12px; }
.kpi .value { font-size: 26px; font-weight: 700; margin-top: 6px; letter-spacing: -.5px; }
.kpi .sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.kpi .value.accent { color: var(--brand); }

/* ---------- 图表 ---------- */
.chart { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding-top: 8px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart .bar { width: 100%; max-width: 46px; background: linear-gradient(180deg, #ff8a5c, var(--brand)); border-radius: 8px 8px 4px 4px; min-height: 3px; }
.chart .cap { font-size: 11px; color: var(--muted); }
.chart .val { font-size: 11px; color: var(--muted-2); }

/* ---------- 表格 ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar .spacer { flex: 1; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: #fcfcfd; }
tbody tr:hover { background: #fbfbfc; }
td.wrap { white-space: normal; }
.table-wrap { overflow: auto; border-radius: 12px; }

/* ---------- 徽标 ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-green { background: var(--green-soft); color: #067647; }
.b-amber { background: var(--amber-soft); color: #b54708; }
.b-blue { background: var(--blue-soft); color: #1d4ed8; }
.b-red { background: var(--red-soft); color: #b42318; }
.b-gray { background: var(--surface-2); color: var(--muted); }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 12px; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 11px;
  background: var(--surface);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255, 107, 53, .14); }
.hint { font-size: 12px; color: var(--muted-2); }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

.btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: #344054;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.danger { color: var(--red); border-color: #f4c7c3; background: var(--red-soft); }
.btn.small { padding: 4px 10px; font-size: 12px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 模态 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(16, 24, 40, .45);
  display: grid; place-items: center; padding: 20px; z-index: 50;
}
.modal {
  width: 100%; max-width: 520px; background: var(--surface); border-radius: 18px;
  box-shadow: 0 30px 60px -20px rgba(16, 24, 40, .4); overflow: hidden;
}
.modal header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; }
.modal header h2 { font-size: 16px; margin: 0; }
.modal .body { padding: 18px 20px; max-height: 66vh; overflow: auto; }
.modal footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- 提示 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: #1d2129; color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 13px; z-index: 80; box-shadow: var(--shadow);
}
.toast.error { background: var(--red); }

.empty { padding: 36px 12px; text-align: center; color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.muted { color: var(--muted); }
.right { text-align: right; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; color: var(--muted); }
.split { display: flex; gap: 16px; align-items: baseline; }
.timeline li { margin-bottom: 8px; }
.stack { display: flex; flex-direction: column; gap: 4px; }

/* ---------- 价目表 ---------- */
.price-grid th, .price-grid td { padding: 8px 10px; }
.price-grid thead th { background: #fcfcfd; }
.price-grid tbody th {
  font-weight: 600;
  color: #344054;
  background: #fcfcfd;
  white-space: nowrap;
}
.price-grid .price-input { width: 96px; padding: 6px 9px; text-align: right; }
.price-grid td { border-bottom: 1px solid var(--border); }

.modal.wide { max-width: 760px; }
.modal.wide .price-grid .price-input { width: 84px; }
