:root {
  --brand: #1F6FEB;
  --brand-dark: #1A5BC4;
  --brand-soft: #EAF1FE;
  --bg: #F6F8FB;
  --card: #FFFFFF;
  --line: #E8ECF2;
  --text: #1A1D24;
  --text-2: #4A5060;
  --text-3: #8A8F99;
  --green: #1B9E52;
  --red: #D93F3F;
  --orange: #E8871A;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(16, 30, 55, .06), 0 6px 20px rgba(16, 30, 55, .05);
}

* { box-sizing: border-box; }

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

a { color: var(--brand); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }
.hidden { display: none !important; }
.muted { color: var(--text-3); }
.nowrap { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============ 登录页（深蓝粒子 + 毛玻璃分栏卡片，风格取自 SPD 集团平台） ============ */
#loginView {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1200px 600px at 75% -10%, rgba(31,111,235,.35), transparent 60%),
    radial-gradient(900px 500px at 10% 110%, rgba(20,90,190,.30), transparent 60%),
    linear-gradient(155deg, #0A1730 0%, #0E2547 55%, #123B70 100%);
  padding: 40px 20px;
}

/* 漂浮气泡粒子 */
.login-particles { position: absolute; inset: 0; pointer-events: none; }
.login-particles i {
  position: absolute;
  bottom: -12%;
  display: block;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(120,180,255,.55), rgba(31,111,235,.16) 70%);
  animation: bubble-rise linear infinite;
}
.login-particles i:nth-child(1)  { left: 6%;  width: 26px; height: 26px; animation-duration: 17s; animation-delay: -3s; }
.login-particles i:nth-child(2)  { left: 16%; width: 46px; height: 46px; animation-duration: 23s; animation-delay: -9s; }
.login-particles i:nth-child(3)  { left: 27%; width: 16px; height: 16px; animation-duration: 14s; animation-delay: -5s; }
.login-particles i:nth-child(4)  { left: 38%; width: 34px; height: 34px; animation-duration: 20s; animation-delay: -14s; }
.login-particles i:nth-child(5)  { left: 50%; width: 20px; height: 20px; animation-duration: 16s; animation-delay: -7s; }
.login-particles i:nth-child(6)  { left: 61%; width: 52px; height: 52px; animation-duration: 26s; animation-delay: -18s; }
.login-particles i:nth-child(7)  { left: 72%; width: 14px; height: 14px; animation-duration: 13s; animation-delay: -2s; }
.login-particles i:nth-child(8)  { left: 81%; width: 30px; height: 30px; animation-duration: 19s; animation-delay: -11s; }
.login-particles i:nth-child(9)  { left: 90%; width: 42px; height: 42px; animation-duration: 24s; animation-delay: -6s; }
.login-particles i:nth-child(10) { left: 95%; width: 18px; height: 18px; animation-duration: 15s; animation-delay: -13s; }
.login-particles i:nth-child(11) { left: 12%; width: 10px; height: 10px; animation-duration: 12s; animation-delay: -8s; }
.login-particles i:nth-child(12) { left: 66%; width: 12px; height: 12px; animation-duration: 12s; animation-delay: -1s; }

@keyframes bubble-rise {
  0%   { transform: translateY(0) scale(1);      opacity: 0; }
  8%   { opacity: .9; }
  100% { transform: translateY(-115vh) scale(1.15); opacity: 0; }
}

.login-card {
  width: 100%;
  max-width: 860px;
  display: flex;
  background: rgba(255, 255, 255, .10);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(4, 16, 40, .45);
  overflow: hidden;
}

/* 左侧品牌区 */
.login-brand {
  flex: 0 0 44%;
  padding: 44px 34px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  background: linear-gradient(160deg, rgba(31,111,235,.30), rgba(10,30,70,.10));
  border-right: 1px solid rgba(255,255,255,.12);
}
.login-logo {
  width: 74px; height: 74px; border-radius: 20px;
  background: linear-gradient(150deg, #1F6FEB, #4C8FF5);
  color: #fff; font-size: 34px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 22px;
  box-shadow: 0 10px 28px rgba(31,111,235,.4);
}
.lb-name {
  color: #fff; font-size: 22px; font-weight: 700; letter-spacing: 1px;
  padding-bottom: 18px; margin-bottom: 18px; position: relative;
}
.lb-name::after {
  content: ''; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 56px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent);
}
.lb-chip {
  margin-bottom: 14px;
  padding: 9px 22px; border-radius: 8px;
  background: linear-gradient(150deg, #1F6FEB, #4C8FF5);
  color: #fff; font-size: 15px; font-weight: 600; letter-spacing: 2px;
  box-shadow: 0 6px 18px rgba(31,111,235,.35);
}
.lb-slogan { color: rgba(255,255,255,.72); font-size: 12px; letter-spacing: .5px; }

/* 右侧登录区 */
.login-body {
  flex: 1;
  padding: 42px 40px 34px;
  background: rgba(255,255,255,.06);
  min-width: 0;
}
.login-title { color: #fff; font-size: 22px; font-weight: 700; margin: 0 0 22px; text-align: center; letter-spacing: 2px; }
.login-title::after {
  content: ''; display: block; width: 72%; height: 1px; margin: 14px auto 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
}

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.field input {
  width: 100%; height: 44px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--radius);
  outline: none; transition: border-color .15s, box-shadow .15s;
  background: #FBFCFE;
}
.field input:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(31,111,235,.12); }

/* 复选框/单选框不参与文本输入框的拉伸（否则会被撑成 44px 高的巨块） */
.field input[type="checkbox"],
.field input[type="radio"] {
  width: 16px; height: 16px; padding: 0; margin: 0;
  border: none; background: transparent; box-shadow: none;
  accent-color: var(--brand); flex: none;
}

.btn {
  height: 44px; padding: 0 20px; border: none; border-radius: var(--radius);
  background: var(--brand); color: #fff; font-size: 15px; font-weight: 600;
  transition: background .15s, opacity .15s;
}
.btn:hover { background: var(--brand-dark); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-ghost { background: #fff; color: var(--text-2); border: 1px solid var(--line); }
.btn-ghost:hover { background: #F7F9FC; color: var(--brand); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; font-weight: 500; }
.btn-green { background: var(--green); }
.btn-green:hover { background: #168044; }

.login-err {
  margin-top: 14px; padding: 10px 14px; border-radius: var(--radius);
  background: #FDEDED; color: var(--red); font-size: 13px;
}

/* 微信扫码不可用时给中性提示，不刷成红色报错 */
.login-hint {
  margin-bottom: 18px; padding: 10px 14px; border-radius: var(--radius);
  background: #FFF8E8; color: #8A5A00; font-size: 13px; line-height: 1.6;
}

.login-switch { text-align: center; margin-top: 18px; font-size: 13px; color: var(--text-3); }
.login-switch a { font-weight: 600; }

/* ===== 微信扫码登录 ===== */
.qr-wrap { display: flex; flex-direction: column; align-items: center; }

.qr-box {
  position: relative;
  width: 212px; height: 212px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #FBFCFE;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}

.qr-img { width: 100%; height: 100%; object-fit: contain; display: block; }

.qr-hint {
  font-size: 13px; color: var(--text-3);
  padding: 0 18px; text-align: center; line-height: 1.6;
}

.qr-mask {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255, 255, 255, .95);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px;
}
.qr-mask-text { font-size: 13px; color: var(--text-2); }

.qr-btn {
  height: 34px; padding: 0 18px;
  border: none; border-radius: 17px;
  background: var(--brand); color: #fff;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.qr-btn:hover { background: var(--brand-dark); }

.qr-tip {
  margin-top: 16px; font-size: 13px; color: var(--text-3);
  text-align: center; line-height: 1.6;
}
.qr-tip strong { color: var(--text-2); font-weight: 600; }
.qr-tip-sub { font-size: 12px; color: var(--text-3); opacity: 0.85; }

.qr-status {
  margin-top: 10px; min-height: 18px;
  font-size: 13px; color: var(--brand); text-align: center;
}
.qr-status.err { color: var(--red); }

.login-alt {
  margin-top: 16px; padding-top: 16px;
  border-top: 1px dashed rgba(255,255,255,.22);
  text-align: center; font-size: 13px;
}
.login-alt a { color: rgba(255,255,255,.75); text-decoration: none; }
.login-alt a:hover { color: #fff; text-decoration: underline; }

/* —— 深色玻璃右栏内的元素适配 —— */
.login-body .field label { color: rgba(255,255,255,.82); }
.login-body .login-err { background: rgba(217,63,63,.22); color: #FFD3D3; }
.login-body .login-hint { background: rgba(255,214,102,.16); color: #FFE9B0; }
.login-body .login-switch { color: rgba(255,255,255,.66); }
.login-body .login-switch a { color: #9CC4FF; }
.login-body .qr-box { border-color: rgba(255,255,255,.35); background: #fff; }
.login-body .qr-hint { color: var(--text-3); }
.login-body .qr-tip { color: rgba(255,255,255,.72); }
.login-body .qr-tip strong { color: #fff; }
.login-body .qr-tip-sub { color: rgba(255,255,255,.55); }
.login-body .qr-status { color: #9CC4FF; }
.login-body .qr-status.err { color: #FFB0B0; }
.login-body .field input { background: #fff; border-color: transparent; }
.login-body .btn { background: #fff; color: var(--brand); font-weight: 700; letter-spacing: 4px; }
.login-body .btn:hover { background: #EAF2FF; }

/* 窄屏：品牌区隐藏，恢复单栏 */
@media (max-width: 760px) {
  .login-brand { display: none; }
  .login-body { padding: 34px 26px 28px; }
}

/* 管局要求：ICP 备案号页脚（登录页 + 主界面共用） */
.login-footer {
  position: fixed; left: 0; right: 0; bottom: 14px;
  text-align: center; font-size: 12px;
}
.login-footer a { color: rgba(255, 255, 255, 0.92); text-decoration: none; }
.login-footer a:hover { color: #fff; text-decoration: underline; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 14px 26px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-3);
}
.sf-sep { color: var(--line); }

/* ============ 主布局 ============ */
#appView { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px; flex-shrink: 0;
  background: #0F1D33;
  color: #C6D0E0;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}

.sb-brand {
  padding: 22px 20px 18px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.sb-logo {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(150deg, #1F6FEB, #4C8FF5);
  color: #fff; font-size: 17px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.sb-name { font-size: 15px; font-weight: 700; color: #fff; line-height: 1.25; }
.sb-name small { display: block; font-size: 11px; font-weight: 400; color: #6E7E99; margin-top: 2px; }

.sb-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.sb-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  font-size: 14px; color: #C6D0E0; cursor: pointer;
  margin-bottom: 3px; transition: background .15s, color .15s;
}
.sb-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.sb-item.active { background: var(--brand); color: #fff; font-weight: 600; }
.sb-item .ico { width: 18px; text-align: center; }
.sb-item .ico svg { width: 16px; height: 16px; display: block; margin: 0 auto; opacity: .92; }
.sb-item.active .ico svg { opacity: 1; }
.sb-badge {
  margin-left: auto; font-size: 11px; padding: 1px 7px; border-radius: 8px;
  background: rgba(255,255,255,.14); color: #DCE4F0;
}
.sb-item.active .sb-badge { background: rgba(255,255,255,.26); color: #fff; }

.sb-foot {
  padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.07);
  font-size: 12px; color: #6E7E99;
}
.sb-user { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.sb-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sb-uname { color: #fff; font-size: 13px; font-weight: 600; line-height: 1.2; }
.sb-urole { font-size: 11px; color: #6E7E99; }
.sb-out {
  width: 100%; height: 30px; border-radius: 7px; border: 1px solid rgba(255,255,255,.14);
  background: transparent; color: #C6D0E0; font-size: 12px;
}
.sb-out:hover { background: rgba(255,255,255,.08); color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* 顶栏：深海军蓝，与侧边栏连成一体（参考 SPD 集团平台） */
.topbar {
  background: #0F1D33; border-bottom: 1px solid rgba(255,255,255,.06);
  padding: 0 26px; height: 60px;
  display: flex; align-items: center; gap: 16px;
  position: sticky; top: 0; z-index: 20;
}
.tb-title { font-size: 17px; font-weight: 700; color: #fff; }
.tb-sub { font-size: 12px; color: #6E7E99; }
.tb-spacer { flex: 1; }
.tb-cust {
  display: flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 12px; border-radius: 17px;
  background: rgba(255,255,255,.10);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.14);
  color: #DCE6F5; font-size: 13px; font-weight: 600;
}
.tb-cust:hover { background: rgba(255,255,255,.16); }
.tb-cust select { border: none; background: transparent; color: #DCE6F5; font-weight: 600; outline: none; cursor: pointer; }
.tb-cust select option { color: #1A1D24; background: #fff; }

/* ============ 业务线切换（药品/耗材/试剂隔离）——深色顶栏适配 ============ */
.biz-tabs { display: flex; align-items: center; gap: 4px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.10); border-radius: 10px; padding: 3px; }
.biz-pill {
  height: 28px; line-height: 28px; padding: 0 14px; border-radius: 8px;
  font-size: 13px; font-weight: 600; color: #9DAEC8; cursor: pointer;
  white-space: nowrap; user-select: none;
}
.biz-pill:hover { color: #fff; }
.biz-pill.on {
  background: rgba(255,255,255,.92); color: var(--bc, #1F6FEB);
  box-shadow: 0 1px 4px rgba(4,16,40,.3);
}
.biz-empty {
  height: 34px; line-height: 34px; padding: 0 12px; border-radius: 17px;
  background: #FEF3F2; color: #B42318; font-size: 12px; font-weight: 600;
}
.biz-tag { border: none; }

.content { padding: 22px 26px 40px; flex: 1; }

/* ============ 卡片 / 统计 ============ */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
}
.card + .card { margin-top: 16px; }
/* 卡片标题：参考站的「▌」蓝色竖条风格 */
.card-title { font-size: 15px; font-weight: 700; margin: 0 0 16px; display: flex; align-items: center; gap: 8px; }
.card-title::before {
  content: ''; flex: none;
  width: 3.5px; height: 15px; border-radius: 2px;
  background: linear-gradient(180deg, #1F6FEB, #5B9BFF);
}
.card-title .sub { font-size: 12px; font-weight: 400; color: var(--text-3); margin-left: auto; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.stat {
  background: #fff; border-radius: var(--radius); padding: 18px 20px;
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 14px;
  transition: transform .15s, box-shadow .15s;
}
.stat:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(16,30,55,.08), 0 10px 28px rgba(16,30,55,.08); }

/* 彩色图标块（参考 SPD 集团平台的统计卡） */
.stat-ico {
  flex: none;
  width: 44px; height: 44px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 21px;
  background: var(--sbg, #EEF2F8);
}
.stat.blue   .stat-ico { background: #EAF1FE; }
.stat.green  .stat-ico { background: #E7F6EE; }
.stat.orange .stat-ico { background: #FDF1E3; }
.stat.red    .stat-ico { background: #FDEDED; }
.stat-num { font-size: 26px; font-weight: 700; line-height: 1.15; }
.stat-num .unit { font-size: 14px; font-weight: 600; margin-left: 2px; }
.stat-label { font-size: 12px; color: var(--text-3); margin-top: 5px; }
.stat.blue .stat-num { color: var(--brand); }
.stat.green .stat-num { color: var(--green); }
.stat.orange .stat-num { color: var(--orange); }
.stat.red .stat-num { color: var(--red); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
@media (max-width: 1100px) { .grid-2, .grid-2-1 { grid-template-columns: 1fr; } }

/* ============ 图表 ============ */
.chart-wrap { position: relative; height: 260px; }
.chart-wrap.tall { height: 320px; }

.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; font-size: 13px; }
.bar-label { width: 130px; flex-shrink: 0; color: var(--text-2); }
.bar-track { flex: 1; height: 18px; background: #F1F4F9; border-radius: 9px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 9px; background: linear-gradient(90deg, #1F6FEB, #5B9BFF); transition: width .5s; }
.bar-val { width: 54px; text-align: right; color: var(--text-3); font-size: 12px; flex-shrink: 0; }

/* ============ 表格 ============ */
.table-tools {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.ti {
  height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; outline: none; color: var(--text); min-width: 0;
}
.ti:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31,111,235,.12); }
.ti-search { flex: 1; min-width: 200px; }
.ti-sm { width: 130px; }

table.data { width: 100%; border-collapse: collapse; background: #fff; font-size: 13px; }
table.data th {
  text-align: left; padding: 11px 12px; background: #F7F9FC;
  border-bottom: 1px solid var(--line); font-weight: 600; color: var(--text-2);
  white-space: nowrap; position: sticky; top: 0; z-index: 2;
}
table.data td { padding: 11px 12px; border-bottom: 1px solid #F2F5F9; vertical-align: top; }
table.data tbody tr:hover { background: #F9FBFE; }
table.data tbody tr { cursor: pointer; }
.table-scroll { max-height: 620px; overflow: auto; border-radius: var(--radius); box-shadow: var(--shadow); background: #fff; }
.t-title { font-weight: 600; color: var(--text); }
.t-title:hover { color: var(--brand); }

.tag {
  display: inline-block; padding: 2px 8px; border-radius: 5px;
  font-size: 11px; line-height: 17px; white-space: nowrap;
}
.tag-gray { background: #F0F2F5; color: #6B7280; }
.tag-blue { background: var(--brand-soft); color: var(--brand); }
.tag-green { background: #E9F7EF; color: var(--green); }
.tag-orange { background: #FFF4E5; color: var(--orange); }
.tag-red { background: #FDEDED; color: var(--red); }
.tag-purple { background: #F1EBFD; color: #6D3BD1; }

.empty-box { text-align: center; padding: 60px 20px; color: var(--text-3); }
.empty-box .ico { font-size: 40px; display: block; margin-bottom: 12px; }

.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 18px; font-size: 13px; color: var(--text-2); }

/* ============ 详情抽屉 ============ */
.drawer-mask {
  position: fixed; inset: 0; background: rgba(14, 22, 38, .42);
  z-index: 100; display: flex; justify-content: flex-end;
}
.drawer {
  width: 100%; max-width: 680px; height: 100%; background: #fff;
  display: flex; flex-direction: column; box-shadow: -8px 0 40px rgba(0,0,0,.16);
}
.drawer-head {
  padding: 20px 26px; border-bottom: 1px solid var(--line);
  display: flex; align-items: flex-start; gap: 14px;
}
.drawer-title { font-size: 18px; font-weight: 700; line-height: 1.4; flex: 1; }
.drawer-close {
  width: 32px; height: 32px; border-radius: 8px; border: none; background: #F3F5F8;
  color: var(--text-2); font-size: 16px; flex-shrink: 0;
}
.drawer-close:hover { background: #E8ECF2; }
.drawer-body { flex: 1; overflow-y: auto; padding: 22px 26px 40px; }

.d-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.d-section { margin-bottom: 24px; }
.d-section h4 {
  font-size: 13px; font-weight: 700; color: var(--text-2);
  margin: 0 0 10px; padding-left: 9px; border-left: 3px solid var(--brand);
}
.d-text {
  font-size: 13.5px; line-height: 1.85; color: var(--text-2);
  white-space: pre-wrap; word-break: break-word;
  background: #F9FBFE; border-radius: 8px; padding: 14px 16px;
}
.d-attach { display: flex; flex-wrap: wrap; gap: 10px; }
.d-attach img {
  width: 130px; height: 130px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--line); cursor: zoom-in; transition: transform .15s;
}
.d-attach img:hover { transform: scale(1.03); }

.lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,.86); z-index: 300;
  display: flex; align-items: center; justify-content: center; padding: 40px;
}
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 6px; }

/* ============ 客户管理 ============ */
.cust-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.cust-card {
  background: #fff; border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.cust-card.off { opacity: .62; }
.cust-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.cust-avatar {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(150deg, #1F6FEB, #4C8FF5);
  color: #fff; font-size: 18px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.cust-name { font-size: 15px; font-weight: 700; }
.cust-loc { font-size: 12px; color: var(--text-2); margin-top: 4px; }
.cust-grp { font-size: 12px; color: var(--text-2); margin-top: 4px; }
.cust-biz { font-size: 12px; margin-top: 6px; }
.cust-biz .tag { margin-right: 4px; }

/* ============ 业务线多选（客户表单 / 用户授权） ============ */
.pick-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pick-chip {
  position: relative;
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 14px 0 10px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff;
  font-size: 13px; font-weight: 600; cursor: pointer; user-select: none;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
/* 左侧圆形勾选指示：盖住原生 checkbox，勾选时变成实心蓝底白勾 */
.pick-chip::before {
  content: ''; flex: none; box-sizing: border-box;
  width: 16px; height: 16px; border-radius: 50%;
  border: 1.5px solid #C6CCD6; background: #fff;
  font-size: 11px; line-height: 13px; text-align: center;
  color: transparent; font-weight: 700;
  transition: border-color .15s, background .15s, color .15s;
}
.pick-chip:hover { border-color: #B9C2CE; }
/* 原生 checkbox 只作状态载体，不占视觉空间（键盘聚焦仍可用） */
.pick-chip input {
  position: absolute; opacity: 0; width: 1px; height: 1px;
  margin: 0; padding: 0; pointer-events: none;
}
/* 勾选态：优先用 :has 实时跟随 checkbox（点一下立刻变样式），.on 作旧浏览器兜底 */
.pick-chip:has(input:checked),
.pick-chip.on {
  border-color: var(--brand); background: #F0F6FF;
  box-shadow: 0 1px 4px rgba(31,111,235,.14);
}
.pick-chip:has(input:checked)::before,
.pick-chip.on::before {
  content: '✓';
  border-color: var(--brand); background: var(--brand); color: #fff;
}

.pick-list { display: flex; flex-direction: column; gap: 2px; }
.pick-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 6px; border-bottom: 1px solid #F5F6F8;
  cursor: pointer; font-size: 13.5px;
}
.pick-row input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); flex: none; }
.pick-row:last-child { border-bottom: none; }
.pick-row:hover { background: #FAFBFD; }
.pick-row input { margin: 0; cursor: pointer; }
.pick-name { font-weight: 500; }

.biz-cell { cursor: pointer; }
.biz-cell:hover { background: #F7F9FC; }
.biz-add { display: flex; gap: 8px; margin-top: 14px; }
.biz-add .ti { flex: 1; }
.cust-summary { font-size: 12.5px; margin: -4px 0 12px; }
.cust-stats { display: flex; gap: 16px; font-size: 12px; color: var(--text-3); margin-bottom: 14px; }
.cust-stats b { color: var(--text-2); font-size: 14px; }
.cust-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }

/* 客户页：左树 + 右卡片 */
.cust-page { display: flex; gap: 16px; align-items: flex-start; }
.cust-side {
  width: 232px; flex-shrink: 0; background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 10px 10px; position: sticky; top: 12px;
  max-height: calc(100vh - 140px); overflow: auto;
}
.cust-side-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; font-weight: 700; color: var(--text-2);
  padding: 0 6px 10px; border-bottom: 1px solid var(--line); margin-bottom: 8px;
}
.mini-btn {
  height: 24px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--line);
  background: #fff; color: var(--brand); font-size: 12px;
}
.mini-btn:hover { background: var(--brand-soft); }
.rg-tree { display: flex; flex-direction: column; }
.rg-row {
  display: flex; align-items: center; gap: 4px; padding: 6px 6px; border-radius: 6px;
  cursor: pointer; font-size: 13px; color: var(--text-2); line-height: 18px;
}
.rg-row:hover { background: #F5F8FE; }
.rg-row.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.rg-root { margin-bottom: 2px; }
.rg-muted { color: var(--text-3); margin-top: 2px; }
.rg-caret {
  width: 14px; flex-shrink: 0; text-align: center; font-size: 10px; color: var(--text-3);
}
.rg-caret.blank { visibility: hidden; }
.rg-name { flex: 1; min-width: 0; }
.rg-count {
  flex-shrink: 0; min-width: 20px; text-align: center; font-size: 11px;
  color: var(--text-3); background: #F2F4F8; border-radius: 8px; padding: 0 6px;
}
.rg-row.on .rg-count { background: rgba(31,111,235,.14); color: var(--brand); }
.cust-main { flex: 1; min-width: 0; }
.tag-purple { background: #F1EBFE; color: #6D45C9; }

/* 字典管理（区域 / 分类） */
.dict-form {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end;
  padding-bottom: 14px; margin-bottom: 12px; border-bottom: 1px dashed var(--line);
}
.dict-form .field { margin: 0; }
.dict-form .field input, .dict-form .field select {
  height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; outline: none;
}
.dict-list { display: flex; flex-direction: column; gap: 6px; max-height: 46vh; overflow: auto; }
.dict-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.dict-row.off { opacity: .6; }
.dict-name { flex: 1; min-width: 0; font-size: 13px; color: var(--text); }
.dict-meta { font-size: 12px; color: var(--text-3); flex-shrink: 0; }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: #FDEDED; }

/* ============ 弹窗 ============ */
.modal-mask {
  position: fixed; inset: 0; background: rgba(14, 22, 38, .45); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal {
  width: 100%; max-width: 460px; background: #fff; border-radius: 12px;
  box-shadow: 0 20px 60px rgba(8,28,66,.3); max-height: 86vh; display: flex; flex-direction: column;
}
.modal.wide { max-width: 760px; }
.modal-head { padding: 20px 24px 0; font-size: 16px; font-weight: 700; }
.modal-desc { padding: 6px 24px 0; font-size: 13px; color: var(--text-3); }
.modal-body { padding: 18px 24px; overflow-y: auto; flex: 1; }
.modal-body .field:last-child { margin-bottom: 0; }
.modal-foot { padding: 0 24px 20px; display: flex; justify-content: flex-end; gap: 10px; }

.user-pick {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border-radius: 8px; border: 1px solid var(--line);
  margin-bottom: 7px; cursor: pointer; transition: all .13s;
}
.user-pick:hover { border-color: #B9CDF5; background: #FAFCFF; }
.user-pick.on { border-color: var(--brand); background: var(--brand-soft); }
.up-check {
  width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid #CBD3DF;
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #fff;
}
.user-pick.on .up-check { background: var(--brand); border-color: var(--brand); }
.up-name { font-size: 13.5px; font-weight: 600; }
.up-sub { font-size: 11.5px; color: var(--text-3); }

.toast {
  position: fixed; top: 22px; left: 50%; transform: translateX(-50%);
  background: #101828; color: #fff; padding: 11px 22px; border-radius: 8px;
  font-size: 13.5px; z-index: 500; box-shadow: 0 10px 32px rgba(0,0,0,.28);
  transition: opacity .25s; max-width: 80vw; text-align: center;
}
.toast.ok { background: #14683A; }
.toast.err { background: #9C2B2B; }

.loading-row { text-align: center; padding: 40px; color: var(--text-3); font-size: 13px; }

/* ============ 侧边栏分组 ============ */
.sb-group {
  padding: 14px 12px 6px;
  font-size: 11px; letter-spacing: .06em;
  color: #5C6B84; text-transform: uppercase;
}

/* ============ 用户与角色 ============ */
.user-table tbody tr { cursor: default; }
.user-table tbody tr.row-off { opacity: .58; }
.user-table td.num { font-variant-numeric: tabular-nums; color: var(--text-2); }

.u-cell { display: flex; align-items: center; gap: 10px; }
.u-ava {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(150deg, #1F6FEB, #4C8FF5);
  color: #fff; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.u-name { font-size: 13.5px; font-weight: 600; max-width: 190px; }
.u-sub { font-size: 11.5px; color: var(--text-3); max-width: 260px; }

.role-sel {
  height: 30px; padding: 0 8px; border-radius: 7px;
  border: 1px solid var(--line); background: #fff; color: var(--text-2);
  font-size: 12.5px; outline: none; cursor: pointer;
}
.role-sel:hover { border-color: #B9CDF5; }
.role-sel:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31,111,235,.12); }
.role-sel:disabled { background: #F5F7FA; cursor: not-allowed; }

/* ============ 权限配置 ============ */
.perm-card { padding: 0; overflow: hidden; }
.perm-head { padding: 20px 22px 16px; border-bottom: 1px solid var(--line); }
.perm-title { font-size: 15px; font-weight: 700; margin-bottom: 5px; }
.perm-sub { font-size: 12.5px; color: var(--text-3); line-height: 1.7; max-width: 780px; }

.perm-scroll { overflow: auto; max-height: calc(100vh - 330px); min-height: 260px; }
.perm-table th { z-index: 3; }
.perm-table .pc-name { width: auto; min-width: 260px; }
.perm-table th.pc-role {
  width: 132px; text-align: center; font-size: 12.5px; line-height: 1.5;
}
.perm-table th.pc-role small {
  display: block; font-size: 11px; font-weight: 400; color: var(--text-3);
}
.perm-table td.pc-cell { text-align: center; vertical-align: middle; }
.perm-table tbody tr { cursor: default; }
.perm-table tbody tr:hover { background: transparent; }

.pc-pname { font-size: 13px; font-weight: 600; color: var(--text); }
.pc-pdesc { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

.pg-row td {
  background: #F7F9FC; font-size: 11.5px; font-weight: 700;
  color: var(--text-2); letter-spacing: .04em; padding: 7px 12px;
  border-bottom: 1px solid var(--line);
}

.pc-box { position: relative; display: inline-flex; cursor: pointer; }
.pc-box input { position: absolute; opacity: 0; width: 0; height: 0; }
.pc-mark {
  width: 20px; height: 20px; border-radius: 6px;
  border: 1.5px solid #CBD3DF; background: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .13s; font-size: 12px; color: #fff; line-height: 1;
}
.pc-box:hover .pc-mark { border-color: var(--brand); }
.pc-box input:checked + .pc-mark { background: var(--brand); border-color: var(--brand); }
.pc-box input:checked + .pc-mark::after { content: "✓"; font-weight: 700; }
.pc-box input:focus-visible + .pc-mark { box-shadow: 0 0 0 3px rgba(31,111,235,.18); }
.pc-box.locked { cursor: not-allowed; }
.pc-box.locked .pc-mark { background: #EEF2F8; border-color: #D8DFEA; }
.pc-box.locked input:checked + .pc-mark { background: #A9B7CB; border-color: #A9B7CB; }
.pc-lock {
  display: block; margin-top: 3px; font-size: 10.5px; color: var(--text-3);
}

.perm-foot {
  padding: 16px 22px; border-top: 1px solid var(--line);
  background: #FBFCFE; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.pf-tip { flex: 1; min-width: 260px; font-size: 12px; color: var(--text-3); line-height: 1.7; }
.pf-actions { display: flex; align-items: center; gap: 10px; }
.pf-dirty { font-size: 12.5px; color: var(--text-3); }
.pf-dirty.on { color: var(--orange); font-weight: 600; }

@media (max-width: 900px) {
  .sidebar { width: 62px; }
  .sb-name, .sb-item span:not(.ico):not(.sb-badge), .sb-user > div, .sb-out { display: none; }
  .sb-brand { justify-content: center; padding: 18px 0; }
  .content { padding: 16px; }
  .topbar { padding: 0 14px; }
}

/* ============ 指派开发人员 ============ */
.assign-box { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.assign-box select { flex: 0 0 240px; }
.assign-box input { flex: 1 1 180px; }
.assign-hint { margin-top: 8px; font-size: 12px; line-height: 1.5; }
.warn-text { color: #B45309; }
.assign-sec { border-left: 3px solid var(--brand); padding-left: 12px; }

/* ============ 客户星级 ============ */
.tag.level-1 { background: #FEF3C7; color: #B45309; font-weight: 600; }
.tag.level-2 {
  background: linear-gradient(135deg, #7C3AED, #A855F7);
  color: #fff; font-weight: 600;
}
.f-hint { margin-top: 5px; font-size: 11.5px; color: var(--text-3); line-height: 1.5; }

/* 沟通记录（问题详情抽屉） */
.d-cmt { padding: 10px 0; border-bottom: 1px solid #F2F4F7; }
.d-cmt:last-child { border-bottom: 0; }
.d-cmt-head { display: flex; align-items: center; gap: 4px; font-size: 13px; }
.d-cmt-body { margin-top: 4px; font-size: 13.5px; color: var(--text-2); line-height: 1.65; white-space: pre-wrap; word-break: break-all; }
