/* ==========================================================================
   admin.css — 后台管理系统
   ========================================================================== */

body.admin-body { background: #f2f4f7; min-height: 100vh; }

/* ---------- 侧边栏 ---------- */
.a-side {
  position: fixed; left: 0; top: 0; bottom: 0; width: 216px; background: #1f242c;
  display: flex; flex-direction: column; z-index: 20;
}
.a-brand { display: flex; align-items: center; gap: 10px; height: 62px; padding: 0 20px; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.a-brand .ab-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.a-brand b { color: #fff; font-size: 15px; font-weight: 600; }
.a-brand span { display: block; font-size: 10px; color: rgba(255, 255, 255, .35); letter-spacing: 1.2px; }
.a-menu { flex: 1; padding: 14px 10px; overflow-y: auto; }
.a-menu .am-group { font-size: 11px; color: rgba(255, 255, 255, .28); padding: 12px 12px 6px; letter-spacing: .6px; }
.a-menu a {
  display: flex; align-items: center; gap: 11px; height: 42px; padding: 0 12px;
  border-radius: 8px; color: rgba(255, 255, 255, .66); font-size: 14px; margin-bottom: 2px;
}
.a-menu a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.a-menu a.on { background: var(--primary); color: #fff; font-weight: 500; }
.a-side-foot { padding: 14px; border-top: 1px solid rgba(255, 255, 255, .07); }
.a-side-foot a { display: flex; align-items: center; gap: 9px; color: rgba(255, 255, 255, .5); font-size: 13px; }
.a-side-foot a:hover { color: #fff; }

/* ---------- 主区 ---------- */
.a-main { margin-left: 216px; min-height: 100vh; display: flex; flex-direction: column; }
.a-top {
  height: 62px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px; padding: 0 24px; position: sticky; top: 0; z-index: 10;
}
.a-top h1 { font-size: 17px; font-weight: 600; }
.a-top .at-crumb { font-size: 12px; color: var(--text-3); }
.a-top .at-right { margin-left: auto; display: flex; align-items: center; gap: 16px; font-size: 13px; color: var(--text-2); }
.a-user { display: flex; align-items: center; gap: 9px; }
.a-user .av { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }
.a-user .un { line-height: 1.25; }
.a-user .un b { display: block; font-size: 13px; font-weight: 600; }
.a-user .un span { font-size: 11px; color: var(--text-3); }

.a-content { padding: 22px 24px 40px; flex: 1; }

/* ---------- 统计卡 ---------- */
.a-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.a-stat { background: #fff; border-radius: 12px; padding: 20px 22px; border: 1px solid var(--border); }
.a-stat .as-label { font-size: 13px; color: var(--text-3); display: flex; align-items: center; gap: 8px; }
.a-stat .as-num { font-size: 28px; font-weight: 700; line-height: 1.25; margin-top: 8px; }
.a-stat .as-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.a-stat.p1 .as-num { color: var(--primary); }
.a-stat.p2 .as-num { color: #2f6fd0; }
.a-stat.p3 .as-num { color: var(--ok); }
.a-stat.p4 .as-num { color: #7a5af0; }

/* ---------- 卡片 / 表格 ---------- */
.a-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-bottom: 20px; }
.a-card-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.a-card-head h2 { font-size: 15px; font-weight: 600; }
.a-card-head .ach-right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.a-card-body { padding: 18px 20px; }
.a-card-body.flush { padding: 0; }

.a-table { width: 100%; font-size: 13px; }
.a-table th {
  text-align: left; font-weight: 500; color: var(--text-3); font-size: 12px;
  padding: 12px 14px; background: #fafbfc; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.a-table td { padding: 13px 14px; border-bottom: 1px solid #f1f3f6; vertical-align: middle; }
.a-table tr:last-child td { border-bottom: 0; }
.a-table tbody tr:hover { background: #fcfcfd; }
.a-table .col-actions { text-align: right; white-space: nowrap; }
.a-table .t-strong { font-weight: 600; }
.a-table .t-muted { color: var(--text-3); }
.a-table .t-mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--text-2); }
.a-table .t-num { color: var(--primary); font-weight: 600; }
.a-table .t-clip { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.a-empty { text-align: center; padding: 60px 20px; color: var(--text-3); }

/* ---------- 工具条 ---------- */
.a-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.a-toolbar .input, .a-toolbar .select { height: 34px; font-size: 13px; width: auto; min-width: 150px; }
.a-tabs { display: flex; gap: 4px; }
.a-tabs a { padding: 6px 14px; border-radius: 20px; font-size: 13px; color: var(--text-2); background: var(--bg); }
.a-tabs a.on { background: var(--primary); color: #fff; }

/* ---------- 表单 ---------- */
.a-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.a-form-grid .full { grid-column: 1 / -1; }
.a-form .field > label { font-size: 13px; color: var(--text-2); }
.a-form .input, .a-form .select, .a-form .textarea { background: #fbfcfd; }
.a-form .input:focus, .a-form .select:focus, .a-form .textarea:focus { background: #fff; }

/* ---------- 弹窗 ---------- */
.a-modal { position: fixed; inset: 0; background: rgba(20, 24, 30, .48); display: none; align-items: flex-start; justify-content: center; z-index: 200; padding: 60px 20px; overflow-y: auto; }
.a-modal.on { display: flex; }
.a-modal-box { background: #fff; border-radius: 14px; width: 100%; max-width: 640px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.a-modal-head { display: flex; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.a-modal-head h3 { font-size: 16px; font-weight: 600; }
.a-modal-head .am-close { margin-left: auto; color: var(--text-3); font-size: 20px; line-height: 1; }
.a-modal-head .am-close:hover { color: var(--danger); }
.a-modal-body { padding: 22px; max-height: 62vh; overflow-y: auto; }
.a-modal-foot { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- 登录页 ---------- */
.a-login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #1f242c; padding: 20px; }
.a-login-box { background: #fff; border-radius: 16px; width: 100%; max-width: 400px; padding: 38px 34px; box-shadow: 0 24px 70px rgba(0, 0, 0, .35); }
.a-login-box .al-logo { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 8px; }
.a-login-box .al-logo .ab-mark { width: 38px; height: 38px; border-radius: 10px; background: var(--primary); display: flex; align-items: center; justify-content: center; }
.a-login-box .al-logo b { font-size: 19px; font-weight: 600; }
.a-login-box .al-sub { text-align: center; font-size: 13px; color: var(--text-3); margin-bottom: 26px; }
.a-login-box .btn { height: 44px; }
.a-login-tip { margin-top: 20px; padding: 12px 14px; border-radius: 8px; background: var(--bg); font-size: 12px; color: var(--text-2); line-height: 1.8; }
.a-login-tip b { color: var(--text); }

/* ---------- 图表（纯 CSS 条形） ---------- */
.bar-list li { margin-bottom: 14px; }
.bar-list .bl-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.bar-list .bl-top span { color: var(--text-2); }
.bar-list .bl-top b { color: var(--text); font-weight: 600; }
.bar-list .bl-track { height: 8px; border-radius: 4px; background: var(--bg); overflow: hidden; }
.bar-list .bl-fill { height: 100%; border-radius: 4px; background: var(--primary); }

.a-2col { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; align-items: start; }

@media (max-width: 1100px) {
  .a-stats { grid-template-columns: 1fr 1fr; }
  .a-2col { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .a-side { transform: translateX(-100%); }
  .a-main { margin-left: 0; }
  .a-form-grid { grid-template-columns: 1fr; }
  .a-table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* ============ 线索看板视图 ============ */
.kb-wrap { margin-top: 4px; }
.kb-cols { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; align-items: start; }
.kb-col { background: #f4f5f7; border-radius: 10px; padding: 10px; min-height: 300px; border: 1px solid transparent; transition: all .15s; }
.kb-col.kb-over { border-color: var(--primary, #f26a21); background: #fff5ef; }
.kb-col-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 10px; font-size: 13px; }
.kb-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.kb-count { margin-left: auto; font-size: 11px; color: #8a8f99; background: #fff; border-radius: 10px; padding: 1px 8px; }
.kb-cards { display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.kb-card { background: #fff; border: 1px solid #e6e8ec; border-radius: 8px; padding: 10px 12px; cursor: grab; transition: box-shadow .15s; }
.kb-card:hover { box-shadow: 0 4px 14px rgba(0, 0, 0, .1); }
.kb-card:active { cursor: grabbing; }
.kb-no { font-size: 11px; color: #9aa0ab; font-family: Menlo, Consolas, monospace; }
.kb-name { font-size: 14px; font-weight: 600; color: #23272e; margin-top: 3px; }
.kb-tel { font-size: 12px; color: #6b7280; margin-top: 2px; }
.kb-content { font-size: 12px; color: #8a8f99; margin-top: 6px; line-height: 1.55; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-tags { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
@media (max-width: 1200px) { .kb-cols { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 800px) { .kb-cols { grid-template-columns: 1fr; } }
