/* AI掌柜 admin 控制台样式（无外部依赖） */
:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --ok: #16a34a;
  --warn: #d97706;
  --bad: #dc2626;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
}
* { 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(--ink); font-size: 14px;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }

/* ── 登录 ── */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #1e293b 0%, #0f172a 100%);
}
.login-card {
  width: 360px; background: var(--card); border-radius: 14px; padding: 32px 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.login-brand { text-align: center; margin-bottom: 24px; }
.logo {
  width: 44px; height: 44px; border-radius: 10px; margin: 0 auto 10px;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: #fff; font-weight: 700; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
.login-brand h1 { font-size: 18px; }
.login-brand .sub { color: var(--muted); font-size: 12px; margin-top: 6px; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px; outline: none; transition: border-color .15s;
}
.field input:focus { border-color: var(--primary); }
.login-error {
  background: #fef2f2; color: var(--bad); border: 1px solid #fecaca;
  border-radius: 8px; padding: 8px 12px; font-size: 12px; margin-bottom: 14px;
}
.login-foot { text-align: center; color: var(--muted); font-size: 11px; margin-top: 14px; }

/* ── 按钮 ── */
.btn {
  border: none; border-radius: 8px; padding: 10px 16px; font-size: 14px;
  cursor: pointer; transition: background .15s, opacity .15s;
}
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn-ghost:hover { color: var(--ink); border-color: #cbd5e1; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; }

/* ── 顶栏 ── */
.topbar {
  height: 56px; background: var(--card); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; position: sticky; top: 0; z-index: 10;
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.logo-sm { width: 30px; height: 30px; font-size: 13px; margin: 0; }
.badge {
  font-size: 11px; color: var(--primary); background: #eff6ff;
  border: 1px solid #bfdbfe; padding: 2px 8px; border-radius: 99px;
}
.topbar-right { display: flex; align-items: center; gap: 12px; }
.whoami { font-size: 12px; color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-gray { background: #9ca3af; }
.dot-ok { background: var(--ok); }
.dot-bad { background: var(--bad); }

/* ── 内容 ── */
.content { max-width: 1080px; margin: 0 auto; padding: 24px; }
.cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px; margin-bottom: 20px;
}
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow);
}
.card-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.card-value { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.card-value-sm { font-size: 18px; }
.card-hint { font-size: 11px; color: var(--muted); margin-top: 6px; }
.card-value.warn { color: var(--warn); }
.card-value.bad { color: var(--bad); }

.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 20px;
}
.panel h2 { font-size: 14px; margin-bottom: 14px; }
.status-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px;
}
.status-item {
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; text-align: center;
}
.status-item .k { font-size: 11px; color: var(--muted); }
.status-item .v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.status-item .v.zero { color: #cbd5e1; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.table th { color: var(--muted); font-weight: 500; font-size: 12px; }
.table tbody tr:hover { background: #f8fafc; }
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 99px;
  font-size: 11px; border: 1px solid var(--line);
}
.tag-s-pending { color: var(--warn); border-color: #fde68a; background: #fffbeb; }
.tag-s-paid, .tag-s-distributed, .tag-s-processing, .tag-s-fulfilling { color: var(--primary); border-color: #bfdbfe; background: #eff6ff; }
.tag-s-completed { color: var(--ok); border-color: #bbf7d0; background: #f0fdf4; }
.tag-s-cancelled, .tag-s-refunded { color: var(--muted); }
.tag-s-refunding { color: var(--bad); border-color: #fecaca; background: #fef2f2; }
.foot { text-align: center; color: var(--muted); font-size: 11px; padding: 8px 0 24px; }
