/* MediBase Admin — Modern Clean SaaS / Linear Aesthetic
   设计令牌：改这一段就能整体换肤 */
:root {
  --bg:            #ffffff;
  --bg-sunken:     #fafafa;
  --bg-elev:       #ffffff;
  --bg-hover:      #f4f4f5;
  --bg-active:     #ececee;
  --border:        #e8e8ea;
  --border-strong: #d4d4d8;
  --text:          #17171a;
  --text-muted:    #6b6b75;
  --text-subtle:   #9a9aa3;
  --accent:        #5e6ad2;
  --accent-hover:  #4f5ac0;
  --accent-soft:   #eef0fb;
  --accent-fg:     #ffffff;
  --green:  #1a7f5a;  --green-soft:  #e6f4ee;
  --amber:  #a86a10;  --amber-soft:  #fdf3e2;
  --red:    #c03636;  --red-soft:    #fdecec;
  --blue:   #2563a8;  --blue-soft:   #e9f1fb;
  --violet: #6d46c8;  --violet-soft: #f1ebfd;
  --radius:    6px;
  --radius-lg: 10px;
  --shadow:    0 1px 2px rgba(0,0,0,.04), 0 2px 8px rgba(0,0,0,.04);
  --shadow-lg: 0 4px 24px rgba(0,0,0,.10);
  --sidebar-w: 236px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue", sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:#08080a; --bg-sunken:#0d0d10; --bg-elev:#131317; --bg-hover:#1a1a20; --bg-active:#232329;
    --border:#212127; --border-strong:#33333c;
    --text:#f2f2f5; --text-muted:#9d9da8; --text-subtle:#6a6a76;
    --accent:#7b86e8; --accent-hover:#8d96ec; --accent-soft:#1b1c33; --accent-fg:#0b0b10;
    --green:#4bbd8c; --green-soft:#0f2620; --amber:#d99b3f; --amber-soft:#2a2013;
    --red:#e57373;   --red-soft:#2d1717;   --blue:#5f9de0;  --blue-soft:#111f30;
    --violet:#a58bea; --violet-soft:#1e1830;
    --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 8px 32px rgba(0,0,0,.55);
  }
}
*,*::before,*::after { box-sizing: border-box; }
html,body { height:100%; }
body {
  margin:0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 13.5px; line-height: 1.55;
  letter-spacing: -0.006em; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1,h2,h3,h4 { margin:0; font-weight:600; letter-spacing:-0.018em; }
h1 { font-size:19px; } h2 { font-size:15px; } h3 { font-size:13.5px; }
code,.mono { font-family: var(--mono); font-size:12px; }
::selection { background: var(--accent-soft); }

/* ---------- 布局 ---------- */
.shell { display:flex; min-height:100vh; }
.sidebar {
  width: var(--sidebar-w); flex:0 0 var(--sidebar-w); background: var(--bg-sunken);
  border-right:1px solid var(--border); display:flex; flex-direction:column;
  position:sticky; top:0; height:100vh; overflow-y:auto;
}
.sidebar__brand { display:flex; align-items:center; gap:9px; padding:16px 16px 12px; }
.sidebar__logo {
  width:24px; height:24px; border-radius:7px; background:linear-gradient(135deg,var(--accent),var(--violet));
  display:grid; place-items:center; color:#fff; font-weight:700; font-size:12px; flex:0 0 24px;
}
.sidebar__name { font-weight:600; font-size:13.5px; letter-spacing:-0.02em;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sidebar__nav { padding:4px 8px 16px; flex:1; }
.nav__group { margin-top:14px; }
.nav__label {
  padding:4px 8px; font-size:10.5px; font-weight:600; text-transform:uppercase;
  letter-spacing:0.07em; color: var(--text-subtle);
}
.nav__item {
  display:flex; align-items:center; gap:8px; padding:5.5px 8px; border-radius:var(--radius);
  color: var(--text-muted); font-size:13px; transition:background .1s, color .1s;
}
.nav__item:hover { background: var(--bg-hover); color: var(--text); }
.nav__item.is-active { background: var(--bg-active); color: var(--text); font-weight:500; }
.nav__icon { width:15px; text-align:center; flex:0 0 15px; opacity:.85; font-size:13px; }
.nav__badge {
  margin-left:auto; background: var(--red-soft); color: var(--red);
  font-size:10.5px; font-weight:600; padding:0 5px; border-radius:5px; min-width:17px; text-align:center;
}
.sidebar__foot { border-top:1px solid var(--border); padding:10px; }
.user { display:flex; align-items:center; gap:8px; padding:5px 6px; border-radius:var(--radius); }
.user:hover { background: var(--bg-hover); }
.user__avatar { width:24px; height:24px; border-radius:50%; background:var(--accent-soft); color:var(--accent);
  display:grid; place-items:center; font-size:11px; font-weight:600; flex:0 0 24px; overflow:hidden; }
.user__avatar img { width:100%; height:100%; object-fit:cover; }
.user__meta { min-width:0; flex:1; }
.user__name { font-size:12.5px; font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.user__role { font-size:11px; color:var(--text-subtle); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.main { flex:1; min-width:0; display:flex; flex-direction:column; }
.topbar {
  height:48px; border-bottom:1px solid var(--border); display:flex; align-items:center;
  gap:12px; padding:0 20px; position:sticky; top:0; background:var(--bg); z-index:20;
}
.crumbs { display:flex; align-items:center; gap:6px; font-size:13px; color:var(--text-muted); min-width:0; }
.crumbs a:hover { color:var(--text); }
.crumbs__sep { color:var(--text-subtle); }
.crumbs__cur { color:var(--text); font-weight:500; }
.topbar__spacer { flex:1; }
.content { padding:20px 24px 48px; max-width:1560px; width:100%; }
.page-head { display:flex; align-items:flex-start; gap:16px; margin-bottom:18px; }
.page-head__text { flex:1; min-width:0; }
.page-head__sub { color:var(--text-muted); font-size:12.5px; margin-top:3px; }
.page-head__actions { display:flex; gap:8px; flex-shrink:0; }
/* ---------- 组件 ---------- */
.card { background:var(--bg-elev); border:1px solid var(--border); border-radius:var(--radius-lg); }
.card.is-editing { border-color:var(--accent); }
.card__head { padding:12px 16px; border-bottom:1px solid var(--border); display:flex; align-items:center; gap:10px; }
.card__title { font-size:13px; font-weight:600; }
.card__body { padding:16px; }
.card__foot { padding:11px 16px; border-top:1px solid var(--border); display:flex; gap:8px; align-items:center; }

.grid { display:grid; gap:12px; }
.grid--6 { grid-template-columns:repeat(6,minmax(0,1fr)); }
.grid--7 { grid-template-columns:repeat(7,minmax(0,1fr)); }
.grid--5 { grid-template-columns:repeat(5,minmax(0,1fr)); }
.grid--4 { grid-template-columns:repeat(4,minmax(0,1fr)); }
.grid--3 { grid-template-columns:repeat(3,minmax(0,1fr)); }
.grid--2 { grid-template-columns:repeat(2,minmax(0,1fr)); }
@media (max-width:1180px){ .grid--4,.grid--5,.grid--6,.grid--7{grid-template-columns:repeat(2,minmax(0,1fr));} }
@media (max-width:820px){ .grid--4,.grid--3,.grid--2,.grid--5,.grid--6,.grid--7{grid-template-columns:1fr;} .sidebar{display:none;} }

.stat { padding:14px 16px; }
.stat__label { font-size:11.5px; color:var(--text-muted); font-weight:500; display:flex; align-items:center; gap:5px; }
.stat__value { font-size:25px; font-weight:600; letter-spacing:-0.03em; margin-top:5px; font-variant-numeric:tabular-nums; }
.stat__delta { font-size:11.5px; margin-top:3px; color:var(--text-subtle); }
.stat__delta.up { color:var(--green); } .stat__delta.down { color:var(--red); }

.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:6px; height:29px; padding:0 11px;
  border:1px solid var(--border-strong); border-radius:var(--radius); background:var(--bg-elev);
  color:var(--text); font-size:12.5px; font-weight:500; font-family:inherit; cursor:pointer;
  transition:background .1s,border-color .1s; white-space:nowrap;
}
.btn:hover { background:var(--bg-hover); }
.btn:disabled { opacity:.45; cursor:not-allowed; }
.btn--primary { background:var(--accent); border-color:var(--accent); color:var(--accent-fg); }
.btn--primary:hover { background:var(--accent-hover); border-color:var(--accent-hover); }
.btn--ghost { border-color:transparent; background:transparent; color:var(--text-muted); }
.btn--ghost:hover { background:var(--bg-hover); color:var(--text); }
.btn--danger { color:var(--red); border-color:var(--border-strong); }
.btn--danger:hover { background:var(--red-soft); border-color:var(--red); }
.btn--sm { height:25px; padding:0 8px; font-size:12px; }
.btn--icon { width:29px; padding:0; }
/* data-toggle 开合按钮：目标展开时高亮，收起时就是普通按钮（如编辑页顶部的「YAML 导入」） */
.btn[aria-expanded="true"] { border-color:var(--accent); color:var(--accent); }

.input, .select, .textarea {
  width:100%; height:29px; padding:0 9px; border:1px solid var(--border-strong); border-radius:var(--radius);
  background:var(--bg-elev); color:var(--text); font-size:12.5px; font-family:inherit; outline:none;
  transition:border-color .1s, box-shadow .1s;
}
.textarea { height:auto; min-height:76px; padding:7px 9px; line-height:1.6; resize:vertical; }
.input:focus,.select:focus,.textarea:focus { border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft); }
.input::placeholder,.textarea::placeholder { color:var(--text-subtle); }
.select { appearance:none; padding-right:26px;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'><path d='M2 4l3 3 3-3' fill='none' stroke='%239a9aa3' stroke-width='1.4' stroke-linecap='round'/></svg>");
  background-repeat:no-repeat; background-position:right 8px center; }
.field { margin-bottom:13px; }
.field__label { display:block; font-size:12px; font-weight:500; color:var(--text-muted); margin-bottom:5px; }
.field__hint { font-size:11.5px; color:var(--text-subtle); margin-top:4px; }
.field__error { font-size:11.5px; color:var(--red); margin-top:4px; }
.checkbox { display:inline-flex; align-items:center; gap:6px; font-size:12.5px; cursor:pointer; }
.external-link-button { appearance:none; border:0; padding:0; background:none; color:var(--accent); font:inherit; cursor:pointer; }
.external-link-button:hover { text-decoration:underline; }
.checkbox input { width:14px; height:14px; accent-color:var(--accent); margin:0; }

.filters { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-bottom:14px; }
.filters .input,.filters .select { width:auto; min-width:132px; }
.filters .input--search { min-width:236px; }
.task-filters { display:grid; grid-template-columns:minmax(0,1fr) minmax(210px,270px); gap:8px; align-items:center; }
.task-filters__main { display:grid; grid-template-columns:repeat(7,minmax(112px,1fr)); gap:8px; flex:1 1 820px; min-width:0; }
.task-filters__main .input,.task-filters__main .select { width:100%; min-width:0; }
.task-filters__tail { display:grid; grid-template-columns:minmax(132px,1fr) auto; gap:8px; align-items:center; min-width:0; }
.task-filters__tail .input { width:100%; min-width:132px; }
.task-filter-context { display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:7px 10px; border:1px solid var(--border); border-radius:var(--radius); background:var(--bg-sunken);
  color:var(--text-muted); font-size:12px; }
.task-filter-context a { color:var(--accent); white-space:nowrap; }
.task-stat { transition:border-color .12s,background .12s; }
.task-stat:hover { border-color:var(--border-strong); background:var(--bg-hover); }
.task-stat.is-active { border-color:var(--accent); box-shadow:inset 0 0 0 1px var(--accent); }
.price-dispatch-menu .export-menu__panel { width:min(360px,calc(100vw - 32px)); }
.task-overview,.task-journey { overflow:visible; }
.task-overview__summary {
  min-height:42px; padding:0 14px; display:flex; align-items:center; justify-content:space-between; gap:16px;
  cursor:pointer; list-style:none; font-size:12.5px;
}
.task-overview__summary::-webkit-details-marker { display:none; }
.task-overview__summary > span:first-child { display:flex; align-items:center; gap:8px; min-width:0; }
.task-overview__summary::after { content:'\203A'; color:var(--text-subtle); font-size:18px; transform:rotate(90deg); transition:transform .12s; }
.task-overview[open] > .task-overview__summary::after,
.task-journey[open] > .task-overview__summary::after { transform:rotate(-90deg); }
.task-overview__summary-stats { display:flex; align-items:center; gap:16px; margin-left:auto; white-space:nowrap; }
.task-overview__summary-stats b { margin-left:3px; font-variant-numeric:tabular-nums; }
.task-overview__body { border-top:1px solid var(--border); padding:0; }
.task-overview__body > .card { border:0; border-radius:0; box-shadow:none; margin-bottom:0; }
.task-overview__section { padding:12px 14px; border-top:1px solid var(--border); }
.task-overview__section-head { display:flex; align-items:center; gap:8px; margin-bottom:10px; font-size:12.5px; }
.task-overview__metrics { margin-bottom:8px; }
.queue-status-strip {
  min-height:38px; padding:0 12px; display:flex; align-items:center; gap:18px; flex-wrap:wrap;
  border:1px solid var(--border); border-radius:var(--radius-lg); background:var(--bg-elev); font-size:12px;
}
.queue-status-strip b { margin-left:3px; font-size:13px; font-variant-numeric:tabular-nums; }
.is-blue { color:var(--blue); }.is-green { color:var(--green); }.is-red { color:var(--red); }
.batch-progress { overflow:hidden; }
.batch-progress__head { flex-wrap:wrap; }
.batch-progress__meta {
  display:flex; align-items:center; gap:8px 18px; flex-wrap:wrap; padding:9px 14px;
  border-top:1px solid var(--border); border-bottom:1px solid var(--border);
  color:var(--text-muted); font-size:12px;
}
.batch-progress__meta b { color:var(--text); font-variant-numeric:tabular-nums; }
.batch-progress__states { display:grid; grid-template-columns:repeat(7,minmax(110px,1fr)); }
.batch-progress__state {
  min-width:0; padding:12px 14px; border-right:1px solid var(--border);
  background:var(--bg-elev); transition:background .1s,box-shadow .1s;
}
.batch-progress__state:last-child { border-right:0; }
.batch-progress__state:hover { background:var(--bg-hover); }
.batch-progress__state.is-active { background:var(--accent-soft); box-shadow:inset 0 -2px 0 var(--accent); }
.batch-progress__state span { display:block; color:var(--text-muted); font-size:11.5px; }
.batch-progress__state b { display:block; margin-top:4px; font-size:20px; font-variant-numeric:tabular-nums; }
.batch-progress__filters { display:flex; gap:6px; flex-wrap:wrap; padding:10px 14px; border-top:1px solid var(--border); }
.batch-progress__table { margin:0 14px 14px; max-height:520px; overflow:auto; }
.batch-monthly-receipt__summary {
  min-height:42px; padding:0 14px; display:flex; align-items:center; justify-content:space-between;
  gap:12px; cursor:pointer; list-style:none;
}
.batch-monthly-receipt__summary::-webkit-details-marker { display:none; }
.batch-monthly-receipt__summary > span:first-child { display:flex; gap:8px; align-items:center; }
.batch-monthly-receipt__metrics { display:flex; align-items:center; gap:8px 22px; flex-wrap:wrap; }
.batch-monthly-receipt__metrics b { margin-left:3px; font-variant-numeric:tabular-nums; }
.batch-monthly-receipt__metrics a { color:var(--accent); }
@media (max-width:1180px) {
  .task-filters { grid-template-columns:1fr; }
  .task-filters__main { grid-template-columns:repeat(4,minmax(120px,1fr)); }
  .task-filters__tail { grid-template-columns:minmax(132px,240px) auto; justify-content:start; }
  .task-overview__summary-stats { white-space:normal; flex-wrap:wrap; gap:6px 12px; }
  .batch-progress__states { grid-template-columns:repeat(4,minmax(120px,1fr)); }
  .batch-progress__state { border-bottom:1px solid var(--border); }
}
@media (max-width:720px) {
  .task-filters__main { grid-template-columns:1fr 1fr; flex-basis:100%; }
  .task-filters__tail { grid-template-columns:1fr auto; }
  .task-overview__summary { align-items:flex-start; padding:10px 12px; }
  .task-overview__summary > span:first-child { align-items:flex-start; flex-direction:column; gap:2px; }
  .task-overview__summary-stats { display:none; }
  .queue-status-strip { gap:8px 14px; padding:8px 10px; }
  .batch-progress__states { grid-template-columns:1fr 1fr; }
  .batch-progress__state { padding:10px 12px; }
  .batch-monthly-receipt__summary { align-items:flex-start; padding:10px 12px; }
  .batch-monthly-receipt__summary > span:first-child { align-items:flex-start; flex-direction:column; gap:2px; }
}

.table-wrap { overflow-x:auto; border:1px solid var(--border); border-radius:var(--radius-lg); background:var(--bg-elev); }
table.tbl { width:100%; border-collapse:collapse; font-size:12.5px; }
.tbl th {
  text-align:left; font-weight:500; color:var(--text-muted); font-size:11.5px; padding:8px 12px;
  border-bottom:1px solid var(--border); white-space:nowrap; background:var(--bg-sunken); position:sticky; top:0;
}
.tbl td { padding:9px 12px; border-bottom:1px solid var(--border); vertical-align:middle; }
.tbl tbody tr:last-child td { border-bottom:none; }
.tbl tbody tr:hover { background:var(--bg-hover); }
.tbl .num { text-align:right; font-variant-numeric:tabular-nums; }
.tbl .nowrap { white-space:nowrap; }
.tbl__actions { display:flex; gap:5px; justify-content:flex-end; }
.tbl__main { font-weight:500; }
.tbl__sub { color:var(--text-subtle); font-size:11.5px; }
/* 多语言字典：术语列整块可点，弹出多语种译文对话框 */
.term-link { display:flex; flex-wrap:wrap; align-items:center; gap:6px; width:100%; padding:0;
  border:0; background:none; color:inherit; font:inherit; text-align:left; cursor:pointer; }
.term-link:hover .tbl__main { color:var(--accent); text-decoration:underline; }
.term-link__edit { display:inline-flex; color:var(--text-subtle); }
.term-link:hover .term-link__edit { color:var(--accent); }

.tag {
  display:inline-flex; align-items:center; gap:4px; height:19px; padding:0 6px; border-radius:5px;
  font-size:11px; font-weight:500; background:var(--bg-active); color:var(--text-muted); white-space:nowrap;
}
.tag--green{background:var(--green-soft);color:var(--green);} .tag--amber{background:var(--amber-soft);color:var(--amber);}
.tag--red{background:var(--red-soft);color:var(--red);}       .tag--blue{background:var(--blue-soft);color:var(--blue);}
.tag--violet{background:var(--violet-soft);color:var(--violet);} .tag--accent{background:var(--accent-soft);color:var(--accent);}
.dot { width:6px; height:6px; border-radius:50%; background:currentColor; flex:0 0 6px; }

.tabs { display:flex; gap:2px; border-bottom:1px solid var(--border); margin-bottom:16px; overflow-x:auto; }
.tabs__item {
  padding:7px 11px; font-size:12.5px; color:var(--text-muted); border-bottom:2px solid transparent;
  margin-bottom:-1px; white-space:nowrap; font-weight:500;
}
.tabs__item:hover { color:var(--text); }
.tabs__item.is-active { color:var(--text); border-bottom-color:var(--accent); }
/* 页签上的「填了没」小点：默认红（未翻译），is-filled 绿。app.js bindTabs 负责切 */
.tabs__flag { display:inline-block; width:6px; height:6px; border-radius:50%; background:var(--red); margin-left:5px; vertical-align:middle; }
.tabs__flag.is-filled { background:var(--green); }
/* 内容区顶部的一级页签（侧栏入口下的功能页，结构见 config/nav.php）：
   它上面是页面标题，和页面自己的 .tabs 是两个层级，所以稍大一点、和下方内容多留些间距 */
.tabs--section { margin-bottom:18px; gap:4px; }
.tabs--section .tabs__item { font-size:13px; padding:8px 14px; }
/* 页签上的待处理条数，和侧栏红点同一个口径（>99 折成 99+） */
.tabs__badge {
  display:inline-block; vertical-align:1px; margin-left:6px; background:var(--red-soft); color:var(--red);
  font-size:10.5px; font-weight:600; padding:0 5px; border-radius:5px; min-width:17px; text-align:center;
}

.empty { padding:52px 20px; text-align:center; color:var(--text-subtle); }
.empty__icon { font-size:26px; opacity:.5; margin-bottom:8px; }
.empty__title { font-size:13.5px; color:var(--text-muted); font-weight:500; }
.empty__hint { font-size:12px; margin-top:4px; }

.pager { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin-top:14px; font-size:12.5px; }
.pager__info { color:var(--text-subtle); margin-right:auto; }
.pager__item { min-width:27px; height:27px; padding:0 7px; display:grid; place-items:center;
  border:1px solid var(--border); border-radius:var(--radius); color:var(--text-muted); }
.pager__item:hover { background:var(--bg-hover); color:var(--text); }
.pager__item.is-active { background:var(--accent); border-color:var(--accent); color:var(--accent-fg); }
/* 输入页码跳转（只有开了 $pagerJump 的列表才出，机构列表默认开） */
.pager__jump { display:flex; align-items:center; gap:6px; margin-left:6px; }
.pager__jump-label { color:var(--text-subtle); font-size:12.5px; }
.pager__jump-input { width:62px; height:27px; padding:0 7px; text-align:center;
  border:1px solid var(--border); border-radius:var(--radius); background:var(--bg-elev);
  color:var(--text); font-size:12.5px; font-family:inherit; outline:none; }
.pager__jump-input:focus { border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft); }

.flash { display:flex; align-items:center; gap:8px; padding:9px 13px; border-radius:var(--radius);
  font-size:12.5px; margin-bottom:14px; border:1px solid transparent; }
.flash--ok { background:var(--green-soft); color:var(--green); border-color:color-mix(in srgb,var(--green) 22%,transparent); }
.flash--error { background:var(--red-soft); color:var(--red); border-color:color-mix(in srgb,var(--red) 22%,transparent); }

.timeline { position:relative; padding-left:19px; }
.timeline::before { content:''; position:absolute; left:5px; top:5px; bottom:5px; width:1px; background:var(--border); }
.timeline__item { position:relative; padding-bottom:15px; }
.timeline__dot { position:absolute; left:-18px; top:4px; width:9px; height:9px; border-radius:50%;
  background:var(--bg-elev); border:2px solid var(--border-strong); }
.timeline__item.is-active .timeline__dot { border-color:var(--accent); background:var(--accent); }
.timeline__time { font-size:11.5px; color:var(--text-subtle); }
.timeline__text { font-size:12.5px; margin-top:1px; }
.timeline__gap { position:absolute; left:-8px; bottom:1px; padding:0 5px; background:var(--bg-elev);
  color:var(--text-subtle); font-size:10.5px; line-height:14px; }

.kv { display:grid; grid-template-columns:104px 1fr; gap:7px 14px; font-size:12.5px; }
.kv__k { color:var(--text-muted); }
.kv__v { min-width:0; word-break:break-word; }
.kv--table { gap:0; border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; }
.kv--table .kv__k, .kv--table .kv__v { padding:9px 12px; border-bottom:1px solid var(--border); }
.kv--table .kv__k { background:var(--bg-sunken); color:var(--text-muted); font-weight:600; }
.kv--table .kv__v { border-left:1px solid var(--border); }
.kv--table .kv__k:nth-last-child(2), .kv--table .kv__v:last-child { border-bottom:0; }
.booking-submitted-at { margin-top:16px; padding-top:10px; border-top:1px solid var(--border); font-size:11.5px; }

.board { display:flex; gap:11px; overflow-x:auto; padding-bottom:8px; }
.board__col { flex:0 0 268px; background:var(--bg-sunken); border:1px solid var(--border); border-radius:var(--radius-lg); }
.board__head { padding:9px 12px; display:flex; align-items:center; gap:7px; border-bottom:1px solid var(--border);
  font-size:12px; font-weight:600; }
.board__count { margin-left:auto; color:var(--text-subtle); font-weight:500; }
.board__body { padding:8px; display:flex; flex-direction:column; gap:7px; max-height:66vh; overflow-y:auto; }
.board__card { background:var(--bg-elev); border:1px solid var(--border); border-radius:var(--radius); padding:9px 10px; }
.board__card:hover { border-color:var(--border-strong); }

.bar { height:5px; border-radius:3px; background:var(--bg-active); overflow:hidden; }
.bar__fill { height:100%; background:var(--accent); border-radius:3px; }
.bar__fill--green{background:var(--green);} .bar__fill--amber{background:var(--amber);} .bar__fill--red{background:var(--red);}

/* 目标月采集漏斗：上段 4 级逐级收窄的转化层级，下段是候选机构的价格审核分流 */
.funnel__row { display:grid; grid-template-columns:104px minmax(0,1fr) 64px 54px 132px; align-items:center; gap:10px; margin:7px 0; font-size:12.5px; }
.funnel__track { height:10px; border-radius:3px; background:var(--bg-active); overflow:hidden; }
.funnel__bar { height:100%; border-radius:3px; background:var(--accent); }
.funnel__num,.funnel__pct,.funnel__conv { text-align:right; }
.funnel__conv { font-size:11.5px; color:var(--text-muted); }
.funnel__split { margin-top:12px; padding-top:10px; border-top:1px solid var(--border); }
@media (max-width:720px){ .funnel__row { grid-template-columns:84px minmax(0,1fr) 58px 52px; } .funnel__conv { display:none; } }

/* 目标月每日产出趋势：折线只画时间序列 */
.trend__legend { display:flex; align-items:center; gap:12px; font-size:11.5px; margin-bottom:8px; flex-wrap:wrap; }
.trend__dot { display:inline-block; width:8px; height:8px; border-radius:2px; margin-right:5px; vertical-align:middle; }
.trend__plot { height:96px; }
.trend__plot svg { display:block; width:100%; height:100%; }
.trend__plot { position:relative; }
.trend__hits { position:absolute; inset:0; z-index:1; display:grid; grid-auto-flow:column; grid-auto-columns:minmax(0,1fr); }
.trend__hits span { display:block; cursor:crosshair; }
.trend__y-max,.trend__y-zero { position:absolute; right:2px; z-index:2; font-family:var(--mono); font-size:10px; line-height:1.4; color:var(--text-subtle); background:var(--bg-elev); padding:0 3px; border-radius:2px; pointer-events:none; }
.trend__y-max { top:0; } .trend__y-zero { bottom:0; }
.trend__axis { display:flex; justify-content:space-between; font-size:11px; margin-top:4px; }
.trend__stats { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin-top:10px; padding-top:10px; border-top:1px solid var(--border); }
.trend__stats span { display:flex; flex-direction:column; gap:2px; }
.trend__stats i { font-style:normal; font-size:11px; color:var(--text-subtle); }
.trend__stats b { font-family:var(--mono); font-size:13px; font-weight:600; }

.thumbs { display:grid; grid-template-columns:repeat(auto-fill,minmax(128px,1fr)); gap:10px; }
.thumb { border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; background:var(--bg-sunken); }
.thumb img { width:100%; height:96px; object-fit:cover; display:block; }
.thumb__meta { padding:6px 8px; font-size:11px; color:var(--text-muted); display:flex; align-items:center; gap:5px; }

/* ---------- 可搜索下拉框 ---------- */
.ss { position:relative; }
.ss__native { position:absolute; opacity:0; pointer-events:none; width:0; height:0; }
.ss__control {
  display:flex; flex-wrap:wrap; align-items:center; gap:4px; width:100%; min-height:30px;
  padding:3px 8px; border:1px solid var(--border-strong); border-radius:var(--radius);
  background:var(--bg-elev); color:var(--text); cursor:text;
}
.ss.is-open .ss__control { border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft); }
.ss__input {
  flex:1; min-width:80px; border:none; outline:none; background:transparent; color:inherit;
  font:inherit; font-size:13px; height:22px; padding:0;
}
.ss__input::placeholder { color:var(--text-subtle); }
.ss__chip {
  display:inline-flex; align-items:center; gap:4px; max-width:100%;
  padding:1px 4px 1px 7px; border-radius:4px; background:var(--accent-soft); color:var(--accent);
  font-size:11.5px; line-height:18px;
}
.ss__x {
  border:none; background:none; color:inherit; cursor:pointer; font-size:13px; line-height:1;
  padding:0 1px; opacity:.65;
}
.ss__x:hover { opacity:1; }
.ss__menu {
  position:absolute; z-index:30; top:calc(100% + 3px); left:0; right:0; max-height:246px; overflow-y:auto;
  padding:4px; border:1px solid var(--border); border-radius:var(--radius);
  background:var(--bg-elev); box-shadow:var(--shadow-lg);
}
.ss__opt {
  display:flex; align-items:center; gap:8px; padding:5px 8px; border-radius:4px;
  font-size:12.5px; cursor:pointer;
}
.ss__opt:hover, .ss__opt.is-active { background:var(--bg-hover); }
.ss__opt.is-on { color:var(--accent); font-weight:500; }
.ss__sub { margin-left:auto; color:var(--text-subtle); font-size:11px; }
.ss__none { padding:9px 8px; color:var(--text-subtle); font-size:12px; text-align:center; }
.filters .ss { min-width:172px; }

.dlg {
  padding:0; border:1px solid var(--border); border-radius:var(--radius-lg);
  background:var(--bg-elev); color:var(--text); box-shadow:var(--shadow-lg);
  width:min(560px,94vw); max-width:none; font:inherit;
}
.dlg::backdrop { background:rgba(0,0,0,.42); backdrop-filter:blur(1px); }
.dlg .card__foot { justify-content:flex-end; }

/* 可点放大的缩略图（二维码等）：按钮只承担点击区域，图片尺寸仍由使用方决定 */
.img-zoom {
  display:inline-block; padding:0; border:0; background:none; line-height:0;
  border-radius:var(--radius); cursor:zoom-in;
}
.img-zoom:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.img-zoom img { display:block; border-radius:var(--radius); }
/* 放大弹层：白底托住二维码，深色遮罩压住页面；关闭按钮固定右上角，不随图片滚走 */
.img-zoom-dialog {
  padding:0; border:0; background:transparent; max-width:none; max-height:none;
}
.img-zoom-dialog::backdrop { background:rgba(0,0,0,.72); }
.img-zoom-dialog img {
  display:block; max-width:92vw; max-height:88vh; border-radius:var(--radius);
  background:#fff; box-shadow:var(--shadow-lg);
}
.img-zoom-dialog__close {
  position:fixed; top:14px; right:14px; width:30px; height:30px; padding:0;
  border:1px solid rgba(255,255,255,.35); border-radius:50%; background:rgba(0,0,0,.45);
  color:#fff; font-size:17px; line-height:1; cursor:pointer;
}
.img-zoom-dialog__close:hover { background:rgba(0,0,0,.7); }
.input--file { padding:4px 8px; line-height:20px; cursor:pointer; }
.input--file::file-selector-button {
  margin:0 9px 0 0; height:20px; padding:0 8px; border:1px solid var(--border-strong);
  border-radius:4px; background:var(--bg-hover); color:var(--text); font:inherit; font-size:11.5px; cursor:pointer;
}

.muted { color:var(--text-muted); } .subtle { color:var(--text-subtle); }
.right { text-align:right; } .center { text-align:center; }
.mt-0{margin-top:0}.mt-8{margin-top:8px}.mt-16{margin-top:16px}.mt-24{margin-top:24px}
.mb-8{margin-bottom:8px}.mb-16{margin-bottom:16px}
.flex{display:flex}.flex-col{flex-direction:column}.items-center{align-items:center}
.justify-between{justify-content:space-between}.gap-4{gap:4px}.gap-8{gap:8px}.gap-12{gap:12px}
.w-full{width:100%}.flex-1{flex:1}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hidden{display:none}

/* 拖拽上传区（资料导入导出） */
.dropzone { position:relative; display:block; padding:28px 20px; text-align:center; cursor:pointer;
  border:1.5px dashed var(--border); border-radius:var(--radius-lg); background:var(--bg-sunken);
  transition:border-color .15s, background .15s; }
.dropzone:hover { border-color:var(--accent); background:var(--bg-hover); }
.dropzone.is-over { border-color:var(--accent); background:var(--accent-soft, var(--bg-hover));
  border-style:solid; }
.dropzone input[type=file] { position:absolute; inset:0; opacity:0; cursor:pointer; }
.dropzone__icon { font-size:22px; opacity:.45; margin-bottom:6px; }
.dropzone__title { font-size:13px; color:var(--text-muted); font-weight:500; }
.dropzone__hint { font-size:11.5px; color:var(--text-subtle); margin-top:4px; }
.dropzone__file { display:none; align-items:center; justify-content:center; gap:8px;
  flex-wrap:wrap; font-size:12.5px; color:var(--text); }
.dropzone.has-file .dropzone__file { display:flex; }
.dropzone.has-file .dropzone__prompt { display:none; }
.dropzone__item { display:inline-flex; align-items:center; gap:6px; max-width:230px;
  padding:3px 8px 3px 3px; border:1px solid var(--border); border-radius:999px; background:var(--bg-elev); }
.dropzone__item img { width:26px; height:26px; border-radius:50%; object-fit:cover; flex:none; }
.dropzone__item:not(:has(img)) { padding-left:9px; }
.dropzone__clear { border:1px solid var(--border); border-radius:var(--radius);
  padding:1px 7px; font-size:11px; color:var(--text-subtle); background:var(--bg-elev); }
.dropzone__clear:hover { color:var(--red); border-color:var(--red); }

/* ---- 机构编辑页：字段历史按钮 / 历史弹窗 / 回填提示（迁移 20260923_042） ---- */
/* 输入框包一层，字段工具条绝对钉在这一层的右上角 */
.hist-input { position:relative; display:block; }
.hist-input > .input, .hist-input > .select, .hist-input > .ss { width:100%; box-sizing:border-box; }
.hist-input > .input, .hist-input > .select { padding-right:74px; }
.hist-input > textarea { width:100%; box-sizing:border-box; padding-right:128px; }
/* 两颗按钮（多语言 + 历史）并排时输入框要留得更宽 */
.hist-input:has(.hist-actions) > .input, .hist-input:has(.hist-actions) > .select { padding-right:132px; }
.hist-input:has(.hist-actions) > textarea { padding-right:132px; }
/* 数量框较窄：历史按钮与输入框并排，保留数字和原生微调按钮的空间。 */
.hist-input:has(> .input:is([name="doctor_count"], [name="director_count"], [name="bed_count"])) {
  display:flex; align-items:center; gap:4px;
}
.hist-input:has(> .input:is([name="doctor_count"], [name="director_count"], [name="bed_count"])) > .input {
  flex:1 1 0; min-width:0; width:0; padding-right:9px;
}
.hist-input:has(> .input:is([name="doctor_count"], [name="director_count"], [name="bed_count"])) > .hist-actions {
  position:static; transform:none; flex:none;
}
/* select.js 增强过的组合框：原生 select 被藏在里面，给它的搜索框留出按钮位 */
.hist-input .ss__input { padding-right:24px; }
.hist-input:has(.hist-actions) .ss__input { padding-right:76px; }

/* 字段旁的按钮工具条：「历史」与「多语言」**同容器** flex 并排，从右往左排。
   以前两颗各自 position:absolute; right:3px，靠相邻兄弟选择器互相让位——
   容器换一种（textarea / 组合框 / checkbox）就会叠在一起，这条是那次问题的根治 */
.hist-actions { position:absolute; top:50%; right:3px; transform:translateY(-50%); z-index:2;
  display:inline-flex; align-items:center; gap:4px; }
/* 文本域那一档按钮钉右上角、且允许换行（textarea 里不放不下时可以折到第二行） */
.hist-input--area > .hist-actions { top:5px; transform:none; justify-content:flex-end; flex-wrap:wrap; }
/* 复选框 / 机构类别那种行内排的：跟在字段 label 后面，不绝对定位 */
.hist-actions--inline { position:static; transform:none; margin-left:8px; vertical-align:middle; }

/* 工具条里的按钮：静态排布，不再各自定位（角标仍以按钮自身为基准，所以是 relative） */
.hist-actions .hist-btn, .hist-actions .locale-btn {
  position:relative; top:auto; right:auto; transform:none; z-index:2;
  height:23px; padding:0 9px; font-size:11.5px; line-height:1;
  border:1px solid var(--border-strong); border-radius:var(--radius);
  background:var(--bg-hover); color:var(--text-muted); cursor:pointer; white-space:nowrap;
}
.hist-actions .hist-btn:hover, .hist-actions .locale-btn:hover { color:var(--accent); border-color:var(--accent); }
.hist-actions .hist-btn:disabled, .hist-actions .locale-btn:disabled { opacity:.5; cursor:not-allowed; }

/* 下面两条是「脚本加载顺序反了、按钮还没进工具条」那一瞬的兜底：此时它们是 .hist-input
   的直接子元素，各自绝对定位也一样会叠。给第二颗（后插入的「多语言」）让出右侧 52px，
   工具条一建好这两条就不再生效 */
.hist-input > .hist-btn { position:absolute; right:3px; top:50%; transform:translateY(-50%); z-index:2;
  height:23px; padding:0 9px; font-size:11.5px; line-height:1;
  border:1px solid var(--border-strong); border-radius:var(--radius);
  background:var(--bg-hover); color:var(--text-muted); cursor:pointer; white-space:nowrap; }
.hist-input > .locale-btn { position:absolute; right:57px; top:50%; transform:translateY(-50%); z-index:1;
  height:23px; padding:0 9px; font-size:11.5px; line-height:1;
  border:1px solid var(--border-strong); border-radius:var(--radius);
  background:var(--bg-hover); color:var(--text-muted); cursor:pointer; white-space:nowrap; }
.hist-input > .hist-btn:hover, .hist-input > .locale-btn:hover { color:var(--accent); border-color:var(--accent); }

/* 多语言弹窗比历史那个宽一点：要放语言页签 + 各语言现值对照表 */
.dlg--wide { width:min(760px,96vw); }
/* 价格修改 / 新增弹窗：字段多，用更宽的弹窗 + 更紧的行距，常见桌面高度下不出现纵向滚动。
   正文只在窗口太矮时兜底滚动，正常内容不超过 max-height 就不出滚动条。 */
.dlg--price { width:min(1040px,96vw); }
.dlg--price .card__head { padding:9px 16px; }
.dlg--price .card__body { padding:12px 16px; max-height:calc(100vh - 112px); overflow:auto; }
.dlg--price .card__foot { padding:8px 16px; }
.dlg--price .field { margin-bottom:7px; }
.dlg--price .field__label { margin-bottom:3px; }
.dlg--price .field__hint { margin-top:3px; font-size:11px; }
/* 1040px 的弹窗里 4 列短字段仍排得下，不跟随全局 1180px 断点掉成两行 */
.dlg--price .grid--4 { grid-template-columns:repeat(4,minmax(0,1fr)); }
@media (max-width:820px){ .dlg--price .grid--4 { grid-template-columns:1fr; } }
.locale-msg--error { color:var(--red); }
/* 品牌码现值回填的播报（机构多语言页 #brand-load-msg）：成功绿 / 码不存在琥珀 / 失败红 */
.brand-load--ok { color:var(--green); }
.brand-load--warn { color:var(--amber); }
.brand-load--err { color:var(--red); }
/* 红色记录数角标：延迟加载，只给有历史的字段挂（0 条不渲染） */
.hist-badge { position:absolute; top:-7px; right:-7px; z-index:3;
  min-width:15px; height:15px; padding:0 4px; box-sizing:border-box;
  border-radius:8px; background:#e5484d; color:#fff;
  font-size:10px; font-weight:700; line-height:15px; text-align:center;
  pointer-events:none; box-shadow:0 0 0 1px #fff; }

/* 字段历史弹窗：一行 = 谁/何时 + 原值 → 新值，两个值都是可回填按钮 */
.hist-list { list-style:none; margin:0; padding:0; max-height:52vh; overflow:auto; }
.hist-row { padding:9px 0; border-bottom:1px dashed var(--border); }
.hist-row:last-child { border-bottom:0; }
.hist-meta { font-size:11.5px; color:var(--text-subtle); margin-bottom:5px; }
.hist-vals { display:flex; gap:8px; align-items:flex-start; flex-wrap:wrap; }
.hist-arrow { align-self:center; color:var(--text-subtle); flex:none; }
.hist-chip { flex:0 1 auto; max-width:46%; text-align:left; word-break:break-all; white-space:pre-wrap;
  padding:5px 8px; font-size:11.5px; line-height:1.55; cursor:pointer;
  border:1px solid var(--border); border-radius:var(--radius);
  background:var(--bg); color:var(--text); font-family:inherit; }
.hist-chip:hover:not(:disabled) { border-color:var(--accent); background:var(--accent-soft); }
.hist-chip--cut, .hist-chip:disabled { cursor:not-allowed; color:var(--text-subtle); background:var(--bg-hover); }
.hist-toast { position:fixed; left:50%; bottom:36px; transform:translateX(-50%); z-index:99;
  padding:9px 15px; border-radius:8px; background:#2b2b31; color:#fff;
  font-size:12.5px; box-shadow:var(--shadow-lg); }

/* 平台资讯机翻进度面板（migration 047）：进度条 + 每门语言的状态表 */
.tr-bar { height:8px; border-radius:4px; background:var(--bg-hover); overflow:hidden; }
.tr-bar__fill { display:block; height:100%; width:0; border-radius:4px; background:var(--accent);
  transition:width .3s ease; }
.tr-counts { margin-top:6px; font-size:12px; }
/* 「机翻 / 人工」标记：机翻用琥珀底，提醒未经过人工确认 */
.tr-badge { display:inline-block; padding:1px 7px; border-radius:10px; font-size:11px;
  background:var(--bg-hover); color:var(--text-subtle); }
.tr-badge--model { background:var(--amber-soft, #fdf3e0); color:var(--amber); }
.monitor-queue-views{display:flex;align-items:center;gap:4px;margin:-4px 0 16px;padding:3px;width:max-content;max-width:100%;border:1px solid var(--border);border-radius:9px;background:var(--bg-sunken)}
.monitor-queue-views__item{padding:7px 14px;border-radius:6px;color:var(--text-muted);font-size:13px;text-decoration:none;white-space:nowrap}
.monitor-queue-views__item:hover{color:var(--text);background:var(--bg-hover)}
.monitor-queue-views__item.is-active{color:var(--text);background:var(--bg-elev);box-shadow:var(--shadow);font-weight:600}
.batch-clinic-source{margin-bottom:12px;font-size:12.5px}

/* 官网弹窗隐藏翻译控件，即使按钮样式声明了 display 也不能显示。 */
#clinic-locale-dialog [hidden] { display: none !important; }
