/* === 四海中医 · 店长/药师/库管端：控件配色统一为品牌红族 ===
 * 覆盖 antd 默认灰：
 *   - Segmented（全部/待处理/进行中/已完成）选中态：白底 -> 品牌红底白字
 *   - ant-btn-default：灰边灰字 -> 暖红灰边、hover 品牌红
 *   - 分页 / 输入框聚焦 / 下拉选中项：统一品牌红
 * 加载于 operations-Bx_n-UGW.css 之后。
 */

:root {
  --sh-red: #c8102e;
  --sh-red-dark: #a80d27;
  --sh-red-bg: #fff0f2;
  --sh-red-bg-soft: #fdf2f3;
  --sh-red-line: #f0d4d8;
  --sh-ink: #2c2426;
  --sh-muted: #7d7174;
  --sh-line: #e3dcdd;
}

/* ---------- Segmented（状态筛选：全部/待处理/进行中/已完成） ---------- */
.ant-segmented {
  background: var(--sh-red-bg-soft) !important;
  border: 1px solid var(--sh-red-line) !important;
  padding: 2px !important;
  border-radius: 5px !important;
}
.ant-segmented .ant-segmented-item {
  color: var(--sh-muted) !important;
  border-radius: 4px !important;
  font-weight: 600 !important;
  transition: all .15s !important;
}
.ant-segmented .ant-segmented-item:hover:not(.ant-segmented-item-selected) {
  color: var(--sh-red) !important;
  background: rgba(200, 16, 46, .07) !important;
}
.ant-segmented .ant-segmented-item-selected {
  background: var(--sh-red) !important;
  color: #fff !important;
  box-shadow: 0 1px 3px rgba(200, 16, 46, .28) !important;
}
.ant-segmented .ant-segmented-item-selected .ant-segmented-item-label {
  color: #fff !important;
  font-weight: 700 !important;
}
/* 滑块（thumb）与选中项同色，避免白色滑块透出 */
.ant-segmented .ant-segmented-thumb {
  background: var(--sh-red) !important;
  border-radius: 4px !important;
}
.ant-segmented .ant-segmented-item-input:focus-visible + .ant-segmented-item-label {
  outline: 2px solid var(--sh-red) !important;
}

/* ---------- ant-btn-default（打印药袋 / 清空 / 刷新 / 导出 等） ---------- */
.ant-btn-default {
  border-color: var(--sh-red-line) !important;
  color: var(--sh-ink) !important;
  background: #fff !important;
  font-weight: 600 !important;
}
.ant-btn-default:hover {
  border-color: var(--sh-red) !important;
  color: var(--sh-red) !important;
  background: var(--sh-red-bg) !important;
}
.ant-btn-default:active {
  border-color: var(--sh-red-dark) !important;
  color: var(--sh-red-dark) !important;
}
.ant-btn-default:focus-visible {
  outline: 2px solid rgba(200, 16, 46, .35) !important;
  outline-offset: 1px;
}
.ant-btn-default .anticon { color: inherit !important; }

/* 主按钮保持品牌红 */
.ant-btn-primary:not(:disabled) {
  background: var(--sh-red) !important;
  border-color: var(--sh-red) !important;
  color: #fff !important;
  font-weight: 600 !important;
}
.ant-btn-primary:not(:disabled):hover {
  background: var(--sh-red-dark) !important;
  border-color: var(--sh-red-dark) !important;
  color: #fff !important;
}
/* 内联「治疗开单」按钮由附加脚本动态插入，不受 antd @layer 保护，需显式指定 */
.ant-btn-primary.sh-to-inline,
.ant-btn-primary.sh-to-inline:hover,
.ant-btn-primary.sh-to-inline:focus {
  color: #fff !important;
  background: var(--sh-red) !important;
  border-color: var(--sh-red) !important;
}
.ant-btn-primary.sh-to-inline:hover { background: var(--sh-red-dark) !important; }

/* ---------- 次级/文字/链接按钮 ---------- */
.ant-btn-link:not(:disabled) { color: var(--sh-red) !important; font-weight: 600 !important; }
.ant-btn-link:not(:disabled):hover { color: var(--sh-red-dark) !important; }
.ant-btn-text:not(:disabled):hover { background: var(--sh-red-bg) !important; color: var(--sh-red) !important; }

/* ---------- 输入框 / 下拉：静止走暖红灰线，聚焦走品牌红 ---------- */
.ant-input,
.ant-input-affix-wrapper,
.ant-input-number,
.ant-picker,
.ant-select:not(.ant-select-disabled) .ant-select-selector {
  border-color: var(--sh-red-line) !important;
}
.ant-input::placeholder,
.ant-input-affix-wrapper input::placeholder { color: #a89da0 !important; }
.ant-input-affix-wrapper .anticon,
.ant-input-prefix .anticon,
.ant-input-suffix .anticon { color: var(--sh-muted) !important; }

.ant-input:hover, .ant-input-affix-wrapper:hover,
.ant-input-number:hover, .ant-picker:hover,
.ant-select:not(.ant-select-disabled):hover .ant-select-selector {
  border-color: var(--sh-red) !important;
}
.ant-input:focus, .ant-input-focused,
.ant-input-affix-wrapper:focus, .ant-input-affix-wrapper-focused,
.ant-select-focused:not(.ant-select-disabled) .ant-select-selector {
  border-color: var(--sh-red) !important;
  box-shadow: 0 0 0 2px rgba(200, 16, 46, .12) !important;
}
.ant-select-dropdown .ant-select-item-option-selected {
  background: var(--sh-red-bg) !important;
  color: var(--sh-red) !important;
  font-weight: 700 !important;
}
.ant-select-dropdown .ant-select-item-option-active:not(.ant-select-item-option-selected) {
  background: var(--sh-red-bg-soft) !important;
}

/* ---------- 药方 / 食养方 分栏按钮（药师端 & 店长端，脚本动态插入） ----------
 * 这些 <button> 由 sihai-pharmacy-tabs.js 创建，初始无 class（apply() 才补），
 * 且原样式表 sihai-pharmacy-tabs.css 带有旧绿色版本缓存。
 * 这里统一接管，并显式消除点击后残留的 focus outline（截图里的红框）。 */
.sihai-rx-tabs { background: #fff !important; border-color: var(--sh-red-line) !important; }
.sihai-rx-tab,
#sihai-pharmacy-tabs button {
  border: 1px solid var(--sh-red-line) !important;
  background: #fff !important;
  color: var(--sh-muted) !important;
  font-weight: 600 !important;
  outline: none !important;
  box-shadow: none !important;
}
.sihai-rx-tab:hover,
#sihai-pharmacy-tabs button:hover {
  border-color: var(--sh-red) !important;
  color: var(--sh-red) !important;
  background: var(--sh-red-bg-soft) !important;
}
.sihai-rx-tab.on,
#sihai-pharmacy-tabs button.on {
  background: var(--sh-red) !important;
  border-color: var(--sh-red) !important;
  color: #fff !important;
  font-weight: 700 !important;
  outline: none !important;
  box-shadow: none !important;
}
.sihai-rx-tab.on:hover,
#sihai-pharmacy-tabs button.on:hover {
  background: var(--sh-red-dark) !important;
  border-color: var(--sh-red-dark) !important;
  color: #fff !important;
}
.sihai-rx-tab:focus,
.sihai-rx-tab:focus-visible,
#sihai-pharmacy-tabs button:focus,
#sihai-pharmacy-tabs button:focus-visible {
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(200, 16, 46, .25) !important;
}
.sihai-rx-tab.on:focus,
.sihai-rx-tab.on:focus-visible,
#sihai-pharmacy-tabs button.on:focus,
#sihai-pharmacy-tabs button.on:focus-visible {
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(200, 16, 46, .3) !important;
}
.sihai-rx-tabs-note { color: var(--sh-muted) !important; }

/* ---------- Radio.Button 按钮组（候诊队列 全部/预约/现场 等） ---------- */
.ant-radio-group .ant-radio-button-wrapper {
  border-color: var(--sh-red-line) !important;
  color: var(--sh-muted) !important;
  background: #fff !important;
  font-weight: 600 !important;
}
.ant-radio-group .ant-radio-button-wrapper:hover {
  color: var(--sh-red) !important;
  border-color: var(--sh-red) !important;
  background: var(--sh-red-bg-soft) !important;
}
.ant-radio-group .ant-radio-button-wrapper-checked,
.ant-radio-group .ant-radio-button-wrapper-checked:first-child {
  border-color: var(--sh-red) !important;
  color: #fff !important;
  background: var(--sh-red) !important;
  box-shadow: none !important;
}
.ant-radio-group .ant-radio-button-wrapper-checked:hover {
  border-color: var(--sh-red-dark) !important;
  color: #fff !important;
  background: var(--sh-red-dark) !important;
}
/* 相邻未选中项的左分隔线跟随，避免露出默认灰 */
.ant-radio-group .ant-radio-button-wrapper-checked::before,
.ant-radio-group .ant-radio-button-wrapper-checked + .ant-radio-button-wrapper::before {
  background-color: var(--sh-red) !important;
}

/* ---------- 复选 / 单选 / 开关 ---------- */
.ant-checkbox-checked .ant-checkbox-inner,
.ant-radio-checked .ant-radio-inner {
  background: var(--sh-red) !important;
  border-color: var(--sh-red) !important;
}
.ant-radio-checked .ant-radio-inner::after { background: #fff !important; }
.ant-checkbox-wrapper:hover .ant-checkbox-inner,
.ant-radio-wrapper:hover .ant-radio-inner { border-color: var(--sh-red) !important; }
.ant-switch.ant-switch-checked { background: var(--sh-red) !important; }

/* ---------- 分页 ---------- */
.ant-pagination .ant-pagination-item-active {
  border-color: var(--sh-red) !important;
  background: var(--sh-red-bg) !important;
}
.ant-pagination .ant-pagination-item-active a { color: var(--sh-red) !important; font-weight: 700 !important; }
.ant-pagination .ant-pagination-item:hover { border-color: var(--sh-red) !important; }
.ant-pagination .ant-pagination-item:hover a { color: var(--sh-red) !important; }
.ant-pagination .ant-pagination-prev:hover .ant-pagination-item-link,
.ant-pagination .ant-pagination-next:hover .ant-pagination-item-link { color: var(--sh-red) !important; }

/* ---------- 标签页 ---------- */
.ant-tabs .ant-tabs-tab:hover { color: var(--sh-red) !important; }
.ant-tabs .ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn { color: var(--sh-red) !important; font-weight: 700 !important; }
.ant-tabs .ant-tabs-ink-bar { background: var(--sh-red) !important; }

/* ---------- 表格：表头与选中行 ---------- */
.ant-table-thead > tr > th {
  background: var(--sh-red-bg-soft) !important;
  color: #8c1c2b !important;
  font-weight: 700 !important;
}
.ant-table-tbody > tr.ant-table-row:hover > td { background: #fff8f8 !important; }
.ant-table-tbody > tr.ant-table-row-selected > td { background: var(--sh-red-bg) !important; }

/* ---------- 空状态 / 提示 ---------- */
.ant-empty-description { color: var(--sh-muted) !important; }
.ant-spin-dot-item { background-color: var(--sh-red) !important; }
