:root {
  --bg: #080d1b;
  --bg-2: #0d1426;
  --panel: #121b30;
  --panel-2: #16203a;
  --line: rgba(212, 175, 55, .16);
  --line-soft: rgba(255, 255, 255, .07);
  --gold: #d4af37;
  --gold-soft: #f0d68a;
  --text: #eaf0ff;
  --muted: #8b98b8;
  --dim: #5b6784;
  --blue: #4c9be8;
  --orange: #e8934a;
  --purple: #9a86f0;
  --teal: #38c0a8;
  --red: #e46a6a;
  --green: #46c48a;
  --radius: 14px;
  --shadow: 0 12px 36px rgba(0, 0, 0, .32);
  --block-gap: 18px; /* 页面区块之间的统一呼吸间距 */
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 13px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; }
a { color: var(--gold-soft); text-decoration: none; }

.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 224px; flex: 0 0 224px; background: var(--bg-2);
  border-right: 1px solid var(--line); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand { padding: 24px 20px 18px; border-bottom: 1px solid var(--line-soft); }
.brand h1 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: .5px; color: var(--gold-soft); }
.brand p { margin: 5px 0 0; font-size: 11px; color: var(--dim); letter-spacing: 1px; }
.nav { padding: 14px 10px; flex: 1; overflow-y: auto; scrollbar-width: thin; }
.nav button {
  width: 100%; text-align: left; background: transparent; border: 0; color: var(--muted);
  padding: 9px 12px; margin-bottom: 3px; border-radius: 9px; cursor: pointer;
  font-size: 13px; display: flex; align-items: center; gap: 11px; transition: .15s;
}
.nav button:hover { background: rgba(255,255,255,.045); color: var(--text); }
/* v47：选中态金条改用 inset 阴影，不再用 border-left 占掉 2px 盒宽，
   否则 active 那一项的图标会比其余 6 项右移 2px，破坏统一对齐。 */
.nav button.active { background: linear-gradient(90deg, rgba(212,175,55,.16), rgba(212,175,55,.03)); color: var(--gold-soft); box-shadow: inset 2px 0 0 var(--gold); }

/* v47：一级图标统一为 28×28 圆角底衬 + 同规格线性 SVG。
   原来 ◈ ▥ ▤ ¥ ☰ ◎ ⚙ 是 7 个不同 Unicode 字形，字面框宽高、笔画粗细、
   emoji 回退全都不一样，16px 的文字容器根本兜不住；改成固定盒子 +
   固定 viewBox / stroke-width / 16px SVG 后，尺寸、线宽、对齐、配色完全一致。 */
.nav .ico {
  width: 30px; height: 30px; flex: 0 0 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px; color: var(--muted);
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.09);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
  transition: color .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.nav .ico svg { width: 18px; height: 18px; display: block; }
.nav button:hover .ico { color: var(--text); background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.16); }
.nav button.active .ico {
  color: var(--gold-soft); background: rgba(212,175,55,.14);
  border-color: rgba(212,175,55,.38);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 3px 12px rgba(212,175,55,.12);
}
.nav-parent.has-active .ico { color: var(--gold-soft); background: rgba(212,175,55,.10); border-color: rgba(212,175,55,.24); }

/* v45：一级分组（可展开/收缩）+ 二级导航 */
.nav-group { margin-top: 6px; }
.nav-parent .caret {
  margin-left: auto; width: 0; height: 0; font-size: 0; line-height: 0;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid var(--muted); opacity: .75; transition: border-color .16s ease;
}
.nav-parent.open .caret { border-top: 0; border-bottom: 5px solid var(--gold-soft); opacity: 1; }
.nav-parent.has-active { color: var(--gold-soft); }
.nav-sub { display: none; margin: 3px 0 8px 20px; padding-left: 10px; border-left: 1px solid var(--line); }
.nav-group.open > .nav-sub { display: block; }
/* v46：点击父按钮时 JS 把 .open 加在 .nav-parent 上，必须让相邻兄弟容器跟随展开，
   否则"箭头变了、二级项却一直 display:none"。 */
.nav-parent.open + .nav-sub { display: block; }
.nav-sub button {
  width: 100%; text-align: left; background: transparent; border: 0; color: var(--muted);
  padding: 8px 12px; margin-bottom: 1px; border-radius: 7px; cursor: pointer;
  font-size: 12px; display: block; transition: .15s;
}
.nav-sub button::before { content: '·'; display: inline-block; width: 12px; opacity: .6; }
.nav-sub button:hover { background: rgba(255,255,255,.045); color: var(--text); }
.nav-sub button.active {
  background: linear-gradient(90deg, rgba(212,175,55,.14), rgba(212,175,55,.02));
  color: var(--gold-soft); box-shadow: inset 2px 0 0 var(--gold);
}
.gov-current {
  padding: 10px 14px; margin-bottom: 16px; border-radius: 8px;
  background: rgba(212,175,55,.07); border: 1px solid var(--line-soft);
  color: var(--gold-soft); font-size: 12px; letter-spacing: .3px;
}
.side-foot { padding: 14px 18px 18px; border-top: 1px solid var(--line-soft); font-size: 11px; color: var(--dim); }
.side-foot b { color: var(--gold); font-weight: 500; }

main { flex: 1; min-width: 0; }
.topbar {
  height: 62px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px; border-bottom: 1px solid var(--line); background: rgba(13,20,38,.9);
  position: sticky; top: 0; z-index: 20; backdrop-filter: blur(12px);
}
.crumb { font-size: 15px; font-weight: 500; color: var(--text); }
.crumb small { display: block; font-size: 11px; color: var(--dim); font-weight: 400; margin-top: 1px; }
.top-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.top-actions input, .top-actions select { width: auto; min-width: 96px; }
.scope-pill {
  font-size: 11px; color: var(--gold-soft); border: 1px solid var(--line);
  padding: 5px 10px; border-radius: 20px; background: rgba(212,175,55,.07);
}
.content { padding: 24px 26px 60px; max-width: 1680px; margin: 0 auto; }
.page { display: none; }
.page.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.panel {
  background: var(--panel); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 18px; margin-bottom: var(--block-gap); box-shadow: var(--shadow);
}
/* KPI 行与下方分组统一留白：工作台与经营看板共用，避免上下区块贴死 */
#kpiCards, .period-panel { margin-bottom: var(--block-gap); }
/* 并排卡片上下留白、空状态在剩余空间居中，两块视觉重量保持一致 */
#page-overview > .grid.g2 > .panel { display: flex; flex-direction: column; }
#ovPending { flex: 1 1 auto; display: flex; flex-direction: column; }
#ovPending .empty { margin: auto; }
.panel.flat { box-shadow: none; }
.panel h2 { margin: 0 0 4px; font-size: 14px; font-weight: 500; color: var(--text); }
.panel h2::before { content: ""; display: inline-block; width: 3px; height: 13px; background: var(--gold); margin-right: 9px; vertical-align: -2px; border-radius: 2px; }
.panel .sub { color: var(--dim); font-size: 11px; margin: 0 0 14px 18px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
/* 经营看板 KPI 三行：每行铺满且行内等宽，行与行之间独立不串位 */
#kpiCards .kpi-row { display: grid; gap: 14px; margin-bottom: 14px; }
#kpiCards .kpi-row:last-child { margin-bottom: 0; }
#kpiCards .kpi-row.r5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
#kpiCards .kpi-row.r4 { grid-template-columns: repeat(4, minmax(0,1fr)); }

.kpi {
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line-soft); border-top: 2px solid var(--gold);
  border-radius: 12px; padding: 15px 16px; min-height: 96px;
}
.kpi .label { color: var(--muted); font-size: 11px; letter-spacing: .3px; }
.kpi .value { font-size: 23px; font-weight: 600; color: var(--gold-soft); margin-top: 8px; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.kpi .hint { color: var(--dim); font-size: 10px; margin-top: 4px; }
.kpi.blue { border-top-color: var(--blue); } .kpi.blue .value { color: #8dc4f7; }
.kpi.orange { border-top-color: var(--orange); } .kpi.orange .value { color: #f2b780; }
.kpi.purple { border-top-color: var(--purple); } .kpi.purple .value { color: #bcaaf7; }
.kpi.teal { border-top-color: var(--teal); } .kpi.teal .value { color: #7ad9c7; }

/* ---- 工作台 · 四期对比：一行一时段，同一套等宽列保证逐项可比 ---- */
.period-panel {
  position: relative; overflow: hidden;
  background: linear-gradient(165deg, #18223c 0%, var(--panel) 44%, #101a2e 100%);
  border: 1px solid rgba(212, 175, 55, .2); padding: 18px 20px 15px;
}
.period-panel::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--gold), rgba(212,175,55,0) 62%);
}
.period-meta { display: flex; align-items: center; gap: 10px; }
.period-meta-note { color: var(--dim); font-size: 10px; }
.period-table {
  margin-top: 8px; border: 1px solid var(--line-soft);
  border-radius: 12px; overflow-x: auto; background: rgba(8, 13, 27, .22);
}
.period-row {
  display: grid; align-items: stretch; min-width: 1020px;
  grid-template-columns: 208px repeat(5, minmax(0, 1fr)) 168px;
}
.period-row + .period-row { border-top: 1px solid rgba(255, 255, 255, .06); }
.period-head { background: rgba(255, 255, 255, .035); }
.period-head .period-cell {
  color: var(--muted); font-size: 10px; letter-spacing: .5px;
  padding: 10px 12px; font-weight: 500;
}
.period-cell {
  padding: 11px 12px; min-width: 0;
  border-left: 1px solid rgba(255, 255, 255, .045);
}
.period-row .period-cell:first-child { border-left: 0; }
.period-data { position: relative; transition: background .15s; }
.period-data::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--tone, var(--gold));
}
.period-data.is-current { background: rgba(255, 255, 255, .022); }
.period-data:hover { background: rgba(255, 255, 255, .055); }
/* 同进度的两行成组：浅紫底连成一块，跟整月参考行一眼分开 */
.period-data.is-mtd { background: rgba(154, 134, 240, .055); }
.period-data.is-mtd:hover { background: rgba(154, 134, 240, .1); }
.period-data.is-total {
  background: rgba(8, 13, 27, .2);
  border-top: 1px dashed rgba(224, 161, 90, .45);
}
.period-data.is-total .pv { color: #e8d3b4; }
.tone-gold { --tone: #d4af37; }
.tone-blue { --tone: #4c9be8; }
.tone-purple { --tone: #9a86f0; }
.tone-teal { --tone: #38c0a8; }
.tone-orange { --tone: #e0a15a; }
.period-label { display: flex; align-items: center; gap: 11px; }
.pl-dot {
  width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%;
  background: var(--tone); box-shadow: 0 0 0 4px rgba(255, 255, 255, .06);
}
.period-label b { display: block; color: var(--text); font-size: 14px; font-weight: 600; line-height: 1.3; }
.period-label small {
  display: block; color: var(--dim); font-size: 10px; line-height: 1.45;
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.period-label .pl-vs { color: var(--tone); }
.pv {
  color: var(--text); font-size: 17px; font-weight: 600; line-height: 1.35;
  letter-spacing: -.3px; font-variant-numeric: tabular-nums; white-space: nowrap;
}
/* 环比是对比信息的主角，基础色比普通说明文字亮一档 */
.pd { color: #7d8bab; font-size: 10px; line-height: 1.5; margin-top: 3px; white-space: nowrap; }
.pd i { font-style: normal; opacity: .72; }
.pd.up { color: var(--gold-soft); }
.pd.down { color: #8dc4f7; }
.pd.flat { color: var(--muted); }
.pd.none, .pd.base { color: #6d7c9c; }
.period-bar-cell { display: flex; flex-direction: column; justify-content: center; }
.pbar {
  height: 7px; border-radius: 5px; margin: 4px 0 3px;
  background: rgba(255, 255, 255, .07); overflow: hidden;
}
.pbar i {
  display: block; height: 100%; border-radius: 5px;
  background: linear-gradient(90deg, var(--tone), rgba(255, 255, 255, .16));
}
.period-pairs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.period-pair {
  border: 1px solid var(--line-soft); border-left: 3px solid var(--tone);
  border-radius: 12px; padding: 12px 14px; background: rgba(8, 13, 27, .34);
}
.pp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.pp-head b { color: var(--text); font-size: 12px; font-weight: 600; }
.pp-head span { color: var(--dim); font-size: 10px; white-space: nowrap; }
.pp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pp-item { min-width: 0; }
.pp-item label { display: block; color: var(--muted); font-size: 10px; }
.pp-item > b {
  display: block; margin-top: 3px; font-size: 16px; font-weight: 600;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.pp-item > b.up { color: var(--gold-soft); }
.pp-item > b.down { color: #8dc4f7; }
.pp-item > b.plain { font-size: 13px; font-weight: 500; }
.pp-item > b.plain .pd { font-size: 12px; margin: 0; }
.pp-item small {
  display: block; color: var(--dim); font-size: 10px; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.period-foot { color: var(--dim); font-size: 10px; line-height: 1.6; margin: 12px 0 0; }

/* 统一格子体系：label 固定 16+5，所有文本控件 36px 高，按钮同高 */
label.f { display: block; height: 16px; line-height: 16px; font-size: 11px; color: var(--muted); margin-bottom: 5px; }
/* 文本框撑满容器；勾选框/单选框必须保持原生尺寸，否则会把标签文字挤成竖排 */
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  width: 100%; height: 36px; background: #0b1224; color: var(--text);
  border: 1px solid var(--line-soft); border-radius: 8px; padding: 0 11px;
  outline: none; font-size: 12px; line-height: 34px; transition: border-color .15s;
}
textarea { height: auto; min-height: 64px; padding: 9px 11px; line-height: 1.6; resize: vertical; }
input[type="checkbox"], input[type="radio"] {
  width: 15px; height: 15px; min-width: 15px; flex: 0 0 15px;
  margin: 2px 0 0; padding: 0; border: 0; background: transparent;
  outline: none; accent-color: var(--gold); cursor: pointer;
}
input:focus, select:focus, textarea:focus { border-color: rgba(212,175,55,.55); }
input[readonly] { color: var(--muted); background: #090f1e; }
/* 挂号带出的初复诊只读下拉：别让浏览器默认禁用态在深色底上糊成一片 */
select:disabled { opacity: .88; color: var(--gold-soft); cursor: not-allowed; }
.field { min-width: 0; }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0,1fr)); align-items: end; }
.form-grid.c3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.form-grid .span2 { grid-column: span 2; }
.form-grid .span4 { grid-column: span 4; }

/* ---------- 收费录入 · 挂号单号输入式检索（汉字 / 全拼 / 首字母） ---------- */
.f-tip { color: var(--dim); font-size: 10px; font-weight: 400; margin-left: 6px; }
.reg-combo { position: relative; }
.reg-combo.is-open { z-index: 60; }
.rc-search {
  position: absolute; left: 11px; top: 0; height: 36px; line-height: 34px;
  color: var(--gold-soft); font-size: 17px; pointer-events: none; z-index: 1;
}
input:not([type="checkbox"]):not([type="radio"]).rc-input {
  padding-left: 32px; padding-right: 34px;
}
.reg-combo.is-open .rc-input { border-color: rgba(212, 175, 55, .55); }
.rc-clear {
  position: absolute; right: 7px; top: 6px; width: 24px; height: 24px; padding: 0;
  border: 1px solid var(--line-soft); border-radius: 50%; background: rgba(255, 255, 255, .05);
  color: var(--muted); font-size: 15px; line-height: 21px; cursor: pointer; z-index: 2;
}
.rc-clear:hover { color: var(--red); border-color: rgba(228, 106, 106, .5); }
.rc-panel.hidden, .rc-clear.hidden { display: none; }
.rc-panel {
  position: absolute; top: calc(100% + 7px); left: 0; width: 100%; z-index: 70;
  background: linear-gradient(170deg, #18223c 0%, var(--panel) 42%, #101a2e 100%);
  border: 1px solid rgba(212, 175, 55, .28); border-radius: 12px;
  box-shadow: 0 22px 56px rgba(0, 0, 0, .62); overflow: hidden;
}
.rc-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, .03);
}
.rc-count { color: var(--gold-soft); font-size: 11px; font-weight: 600; white-space: nowrap; }
.rc-tip { color: var(--dim); font-size: 10px; white-space: nowrap; }
/* 高度控制在「保存就诊记录」按钮上沿之前，不让面板把按钮盖掉半截 */
.rc-list { max-height: 258px; overflow-y: auto; }
.rc-list::-webkit-scrollbar { width: 7px; }
.rc-list::-webkit-scrollbar-thumb { background: rgba(212, 175, 55, .32); border-radius: 8px; }
.rc-item {
  padding: 9px 14px; border-bottom: 1px solid rgba(255, 255, 255, .045);
  border-left: 3px solid transparent; cursor: pointer; transition: background .12s;
}
.rc-item:last-child { border-bottom: 0; }
.rc-item:hover, .rc-item.is-active {
  background: rgba(212, 175, 55, .09); border-left-color: var(--gold);
}
.rc-item.is-picked .rc-name { color: var(--gold-soft); }
.rc-top { display: flex; align-items: baseline; gap: 9px; min-width: 0; }
.rc-name { color: var(--text); font-size: 12px; font-weight: 600; white-space: nowrap; }
.rc-py {
  color: var(--dim); font-size: 10px; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rc-no {
  margin-left: auto; color: var(--muted); font-size: 10px; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.rc-meta {
  color: var(--muted); font-size: 10px; margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rc-item mark, .rc-py mark {
  background: rgba(212, 175, 55, .22); color: var(--gold-soft);
  border-radius: 3px; padding: 0 2px;
}
.rc-empty { padding: 26px 14px; text-align: center; color: var(--muted); font-size: 12px; }
.rc-empty small { display: block; margin-top: 6px; color: var(--dim); font-size: 10px; }
.rc-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border-top: 1px solid var(--line-soft);
  background: rgba(8, 13, 27, .3); color: var(--dim); font-size: 10px;
}
.rc-manual {
  border: 1px dashed rgba(255, 255, 255, .18); background: transparent; color: var(--muted);
  border-radius: 7px; padding: 5px 10px; font-size: 10px; cursor: pointer; white-space: nowrap;
}
.rc-manual:hover { color: var(--gold-soft); border-color: rgba(212, 175, 55, .5); }

/* ---------- 新建挂号：手机号档案下拉 + 重复登记确认 ---------- */
#regPhoneCombo .rc-panel { min-width: 340px; }
.rc-item.is-exact { background: rgba(212, 175, 55, .07); }
.rc-item.is-exact .rc-name { color: var(--gold-soft); }
.dup-reg-note { margin: 0 22px 18px; }
.modal .box-confirm.is-warn { border-color: rgba(212, 175, 55, .35); }
#dupRegModal .confirm-head h3 { color: var(--gold-soft); }
#dupRegModal .confirm-icon {
  background: rgba(212, 175, 55, .13); border-color: rgba(212, 175, 55, .4);
  color: var(--gold-soft);
}
#dupRegModal .confirm-summary { margin-top: 18px; }
@media (max-width: 760px) {
  #regPhoneCombo .rc-panel { min-width: 0; width: 100%; }
}


button.btn {
  height: 36px; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #d4af37, #b18d24); color: #14100a; border: 0;
  padding: 0 16px; border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer;
  white-space: nowrap; transition: .15s;
}
button.btn:hover { filter: brightness(1.12); }
button.btn.ghost { background: transparent; color: var(--gold-soft); border: 1px solid var(--line); font-weight: 400; }
button.btn.ghost:hover { background: rgba(212,175,55,.09); }
button.btn.danger { background: transparent; color: var(--red); border: 1px solid rgba(228,106,106,.35); }
/* 表格内小按钮保持紧凑，避免撑高行；筛选/表单区会统一回 36px */
button.btn.sm { height: 30px; padding: 0 11px; font-size: 11px; }
.btn-row { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }
/* 新建账号栏：所有控件等高、同一基线 */
.user-create-bar { gap: 8px; }
.user-create-bar input, .user-create-bar select { height: 36px; padding: 0 11px; }
.user-create-bar .btn { height: 36px; padding: 0 15px; }
.user-create-bar .scope-pill { height: 30px; display: inline-flex; align-items: center; }

table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { color: var(--muted); font-weight: 500; text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; background: rgba(255,255,255,.018); }
td { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: rgba(212,175,55,.045); }
td.num, th.num { text-align: right; }
tr.total td { color: var(--gold-soft); font-weight: 600; border-top: 1px solid var(--line); }
.table-wrap { overflow-x: auto; border-radius: 8px; }
.table-wrap::-webkit-scrollbar { height: 7px; }
.table-wrap::-webkit-scrollbar-thumb { background: rgba(212,175,55,.3); border-radius: 6px; }
.empty { text-align: center; color: var(--dim); padding: 26px; font-size: 12px; }
/* 审计详情等长文本两行截断，鼠标悬停看全文，避免撑爆表格 */
.cell-clamp {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden; max-width: 360px; line-height: 1.45; word-break: break-all;
}

.chip { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 10px; border: 1px solid transparent; white-space: nowrap; }
.chip.gold { color: var(--gold-soft); background: rgba(212,175,55,.12); border-color: rgba(212,175,55,.28); }
.chip.blue { color: #8dc4f7; background: rgba(76,155,232,.13); border-color: rgba(76,155,232,.3); }
.chip.orange { color: #f2b780; background: rgba(232,147,74,.13); border-color: rgba(232,147,74,.3); }
.chip.purple { color: #bcaaf7; background: rgba(154,134,240,.13); border-color: rgba(154,134,240,.3); }
.chip.teal { color: #7ad9c7; background: rgba(56,192,168,.13); border-color: rgba(56,192,168,.3); }
.chip.red { color: #f09a9a; background: rgba(228,106,106,.13); border-color: rgba(228,106,106,.3); }
.chip.gray { color: var(--muted); background: rgba(255,255,255,.05); border-color: var(--line-soft); }

.status-ok { color: var(--green); }
.status-warn { color: var(--orange); }
.chart { width: 100%; height: 260px; }
.fallback-bar { display: flex; align-items: flex-end; gap: 6px; height: 210px; padding-top: 10px; }
.fallback-bar .col { flex: 1; min-width: 12px; background: linear-gradient(180deg, var(--gold), rgba(212,175,55,.25)); border-radius: 3px 3px 0 0; position: relative; }
.fallback-bar .col span { position: absolute; bottom: -20px; left: 0; right: 0; text-align: center; font-size: 9px; color: var(--dim); }
.fallback-wrap { padding-bottom: 22px; }

/* 筛选栏：6 列等宽格子，两行正好填满；结果计数与操作按钮按格跨度独立分区 */
.filters { display: grid; gap: 10px 12px; grid-template-columns: repeat(6, minmax(0,1fr)); align-items: end; }
.filters .field, .filters .filter-cell { min-width: 0; }
.filters .field > label.f, .filters .filter-cell > label.f { height: 16px; line-height: 16px; margin-bottom: 5px; }
.filters .fspan2 { grid-column: span 2; }
.filters .fspan3 { grid-column: span 3; }
.filters .fspan4 { grid-column: span 4; }
.filters .fspan5 { grid-column: span 5; }
.filter-cell { display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; }
.filter-cell.act::before { content: ""; display: block; height: 16px; margin-bottom: 5px; }
.filter-inline, .filter-actions { display: flex; align-items: center; gap: 8px; height: 36px; min-width: 0; }
.filter-actions { justify-content: flex-end; }
.filter-cell.act .filter-actions { border-left: 1px solid var(--line-soft); padding-left: 14px; }
.filter-note { margin-right: auto; font-size: 10px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* v44：多了两个收费项目下拉后，按钮独占一整行；左侧留口径说明，右侧三个按钮对齐 */
#visitFilters .visit-act { grid-column: 1 / -1; }
#visitFilters .visit-act::before { display: none; }
#visitFilters .visit-act .filter-actions { border-left: 0; padding-left: 0; }
/* v35：搜索结果计数占位与输入框同高同圆角，金色数字一眼能读到；两处筛选栏共用 */
.filter-result {
  display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px;
  border: 1px solid rgba(212,175,55,.32); border-radius: 8px;
  background: linear-gradient(90deg, rgba(212,175,55,.13), rgba(212,175,55,.025));
  color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden;
  font-variant-numeric: tabular-nums;
}
.filter-result b { color: var(--gold); font-size: 18px; font-weight: 600; line-height: 1; }
.filter-result.pending b { color: var(--dim); font-size: 14px; }
.filters .btn, .filters .btn.sm { height: 36px; padding: 0 14px; }
.filter-inline .btn { padding: 0 10px; }
/* 表格工具栏里的搜索框 / 下拉：统一到同一格子宽度 */
.toolbar-row input, .toolbar-row select { width: 160px; height: 36px; }
.toolbar-row .btn, .toolbar-row .btn.sm { height: 36px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; font-size: 11px; color: var(--muted); }
.cs-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 12px; }
.cs-chips .chip { font-size: 11px; padding: 4px 11px; }
.cs-chips .chip b { color: var(--gold-soft); font-weight: 500; margin-left: 6px; }
.cs-share { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.cs-share .pbar { flex: 1; min-width: 48px; margin: 0; }
.cs-items { color: var(--muted); font-size: 11px; line-height: 1.7; }
.hint-box { background: rgba(212,175,55,.06); border: 1px solid var(--line); border-radius: 9px; padding: 11px 14px; font-size: 11px; color: var(--muted); line-height: 1.8; }
.hint-box b { color: var(--gold-soft); font-weight: 500; }
.warn-box { background: rgba(232,147,74,.07); border-color: rgba(232,147,74,.25); color: #e7bd94; }
.ok-box { background: rgba(70,196,138,.07); border-color: rgba(70,196,138,.25); color: #a5dec2; }

/* ---------- 历史导入：本地表格上传 ---------- */
.import-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  margin: 14px 0 12px; padding: 14px 16px; border: 1px dashed rgba(212,175,55,.32);
  border-radius: 10px; background: rgba(212,175,55,.035); transition: border-color .18s, background .18s;
}
.import-bar.drag { border-color: var(--gold); background: rgba(212,175,55,.12); }
.import-pick { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 auto; }
.import-file { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.import-file b { color: var(--gold-soft); font-weight: 500; }
.import-side { display: flex; gap: 9px; flex: 0 0 auto; }
.import-bar .btn { height: 36px; }
.import-bar .btn:disabled { opacity: .55; cursor: not-allowed; filter: none; }
.import-result { margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.02); font-size: 11px; color: var(--muted); line-height: 1.9; }
.import-result.ok { border-color: rgba(70,196,138,.3); background: rgba(70,196,138,.06); color: #a5dec2; }
.import-result.bad { border-color: rgba(228,106,106,.32); background: rgba(228,106,106,.06); color: #efb4b4; }
.ir-title { font-size: 12px; color: var(--gold-soft); font-weight: 600; margin-bottom: 4px; }
.ir-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 7px 0; }
.ir-line { display: flex; flex-wrap: wrap; gap: 16px; margin: 4px 0; }
.ir-line b { color: var(--text); font-weight: 600; }
.import-advanced { margin: 0 0 14px; font-size: 11px; color: var(--muted); }
.import-advanced summary { cursor: pointer; color: var(--gold-soft); outline: none; }
.import-path-row { margin-top: 10px; }
.import-path-row input { flex: 1 1 320px; min-width: 220px; height: 36px; }

/* ---------- 放大版日期选择器：点日期框弹出，底部带昨天 / 今天 / 上月 / 本月 ---------- */
.dp-wrap { position: relative; width: 100%; cursor: pointer; }
/* 原生日历弹层小且是白底，这里彻底接管点击：键盘仍可聚焦手输 */
.dp-wrap .dp-bound { pointer-events: none; padding-right: 30px; }
.dp-wrap .dp-bound::-webkit-calendar-picker-indicator { opacity: 0; width: 0; padding: 0; margin: 0; }
.dp-wrap::after {
  content: "▦"; position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  color: var(--gold); font-size: 14px; line-height: 1; pointer-events: none; opacity: .9;
}
.dp-pop {
  position: fixed; z-index: 80; width: 372px; max-width: calc(100vw - 20px);
  padding: 16px 16px 14px; border-radius: 14px;
  background: linear-gradient(180deg, #17223c, #101a30);
  border: 1px solid rgba(212,175,55,.34);
  box-shadow: 0 24px 60px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.03) inset;
}
.dp-pop.hidden { display: none; }
.dp-head { display: flex; align-items: center; gap: 8px; }
.dp-title { flex: 1; text-align: center; font-size: 17px; font-weight: 600; color: var(--gold-soft); letter-spacing: .5px; }
.dp-nav {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--line-soft); background: rgba(255,255,255,.04);
  color: var(--muted); font-size: 17px; line-height: 1; text-align: center; padding: 0;
}
.dp-nav:hover { color: var(--gold-soft); border-color: rgba(212,175,55,.4); background: rgba(212,175,55,.1); }
.dp-nav.dp-dot { font-size: 9px; color: var(--dim); }
.dp-side { margin: 8px 0 10px; text-align: center; font-size: 11px; color: var(--muted); }
.dp-side b { color: var(--gold-soft); font-weight: 500; }
.dp-week, .dp-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 5px; }
.dp-week span { text-align: center; font-size: 11px; color: var(--dim); padding: 2px 0 4px; }
.dp-cell {
  height: 42px; display: flex; align-items: center; justify-content: center;
  border-radius: 9px; font-size: 15px; color: var(--text); cursor: pointer;
  border: 1px solid transparent; background: rgba(255,255,255,.03); transition: .14s;
}
.dp-cell:hover { background: rgba(212,175,55,.14); border-color: rgba(212,175,55,.35); color: var(--gold-soft); }
.dp-cell.out { color: var(--dim); opacity: .5; background: transparent; }
.dp-cell.in-range { background: rgba(76,155,232,.12); border-color: rgba(76,155,232,.16); }
.dp-cell.today { border-color: rgba(76,155,232,.7); color: #9fcbff; }
.dp-cell.sel { background: linear-gradient(145deg, #e2c259, #c39a25); color: #0b1020; font-weight: 700; border-color: #f0d68a; }
.dp-foot { margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.dp-foot-label { font-size: 10px; color: var(--dim); margin-bottom: 8px; }
.dp-quick { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 7px; }
.dp-quick button {
  height: 34px; border-radius: 8px; cursor: pointer; font-size: 12px;
  border: 1px solid rgba(212,175,55,.32); background: rgba(212,175,55,.06); color: var(--gold-soft);
}
.dp-quick button:hover, .dp-quick button.active { background: rgba(212,175,55,.2); border-color: var(--gold); color: #fff4d4; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast div { background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: 9px; padding: 10px 16px; font-size: 12px; box-shadow: var(--shadow); min-width: 220px; }
.toast div.err { border-left-color: var(--red); }
.modal { position: fixed; inset: 0; background: rgba(3,6,14,.78); z-index: 90; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal.hidden { display: none; }
.modal .box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; width: min(760px, 96vw); max-height: 88vh; overflow: auto; box-shadow: var(--shadow); }
.modal h3 { margin: 0 0 14px; font-size: 15px; color: var(--gold-soft); font-weight: 500; }

/* ---------- 新建挂号：二级菜单弹窗（固定头 + 单滚动体 + 固定底栏） ---------- */
.modal .box-reg {
  width: min(940px, 96vw); max-height: 92vh;
  display: flex; flex-direction: column; padding: 0; overflow: hidden;
}
.reg-head {
  flex: none; display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; padding: 20px 24px 16px; border-bottom: 1px solid var(--line-soft);
}
.reg-head-txt { flex: 1; min-width: 0; }
.reg-head h3 { margin: 0; font-size: 16px; font-weight: 600; color: var(--gold-soft); letter-spacing: .3px; }
.reg-head h3::before { content: ""; display: inline-block; width: 3px; height: 15px; background: var(--gold); border-radius: 2px; margin-right: 10px; vertical-align: -2px; }
.reg-head .sub { margin: 7px 0 0 13px; font-size: 11px; color: var(--muted); line-height: 1.6; }
.reg-body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 20px 24px; }
.reg-body .form-grid { gap: 14px; }
.reg-foot {
  flex: none; display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  padding: 14px 24px; border-top: 1px solid var(--line-soft); background: rgba(255,255,255,.015);
}
.reg-foot .scope-pill { margin-right: auto; }
/* 修改患者信息：与新建挂号共用三段式，只用描边色区分入口 */
.modal .box-patient { border-color: rgba(212,175,55,.28); }
/* 退号原因是条件出现的补充说明，独立成行，不参与上方 4 列等宽网格 */
.reg-reason { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line-soft); }
.reg-reason label.f { display: block; margin-bottom: 7px; }
.reg-reason input { width: 100%; }
/* 两个挂号弹窗：除最后一格备注（span2）外，所有填写项一律 1 格等宽 */
#regForm .field, #patientForm .field { min-width: 0; }
#regForm .field.span2, #patientForm .field.span2 { grid-column: span 2; }

/* ---------- 删除就诊明细：两级确认 + 行内操作区 ---------- */
.is-hidden { display: none !important; }
.modal .box-confirm {
  width: min(540px, 94vw); padding: 0; overflow: hidden;
  border-color: rgba(228,106,106,.28);
}
.confirm-head {
  display: flex; align-items: flex-start; gap: 13px;
  padding: 20px 22px 16px; border-bottom: 1px solid var(--line-soft);
}
.confirm-icon {
  flex: none; width: 32px; height: 32px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(228,106,106,.14); border: 1px solid rgba(228,106,106,.35);
  color: #f09a9a; font-size: 17px; font-weight: 700;
}
.confirm-head-txt { flex: 1; min-width: 0; }
.confirm-head h3 { margin: 0; font-size: 15px; color: #f0b4b4; font-weight: 600; }
.confirm-head .sub { margin: 6px 0 0; font-size: 11px; color: var(--muted); line-height: 1.5; }
.confirm-steps { display: flex; gap: 8px; padding: 14px 22px 0; }
.confirm-steps span {
  flex: 1; text-align: center; padding: 7px 8px; font-size: 11px;
  border: 1px solid var(--line-soft); border-radius: 7px;
  color: var(--dim); background: rgba(255,255,255,.02);
}
.confirm-steps span.on {
  color: #f0b4b4; border-color: rgba(228,106,106,.35); background: rgba(228,106,106,.08);
}
.confirm-summary {
  display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1px;
  margin: 14px 22px 16px; border: 1px solid var(--line-soft);
  border-radius: 9px; overflow: hidden; background: var(--line-soft);
}
.confirm-summary .cs { padding: 10px 12px; background: rgba(255,255,255,.018); min-width: 0; }
.confirm-summary .cs b { display: block; font-size: 10px; color: var(--muted); font-weight: 400; margin-bottom: 4px; }
.confirm-summary .cs > span {
  display: block; font-size: 12px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.confirm-summary .cs.wide { grid-column: span 2; }
.confirm-summary .cs.hl > span { color: #f0b4b4; font-weight: 600; }
.box-confirm .hint-box { margin: 0 22px 18px; }
.box-confirm .warn-box { margin: 0 22px 18px; border-radius: 9px; padding: 11px 14px; font-size: 11px; line-height: 1.8; }
.confirm-foot {
  display: flex; justify-content: flex-end; gap: 9px; flex-wrap: wrap;
  padding: 14px 22px; border-top: 1px solid var(--line-soft); background: rgba(255,255,255,.015);
}
button.btn.danger-solid {
  background: rgba(228,106,106,.9); color: #170d0d; border: 1px solid rgba(228,106,106,.9); font-weight: 600;
}
button.btn.danger-solid:hover { background: #e46a6a; }
button.btn.danger-solid:disabled { opacity: .55; cursor: wait; }
.row-actions { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.row-actions .btn.sm { height: 26px; padding: 0 10px; }

/* ---------- 患者信息页：删除按钮独立危险区 + 二级确认弹窗 ---------- */
/* 删除放底栏最左、取消/保存整组靠最右，中间用 space-between 撑开一整栏；
   再加一条竖虚线与危险色底，明确告诉用户「这不是一组按钮」，防误触。 */
.pt-foot { justify-content: space-between; gap: 16px; }
.pt-foot .scope-pill { margin-right: 0; }
.pt-danger-zone {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  padding-right: 18px; border-right: 1px dashed var(--line);
}
.pt-danger-zone .btn.danger {
  height: 34px; padding: 0 14px; letter-spacing: .2px;
  background: rgba(228,106,106,.07); border-color: rgba(228,106,106,.45);
}
.pt-danger-zone .btn.danger:hover { background: rgba(228,106,106,.16); }
.ico-trash { width: 13px; height: 13px; flex: none; }
.pt-danger-hint { font-size: 10px; color: var(--dim); white-space: nowrap; }
.pt-foot-right { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
/* 二级确认叠在患者信息页之上：高一层 + 更深遮罩，层次一眼可辨 */
.modal.modal-nested { z-index: 220; background: rgba(2,4,10,.88); }
.modal.modal-nested .box-confirm {
  max-height: 92vh; overflow-y: auto;
  box-shadow: 0 26px 72px rgba(0,0,0,.62);
}
#ptDelLinked {
  margin: 0 22px 12px; border-radius: 9px; padding: 10px 13px;
  font-size: 11px; line-height: 1.8;
}
#ptDelLinked b { color: #e7bd94; font-weight: 600; }
/* 内容在矮窗口里可滚时，让最终确认按钮始终吸底可见，不藏到滚动条下面 */
.pt-del-foot {
  justify-content: space-between;
  position: sticky; bottom: 0; z-index: 1; background: var(--panel);
}
.pt-del-foot-right { display: flex; align-items: center; gap: 9px; }
@media (max-width: 980px) {
  .pt-foot .scope-pill { display: none; }
}
@media (max-width: 760px) {
  .pt-foot { flex-direction: column; align-items: stretch; gap: 16px; }
  .pt-danger-zone { border-right: 0; border-bottom: 1px dashed var(--line); padding: 0 0 12px; }
  .pt-danger-hint { white-space: normal; }
  .pt-foot-right { justify-content: flex-end; }
  #ptDelLinked { margin-left: 16px; margin-right: 16px; }
  /* 窄屏弹窗仍有 96vw 宽度，8 格保持两列比堆成一列更矮、不用滚动就能看到全部按钮 */
  #ptDelSummary { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .pt-del-foot, .confirm-head, .confirm-foot { padding-left: 16px; padding-right: 16px; }
}

/* ---------- 字典管理：新增弹窗 / 状态按钮 / 动作确认 ---------- */
/* 顶部只留一个入口按钮，三个填写项等宽收进二级菜单；删除与状态用虚线隔开防误触 */
.dict-toolbar { justify-content: space-between; }
.dict-toolbar .scope-pill { margin-right: auto; }
.dict-actions { gap: 8px; flex: 0 0 auto; }
.dict-actions .btn { white-space: nowrap; }
.modal .box-dict { width: min(640px, 94vw); max-height: 88vh; }
/* 新增字典类别：单字段弹窗 + 已有类别 chips，避免用户重复建同名类别 */
.modal .box-kind { width: min(600px, 94vw); }
.dict-kind-form { grid-template-columns: repeat(2, minmax(0,1fr)); margin-bottom: 14px; }
.dict-kind-form .span2 { grid-column: span 2; }
.dict-kind-list { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; min-height: 30px; margin-bottom: 14px; }
.dk-label { font-size: 11px; color: var(--dim); margin-right: 4px; }
.dk-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 7px;
  font-size: 11px; color: var(--muted); background: rgba(255,255,255,.04); border: 1px solid var(--line-soft); }
.dk-chip.is-custom { color: var(--gold-soft); border-color: rgba(212,175,55,.32); background: rgba(212,175,55,.08); }
.dk-chip i { font-style: normal; font-size: 9px; color: var(--gold); opacity: .85; }
.dict-kind-note { margin-top: 2px; }
.dict-form { grid-template-columns: repeat(3, minmax(0,1fr)); }
.dict-sync-note { margin-top: 16px; }

.dict-actions { gap: 6px; }
.dict-actions .btn.sm { height: 26px; padding: 0 11px; }
.dict-state {
  height: 26px; padding: 0 10px; border-radius: 7px; font-size: 11px;
  border: 1px solid var(--line-soft); background: rgba(255,255,255,.025);
  color: var(--dim); opacity: .78; cursor: not-allowed; white-space: nowrap;
}
.dict-state.is-on { border-color: rgba(56,192,168,.22); color: #6fae9f; }
.dict-state.is-off { border-color: rgba(232,147,74,.22); color: #b89170; }
button.btn.dict-act { font-weight: 600; }
button.btn.dict-act.act-enable {
  background: rgba(56,192,168,.16); color: #7ad9c7; border: 1px solid rgba(56,192,168,.5);
}
button.btn.dict-act.act-enable:hover { background: rgba(56,192,168,.26); }
/* v73：按用户要求，「复制到本院」直接复用「停用」的黄底黑字样式。
   两个 class 共用同一条规则，以后改停用会自动同步，不再各自维护一套配色。 */
button.btn.dict-act.act-disable,
button.btn.dict-act.act-copy {
  background: linear-gradient(135deg, #d4af37, #b18d24); color: #14100a; border: 0;
  box-shadow: 0 0 0 1px rgba(212,175,55,.18);
}
button.btn.dict-act.act-delete {
  background: transparent; color: #f09a9a; border: 1px solid rgba(228,106,106,.4);
  font-weight: 400;
}
button.btn.dict-act.act-delete:hover { background: rgba(228,106,106,.12); }
/* 删除放在状态组右侧、用红调虚线再隔一档，避免「停用」连着「删除」误触 */
.dict-sep {
  width: 1px; height: 18px; border-left: 1px dashed rgba(228,106,106,.5); margin: 0 6px;
}

/* 同一确认弹窗按动作换色：启用青绿、停用暖橙、删除红；图标与标题一起变 */
#dictConfirmModal[data-mode="enable"] .confirm-icon {
  background: rgba(56,192,168,.14); border-color: rgba(56,192,168,.4); color: #7ad9c7;
}
#dictConfirmModal[data-mode="enable"] .confirm-head h3 { color: #8fdccc; }
#dictConfirmModal[data-mode="enable"] .confirm-steps span.on {
  color: #8fdccc; border-color: rgba(56,192,168,.4); background: rgba(56,192,168,.08);
}
#dictConfirmModal[data-mode="disable"] .confirm-icon {
  background: rgba(232,147,74,.14); border-color: rgba(232,147,74,.4); color: #f2b780;
}
#dictConfirmModal[data-mode="disable"] .confirm-head h3 { color: #f2c093; }
#dictConfirmModal[data-mode="disable"] .confirm-steps span.on {
  color: #f2c093; border-color: rgba(232,147,74,.4); background: rgba(232,147,74,.08);
}
#dictConfirmModal[data-mode="delete"] .confirm-head h3 { color: #f0b4b4; }

/* 权限面板里的「自定义字典」分组：停用项保留勾选但不可改，启用后自动放开 */
.perm-item.is-off { opacity: .58; cursor: not-allowed; }
.perm-item.is-off:hover { border-color: var(--line-soft); background: rgba(255,255,255,.015); }
.perm-item.is-off input { cursor: not-allowed; }
@media (max-width: 760px) {
  .dict-form { grid-template-columns: 1fr; }
  .dict-toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .dict-actions { flex-wrap: wrap; }
  /* 8 格摘要在窄屏仍保持两列，比堆成一列矮得多，最终确认文案不会被吸底栏遮住 */
  #dictConfirmSummary { grid-template-columns: repeat(2, minmax(0,1fr)); }
  #dictConfirmSummary .cs.wide { grid-column: span 2; }
  #dictConfirmNote1, #dictConfirmNote2 { margin-bottom: 16px; }
}

/* ---------- 细粒度权限面板：固定头 + 单滚动体 + 固定底栏 ---------- */
.modal .box-perm {
  width: min(1080px, 96vw); max-height: 90vh;
  display: flex; flex-direction: column; padding: 0; overflow: hidden;
}
.perm-head {
  flex: none; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 20px 24px 16px; border-bottom: 1px solid var(--line-soft);
}
.perm-head h3 { margin: 0; font-size: 16px; font-weight: 600; color: var(--gold-soft); letter-spacing: .3px; }
.perm-head h3::before { content: ""; display: inline-block; width: 3px; height: 15px; background: var(--gold); border-radius: 2px; margin-right: 10px; vertical-align: -2px; }
.perm-sub { margin: 7px 0 0 13px; font-size: 11px; color: var(--muted); line-height: 1.6; }
.perm-x {
  flex: none; width: 28px; height: 28px; line-height: 1; font-size: 18px;
  border: 1px solid var(--line-soft); border-radius: 8px;
  background: transparent; color: var(--muted); cursor: pointer; transition: .15s;
}
.perm-x:hover { color: var(--text); border-color: var(--gold); }

.perm-toolbar {
  flex: none; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0; padding: 12px 24px; border: 0; border-bottom: 1px solid var(--line-soft);
  border-radius: 0; background: rgba(255,255,255,.02);
}
.perm-toolbar .f { display: inline-flex; align-items: center; height: 32px; margin: 0; font-size: 11px; }
.perm-toolbar select { width: 190px; height: 32px; padding: 5px 10px; }
.perm-toolbar .btn { height: 32px; padding: 0 14px; }
.perm-toolbar .scope-pill { margin-left: auto; font-variant-numeric: tabular-nums; }

.perm-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 18px 24px 22px; }
.perm-body::-webkit-scrollbar { width: 8px; }
.perm-body::-webkit-scrollbar-thumb { background: rgba(212,175,55,.28); border-radius: 6px; }
.perm-section { display: flex; align-items: center; gap: 10px; margin: 2px 0 12px; font-size: 11px; color: var(--dim); letter-spacing: .4px; }
.perm-section b { color: var(--gold-soft); font-weight: 500; letter-spacing: .5px; }
.perm-section::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }

.perm-groups { display: grid; grid-template-columns: 1fr; gap: 12px; }
.perm-group { min-width: 0; border: 1px solid var(--line-soft); border-radius: 10px; background: rgba(255,255,255,.015); overflow: hidden; }
.perm-group-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; border-bottom: 1px solid var(--line-soft); background: rgba(212,175,55,.035);
}
.perm-group h4 { margin: 0; display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--gold-soft); font-weight: 500; }
.perm-group h4 .idx { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; flex: none; border-radius: 5px; background: rgba(212,175,55,.14); font-size: 10px; }
.perm-group h4 small { font-size: 10px; color: var(--muted); font-weight: 400; }
.perm-group-count { flex: none; font-size: 10px; color: var(--dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.perm-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 8px; padding: 12px 14px 14px; }

.perm-item, .perm-radio {
  display: flex; align-items: flex-start; gap: 9px; min-width: 0; min-height: 48px;
  padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 8px;
  background: rgba(255,255,255,.015); cursor: pointer; transition: .15s;
}
.perm-item:hover, .perm-radio:hover { border-color: rgba(212,175,55,.35); background: rgba(212,175,55,.045); }
.perm-item:has(input:checked), .perm-radio:has(input:checked) { border-color: rgba(212,175,55,.42); background: rgba(212,175,55,.075); }
.perm-item > span, .perm-radio > span { flex: 1 1 auto; min-width: 0; font-size: 12px; color: var(--text); line-height: 1.45; overflow-wrap: anywhere; }
.perm-item small, .perm-radio small {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  margin-top: 2px; font-size: 10px; line-height: 1.4; color: var(--muted);
}
/* 分组规则说明 + 主选项徽标：一眼看出哪张卡是该模块的总开关 */
.perm-cascade-note {
  margin: 10px 0 12px; padding: 9px 12px; border-left: 2px solid var(--gold);
  border-radius: 0 6px 6px 0; background: rgba(212,175,55,.055);
  font-size: 10.5px; line-height: 1.65; color: var(--muted);
}
.perm-cascade-note b { color: var(--gold-soft); font-weight: 600; }
.perm-item.is-primary {
  border-color: rgba(212,175,55,.3); background: rgba(212,175,55,.045);
}
.perm-item.is-primary > span { color: var(--gold-soft); font-weight: 600; }
.perm-primary-tag {
  display: inline-block; margin-left: 6px; padding: 1px 5px; border-radius: 4px;
  background: rgba(212,175,55,.18); color: var(--gold-soft);
  font-size: 9px; font-weight: 500; vertical-align: 1px;
}

.perm-extra { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; margin-top: 12px; }
.perm-card { min-width: 0; display: flex; flex-direction: column; border: 1px solid var(--line-soft); border-radius: 10px; background: rgba(255,255,255,.015); overflow: hidden; }
.perm-card-h { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); background: rgba(212,175,55,.035); font-size: 12px; color: var(--gold-soft); }
.perm-card-h small { display: block; margin-top: 2px; font-size: 10px; color: var(--muted); }
.perm-radios { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px 14px; flex: 0 0 auto; }
.perm-card-note { margin: 0 14px 14px; margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--line-soft); font-size: 10px; color: var(--dim); line-height: 1.6; }

.perm-foot {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 24px; border-top: 1px solid var(--line-soft); background: rgba(8,13,27,.55);
}
.perm-foot-hint { font-size: 10px; color: var(--dim); }
.perm-foot .btn { height: 34px; padding: 0 18px; }
.stat-line { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--line-soft); font-size: 12px; }
.stat-line span:last-child { color: var(--gold-soft); font-variant-numeric: tabular-nums; }
.tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { background: transparent; border: 1px solid var(--line-soft); color: var(--muted); padding: 7px 14px; border-radius: 8px; cursor: pointer; font-size: 12px; }
.tabs button.active { color: var(--gold-soft); border-color: var(--gold); background: rgba(212,175,55,.09); }
.flow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11px; color: var(--muted); }
.flow i { font-style: normal; color: var(--gold); }

@media (max-width: 1180px) {
  .filters { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .filter-note { display: none; }
  .g5, .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  #kpiCards .kpi-row.r5, #kpiCards .kpi-row.r4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .form-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .form-grid .span4 { grid-column: span 2; }
}
@media (max-width: 760px) {
  .sidebar { width: 62px; flex-basis: 62px; }
  .brand h1, .brand p, .nav button span:not(.ico), .side-foot { display: none; }
  .nav button { justify-content: center; padding: 12px 0; }
  .nav-parent .caret { display: none; }
  .nav-sub { margin-left: 2px; padding-left: 2px; border-left: 0; }
  .nav-sub button { padding: 8px 2px; font-size: 10px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .nav-sub button::before { display: none; }
  .content { padding: 16px; }
  .g3, .g2, .g5, .g4 { grid-template-columns: 1fr; }
  #kpiCards .kpi-row.r5, #kpiCards .kpi-row.r4 { grid-template-columns: 1fr; }
  .period-pairs { grid-template-columns: 1fr; }
  .period-meta { flex-direction: column; align-items: flex-end; gap: 4px; }
  .period-panel { padding: 16px 14px 13px; }
  /* 单列堆叠时统一成同一段留白，避免网格间距与卡片边距叠加成双倍空白 */
  #page-overview > .grid.g2 { gap: var(--block-gap); margin-bottom: var(--block-gap); }
  #page-overview > .grid.g2 > .panel { margin-bottom: 0; }
  .filters { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .filters .fspan2, .filters .fspan3, .filters .fspan4, .filters .fspan5 { grid-column: span 2; }
  .filter-cell.act .filter-actions { border-left: 0; padding-left: 0; }
  .reg-head, .reg-foot { padding-left: 16px; padding-right: 16px; }
  .reg-body { padding: 16px; }
  .reg-head .sub { margin-left: 13px; }
  .reg-foot .scope-pill { display: none; }
  .toolbar-row input, .toolbar-row select { width: 100%; }
  .topbar { padding: 0 14px; }
  .import-bar { align-items: stretch; }
  .import-pick { flex-wrap: wrap; }
  .import-file { white-space: normal; line-height: 1.6; }
  .import-side { flex: 1 1 100%; }
  .import-side .btn { flex: 1 1 auto; }
  .import-path-row input { min-width: 0; flex: 1 1 100%; }
}

/* ---------- 账号登录 / 改密 ---------- */
.login-screen {
  position: fixed; inset: 0; z-index: 200; display: flex;
  align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(ellipse at 50% 0%, #16213d 0%, #080d1b 62%);
}
.login-screen.hidden { display: none; }
.login-card {
  width: 100%; max-width: 400px; padding: 34px 34px 28px;
  background: linear-gradient(160deg, rgba(22,32,58,.96), rgba(13,20,38,.98));
  border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 24px 80px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.04);
}
.login-brand { text-align: center; margin-bottom: 26px; }
.login-brand h1 {
  margin: 0; font-size: 25px; letter-spacing: 3px; font-weight: 600;
  white-space: nowrap; /* v65：系统名比原来的四字院名长，渐变标题不折行 */
  background: linear-gradient(120deg, #f0d68a, #d4af37 55%, #f0d68a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.login-brand p { margin: 7px 0 0; font-size: 10px; letter-spacing: 2px; color: var(--dim); }
.login-card .field { margin-bottom: 15px; }
.login-card .field .f { display: block; margin-bottom: 6px; }
.login-card input { width: 100%; }
.login-err { min-height: 18px; font-size: 12px; color: var(--red); }
#btnLoginSubmit { letter-spacing: 4px; }
/* v64：30 天免登录 + 手机桌面安装引导 */
.login-remember {
  display: flex; align-items: flex-start; gap: 9px; margin: 2px 0 12px;
  font-size: 12px; color: var(--text); cursor: pointer; line-height: 1.5;
}
.login-remember input { width: auto !important; margin: 3px 0 0; accent-color: var(--gold); flex: 0 0 auto; }
.login-remember small { display: block; font-size: 11px; color: var(--dim); font-weight: 400; }
.pwa-install {
  display: flex; align-items: center; gap: 10px; margin-top: 16px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px;
  background: rgba(212, 175, 55, .06);
}
.pwa-install.hidden, .pwa-install .hidden { display: none; }
.pwa-install-ico img { width: 34px; height: 34px; border-radius: 8px; display: block; }
.pwa-install-txt { flex: 1; min-width: 0; font-size: 11px; color: var(--muted); line-height: 1.5; }
.pwa-install-txt b { display: block; font-size: 12px; color: var(--gold-soft); }
.pwa-install .btn { flex: 0 0 auto; }
.pwa-install-x { background: none; border: 0; color: var(--dim); font-size: 18px; cursor: pointer; padding: 0 2px; }
.modal { z-index: 210; }
@media (max-width: 760px) {
  .login-card { padding: 26px 20px; }
  .top-actions .scope-pill { display: none; }
}
@media (max-width: 420px) {
  .pwa-install { flex-wrap: wrap; }
  .pwa-install .btn { flex: 1 1 100%; }
}

/* ---------- 权限面板响应式 ---------- */
@media (max-width: 980px) {
  .perm-items { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}
@media (max-width: 760px) {
  .modal .box-perm { width: 96vw; max-height: 94vh; }
  .perm-head, .perm-toolbar, .perm-foot { padding-left: 16px; padding-right: 16px; }
  .perm-body { padding: 16px; }
  .perm-toolbar .scope-pill { margin-left: 0; }
  .perm-extra, .perm-items { grid-template-columns: 1fr; }
  .perm-group h4 small { display: none; }
  .perm-foot { justify-content: flex-end; }
  .modal .box-confirm, .modal .box-reg { width: 96vw; max-height: 94vh; }
  .confirm-head, .confirm-foot { padding-left: 16px; padding-right: 16px; }
  .confirm-steps, .box-confirm .hint-box, .box-confirm .warn-box { margin-left: 16px; margin-right: 16px; }
  .confirm-steps { padding-left: 0; padding-right: 0; }
  .confirm-summary { grid-template-columns: 1fr; margin-left: 16px; margin-right: 16px; }
  .confirm-summary .cs.wide { grid-column: span 1; }
}

/* ---------- 挂号单号检索：窄屏适配 ---------- */
@media (max-width: 760px) {
  .f-tip { display: none; }
  .rc-tip, .rc-foot > span { display: none; }
  .rc-foot { justify-content: flex-end; }
  .rc-py { display: none; }
  .rc-list { max-height: 220px; }
  .rc-panel { border-radius: 10px; }
}
@media (max-width: 980px) {
  .rc-meta { font-size: 9px; }
  .rc-foot { flex-wrap: wrap; }
}

/* ---------- 收费录入：二级菜单 + 页面入口 ---------- */
.form-grid .span3 { grid-column: span 3; }
.modal .box-bill { width: min(1000px, 96vw); border-color: rgba(212,175,55,.24); }
/* v41：三段式收费录入页，中间待录入区用金色边条强调 */
#page-billing .panel + .panel { margin-top: 16px; }
.bill-pending-panel { border-left: 2px solid rgba(212,175,55,.45); }
.bill-pending-panel .panel-head { margin-bottom: 10px; }
.bill-pending-actions { display: flex; gap: 6px; justify-content: flex-end; }
.bill-pending-actions .btn.sm { height: 26px; padding: 0 12px; white-space: nowrap; }
.bill-pending-count { color: var(--gold); font-weight: 700; }
.bill-pending-actions .btn.sm:disabled {
  opacity: .38; cursor: not-allowed; filter: grayscale(.85);
}
.bill-launch-panel { padding: 18px 22px; }
.bill-launch { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.bill-launch-txt { min-width: 0; }
.bill-launch .sub { margin: 0; max-width: 760px; line-height: 1.7; }
.bill-launch .btn { height: 40px; padding: 0 22px; font-size: 13px; flex: none; }
.bill-section-title {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  margin: 20px 0 12px; padding-bottom: 9px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--gold-soft); font-size: 12px; font-weight: 600; letter-spacing: .3px;
}
.bill-section-title span { color: var(--dim); font-size: 10px; font-weight: 400; letter-spacing: 0; }
.bill-total-bar {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  margin-top: 16px; padding: 12px 16px; border-radius: 9px;
  border: 1px solid rgba(212,175,55,.26); background: rgba(212,175,55,.055);
}
.bt-label { color: var(--muted); font-size: 11px; }
.bt-value {
  flex: 1; min-width: 0; line-height: 1.7;
  color: var(--gold-soft); font-size: 13px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.box-bill .reg-body .form-grid { gap: 14px; }
/* 患者与就诊信息：6 列打底，顶部单号/核对栏各半宽，下面六个格子 3 + 3 等宽 */
#billFormInfo { grid-template-columns: repeat(6, minmax(0,1fr)); }
.box-bill .rc-panel { z-index: 90; }
.box-bill .rc-list { max-height: 196px; }
.box-bill .hint-box { margin: 14px 0 0; }
/* 中等屏：收费弹窗两个网格统一 3 列，备注占整行。
   否则 .span3 会在 2 列网格里撑出一条 auto 隐式列，让每行第 3 格明显变窄。 */
@media (max-width: 1180px) {
  .box-bill .reg-body .form-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .box-bill .form-grid .span2 { grid-column: span 2; }
  .box-bill .form-grid .span3 { grid-column: span 3; }
}
@media (max-width: 760px) {
  /* 只收窄收费录入弹窗，不动其它页面已经对齐好的筛选格 / 挂号表单 */
  .box-bill .reg-body .form-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .box-bill .form-grid .span2,
  .box-bill .form-grid .span3,
  .box-bill .form-grid .span4 { grid-column: span 2; }
  .bill-launch { flex-direction: column; align-items: flex-start; gap: 14px; }
  .bill-section-title span { display: none; }
  .bill-total-bar { gap: 8px; }
}
/* 信息区在中等/窄屏仍保持「上 3 下 3 / 上 2 下 2」的均匀节奏，ID 权重高于通用 form-grid 回退 */
@media (max-width: 1180px) {
  #billFormInfo { grid-template-columns: repeat(3, minmax(0,1fr)); }
  #billFormInfo .field.span2 { grid-column: span 1; }
  #billFormInfo .field.span3 { grid-column: span 3; }
}
@media (max-width: 760px) {
  #billFormInfo { grid-template-columns: repeat(2, minmax(0,1fr)); }
  #billFormInfo .field.span2 { grid-column: span 1; }
  #billFormInfo .field.span3 { grid-column: span 2; }
}

/* ---------- v25 新建账号二级菜单：四项等宽 + 医生多选 ---------- */
.modal .box-user { width: min(720px, 96vw); max-height: 92vh; border-color: rgba(212,175,55,.24); }
.box-user .reg-body .form-grid { gap: 14px; }
#uaFormInfo { grid-template-columns: repeat(4, minmax(0,1fr)); }
#uaFormInfo .field.span2 { grid-column: span 2; }
.ua-doctor-bar { display: flex; align-items: center; gap: 9px; margin: 2px 0 12px; }
.ua-doctors { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 9px; }
.ua-doc {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px;
  background: rgba(255,255,255,.018); cursor: pointer; transition: .15s;
}
.ua-doc:hover { border-color: rgba(212,175,55,.42); }
.ua-doc.is-on { border-color: rgba(212,175,55,.62); background: rgba(212,175,55,.09); }
.ua-doc-name { font-size: 12px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ua-doc small { margin-left: auto; font-size: 10px; color: var(--muted); white-space: nowrap; }
/* v61：医生按院联动。医院标签、范围条与失效绑定提示。 */
.ua-doc-hosp-label { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.ua-doc-hosp-label[hidden] { display: none; }
.ua-doc-hosp-label select { min-width: 132px; padding: 5px 8px; font-size: 11px; }
.ua-doc-scope { font-size: 11px; color: var(--muted); margin: -4px 0 10px; }
.ua-doc-scope b { color: var(--gold-soft); font-weight: 600; }
.ua-doc .ua-doc-hosp { font-size: 9px; color: var(--gold-soft); margin-left: auto; white-space: nowrap; }
.ua-doc .ua-doc-hosp + small { margin-left: 4px; }
.ua-doc-note { font-size: 11px; color: #f0b4b4; margin-top: 10px; }
.ua-doc-note:empty { display: none; }
.dict-owner-sel { min-width: 118px; padding: 4px 7px; font-size: 11px; }
.ua-perm-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.ua-perm-tip { font-size: 10px; color: var(--muted); }
.box-user .hint-box { margin: 14px 0 0; }
/* 修改账号：登录账号锁定不可改；删除按钮与危险文案沿用全局 danger 色 */
#uaUsername:disabled { opacity: .72; color: var(--gold-soft); cursor: not-allowed; }
.user-actions .btn.sm { padding: 0 8px; }
.user-actions .btn.sm:disabled { opacity: .42; cursor: not-allowed; }
/* 原始超管：整行没有操作按钮，只留一枚金色说明徽标 */
.superuser-tag { padding: 3px 11px; font-size: 11px; letter-spacing: .02em; cursor: help; }
.user-del-warn b { color: #f0b4b4; }
@media (max-width: 980px) {
  .ua-doctors { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 760px) {
  #uaFormInfo { grid-template-columns: repeat(2, minmax(0,1fr)); }
  #uaFormInfo .field.span2 { grid-column: span 1; }
  .ua-doctors { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .ua-perm-tip { display: none; }
}

/* ---------- v38 角色管理：列表 + 新建/权限二级菜单 ---------- */
.role-toolbar { justify-content: space-between; align-items: center; }
.role-actions { gap: 6px; flex: 0 0 auto; }
.role-actions .btn.sm { height: 26px; padding: 0 11px; white-space: nowrap; }
.role-tag { margin-left: 6px; font-size: 10px; vertical-align: middle; }
.modal .box-role { width: min(1000px, 96vw); }
/* v39：继承模板 / 字段范围下线，剩三格一行等宽 */
#roleFormInfo { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#roleFormInfo .field { min-width: 0; }
.role-perm-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0 12px; }
.role-perm-bar .scope-pill { height: 26px; display: inline-flex; align-items: center; }
/* v39：权限点区吃掉弹窗剩余高度，一次能看到更多组，不再固定 310px */
#roleModal .box-role { height: min(92vh, 920px); }
#roleModal .reg-body { display: flex; flex-direction: column; overflow: hidden; }
.role-perm-scroll {
  flex: 1 1 auto; min-height: 280px; max-height: none;
  overflow: auto; padding-right: 6px;
  border: 1px solid var(--line-soft); border-radius: 10px;
}
.role-perm-scroll .perm-groups { padding: 12px; gap: 10px; }
.role-perm-scroll .perm-items {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  padding: 10px 12px 12px;
}
.role-foot {
  flex: none; display: flex; align-items: center; gap: 9px;
  padding: 14px 24px; border-top: 1px solid var(--line-soft);
  background: rgba(255,255,255,.015);
}
@media (max-width: 760px) {
  #roleFormInfo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-height: 720px) {
  #roleModal .reg-body { overflow: auto; }
  #roleModal .role-perm-scroll { flex: none; height: 360px; min-height: 360px; }
}

/* ---------- v42：有效到诊规则卡片（口径与备份） ---------- */
.rule-panel { padding: 18px 20px 20px; }
.rule-panel .sub { margin-bottom: 16px; }
.rule-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.rule-card {
  min-width: 0; border: 1px solid var(--line-soft); border-radius: 12px;
  background: var(--panel-2); padding: 16px 18px;
  transition: border-color .18s, background .18s, box-shadow .18s;
}
.rule-card.is-on {
  border-color: rgba(212,175,55,.48);
  background: linear-gradient(135deg, rgba(212,175,55,.10), rgba(212,175,55,.02));
  box-shadow: inset 0 0 0 1px rgba(212,175,55,.08);
}
.rule-toggle { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.rule-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.rule-toggle i {
  position: relative; flex: 0 0 18px; width: 18px; height: 18px; margin-top: 2px;
  border: 1px solid rgba(255,255,255,.22); border-radius: 5px;
  background: rgba(255,255,255,.04); transition: background .18s, border-color .18s;
}
.rule-card.is-on .rule-toggle i { background: var(--gold); border-color: var(--gold); }
.rule-card.is-on .rule-toggle i::after {
  content: ""; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px;
  border: solid #0b1120; border-width: 0 2px 2px 0; transform: rotate(42deg);
}
.rule-toggle:focus-within i { outline: 2px solid rgba(212,175,55,.5); outline-offset: 2px; }
.rule-body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.rule-body b { font-size: 13px; font-weight: 600; color: var(--text); }
.rule-card.is-on .rule-body b { color: var(--gold-soft); }
.rule-body small { font-size: 11px; line-height: 1.7; color: var(--muted); }
.rule-extra {
  display: flex; align-items: center; gap: 10px; margin: 14px 0 0 30px;
  padding-top: 12px; border-top: 1px solid var(--line-soft);
}
.rule-extra .f { margin: 0; font-size: 11px; color: var(--muted); white-space: nowrap; }
.rule-extra input { width: 130px; }
.rule-extra input:disabled { opacity: .42; }
.rule-current {
  margin-top: 14px; padding: 10px 14px; border-radius: 9px; font-size: 11px;
  color: #a5dec2; background: rgba(70,196,138,.07); border: 1px solid rgba(70,196,138,.25);
}
.rule-current.is-draft {
  color: #e7bd94; background: rgba(232,147,74,.07); border-color: rgba(232,147,74,.25);
}
@media (max-width: 900px) {
  .rule-grid { grid-template-columns: 1fr; }
}

/* ---------- v43 收费项目：两层树 / 科室矩阵 / 动态录入 / 二级抽屉 ---------- */
.charge-toolbar { flex-wrap: wrap; gap: 10px; }
.charge-showdel { color: var(--muted); font-size: 11px; display: inline-flex;
  align-items: center; gap: 6px; cursor: pointer; margin-right: 6px; }
.charge-showdel input { accent-color: var(--gold); }
.modal .box-charge { width: min(660px, 94vw); max-height: 90vh; overflow: auto; }
/* v57：新增一级分组没有父级，「所属一级项目」整行隐藏，项目名称补满空出的栅格列。 */
#chargeItemModal[data-level="1"] #chargeParentField { display: none; }
#chargeItemModal[data-level="1"] #chargeNameField { grid-column: span 3; }
/* v60：二级项自动继承所属一级的大类，不必再选金额归类。 */
#chargeItemModal[data-level="2"] #chargeBucketField { display: none; }
@media (max-width: 1180px) {
  /* 窄屏 form-grid 降为 2 列，span3 会溢出，收回 1 列。 */
  #chargeItemModal[data-level="1"] #chargeNameField { grid-column: span 1; }
}
.charge-dept-checks { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 2px; }
.charge-dept-checks label { display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border: 1px solid var(--line-soft); border-radius: 8px;
  background: var(--panel-2); color: var(--muted); font-size: 11px; cursor: pointer; }
.charge-dept-checks input { accent-color: var(--gold); }
.charge-tree { display: grid; gap: 12px; }
.charge-group { border: 1px solid var(--line-soft); border-radius: 12px;
  background: var(--panel-2); overflow: hidden; }
.charge-group.is-off { opacity: .62; }
.charge-group-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 11px 14px; background: rgba(212,175,55,.05); border-bottom: 1px solid var(--line-soft); }
.charge-group-head .cg-name { color: var(--gold-soft); font-size: 13px; font-weight: 600; }
.charge-group-head .cg-meta { color: var(--dim); font-size: 11px; }
.charge-group-head .cg-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.charge-item-row { display: grid; grid-template-columns: minmax(150px,1.2fr) minmax(90px,.7fr)
  minmax(170px,1.6fr) minmax(80px,.6fr) auto; gap: 10px; align-items: center;
  padding: 9px 14px; border-top: 1px solid var(--line-soft); font-size: 11px; }
.charge-item-row:first-of-type { border-top: 0; }
.charge-item-row .ci-name { color: var(--text); }
.charge-item-row .ci-sub { color: var(--dim); }
.charge-item-row .ci-actions { display: flex; gap: 5px; justify-content: flex-end; }
.charge-item-row.is-off .ci-name { color: var(--muted); text-decoration: line-through; }
.charge-empty { padding: 22px; text-align: center; color: var(--dim); font-size: 11px; }

.bill-charge-groups { display: grid; gap: 10px; margin-bottom: 14px; }
.bill-charge-group { border: 1px solid var(--line-soft); border-radius: 10px;
  background: rgba(255,255,255,.018); overflow: hidden; }
.bill-charge-head { display: flex; align-items: center; gap: 9px; padding: 8px 12px;
  background: rgba(212,175,55,.045); border-bottom: 1px solid var(--line-soft); }
.bill-charge-head .bc-name { color: var(--gold-soft); font-size: 11px; font-weight: 600; }
.bill-charge-head .bc-bucket { color: var(--dim); font-size: 10px; }
.bill-charge-head .bc-sum { margin-left: auto; color: var(--text); font-size: 11px; }
.bill-charge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 10px; padding: 11px 12px; }
.bill-charge-item label.f { display: block; color: var(--muted); font-size: 10px;
  margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bill-charge-item input { width: 100%; }
.bill-charge-item.is-off label.f { color: #e7bd94; }
.bill-charge-item.is-off input { border-color: rgba(232,147,74,.42);
  background: rgba(232,147,74,.06); }
.bill-charge-item .bc-tag { color: var(--orange); font-size: 9px; }
/* v49：只读合计格 —— 与 36px 输入框等高对齐，金色底衬，明确不是可填项 */
.bill-charge-item.bc-total-cell label.f { color: var(--gold-soft); }
.bill-charge-item.bc-total-cell .bc-total-val {
  width: 100%; height: 36px; display: flex; align-items: center; padding: 0 11px;
  border: 1px solid rgba(212,175,55,.30); border-radius: 8px;
  background: rgba(212,175,55,.075); color: var(--gold-soft);
  font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
}
/* v49：就诊明细一级费用金额可点开该组二级窗口 */
.fee-link {
  background: transparent; border: 0; border-bottom: 1px dashed rgba(212,175,55,.42);
  padding: 0; margin: 0; color: var(--text); font: inherit; cursor: pointer;
  transition: color .14s ease, border-color .14s ease;
}
.fee-link:hover { color: var(--gold-soft); border-bottom-color: var(--gold-soft); }
@media (max-width: 760px) {
  .charge-item-row { grid-template-columns: 1fr 1fr; }
  .charge-item-row .ci-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

.drawer-modal { justify-content: flex-end; padding: 0; }
.charge-drawer { width: min(560px, 96vw); height: 100vh; display: flex; flex-direction: column;
  background: var(--panel); border-left: 1px solid var(--line); box-shadow: -18px 0 48px rgba(0,0,0,.42); }
.drawer-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 14px;
  border-bottom: 1px solid var(--line-soft); }
.drawer-head h3 { margin: 0 0 4px; font-size: 15px; color: var(--gold-soft); font-weight: 500; }
.drawer-head .sub { margin: 0; color: var(--muted); font-size: 11px; }
.drawer-head .perm-x { margin-left: auto; }
.drawer-body { flex: 1 1 auto; overflow: auto; padding: 16px 22px; }
.charge-detail-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.charge-detail-chips span { padding: 5px 9px; border: 1px solid var(--line-soft);
  border-radius: 8px; background: var(--panel-2); color: var(--muted); font-size: 10px; }
.charge-detail-chips span b { color: var(--gold-soft); font-weight: 600; }
/* v49：按一级费用下钻时，当前分组高亮 */
.charge-detail-chips span.is-current {
  border-color: rgba(212,175,55,.5); background: rgba(212,175,55,.12);
  color: var(--gold-soft);
}
.drawer-foot { padding: 12px 22px; border-top: 1px solid var(--line-soft);
  color: var(--text); font-size: 12px; display: flex; justify-content: space-between; }
.drawer-foot b { color: var(--gold-soft); }

/* ---------------- v52 多医院：左上角切换器 / 医院管理 / 角色医院多选 ---------------- */
.sidebar { z-index: 30; }
.brand { position: relative; }
.brand-switch {
  display: flex; align-items: center; gap: 9px; width: 100%;
  background: transparent; border: 0; padding: 0; cursor: pointer;
  color: var(--gold-soft); text-align: left;
}
.brand-switch:hover .brand-name { color: #fff0c0; }
.brand-switch:focus-visible { outline: 1px solid var(--gold); outline-offset: 4px; border-radius: 6px; }
.brand-mark {
  width: 22px; height: 22px; flex: 0 0 22px; display: inline-flex;
  align-items: center; justify-content: center; border-radius: 7px;
  background: rgba(212,175,55,.13); border: 1px solid rgba(212,175,55,.28);
}
.brand-mark svg { width: 14px; height: 14px; display: block; }
.brand-name { font-size: 16px; font-weight: 600; letter-spacing: .5px; transition: color .15s; }
.brand-caret { width: 12px; height: 12px; margin-left: auto; opacity: .7; transition: transform .18s ease; }
.brand-switch[aria-expanded="true"] .brand-caret { transform: rotate(180deg); }
.brand-switch.is-locked { cursor: default; }
.brand-switch.is-locked .brand-caret { display: none; }

.hosp-pop {
  position: absolute; left: 10px; right: 10px; top: calc(100% - 6px);
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow); padding: 6px; z-index: 60;
}
.hosp-pop.hidden { display: none; }
.hosp-pop-head {
  padding: 6px 10px 9px; margin-bottom: 5px; font-size: 10.5px;
  color: var(--dim); letter-spacing: .6px; border-bottom: 1px solid var(--line-soft);
}
.hosp-item {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  background: transparent; border: 0; color: var(--text); padding: 9px 10px;
  border-radius: 8px; cursor: pointer; font-size: 12.5px; transition: .14s;
}
.hosp-item:hover { background: rgba(255,255,255,.055); }
.hosp-item.is-current { background: rgba(212,175,55,.12); color: var(--gold-soft); }
.hosp-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--dim); }
.hosp-item.is-current .hosp-dot {
  background: var(--gold); box-shadow: 0 0 0 3px rgba(212,175,55,.18);
}
.hosp-item .hosp-full { display: block; font-size: 10px; color: var(--dim); line-height: 1.35; }
.hosp-check { margin-left: auto; color: var(--gold); font-size: 13px; }
.hosp-empty { padding: 12px 10px; font-size: 12px; color: var(--dim); }

.role-hosp-box {
  margin: 0 0 16px; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--line-soft); background: rgba(255,255,255,.02);
}
.role-hosp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.role-hosp-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  border-radius: 18px; border: 1px solid var(--line-soft); background: var(--panel-2);
  font-size: 12px; color: var(--muted); cursor: pointer; transition: .14s;
}
.role-hosp-chip:hover { border-color: rgba(212,175,55,.38); color: var(--text); }
.role-hosp-chip input { accent-color: var(--gold); margin: 0; }
.role-hosp-chip.is-on { border-color: rgba(212,175,55,.42); color: var(--gold-soft); }
.role-hosp-tools { margin-top: 10px; display: flex; gap: 8px; }
.role-hosp-empty { font-size: 12px; color: var(--dim); }
/* v52：账号弹窗的医院范围三态选择。沿用角色 chip 的视觉，但强调「互斥」。 */
.ua-hosp-modes { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.ua-hosp-mode {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  border-radius: 18px; border: 1px solid var(--line-soft); background: var(--panel-2);
  font-size: 12px; color: var(--muted); cursor: pointer; transition: .14s;
}
.ua-hosp-mode:hover { border-color: rgba(212,175,55,.38); color: var(--text); }
.ua-hosp-mode input { accent-color: var(--gold); margin: 0; }
.ua-hosp-mode.is-on { border-color: rgba(212,175,55,.42); color: var(--gold-soft); }
.ua-hosp-pick[hidden] { display: none; }
.ua-hosp-hint { margin-top: 10px; font-size: 12px; color: var(--dim); line-height: 1.7; }
.ua-hosp-hint b { color: var(--gold-soft); font-weight: 600; }
.ua-hosp-hint.warn { color: #e0a2a2; }
.hosp-tag { white-space: nowrap; }

@media (max-width: 760px) {
  .brand { padding: 14px 8px 12px; }
  .brand-switch { justify-content: center; }
  .brand-name { font-size: 10px; letter-spacing: 0; }
  .brand-mark, .brand-caret, .brand p { display: none; }
  .hosp-pop { left: 2px; right: auto; width: 180px; }
}

/* ---------- 回访管理：复用深色高奢变量，仅补最小布局差异 ---------- */
/* .fupane 由 JS 切换 style.display，容器本身无需额外样式 */
#fuStatsKpis {
  display: grid; gap: 14px; grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: var(--block-gap);
}
/* 只读展示 span：与 input[readonly] 同高同质感 */
.fu-ro {
  display: block; height: 36px; line-height: 34px; padding: 0 11px;
  background: #090f1e; border: 1px solid var(--line-soft); border-radius: 8px;
  color: var(--muted); font-size: 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fu-ro-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* 「仅看逾期」勾选框：与其它 36px 控件同高同基线 */
.fu-check {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 11px;
  border: 1px solid var(--line-soft); border-radius: 8px;
  background: #0b1224; color: var(--muted); font-size: 12px; cursor: pointer;
}
.fu-check:hover { border-color: rgba(212, 175, 55, .35); }
/* 弹窗沿用 .box-reg 三段式，仅略收窄宽度 */
.modal .box-fu { width: min(820px, 96vw); }

/* ---------- v67b：关键词自动匹配 ---------- */
.fu-kw { position: relative; }
.fu-suggest {
  position: absolute; z-index: 60; top: calc(100% + 4px); left: 0; right: 0;
  min-width: 270px; max-height: 306px; overflow-y: auto; padding: 5px;
  background: #0b1224; border: 1px solid rgba(212, 175, 55, .35);
  border-radius: 10px; box-shadow: 0 18px 40px rgba(0, 0, 0, .55);
}
.fu-suggest.hidden { display: none; }
.fu-sg-item {
  display: grid; grid-template-columns: 74px minmax(0, 1fr);
  gap: 2px 10px; align-items: center;
  padding: 8px 10px; border-radius: 7px; cursor: pointer;
}
.fu-sg-item:hover { background: rgba(212, 175, 55, .14); }
.fu-sg-kind { grid-row: span 2; font-size: 11px; color: var(--gold-soft); }
.fu-sg-val {
  font-size: 13px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fu-sg-sub {
  font-size: 11px; color: var(--dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* v67b：新建回访的患者信息 5 个字段全部可自由填写 */
.fu-free-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* 弹窗日期：点开自绘日历，同时也保留键盘直接输入 */
.dp-wrap input:not(.dp-bound) { padding-right: 30px; }
@media (max-width: 760px) {
  .fu-free-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  #fuStatsKpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  #fuStatsKpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ==================== v69：字典按院分类展示 / 收费录入增强 ==================== */
/* 字典页：左侧竖排类别导航 + 右侧单类表格，本院自建与平台共享分区 */
.dict-layout {
  display: grid; grid-template-columns: 214px minmax(0, 1fr);
  gap: 16px; align-items: start;
}
.dict-nav {
  background: var(--bg-2); border: 1px solid var(--line-soft);
  border-radius: 12px; padding: 12px 10px; position: sticky; top: 12px;
  max-height: calc(100vh - 100px); overflow-y: auto; scrollbar-width: thin;
}
.dict-nav-cap {
  color: var(--gold-soft); font-size: 11px; font-weight: 600; letter-spacing: .4px;
  padding: 2px 8px 10px; border-bottom: 1px solid var(--line-soft); margin-bottom: 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dict-nav-list { display: grid; gap: 3px; }
.dict-kind-item {
  width: 100%; display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border: 1px solid transparent; border-radius: 8px;
  background: transparent; color: var(--muted); cursor: pointer;
  font-size: 12px; text-align: left; line-height: 1.4;
}
.dict-kind-item span {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dict-kind-item i {
  flex: none; min-width: 22px; padding: 1px 5px; border-radius: 20px;
  background: rgba(255,255,255,.06); color: var(--dim);
  font-size: 10px; font-style: normal; text-align: center;
}
.dict-kind-item:hover { background: rgba(212,175,55,.08); color: var(--text); }
.dict-kind-item.is-on {
  background: rgba(212,175,55,.14); border-color: rgba(212,175,55,.32);
  color: var(--gold-soft); font-weight: 600;
}
.dict-kind-item.is-on i { background: rgba(212,175,55,.22); color: var(--gold-soft); }
.dict-main { min-width: 0; }
.dict-main-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 10px;
}
.dict-main-head h3 { margin: 0; font-size: 14px; color: var(--gold-soft); font-weight: 600; }
.dict-group-title {
  display: flex; align-items: center; gap: 10px; margin: 16px 0 8px;
  font-size: 11px; letter-spacing: .3px; color: var(--muted);
  padding-left: 10px; border-left: 3px solid var(--dim);
}
.dict-group-title:first-child { margin-top: 0; }
.dict-group-title b { color: var(--dim); font-weight: 500; }
.dict-group-title.is-own { border-left-color: var(--teal); color: var(--teal); }
.dict-group-title.is-platform { border-left-color: var(--gold); color: var(--gold-soft); }
/* v73：v72 的冷灰蓝低饱和方案已废弃 —— 用户看着更丑，改回「停用」同款。
   共用规则已上移到 .act-disable / .act-copy 块，这里不再重复定义，
   否则后面的覆盖规则会把共用样式盖掉。hover 与停用一样继承基础提亮。 */

/* 今日新录入：标题右侧营业额合计卡 + 三态排序表头 */
.bill-recent-head { align-items: center; }
.bill-recent-kpis { display: flex; gap: 10px; flex-wrap: wrap; }
.br-kpi {
  display: grid; gap: 2px; min-width: 168px; padding: 9px 14px;
  background: linear-gradient(135deg, rgba(212,175,55,.13), rgba(212,175,55,.03));
  border: 1px solid rgba(212,175,55,.28); border-radius: 10px;
}
.br-kpi span { color: var(--muted); font-size: 10px; letter-spacing: .3px; }
.br-kpi b { color: var(--gold-soft); font-size: 18px; font-weight: 700; line-height: 1.3; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--gold-soft); background: rgba(212,175,55,.09); }
.sort-ind { color: var(--gold); font-size: 9px; margin-left: 4px; white-space: nowrap; }

/* 收费录入弹窗：挂号信息区 4 列均匀分布，与上方 6 列信息区视觉对齐 */
#billFormReg { grid-template-columns: repeat(4, minmax(0, 1fr)); }
#billFormReg .field { min-width: 0; }
#billRegBlock { margin-top: 4px; }
#billRecentPanel .table-wrap { overflow-x: auto; }
#billRecent table { min-width: 1080px; }
#billRecent td, #billRecent th { padding: 9px 10px; }
.bill-launch-panel, .bill-pending-panel, #billRecentPanel { margin-bottom: var(--block-gap); }

@media (max-width: 1180px) {
  #billFormReg { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dict-layout { grid-template-columns: 176px minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .dict-layout { grid-template-columns: minmax(0, 1fr); }
  .dict-nav { position: static; max-height: none; }
  .dict-nav-list {
    display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px;
  }
  .dict-kind-item { width: auto; flex: none; white-space: nowrap; }
  .dict-kind-item span { min-width: 0; }
  .bill-recent-kpis { width: 100%; }
}
@media (max-width: 760px) {
  #billFormReg { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .br-kpi { flex: 1; min-width: 140px; }
}

/* ==================== v70：回访患者详情只读 / 弹窗布局 ==================== */
/* 列表里的患者姓名可点，直接进「修改回访」二级界面 */
.fu-name-link {
  color: var(--gold-soft); font-weight: 600; cursor: pointer;
  text-decoration: none; border-bottom: 1px dashed rgba(212, 175, 55, .45);
}
.fu-name-link:hover { color: #fff; border-bottom-color: var(--gold-soft); }

/* 患者信息只读网格；完整手机号只在这一层出现 */
.fu-detail-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 14px; margin: 0 0 4px;
}
.fu-ro-item {
  min-width: 0; background: var(--bg-2); border: 1px solid var(--line-soft);
  border-radius: 8px; padding: 8px 10px;
}
.fu-ro-item .k { display: block; font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.fu-ro-item .v { display: block; font-size: 12.5px; color: var(--text); word-break: break-all; }
.fu-ro-item.is-phone .v { color: var(--gold-soft); font-weight: 600; letter-spacing: .3px; }
.fu-ro-note {
  grid-column: 1 / -1; background: rgba(212, 175, 55, .07);
  border: 1px dashed rgba(212, 175, 55, .32); border-radius: 8px;
  padding: 9px 12px; font-size: 11.5px; color: var(--muted);
}
#fuDetailRegs table, #fuDetailVisits table { min-width: 760px; }
#fuDetailRegs, #fuDetailVisits { margin-bottom: 4px; }

/* 下次计划回访日期与复诊预约日期并排一行，三格等宽 */
.fu-subrow {
  grid-column: 1 / -1; display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end;
}
/* 病情反馈 / 备注各占独立一行，行高约为普通填写项的两倍（36px → 104px） */
.fu-tall { grid-column: 1 / -1; }
.fu-tall textarea { min-height: 104px; line-height: 1.7; }
@media (max-width: 760px) {
  .fu-subrow { grid-template-columns: 1fr; }
  .fu-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

