/* VetCores 运营看板 · 样式（浅色专业风） */

:root {
  --brand: #2B6DE8;
  --brand-dark: #1F56C0;
  --bg: #F4F6FA;
  --panel: #FFFFFF;
  --line: #E6EAF2;
  --text: #1B2435;
  --text-2: #5A6679;
  --text-3: #93A0B4;
  --green: #12B76A;
  --gold: #F0A020;
  --red: #E5484D;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(27, 36, 53, .06);
  --shadow-lg: -8px 0 32px rgba(27, 36, 53, .12);
}

* { box-sizing: border-box; }

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

.hidden { display: none !important; }

/* ── 通用控件 ── */
.btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: .15s;
  white-space: nowrap;
}
.btn:hover { border-color: #C9D4E6; background: #FAFBFE; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.btn-danger { color: var(--red); border-color: #F5C6C8; }
.btn-danger:hover { background: #FEF3F3; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; padding: 11px; font-size: 15px; }
.btn-ghost { background: #fff; }

.input {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: .15s;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(43,109,232,.10); }
.select { appearance: none; padding-right: 26px; background-image: linear-gradient(45deg, transparent 50%, #93A0B4 50%), linear-gradient(135deg, #93A0B4 50%, transparent 50%); background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }

/* ── 新人礼活动配置 ── */
.gift-config-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 22px;
  padding: 12px 4px 4px;
  font-size: 13px;
  color: var(--text);
}
.gift-config-row label { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.gift-config-row .input-num { width: 96px; padding: 6px 10px; }
.gift-toggle { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.gift-toggle input { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }

/* ── 免费使用阶段面板 ── */
.free-state {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(43, 109, 232, .10);
  color: var(--brand);
}
.free-state.off { background: rgba(120, 130, 145, .12); color: var(--text-2); }
.free-usage {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--bg-2, #f5f7fa);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-2);
}
.free-usage b { color: var(--text); font-size: 13.5px; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.field input { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 14px; outline: none; }
.field input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(43,109,232,.10); }

.form-err { color: var(--red); font-size: 12px; min-height: 18px; margin-top: 8px; }

/* ── 登录 ── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #EDF2FC 0%, #F7F9FC 55%, #F4F6FA 100%);
  padding: 24px;
}
.login-card {
  width: 380px;
  background: #fff;
  border-radius: 16px;
  padding: 32px 28px 24px;
  box-shadow: 0 12px 40px rgba(27,36,53,.10);
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.login-logo {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 17px; letter-spacing: .5px;
}
.login-name { font-size: 16px; font-weight: 600; }
.login-sub { font-size: 12px; color: var(--text-3); margin-top: 3px; }

/* ── 顶栏 ── */
.topbar {
  height: 56px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.topbar-logo {
  width: 28px; height: 28px; border-radius: 8px; background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
}
.topbar-title { font-size: 15px; font-weight: 600; }
.badge-env {
  font-size: 11px; color: var(--brand); background: #EEF4FF;
  border: 1px solid #D6E2FB; border-radius: 20px; padding: 2px 9px;
}
.topbar-right { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--text-2); }
.topbar-time { color: var(--text-3); }
.topbar-user { color: var(--text); }
.switch { display: flex; align-items: center; gap: 5px; cursor: pointer; user-select: none; }
.switch input { accent-color: var(--brand); }

/* ── 布局 ── */
.main { max-width: 1400px; margin: 0 auto; padding: 20px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: #D8E1F0;
}
.stat-card.accent-green::after { background: var(--green); }
.stat-card.accent-blue::after { background: var(--brand); }
.stat-card.accent-gold::after { background: var(--gold); }
.stat-label { font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: 26px; font-weight: 600; margin: 8px 0 4px; letter-spacing: -.5px; }
.stat-foot { font-size: 11px; color: var(--text-3); }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: #C9D4E6; }
.dot-green { background: var(--green); box-shadow: 0 0 0 3px rgba(18,183,106,.16); }

.two-col { display: grid; grid-template-columns: 1.35fr 1fr; gap: 14px; margin-bottom: 16px; }
@media (max-width: 980px) { .two-col { grid-template-columns: 1fr; } }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.panel-head h2 { font-size: 14px; font-weight: 600; margin: 0; }
.panel-sub { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.legend { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.legend-blue { background: var(--brand); }
.legend-gray { background: #C9D4E6; }

/* 在线用户条 */
.online-strip { display: flex; flex-wrap: wrap; gap: 8px; min-height: 62px; align-items: center; }
.online-chip {
  display: flex; align-items: center; gap: 7px;
  border: 1px solid #E2EAF6; background: #F8FAFE;
  border-radius: 20px; padding: 5px 12px 5px 5px;
}
.online-chip img, .online-chip .ph {
  width: 24px; height: 24px; border-radius: 50%; object-fit: cover;
  background: #D9E4F7; color: var(--brand); font-size: 11px;
  display: flex; align-items: center; justify-content: center;
}
.online-chip .oc-name { font-size: 12px; }
.online-chip .oc-time { font-size: 11px; color: var(--text-3); }
.pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .3 } }

/* 趋势 */
.trend { display: flex; align-items: flex-end; gap: 10px; height: 118px; padding-top: 8px; }
.trend-day { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.trend-bars { display: flex; align-items: flex-end; gap: 3px; height: 88px; }
.trend-bar { width: 11px; border-radius: 3px 3px 0 0; min-height: 2px; transition: height .3s; }
.trend-bar.active { background: var(--brand); }
.trend-bar.signup { background: #C9D4E6; }
.trend-label { font-size: 10px; color: var(--text-3); white-space: nowrap; }

/* 标签页 */
.tabs { display: flex; gap: 4px; margin: 18px 0 12px; }
.tab {
  border: none; background: transparent; padding: 9px 16px; font-size: 13px; color: var(--text-2);
  border-radius: 8px; cursor: pointer;
}
.tab:hover { background: #EDF2FA; }
.tab.active { background: #fff; color: var(--brand); font-weight: 600; box-shadow: var(--shadow); }

/* 工具条 */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
.toolbar .input { min-width: 150px; }
.toolbar .input:first-child { min-width: 230px; flex: 1; max-width: 340px; }

/* 表格 */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-weight: 500; color: var(--text-2); font-size: 12px;
  padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 11px 10px; border-bottom: 1px solid #F1F4F9; vertical-align: middle; }
.table tbody tr:hover { background: #FAFBFE; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .op { text-align: right; white-space: nowrap; }
.empty { text-align: center; color: var(--text-3); padding: 26px 0; font-size: 13px; }

.u-cell { display: flex; align-items: center; gap: 9px; }
.u-cell img, .u-cell .ph {
  width: 30px; height: 30px; border-radius: 50%; object-fit: cover;
  background: #E4ECF9; color: var(--brand); font-size: 12px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.u-name { font-size: 13px; }
.u-sub { font-size: 11px; color: var(--text-3); }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; padding: 2px 8px; border-radius: 20px; white-space: nowrap;
}
.tag-online { background: #E7F8EF; color: #0A8F53; }
.tag-offline { background: #F2F4F8; color: var(--text-3); }
.tag-green { background: #E7F8EF; color: #0A8F53; }
.tag-gold { background: #FFF6E5; color: #B4750B; }
.tag-red { background: #FDECEC; color: #C33; }
.tag-gray { background: #F2F4F8; color: var(--text-2); }
.tag-blue { background: #EEF4FF; color: var(--brand); }

.pager { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; font-size: 12px; color: var(--text-2); }
.pager-btns { display: flex; gap: 8px; }

/* 抽屉 */
.mask { position: fixed; inset: 0; background: rgba(16, 24, 40, .40); z-index: 40; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 460px; max-width: 94vw;
  background: #fff; z-index: 50; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  animation: slideIn .22s ease-out;
}
@keyframes slideIn { from { transform: translateX(30px); opacity: .6 } to { transform: none; opacity: 1 } }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.drawer-head h2 { font-size: 15px; margin: 0; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px 30px; }
.icon-btn { border: none; background: transparent; font-size: 15px; color: var(--text-3); cursor: pointer; padding: 4px; }
.icon-btn:hover { color: var(--text); }

.sec { margin-bottom: 22px; }
.sec-title { font-size: 12px; color: var(--text-3); margin-bottom: 10px; letter-spacing: .4px; }
.kv { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed #EEF1F7; font-size: 13px; }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--text-2); }
.kv .v { color: var(--text); text-align: right; max-width: 62%; word-break: break-all; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.drawer-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 18px; }

.cert-img {
  width: 100%; border-radius: 8px; border: 1px solid var(--line);
  cursor: zoom-in; display: block; margin-top: 6px;
}
.tx-item { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #F4F6FA; font-size: 12px; }
.tx-item .tx-l { color: var(--text-2); }
.tx-item .tx-amt.plus { color: var(--green); }
.tx-item .tx-amt.minus { color: var(--red); }

/* 弹窗 */
.modal-wrap { position: fixed; inset: 0; background: rgba(16,24,40,.40); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: #fff; border-radius: 14px; padding: 22px 22px 18px; width: 400px; max-width: 100%; }
.modal h3 { margin: 0 0 6px; font-size: 15px; }
.modal-sub { font-size: 12px; color: var(--text-3); margin: 0 0 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.quick-row { display: flex; gap: 6px; flex-wrap: wrap; }

/* 设置 */
.settings-form { max-width: 380px; }
.hint-box {
  margin-top: 20px; background: #F7F9FD; border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 14px; font-size: 12px; color: var(--text-2); max-width: 560px;
}

/* AI 复审结果 */
.air-badge { display: inline-block; padding: 4px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: #fff; }
.air-reason { margin: 14px 0 0; font-size: 13px; line-height: 1.7; color: var(--text-1); background: #F7F9FD; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.air-meta { margin: 10px 0 0; font-size: 12px; color: var(--text-3); line-height: 1.8; }
.air-loading { text-align: center; padding: 14px 0 6px; font-size: 13px; color: var(--text-2); }
.spinner { width: 26px; height: 26px; margin: 0 auto 12px; border: 3px solid var(--line); border-top-color: var(--text-1); border-radius: 50%; animation: airspin .9s linear infinite; }
@keyframes airspin { to { transform: rotate(360deg); } }

/* 图片放大 */
.lightbox { position: fixed; inset: 0; background: rgba(10,15,25,.85); z-index: 80; display: flex; align-items: center; justify-content: center; padding: 30px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%) translateY(20px);
  background: #1B2435; color: #fff; padding: 10px 18px; border-radius: 8px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: .25s; z-index: 90;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: #C0392B; }

/* 重复发放追回面板 */
.dedup-auto-note {
  margin-top: 10px; padding: 10px 14px; border-radius: 10px;
  background: var(--bg-2, #f5f7fa);
  font-size: 12.5px; line-height: 1.75; color: var(--text-2);
}
.dedup-auto-note b { color: var(--text); font-size: 13.5px; }
.dedup-auto-note .warn { color: #B45309; font-weight: 600; }

.dedup-summary {
  margin-top: 12px; padding: 10px 14px; border-radius: 10px;
  background: #F6F9FF; border: 1px solid #DCE7FA;
  font-size: 13px; line-height: 1.9; color: var(--text-1);
}
.dedup-summary b { color: var(--brand-dark); }
.dedup-summary .warn { color: #B45309; font-weight: 600; }
.dedup-badge {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: 12px; line-height: 18px; font-weight: 600; white-space: nowrap;
}
.dedup-badge.plan { background: #FFF4E5; color: #B45309; }
.dedup-badge.done { background: #E8F6EE; color: #0F7B45; }
.dedup-badge.skip { background: #F0F2F5; color: #64748B; }

/* ── 临床经营看板 ── */
/* 横向占比条：病历类型分布 / 客户分层结构共用 */
.clinic-bars { display: flex; flex-direction: column; gap: 11px; padding: 2px 0 4px; }
.clinic-bar-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.clinic-bar-name { font-size: 12px; color: var(--text-2); }
.clinic-bar-num { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.clinic-bar-track { height: 8px; background: #EEF2F8; border-radius: 999px; overflow: hidden; }
.clinic-bar-fill { height: 100%; background: var(--brand); border-radius: 999px; transition: width .3s; }
/* 口径说明（hint-box 内的多行） */
.note-item { font-size: 12px; color: var(--text-2); line-height: 1.75; }
.note-item + .note-item { margin-top: 6px; }
