/* ============================================================
   乐火传媒 CRM · 视觉风格 v3
   参考：现代 SaaS 数据看板（深藏青侧栏 + 浅色内容区 + 圆角卡片）
   ============================================================ */
:root {
  --side-w: 236px;
  --navy-1: #1b2a4a;
  --navy-2: #101a30;
  --primary: #2f6fed;
  --primary-2: #5a8dff;
  --ink: #17264a;
  --ink-2: #55648a;
  --ink-3: #8b97b5;
  --bg: #f2f5fb;
  --card-shadow: 0 2px 14px rgba(23, 43, 99, .06);
  --card-shadow-hover: 0 8px 24px rgba(23, 43, 99, .12);
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  background-image:
    radial-gradient(560px 320px at 85% -80px, rgba(47, 111, 237, .08), transparent 70%),
    radial-gradient(480px 300px at -60px 40%, rgba(192, 85, 47, .06), transparent 70%);
  background-attachment: fixed;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* ---------- 布局框架 ---------- */
.layout { display: flex; min-height: 100vh; }

/* ---------- 侧栏：深藏青 ---------- */
.sidebar {
  width: var(--side-w);
  background: linear-gradient(180deg, var(--navy-1) 0%, var(--navy-2) 100%);
  color: #c3cde3;
  position: fixed; top: 0; bottom: 0; left: 0;
  overflow-y: auto; z-index: 100;
  display: flex; flex-direction: column;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent;
}
.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 4px; }

.sidebar .brand {
  padding: 20px 18px 16px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.sidebar .brand .logo {
  width: 40px; height: 40px; flex-shrink: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary-2), var(--primary) 60%, #2456c4);
  color: #fff; font-size: 19px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(47, 111, 237, .45), inset 0 1px 0 rgba(255,255,255,.25);
}
.sidebar .brand .t { font-size: 16px; font-weight: 700; color: #fff; line-height: 1.25; }
.sidebar .brand small { display: block; font-size: 11px; color: #7f8db0; font-weight: 400; margin-top: 3px; letter-spacing: .3px; }

.sidebar .nav-wrap { flex: 1; padding: 10px 0 14px; }
.sidebar .nav-group { margin-top: 6px; }
.sidebar .nav-title {
  padding: 10px 22px 6px;
  font-size: 11px; letter-spacing: 2px;
  color: #66779e;
}
.sidebar a {
  display: flex; align-items: center; gap: 10px;
  margin: 2px 12px; padding: 9px 12px;
  border-radius: 10px;
  color: #c3cde3; text-decoration: none; font-size: 14px;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.sidebar a i.bi { font-size: 15px; width: 20px; text-align: center; opacity: .85; }
.sidebar a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar a.active {
  background: linear-gradient(90deg, var(--primary-2), var(--primary));
  color: #fff; font-weight: 600;
  box-shadow: 0 4px 12px rgba(47, 111, 237, .4);
}
.sidebar a.active i.bi { opacity: 1; }
.sidebar a .badge { font-size: 10px; font-weight: 600; }

/* 侧栏底部信息卡 */
.sidebar-foot { margin: 8px 14px 16px; padding: 14px 16px; border-radius: 14px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); }
.sidebar-foot .sf-title { color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.sidebar-foot .sf-title i { color: var(--primary-2); }
.sidebar-foot .sf-sub { color: #7f8db0; font-size: 11.5px; margin-top: 6px; line-height: 1.6; }

/* ---------- 主区域 ---------- */
.main { flex: 1; margin-left: var(--side-w); display: flex; flex-direction: column; min-width: 0; }

.topbar {
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid #e8edf6;
  padding: 12px 26px;
  display: flex; justify-content: space-between; align-items: center;
  position: sticky; top: 0; z-index: 90;
}
.topbar .crumb { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-3); }
.topbar .crumb strong {
  background: linear-gradient(90deg, rgba(47,111,237,.12), rgba(90,141,255,.08));
  color: var(--primary); font-weight: 700; white-space: nowrap;
  padding: 5px 14px; border-radius: 999px; font-size: 13px;
}
.topbar .who { display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--ink-2); }
.topbar .who > a { color: var(--ink-2); text-decoration: none; width: 34px; height: 34px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center; transition: background .18s ease; }
.topbar .who > a:hover { background: #eef3fd; color: var(--primary); }
.user-chip {
  display: flex; align-items: center; gap: 9px;
  background: #fff; border: 1px solid #e8edf6;
  padding: 5px 14px 5px 6px; border-radius: 999px;
  box-shadow: 0 1px 4px rgba(23,43,99,.06);
  font-weight: 600; color: var(--ink); font-size: 13.5px;
}
.user-chip .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  color: #fff; font-size: 13px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.user-chip .uc-name { line-height: 1.15; }
.user-chip .uc-name small { display: block; font-size: 11px; color: var(--ink-3); font-weight: 400; }

/* 顶栏搜索（筛选当前页表格内容） */
.topsearch {
  display: flex; align-items: center; gap: 8px;
  background: #f2f5fb; border: 1px solid #e8edf6;
  border-radius: 999px; padding: 7px 16px;
  min-width: 260px; color: var(--ink-3);
}
.topsearch i { font-size: 14px; }
.topsearch input {
  border: 0; outline: 0; background: transparent;
  font-size: 13px; width: 100%; color: var(--ink);
}
.topsearch input::placeholder { color: #a4aec5; }

/* ---------- 总监总览 · 排名条样式（参考图：圆点排名 + 条形 + 数值） ---------- */
.rank-row { display: grid; grid-template-columns: 24px minmax(64px, auto) 1fr auto; align-items: center; gap: 10px; margin-bottom: 10px; }
.rank-row:last-child { margin-bottom: 0; }
.rank-dot {
  width: 22px; height: 22px; border-radius: 50%;
  font-size: 11.5px; font-weight: 700; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  background: #c3cde3;
}
.rank-row:nth-child(1) .rank-dot { background: linear-gradient(135deg, #5a8dff, #2f6fed); }
.rank-row:nth-child(2) .rank-dot { background: linear-gradient(135deg, #D9A088, #C0552F); }
.rank-row:nth-child(3) .rank-dot { background: linear-gradient(135deg, #fbbf24, #e8930c); }
.rank-row:nth-child(4) .rank-dot { background: linear-gradient(135deg, #a78bfa, #8b5cf6); }
.rank-row:nth-child(5) .rank-dot { background: linear-gradient(135deg, #f87171, #e14b64); }
.rank-label { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.rank-val { font-size: 13px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.rank-bar .progress { height: 7px; }
.allWork-box { background: linear-gradient(180deg, #fbfcff, #f7f9fe); border: 1px solid #edf1f8; border-radius: 12px; }
.allWork-box .fw-bold { color: var(--ink); }

.content { padding: 24px 26px 10px; flex: 1; }

/* ---------- 页面标题 ---------- */
.page-title { font-size: 20px; font-weight: 800; color: var(--ink); margin-bottom: 18px; letter-spacing: .3px; }
.page-title::before {
  content: ""; display: inline-block;
  width: 5px; height: 18px; border-radius: 3px;
  background: linear-gradient(180deg, var(--primary-2), var(--primary));
  margin-right: 10px; vertical-align: -2px;
  box-shadow: 0 2px 6px rgba(47,111,237,.4);
}

/* ---------- 卡片体系 ---------- */
.card { border: 0; border-radius: 14px; box-shadow: var(--card-shadow); }
.card-header { background: #fff; border-bottom: 1px solid #eef2f9; font-weight: 700; color: var(--ink); }

.detail-block {
  background: #fff; border-radius: 14px;
  padding: 18px 20px; box-shadow: var(--card-shadow);
  margin-bottom: 16px;
  border: 1px solid rgba(232, 237, 246, .8);
}
.detail-block h6 {
  position: relative;
  font-weight: 700; font-size: 15px; color: var(--ink);
  padding-left: 12px; margin-bottom: 14px;
}
.detail-block h6::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 4px; height: 15px; border-radius: 2px;
  background: linear-gradient(180deg, var(--primary-2), var(--primary));
}

/* ---------- 统计卡片（参考图：左侧彩色图标块） ---------- */
.stat-card {
  position: relative; overflow: hidden;
  border-radius: 14px; padding: 18px 20px 18px 74px;
  background: #fff;
  box-shadow: var(--card-shadow);
  border: 1px solid rgba(232, 237, 246, .8);
  transition: transform .2s ease, box-shadow .2s ease;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--card-shadow-hover); }
.stat-card::before {
  content: "\f4d0"; font-family: "bootstrap-icons";
  position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; line-height: 1;
  color: #2f6fed; background: rgba(47, 111, 237, .12);
}
.stat-card::after {
  content: ""; position: absolute; right: -24px; bottom: -34px;
  width: 100px; height: 100px; border-radius: 50%;
  background: radial-gradient(circle, rgba(47,111,237,.07), transparent 70%);
}
.row > div:nth-child(4n+2) .stat-card::before { content: "\f673"; color: #C0552F; background: rgba(192, 85, 47, .13); }
.row > div:nth-child(4n+3) .stat-card::before { content: "\f1cc"; color: #e8930c; background: rgba(246, 166, 9, .14); }
.row > div:nth-child(4n+4) .stat-card::before { content: "\f615"; color: #8b5cf6; background: rgba(139, 92, 246, .13); }
.stat-card .num { font-size: 24px; font-weight: 800; letter-spacing: .3px; line-height: 1.15; }
.stat-card .num.text-primary { color: var(--primary) !important; }
.stat-card .num.text-success { color: #A8431F !important; }
.stat-card .num.text-danger { color: #e14b64 !important; }
.stat-card .num.text-warning { color: #e8930c !important; }
.stat-card .lbl { font-size: 12.5px; color: var(--ink-3); margin-top: 5px; }

/* ---------- 过滤条 / 表格 ---------- */
.filter-bar { background: #fff; padding: 14px 16px; border-radius: 14px; box-shadow: var(--card-shadow); margin-bottom: 16px; border: 1px solid rgba(232,237,246,.8); }

.table { --bs-table-hover-bg: #f6f9ff; }
.table td, .table th { vertical-align: middle; font-size: 13.5px; padding: .65rem .9rem; }
.table thead th {
  background: #f7f9fd; color: var(--ink-3); font-weight: 600; font-size: 12.5px;
  border-bottom: 1px solid #e8edf6; white-space: nowrap;
}
.table tbody tr { transition: background .15s ease; }

/* ---------- 进度条 ---------- */
.progress { height: 8px; border-radius: 999px; background: #edf1f8; overflow: hidden; }
.progress-bar { border-radius: 999px; }

.progress-label { font-size: 12.5px; color: var(--ink-2); display: flex; justify-content: space-between; margin-bottom: 5px; }

/* ---------- 按钮 / 表单 / 徽标 ---------- */
.btn { border-radius: 9px; font-weight: 600; font-size: 13.5px; }
.btn-primary {
  --bs-btn-bg: var(--primary); --bs-btn-border-color: var(--primary);
  --bs-btn-hover-bg: #2456d4; --bs-btn-hover-border-color: #2456d4;
  --bs-btn-active-bg: #1f4bbd; --bs-btn-active-border-color: #1f4bbd;
  box-shadow: 0 3px 10px rgba(47, 111, 237, .28);
}
.btn-primary:hover { box-shadow: 0 5px 14px rgba(47, 111, 237, .38); }
.btn-outline-primary { --bs-btn-color: var(--primary); --bs-btn-border-color: rgba(47,111,237,.5); --bs-btn-hover-bg: var(--primary); --bs-btn-hover-border-color: var(--primary); border-radius: 9px; }

.badge { font-weight: 600; border-radius: 7px; padding: .38em .7em; }

.form-control, .form-select { border-radius: 9px; border-color: #dfe6f2; font-size: 13.5px; }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 .2rem rgba(47,111,237,.12); }
.form-label { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.input-group-text { border-radius: 9px 0 0 9px; }

.alert { border-radius: 12px; border: 0; box-shadow: var(--card-shadow); font-size: 13.5px; }
.alert-success { background: #F7E8DF; color: #8E3418; }
.alert-danger { background: #fdeef1; color: #c2334d; }
.alert-warning { background: #fdf5e4; color: #a86e04; }
.alert-info { background: #eaf1fe; color: #2456c4; }
.alert-primary { background: #eaf1fe; color: #2456c4; }

.modal-content { border: 0; border-radius: 16px; box-shadow: 0 18px 50px rgba(15,30,70,.22); }
.modal-header { border-bottom: 1px solid #eef2f9; }
.modal-footer { border-top: 1px solid #eef2f9; }

.pagination { --bs-pagination-border-radius: 8px; }

/* ---------- 其他业务组件 ---------- */
.kv { display: flex; font-size: 13.5px; margin-bottom: 7px; }
.kv .k { width: 110px; color: var(--ink-3); flex-shrink: 0; }

.todo-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 12px; border-bottom: 1px solid #f0f3f9; font-size: 13.5px;
}
.todo-item:last-child { border-bottom: 0; }

.msg-unread { font-weight: 700; }

.footer-note { color: #a4aec5; font-size: 12px; text-align: center; padding: 22px 0 14px; }

/* ---------- 登录页 ---------- */
.login-bg {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #16233f 0%, #1d3054 55%, #2451b8 130%);
  position: relative; overflow: hidden;
  padding: 24px;
}
.login-bg::before, .login-bg::after {
  content: ""; position: absolute; border-radius: 50%;
}
.login-bg::before { width: 480px; height: 480px; right: -120px; top: -140px;
  background: radial-gradient(circle, rgba(90,141,255,.28), transparent 65%); }
.login-bg::after { width: 420px; height: 420px; left: -110px; bottom: -150px;
  background: radial-gradient(circle, rgba(192,85,47,.20), transparent 65%); }
.login-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 400px;
  background: #fff; border-radius: 20px;
  padding: 38px 36px 32px;
  box-shadow: 0 24px 70px rgba(8, 18, 45, .45);
}
.login-card .logo-lg {
  width: 58px; height: 58px; margin: 0 auto 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary-2), var(--primary) 60%, #2456c4);
  color: #fff; font-size: 26px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(47,111,237,.4);
}
.login-card h5 { color: var(--ink); font-size: 19px; }
.login-card .btn-primary { padding: 11px; font-size: 15px; letter-spacing: 6px; border-radius: 11px; }

/* 兼容旧类名 */
.login-wrap { max-width: 400px; margin: 10vh auto; }
.login-wrap .card { border-radius: 16px; }

/* ---------- 手机端适配 ---------- */
.menu-toggle { display: none; border: 0; background: none; font-size: 22px; line-height: 1; padding: 2px 10px 2px 0; color: var(--ink-2); }
.sidebar-mask { display: none; }
@media (max-width: 768px) {
  .sidebar { width: 240px; transform: translateX(-100%); transition: transform .25s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-mask.show { display: block; position: fixed; inset: 0; background: rgba(10,18,40,.5); z-index: 99; }
  .main { margin-left: 0; }
  .menu-toggle { display: inline-block; }
  .content { padding: 16px 14px 8px; }
  .topbar { padding: 10px 14px; font-size: 14px; }
  .page-title { font-size: 17px; }
  .filter-bar .row > div { margin-bottom: 8px; }
  .kv { font-size: 13px; }
  .kv .k { width: 92px; }
  .btn { font-size: 14px; }
  .table { font-size: 12.5px; white-space: nowrap; }
  .stat-card { padding: 12px 14px 12px 56px; }
  .stat-card .num { font-size: 19px; }
  .stat-card::before { left: 12px; width: 34px; height: 34px; font-size: 16px; border-radius: 10px; }
  .topsearch { display: none; }
  .sidebar-foot { display: none; }
}
@media (max-width: 576px) {
  .hide-xs { display: none !important; }
}
