:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --bg: #f1f5f9;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --green: #16a34a;
  --red: #dc2626;
  --amber: #d97706;
  --sidebar: #0f172a;
  --sidebar-text: #94a3b8;
  --radius: 10px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px;
}
a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
}
.login-card {
  width: 380px; background: var(--card); border-radius: 16px; padding: 36px 32px;
  box-shadow: 0 25px 60px rgba(0,0,0,.35);
}
.login-card h1 { font-size: 20px; text-align: center; margin-bottom: 4px; }
.login-card .sub { text-align: center; color: var(--muted); margin-bottom: 24px; font-size: 13px; }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 234px; background: var(--sidebar); color: var(--sidebar-text);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar .logo { color: #fff; font-size: 14px; font-weight: 700; padding: 20px 18px 14px; white-space: nowrap; }
.sidebar .logo small { display: block; font-size: 11px; color: var(--sidebar-text); font-weight: 400; margin-top: 3px; white-space: nowrap; }
.nav-item {
  padding: 11px 18px; cursor: pointer; border-left: 3px solid transparent; font-size: 14px;
  display: flex; align-items: center; gap: 8px;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: rgba(37,99,235,.22); color: #fff; border-left-color: var(--primary); }
.sidebar .user-box { margin-top: auto; padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; }
.sidebar .user-box .name { color: #fff; font-size: 13px; margin-bottom: 6px; }
.main { flex: 1; padding: 22px 26px; min-width: 0; }
.page-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.page-title .ops { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 卡片/统计 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.stat-card .label { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.stat-card .value { font-size: 24px; font-weight: 700; }
.stat-card .value.green { color: var(--green); }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.card h3 { font-size: 14px; margin-bottom: 12px; }

/* ---------- 表格 ---------- */
table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; }
th { background: #f8fafc; color: var(--muted); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fafc; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); }

/* ---------- 控件 ---------- */
.btn {
  border: 1px solid var(--border); background: #fff; color: var(--text);
  padding: 7px 14px; border-radius: 8px; font-size: 13px; transition: .15s;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.danger { color: var(--red); border-color: #fecaca; }
.btn.danger:hover { background: #fef2f2; }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
input, select, textarea {
  width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; font-family: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select { width: auto; min-width: 160px; }

/* ---------- 标签 ---------- */
.tag { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; line-height: 18px; }
.tag.green { background: #dcfce7; color: var(--green); }
.tag.red { background: #fee2e2; color: var(--red); }
.tag.blue { background: #dbeafe; color: var(--primary); }
.tag.amber { background: #fef3c7; color: var(--amber); }
.tag.gray { background: #f1f5f9; color: var(--muted); }

/* ---------- 分页 ---------- */
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; color: var(--muted); font-size: 13px; }

/* ---------- 弹窗 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.55); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal { background: #fff; border-radius: 14px; width: 560px; max-width: 100%; max-height: 88vh; overflow: auto; padding: 22px 24px; }
.modal h2 { font-size: 16px; margin-bottom: 16px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ---------- Toast ---------- */
#toast-root { position: fixed; top: 16px; right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 10px 16px; border-radius: 8px; color: #fff; font-size: 13px; box-shadow: 0 6px 18px rgba(0,0,0,.18); animation: pop .2s; max-width: 420px; }
.toast.ok { background: var(--green); }
.toast.err { background: var(--red); }
@keyframes pop { from { transform: translateY(-6px); opacity: 0; } }

.muted { color: var(--muted); }
.money { color: var(--red); font-weight: 600; }
.new-badge { background: var(--red); color: #fff; border-radius: 4px; font-size: 10px; padding: 1px 4px; margin-left: 4px; vertical-align: middle; }
.demo-hint { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: 8px; padding: 8px 14px; margin-bottom: 14px; font-size: 13px; }
.mt8 { margin-top: 8px; } .mt14 { margin-top: 14px; }
.quota-table { margin-top: 10px; }

/* ---------- 配额看板 ---------- */
.qb-status { font-size: 13px; margin-top: 8px; min-height: 18px; }
.qb-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 14px; }
.qb-kpi { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.qb-kpi .t { font-size: 12px; color: var(--muted); }
.qb-kpi .n { font-size: 24px; font-weight: 700; margin-top: 4px; }
.qb-kpi .n b { font-size: 15px; font-weight: 600; color: var(--muted); }
.qb-kpi .r { margin-top: 4px; font-size: 14px; font-weight: 700; }
.qb-banner { border: 1px solid var(--border); border-radius: 12px; margin-top: 14px; padding: 16px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.qb-banner .lab { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.qb-banner .big { font-size: 20px; font-weight: 700; line-height: 1.2; }
.qb-banner .sub { font-size: 14px; margin-top: 6px; }
.qb-red { background: #c62828 !important; color: #fff !important; font-weight: 700; }
.qb-orange { color: #e65100 !important; font-weight: 800; }
.qb-green { color: #2e7d32 !important; font-weight: 800; }
.qb-gray { color: #64748b !important; font-weight: 600; }
.qb-deep-red { background: #7f0000 !important; color: #fff !important; font-weight: 700; }
.qb-yellow { color: #f9a825 !important; font-weight: 800; }
.qb-remaining { color: #475569 !important; }
.qb-textrow { padding: 10px 14px; line-height: 2; font-size: 13px; background: #fafbfc; }
.qb-textrow span { margin-right: 6px; }
#qbTable th, #qbTable td { white-space: nowrap; }
#qbTable { width: auto; min-width: 100%; }
.qb-grphead td { background: #1c2b4a; color: #fff; font-weight: 700; padding: 8px 14px; }
.qb-grphead { border: none; }
.qb-btn { background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.25); color: #fff; border-radius: 6px; padding: 2px 10px; font-size: 12px; margin-left: 10px; }
.qb-btn:hover { border-color: #fff; color: #fff; }
.qb-dimrow td { background: #e3ecf7; color: #1c2b4a; font-weight: 700; padding: 7px 14px; cursor: pointer; }
.qb-dimrow .cnt { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 8px; }
.qb-dimrow .arrow { font-weight: 400; color: #5b7bb8; font-size: 12px; }
.qb-opt { background: #f8fafc; font-weight: 700; }
.qb-cross-wrap { overflow-x: auto; padding: 10px; }
.qb-cross-wrap table { margin: 0; width: auto; }
.qb-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; font-size: 12px; color: var(--muted); }
.qb-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
@media (max-width: 760px) {
  .sidebar { width: 60px; }
  .sidebar .logo small, .nav-item span.txt { display: none; }
  .main { padding: 14px; }
}

/* v1.9.33 强制让 field 里的 input 撑满 */
.field input, .field select { width: 100% !important; box-sizing: border-box; }
