/* 青豆 CRM 演示控制台 — 轻量、克制的界面样式 */

:root {
  --ink: #101823;
  --ink-2: #334155;
  --muted: #6b7a90;
  --line: #e5e9f0;
  --line-soft: #eef1f6;
  --bg: #f4f6f9;
  --panel: #ffffff;
  --accent: #157a5f;
  --accent-ink: #0f5a46;
  --accent-soft: #e6f2ee;
  --side: #111a24;
  --side-ink: #aab6c6;
  --ok-bg: #e7f5ee;
  --ok-ink: #1a7a52;
  --warn-bg: #fdf1e0;
  --warn-ink: #9a6512;
  --info-bg: #e8f0fb;
  --info-ink: #23558f;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

.shell { display: flex; min-height: 100vh; }

/* ---------- 侧边栏 ---------- */
.sidebar {
  width: 218px;
  flex: 0 0 218px;
  background: var(--side);
  color: var(--side-ink);
  padding: 22px 0;
  display: flex;
  flex-direction: column;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 20px 20px; }
.brand-mark {
  width: 30px; height: 30px; flex: 0 0 30px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #fff; font-size: 15px; font-weight: 600;
}
.brand-name { display: flex; flex-direction: column; color: #fff; font-size: 14px; font-weight: 600; letter-spacing: .2px; }
.brand-name em { font-style: normal; font-size: 11px; font-weight: 400; color: #7b8a9c; letter-spacing: .3px; }

.nav { display: flex; flex-direction: column; gap: 1px; padding: 6px 12px; }
.nav a {
  color: var(--side-ink);
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 13.5px;
  text-decoration: none;
}
.nav a:hover { background: rgba(255, 255, 255, .06); color: #eaf0f6; text-decoration: none; }
.nav a.on { background: rgba(21, 122, 95, .22); color: #dff2ea; font-weight: 600; box-shadow: inset 2px 0 0 var(--accent); }

.sidebar-foot { margin-top: auto; padding: 16px 20px 0; border-top: 1px solid rgba(255, 255, 255, .08); font-size: 12px; }
.sidebar-foot a { display: block; color: #8494a8; padding: 3px 0; }
.sidebar-foot a:hover { color: #dfe7ef; }
.org { color: #6f7f92; margin-bottom: 8px; }

/* ---------- 主区 ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 56px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
}
.crumb { font-size: 13px; color: var(--muted); }
.who { display: flex; align-items: center; gap: 14px; font-size: 12.5px; color: var(--muted); }
.mail { font-variant-numeric: tabular-nums; }
.linkish {
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  border-radius: 6px; padding: 3px 10px; font-size: 12.5px; cursor: pointer;
}
.linkish:hover { border-color: #cbd5e1; color: var(--ink); }

.content { padding: 26px 28px 40px; max-width: 1220px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 21px; font-weight: 600; letter-spacing: .2px; }
.page-head .sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.page-head .total { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.back { display: inline-block; margin-bottom: 6px; font-size: 12.5px; color: var(--muted); }

/* ---------- 指标卡 ---------- */
.stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 22px; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; text-decoration: none;
}
.stat:hover { border-color: #cfd8e3; text-decoration: none; box-shadow: 0 1px 2px rgba(16, 24, 35, .04); }
.stat-label { font-size: 12px; color: var(--muted); }
.stat-value { font-size: 24px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: .3px; }

/* ---------- 面板与表格 ---------- */
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: 18px; overflow: hidden;
}
/* On a narrow screen the table scrolls sideways instead of squeezing every
   column until one character fits per line. */
.panel { overflow-x: auto; }
.table { min-width: 760px; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 18px; border-bottom: 1px solid var(--line-soft);
}
.panel-head h2 { margin: 0; font-size: 14.5px; font-weight: 600; }
.panel-head .more { font-size: 12.5px; }

.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-weight: 500; font-size: 12px; color: var(--muted);
  padding: 10px 18px; background: #fafbfd; border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}
.table td {
  padding: 11px 18px; border-bottom: 1px solid var(--line-soft);
  color: var(--ink-2); vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: #fcfdfd; }
.table td:first-child { color: var(--ink); font-weight: 500; }
.table .empty { text-align: center; color: var(--muted); padding: 30px 0; }

.pill {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; line-height: 18px; white-space: nowrap;
}
.pill-ok { background: var(--ok-bg); color: var(--ok-ink); }
.pill-warn { background: var(--warn-bg); color: var(--warn-ink); }
.pill-info { background: var(--info-bg); color: var(--info-ink); }
.pill-muted { background: #f0f2f6; color: #6b7a90; }

.pager { display: flex; align-items: center; gap: 14px; margin: 4px 0 8px; font-size: 13px; }
.pager a { border: 1px solid var(--line); background: #fff; padding: 5px 12px; border-radius: 6px; color: var(--ink-2); }
.pager a:hover { border-color: #cbd5e1; text-decoration: none; }
.page-now { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- 详情 ---------- */
.detail { margin: 0; padding: 4px 0; }
.detail-row { display: flex; border-bottom: 1px solid var(--line-soft); }
.detail-row:last-child { border-bottom: none; }
.detail dt {
  width: 150px; flex: 0 0 150px; padding: 11px 18px; color: var(--muted); font-size: 13px;
  background: #fafbfd;
}
.detail dd { margin: 0; padding: 11px 18px; color: var(--ink-2); flex: 1; word-break: break-word; }

/* ---------- 登录 ---------- */
.login-body { display: grid; place-items: center; min-height: 100vh; background: linear-gradient(180deg, #f6f8fa 0%, #eef1f6 100%); }
.login-card {
  width: 340px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 30px 28px 28px; box-shadow: 0 12px 32px rgba(16, 24, 35, .07);
}
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.login-card h1 { margin: 0; font-size: 19px; font-weight: 600; }
.login-card .sub { margin: 5px 0 18px; color: var(--muted); font-size: 13px; }
.alert {
  background: #fdeeee; color: #a33; border: 1px solid #f3d4d4;
  border-radius: 8px; padding: 8px 12px; font-size: 12.5px; margin-bottom: 14px;
}
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-form label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); }
.login-form input {
  border: 1px solid var(--line); border-radius: 7px; padding: 9px 11px;
  font-size: 14px; color: var(--ink); background: #fff;
}
.login-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.primary {
  margin-top: 6px; border: none; border-radius: 7px; padding: 10px;
  background: var(--accent); color: #fff; font-size: 14px; cursor: pointer;
}
.primary:hover { background: var(--accent-ink); }

@media (max-width: 1080px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .sidebar { display: none; }
  .content { padding: 16px 12px 28px; }
  .table { min-width: 640px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .content { padding: 18px 14px 30px; }
}
