/* 客资派单与绩效管理系统 - Bootstrap 5 现代浅色管理后台 */
:root{
  --brand:#2563eb;
  --brand-dark:#1d4ed8;
  --brand-soft:#eaf1ff;
  --bg:#f5f7fb;
  --surface:#ffffff;
  --border:#e6ebf2;
  --text:#1f2937;
  --muted:#6b7280;
  --shadow:0 1px 2px rgba(16,24,40,.03),0 8px 24px rgba(16,24,40,.04);
  --sidebar-w:248px;
  --topbar-h:60px;
}
*{box-sizing:border-box}
html,body{min-height:100%}
body.admin-body{
  margin:0;background:var(--bg);color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;
  font-size:14px;-webkit-font-smoothing:antialiased;
}
a{text-decoration:none}
a:hover{text-decoration:none}

/* ---------- 顶栏 ---------- */
.admin-topbar{
  height:var(--topbar-h);background:var(--surface);border-bottom:1px solid var(--border);
  box-shadow:0 1px 3px rgba(16,24,40,.03);z-index:1040;
}
.admin-topbar .navbar-brand{color:#111827;font-size:16px;letter-spacing:.2px}
.topbar-icon{color:#64748b;padding:.35rem .6rem;border-radius:8px}
.topbar-icon:hover{color:var(--brand);background:var(--brand-soft)}
.unread-badge{font-size:10px;font-weight:600}
.topbar-avatar{
  width:32px;height:32px;border-radius:10px;background:linear-gradient(135deg,#3b82f6,#2563eb);
  color:#fff;align-items:center;justify-content:center;font-weight:700;font-size:13px;
}

/* ---------- 侧边栏 ---------- */
.admin-sidebar{
  position:fixed;top:var(--topbar-h);bottom:0;left:0;width:var(--sidebar-w);
  background:var(--surface);border-right:1px solid var(--border);z-index:1030;
  overflow-y:auto;overflow-x:hidden;
}
.admin-sidebar::-webkit-scrollbar,.admin-offcanvas .offcanvas-body::-webkit-scrollbar{width:5px}
.admin-sidebar::-webkit-scrollbar-thumb,.admin-offcanvas .offcanvas-body::-webkit-scrollbar-thumb{background:#d7dee8;border-radius:4px}
.sidebar-brand{padding:18px 18px 14px}
.sidebar-brand-link{display:flex;align-items:center;gap:10px;color:#111827}
.brand-icon{
  width:34px;height:34px;border-radius:10px;display:inline-flex;align-items:center;justify-content:center;
  background:linear-gradient(135deg,#3b82f6,#2563eb);color:#fff;font-size:18px;
  box-shadow:0 4px 10px rgba(37,99,235,.25);
}
.brand-text{font-weight:700;font-size:15px}
.sidebar-project{padding:0 16px 14px;border-bottom:1px solid var(--border)}
.sidebar-project .form-select{border-radius:8px;border-color:var(--border);font-size:12.5px;background-color:#fafbfd}
.sidebar-nav{padding:10px 12px 20px;flex:1}
.sidebar-group-label{
  color:#9aa4b2;font-size:11px;font-weight:600;letter-spacing:.08em;
  padding:14px 10px 6px;text-transform:uppercase;
}
.sidebar-link{
  display:flex;align-items:center;gap:10px;padding:9px 11px;margin:2px 0;
  border-radius:8px;color:#4b5563;font-size:13.5px;transition:.15s;
}
.sidebar-link i{width:18px;text-align:center;font-size:15px;color:#94a3b8}
.sidebar-link:hover{background:#f6f8fc;color:#111827}
.sidebar-link:hover i{color:var(--brand)}
.sidebar-link.active{
  background:var(--brand-soft);color:var(--brand-dark);font-weight:600;
  box-shadow:inset 3px 0 0 var(--brand);
}
.sidebar-link.active i{color:var(--brand)}
.sidebar-user{
  display:flex;align-items:center;gap:10px;padding:14px 16px;border-top:1px solid var(--border);
  background:#fcfdff;
}
.avatar-circle{
  width:34px;height:34px;border-radius:10px;background:linear-gradient(135deg,#3b82f6,#2563eb);
  color:#fff;display:inline-flex;align-items:center;justify-content:center;font-weight:700;flex-shrink:0;
}
.avatar-circle-sm{
  width:30px;height:30px;border-radius:9px;background:var(--brand);color:#fff;
  display:inline-flex;align-items:center;justify-content:center;font-weight:700;font-size:13px;
}
.admin-offcanvas{width:var(--sidebar-w)}
.admin-offcanvas .offcanvas-header{height:var(--topbar-h)}
.admin-offcanvas .sidebar-brand{display:none}
.admin-offcanvas .sidebar-user{margin-top:auto}

/* ---------- 主内容 ---------- */
.admin-main{min-height:100vh;padding-top:var(--topbar-h);transition:.2s}
@media(min-width:992px){.admin-main{margin-left:var(--sidebar-w)}}
.page-heading{border-bottom:1px solid var(--border);padding-bottom:12px}
.page-heading h4{font-size:18px}

/* 卡片与表格 */
.card{
  background:var(--surface);border:1px solid var(--border);border-radius:12px;box-shadow:var(--shadow);
}
.card-header{
  background:var(--surface);border-bottom:1px solid var(--border);font-weight:600;
  padding:13px 18px;border-radius:12px 12px 0 0;
}
.card-body{padding:18px}
.card-footer{background:#fcfdff;border-top:1px solid var(--border)}
.table{--bs-table-bg:transparent;margin-bottom:0}
.table>:not(caption)>*>*{padding:11px 14px}
.table>thead>th{
  font-size:12px;color:#7b8794;font-weight:600;background:#f8fafc;
  border-bottom:1px solid var(--border);white-space:nowrap;
}
.table td,.table th{vertical-align:middle;font-size:13px;border-color:#eef1f5}
.table-hover>tbody>tr:hover{--bs-table-accent-bg:#f8fbff;background:#f8fbff}
.badge{border-radius:6px;font-weight:500}
.form-label{font-size:13px;font-weight:600;color:#374151}
.form-control,.form-select{
  border-color:#dbe3ec;border-radius:8px;font-size:13.5px;padding:.5rem .75rem;
}
.form-control:focus,.form-select:focus{
  border-color:var(--brand);box-shadow:0 0 0 3px rgba(37,99,235,.12);
}
.form-control-sm,.form-select-sm{font-size:12.5px;border-radius:7px}
.btn{border-radius:8px;font-weight:500}
.btn-primary{--bs-btn-bg:var(--brand);--bs-btn-border-color:var(--brand);--bs-btn-hover-bg:var(--brand-dark);--bs-btn-hover-border-color:var(--brand-dark)}
.btn-sm{padding:.28rem .6rem;font-size:12.5px}
.shadow-sm{box-shadow:var(--shadow)!important}

/* 统计卡片 */
.stat-card{
  border-radius:12px;padding:16px 18px;color:#fff;display:block;position:relative;overflow:hidden;
  min-height:96px;box-shadow:0 8px 20px rgba(16,24,40,.08);
}
.stat-card:after{
  content:'';position:absolute;right:-28px;bottom:-34px;width:90px;height:90px;
  border-radius:50%;background:rgba(255,255,255,.10);
}
.stat-card .stat-icon{position:absolute;right:14px;top:14px;font-size:28px;opacity:.28}
.stat-card .stat-label{font-size:12px;opacity:.88}
.stat-card .stat-value{font-size:26px;font-weight:700;line-height:1.25;margin-top:7px;letter-spacing:.3px}
.bg-stat-1{background:linear-gradient(135deg,#3b82f6,#2563eb)}
.bg-stat-2{background:linear-gradient(135deg,#10b981,#059669)}
.bg-stat-3{background:linear-gradient(135deg,#f59e0b,#d97706)}
.bg-stat-4{background:linear-gradient(135deg,#8b5cf6,#7c3aed)}
.bg-stat-5{background:linear-gradient(135deg,#f43f5e,#e11d48)}
.bg-stat-6{background:linear-gradient(135deg,#06b6d4,#0891b2)}

/* 时间轴 */
.timeline{list-style:none;padding:0;margin:0}
.timeline li{position:relative;padding:0 0 16px 24px;border-left:1px solid #e5e7eb;margin-left:8px}
.timeline li:last-child{border-left-color:transparent;padding-bottom:0}
.timeline li:before{
  content:'';position:absolute;left:-5px;top:4px;width:9px;height:9px;border-radius:50%;
  background:var(--brand);box-shadow:0 0 0 3px #e0ecff;
}
.timeline .tl-time{font-size:11px;color:#9ca3af}

/* 登录页 */
.login-page{background:linear-gradient(135deg,#eef2ff,#e0f2fe 60%,#f0fdfa);min-height:100vh}
.login-logo{
  width:64px;height:64px;border-radius:18px;background:linear-gradient(135deg,#3b82f6,#2563eb);
  color:#fff;display:flex;align-items:center;justify-content:center;font-size:32px;
  box-shadow:0 10px 24px rgba(37,99,235,.25);
}
.login-page .card{border:0;box-shadow:0 20px 60px rgba(16,24,40,.10)}

/* 业务组件 */
.mini-chart{height:180px}
.filter-bar .form-select,.filter-bar .form-control{font-size:13px}
.status-pill{display:inline-block;padding:3px 9px;border-radius:20px;font-size:11px;font-weight:600}
.sp-pending{background:#fef3c7;color:#92400e}
.sp-assigned{background:#dbeafe;color:#1e40af}
.sp-following{background:#e0e7ff;color:#3730a3}
.sp-valid{background:#dcfce7;color:#166534}
.sp-invalid{background:#fee2e2;color:#991b1b}
.sp-closed{background:#f3f4f6;color:#4b5563}
.notice-item{border-left:3px solid var(--brand);border-radius:0 8px 8px 0}
.notice-item.unread{background:#f0f7ff}
.mobile-tip{display:none}

@media(max-width:575.98px){
  .card-header{padding:11px 14px}
  .card-body{padding:14px}
  .form-label{font-size:12.5px}
  .stat-card{padding:13px;min-height:84px}
  .stat-card .stat-value{font-size:20px}
  .stat-card .stat-icon{font-size:22px}
  .table td,.table th{padding:9px 10px;font-size:12px}
  .page-heading{padding-bottom:8px}
}
