/* 召富掌柜运营后台 —— 轻量无依赖样式 */
:root {
  --primary: #ff5b3a;
  --primary-dark: #e6482a;
  --bg: #f5f6f8;
  --card: #ffffff;
  --line: #eceef2;
  --text: #1f2329;
  --text-2: #5b6167;
  --text-3: #9aa0a6;
  --green: #2f9e6d;
  --red: #e5484d;
  --orange: #f5a524;
  --blue: #4c6fff;
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

.hidden { display: none !important; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fff3ef 0%, #f5f6f8 55%, #eef1ff 100%);
  padding: 24px;
}

.login-card {
  width: 380px;
  background: var(--card);
  border-radius: 18px;
  padding: 32px;
  box-shadow: 0 18px 48px rgba(31, 35, 41, 0.1);
}

.login-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 26px; }
.login-mark {
  width: 46px; height: 46px; border-radius: 13px;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700;
}
.login-title { font-size: 17px; font-weight: 700; }
.login-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.field { display: block; margin-bottom: 16px; }
.field span { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.field input {
  width: 100%; height: 42px; border: 1px solid var(--line);
  border-radius: 10px; padding: 0 12px; font-size: 14px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(255, 91, 58, .12); }

.login-msg { color: var(--red); font-size: 13px; min-height: 20px; margin-top: 10px; }
.login-foot { margin-top: 14px; font-size: 12px; color: var(--text-3); text-align: center; }

/* ---------- 按钮 ---------- */
.btn {
  border: none; border-radius: 10px; cursor: pointer;
  font-size: 14px; padding: 0 16px; height: 38px;
  transition: opacity .15s, background .15s;
  font-family: inherit;
}
.btn:hover { opacity: .9; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-ghost { background: #fff; border: 1px solid var(--line); color: var(--text-2); }
.btn-danger { background: #fff; border: 1px solid #ffd8d6; color: var(--red); }
.btn-sm { height: 30px; font-size: 13px; padding: 0 12px; border-radius: 8px; }
.btn-block { width: 100%; height: 44px; font-size: 15px; font-weight: 600; }
.btn-link { background: none; border: none; color: var(--blue); cursor: pointer; font-size: 13px; padding: 0 4px; font-family: inherit; }
.btn-link.danger { color: var(--red); }

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

.sidebar {
  width: 208px; background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 20px 18px; border-bottom: 1px solid var(--line); }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; background: var(--primary);
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.brand-name { font-size: 14px; font-weight: 700; }
.brand-sub { font-size: 11px; color: var(--text-3); }

.nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.nav-item {
  display: block; padding: 10px 12px; border-radius: 9px; color: var(--text-2);
  cursor: pointer; font-size: 13.5px; margin-bottom: 2px; user-select: none;
}
.nav-item:hover { background: #f7f8fa; }
.nav-item.active { background: rgba(255, 91, 58, .1); color: var(--primary); font-weight: 600; }
.sidebar-foot { padding: 12px; border-top: 1px solid var(--line); }

.main { flex: 1; margin-left: 208px; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 60px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px; position: sticky; top: 0; z-index: 10;
}
.page-title { font-size: 16px; font-weight: 700; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.who { font-size: 13px; color: var(--text-2); }
.pay-badge { font-size: 12px; padding: 3px 10px; border-radius: 20px; background: #fff4e8; color: var(--orange); }
.pay-badge.ok { background: #e8f7ef; color: var(--green); }

.content { padding: 20px 22px 40px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card); border-radius: var(--radius); padding: 18px 20px;
  box-shadow: 0 1px 2px rgba(31, 35, 41, .04); margin-bottom: 16px;
}
.card-title { font-size: 14px; font-weight: 700; margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; }
.card-title small { font-weight: 400; color: var(--text-3); font-size: 12px; }

.grid { display: grid; gap: 14px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.stat { background: #fff; border-radius: var(--radius); padding: 16px 18px; box-shadow: 0 1px 2px rgba(31,35,41,.04); }
.stat-label { font-size: 12.5px; color: var(--text-3); }
.stat-value { font-size: 24px; font-weight: 700; margin-top: 6px; letter-spacing: -.5px; }
.stat-value.sm { font-size: 19px; }
.stat-sub { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.stat.danger .stat-value { color: var(--red); }
.stat.ok .stat-value { color: var(--green); }
.stat.warn .stat-value { color: var(--orange); }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--text-3); font-weight: 500; font-size: 12.5px; background: #fafbfc; }
tbody tr:hover { background: #fafbfc; }
td.num { font-variant-numeric: tabular-nums; }
.empty-row { text-align: center; color: var(--text-3); padding: 32px 0; }

/* ---------- 标签 ---------- */
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; }
.tag-green { background: #e8f7ef; color: var(--green); }
.tag-red { background: #fdeaea; color: var(--red); }
.tag-orange { background: #fff4e8; color: var(--orange); }
.tag-blue { background: #eef1ff; color: var(--blue); }
.tag-gray { background: #f1f2f4; color: var(--text-3); }

/* ---------- 表单 ---------- */
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 760px) { .form-row, .form-row-3 { grid-template-columns: 1fr; } }
.form-item { margin-bottom: 14px; }
.form-item label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.form-item input, .form-item select, .form-item textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 9px;
  padding: 9px 11px; font-size: 13.5px; outline: none; font-family: inherit; background: #fff;
}
.form-item input:focus, .form-item select:focus, .form-item textarea:focus { border-color: var(--primary); }
.form-item .hint { font-size: 12px; color: var(--text-3); margin-top: 4px; }

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar select, .toolbar input {
  height: 34px; border: 1px solid var(--line); border-radius: 9px; padding: 0 10px;
  font-size: 13px; outline: none; background: #fff; font-family: inherit;
}
.spacer { flex: 1; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(17, 20, 24, .45);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal {
  background: #fff; border-radius: 14px; width: 100%; max-width: 620px;
  max-height: 86vh; overflow-y: auto; padding: 22px;
}
.modal h3 { font-size: 16px; margin-bottom: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ---------- 提示 ---------- */
.toast {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%) translateY(-20px);
  background: rgba(31, 35, 41, .92); color: #fff; padding: 10px 18px; border-radius: 10px;
  font-size: 13.5px; opacity: 0; pointer-events: none; transition: all .22s; z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: rgba(229, 72, 77, .95); }

.notice {
  background: #fff8f5; border: 1px solid #ffe2d8; color: #a4432a;
  padding: 12px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 16px; line-height: 1.7;
}
.notice b { color: var(--primary-dark); }
