/* =====================================================
 * 诺伊莱氪综合管理系统 - 森系清新主题 v2
 * 自然 · 轻盈 · 年轻（00后审美：极光渐变底 + 大圆角 + 胶囊按钮）
 * ===================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #10b981;          /* 薄荷绿 */
  --primary-dark: #059669;
  --primary-light: #d9f5e7;
  --accent: #38bdf8;           /* 晴空蓝 */
  --accent-light: #e2f4fe;
  --bg: #f5f9f7;               /* 晨雾白绿 */
  --card: #ffffff;
  --border: #e6efea;
  --text: #24352f;
  --text-light: #6f8a80;
  --red: #f26d7d;
  --red-bg: #fdeef0;
  --green: #12a874;
  --orange: #f59e42;
  --shadow: 0 2px 10px rgba(16, 185, 129, .06), 0 1px 3px rgba(36, 53, 47, .04);
  --shadow-lg: 0 12px 40px rgba(16, 185, 129, .14), 0 2px 8px rgba(36, 53, 47, .05);
  --radius: 18px;
}
body {
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 88% -8%, #d3f3e3 0%, transparent 42%),
    radial-gradient(circle at -8% 108%, #d7edfb 0%, transparent 40%),
    radial-gradient(circle at 55% 120%, #fdeeda 0%, transparent 35%);
  background-attachment: fixed;
  color: var(--text); font-size: 14.5px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 登录页 ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #d9f4e4 0%, #d3edfa 48%, #fdeed9 100%); }
.login-box { background: rgba(255,255,255,.88); backdrop-filter: blur(14px); border-radius: 24px; padding: 44px 42px; width: 390px;
  box-shadow: 0 20px 60px rgba(16,185,129,.18), 0 2px 8px rgba(36,53,47,.05); border: 1px solid rgba(255,255,255,.9); }
.login-box h1 { font-size: 23px; text-align: center; margin-bottom: 8px; color: var(--primary-dark); letter-spacing: 2px; font-weight: 700; }
.login-box .sub { text-align: center; color: var(--text-light); font-size: 13px; margin-bottom: 30px; }
.login-box label { display: block; margin: 14px 0 6px; font-size: 13px; color: var(--text); font-weight: 500; }
.login-box input { width: 100%; padding: 12px 16px; border: 1.5px solid var(--border); border-radius: 14px; font-size: 14px; background: #fbfefc; transition: border-color .2s, box-shadow .2s; }
.login-box input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-light); }
.login-box button { width: 100%; margin-top: 26px; padding: 13px; background: linear-gradient(135deg, #34d399, #10b981); color: #fff;
  border: none; border-radius: 999px; font-size: 15px; cursor: pointer; letter-spacing: 8px; font-weight: 600; box-shadow: 0 6px 18px rgba(16,185,129,.32); transition: transform .15s, box-shadow .15s; }
.login-box button:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(16,185,129,.38); }
.login-tip { margin-top: 18px; font-size: 12px; color: var(--text-light); line-height: 1.8; background: #f0f9f4; padding: 10px 14px; border-radius: 12px; }
.login-err { color: var(--red); font-size: 13px; margin-top: 10px; min-height: 18px; text-align: center; }

/* ---------- 主框架（明亮侧边栏） ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: rgba(255,255,255,.82); backdrop-filter: blur(10px); border-right: 1px solid var(--border);
  color: var(--text-light); flex-shrink: 0; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar .logo { padding: 22px 20px; font-size: 16px; font-weight: 700; color: var(--primary-dark); border-bottom: 1px solid var(--border); line-height: 1.4; letter-spacing: 1px; }
.sidebar .logo small { display: block; font-size: 11px; font-weight: 400; color: var(--text-light); margin-top: 4px; letter-spacing: 0; }
.sidebar nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.sidebar .nav-group { padding: 16px 14px 8px; font-size: 15px; color: #a8c0b6; letter-spacing: 2px; font-weight: 600; }
.sidebar a.nav-item { display: flex; align-items: center; gap: 9px; padding: 12px 18px; margin: 4px 0;
  font-size: 16px;
  color: #55706a; text-decoration: none; font-size: 16px; cursor: pointer; border-radius: 999px; transition: background .15s, color .15s, transform .12s; }
.sidebar a.nav-item:hover { background: var(--primary-light); color: var(--primary-dark); }
.sidebar a.nav-item.active { background: linear-gradient(135deg, #34d399, #10b981); color: #fff; box-shadow: 0 4px 14px rgba(16,185,129,.3); }
.nav-badge { margin-left: auto; background: var(--red); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 8px; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { background: rgba(255,255,255,.78); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); padding: 0 26px; height: 60px;
  display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 50; }
.topbar .page-title { font-size: 16px; font-weight: 600; color: var(--text); letter-spacing: .5px; }
.topbar .page-title::before { content: "🌿 "; }
.topbar .right { display: flex; align-items: center; gap: 18px; }
.bell { position: relative; cursor: pointer; font-size: 18px; color: var(--text-light); transition: transform .15s; }
.bell:hover { transform: scale(1.12); }
.bell .dot { position: absolute; top: -4px; right: -6px; background: var(--red); color: #fff; border-radius: 999px; font-size: 10px; padding: 0 5px; line-height: 15px; }
.user-chip { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.user-chip .role { font-size: 12px; color: #fff; background: linear-gradient(135deg, #34d399, #10b981); border-radius: 999px; padding: 3px 12px; }
.user-chip .role.emp { background: linear-gradient(135deg, #5cc9fa, #0ea5e9); }
.logout-btn { background: #fff; border: 1.5px solid var(--border); border-radius: 999px; padding: 5px 14px; cursor: pointer; color: var(--text-light); font-size: 13px; transition: all .15s; }
.logout-btn:hover { color: var(--red); border-color: var(--red); }

.content { padding: 24px 26px 44px; }

/* ---------- 卡片 / 表格 ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; margin-bottom: 22px; border: 1px solid rgba(230,239,234,.8); }
.card h3 { font-size: 15px; margin-bottom: 16px; display: flex; align-items: center; gap: 9px; color: var(--text); font-weight: 600; }
.card h3::before { content: ""; width: 5px; height: 16px; background: linear-gradient(180deg, #34d399, #38bdf8); border-radius: 999px; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th, table.grid td { border: 1px solid var(--border); padding: 9px 11px; text-align: left; vertical-align: top; }
table.grid th { background: #f1f9f4; font-weight: 600; white-space: nowrap; color: #3d5c53; }
table.grid tr.weekend td { background: var(--red-bg); color: var(--red); }
table.grid tr.weekend td:first-child { border-left: 3px solid var(--red); }
table.grid tbody tr:hover td { background: #f3fbf7; }
table.grid tr.weekend:hover td { background: #fbe3e7; }
.tbl-scroll { overflow: auto; max-height: 72vh; border-radius: 12px; }
/* 数据表格统一冻结：表头冻结 + 首列（医院/日期等）冻结 */
table.grid thead th { position: sticky; top: 0; z-index: 6; background: #f1f9f4; }
table.grid th:first-child, table.grid td:first-child { position: sticky; left: 0; z-index: 5; background: #fbfcfe; }
table.grid thead th:first-child { z-index: 7; background: #f1f9f4; }
table.grid tr.weekend td:first-child { background: var(--red-bg); }
table.grid tbody tr:hover td:first-child { background: #f3fbf7; }
.money { color: var(--orange); font-weight: 600; }
.tag { display: inline-block; border-radius: 999px; padding: 2px 11px; font-size: 12px; font-weight: 500; }
.tag-green { background: var(--primary-light); color: var(--green); }
.tag-red { background: var(--red-bg); color: var(--red); }
.tag-blue { background: var(--accent-light); color: #0284c7; }
.tag-orange { background: #fdf1e3; color: var(--orange); }
.tag-gray { background: #eef3f1; color: var(--text-light); }

/* ---------- 表单 ---------- */
.form-row { display: flex; flex-wrap: wrap; gap: 14px 20px; margin-bottom: 4px; }
.form-item { display: flex; flex-direction: column; gap: 6px; }
.form-item label { font-size: 13px; color: #41605a; font-weight: 500; }
.form-item input, .form-item select, .form-item textarea {
  padding: 9px 14px; border: 1.5px solid var(--border); border-radius: 12px; font-size: 13px; min-width: 180px; background: #fbfefc; color: var(--text); font-family: inherit; transition: border-color .2s, box-shadow .2s; }
.form-item textarea { min-width: 100%; min-height: 90px; resize: vertical; }
.form-item input:focus, .form-item select:focus, .form-item textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-light); }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 20px; border-radius: 999px; border: none; font-weight: 500;
  font-size: 13px; cursor: pointer; background: linear-gradient(135deg, #34d399, #10b981); color: #fff; box-shadow: 0 3px 10px rgba(16,185,129,.24); transition: transform .12s, box-shadow .15s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(16,185,129,.32); }
.btn-green { background: linear-gradient(135deg, #34d399, #12a874); }
.btn-red { background: linear-gradient(135deg, #f58a97, #f26d7d); box-shadow: 0 3px 10px rgba(242,109,125,.24); }
.btn-orange { background: linear-gradient(135deg, #f8b968, #f59e42); box-shadow: 0 3px 10px rgba(245,158,66,.26); color: #fff; }
.btn-gray { background: #a7bab5; box-shadow: none; }
.btn-line { background: #fff; border: 1.5px solid var(--border); color: var(--text); box-shadow: none; }
.btn-line:hover { border-color: var(--primary); color: var(--primary-dark); background: #fff; box-shadow: none; transform: none; }
.btn-sm { padding: 4px 12px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 16px; }
.toolbar .form-item input, .toolbar .form-item select { min-width: 150px; }
.spacer { flex: 1; }

/* ---------- 统计块 ---------- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; border: 1px solid rgba(230,239,234,.8); transition: transform .15s, box-shadow .15s; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-card .num { font-size: 27px; font-weight: 700; color: var(--primary-dark); }
.stat-card .num.red { color: var(--red); } .stat-card .num.green { color: var(--green); } .stat-card .num.orange { color: var(--orange); }
.stat-card .lbl { font-size: 13px; color: var(--text-light); margin-top: 4px; }

/* ---------- 打卡 ---------- */
.punch-panel { display: flex; gap: 20px; flex-wrap: wrap; }
.punch-btn { flex: 1; min-width: 200px; border-radius: 22px; padding: 28px; text-align: center; color: #fff; cursor: pointer; border: none; transition: transform .15s, box-shadow .15s; }
.punch-btn:not(:disabled):hover { transform: translateY(-3px); }
.punch-btn .t1 { font-size: 18px; font-weight: 600; }
.punch-btn .t2 { font-size: 12px; opacity: .9; margin-top: 6px; }
.punch-in { background: linear-gradient(135deg, #34d399, #5eead4); box-shadow: 0 8px 22px rgba(52,211,153,.32); }
.punch-out { background: linear-gradient(135deg, #38bdf8, #7dd3fc); box-shadow: 0 8px 22px rgba(56,189,248,.32); }
.punch-btn:disabled { opacity: .45; cursor: not-allowed; }
.wecom-note { font-size: 12px; color: var(--text-light); margin-top: 10px; line-height: 1.7; background: #f0f9f4; border-radius: 12px; padding: 10px 14px; }

/* ---------- 耗材 ---------- */
.consumable-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin: 10px 0; }
.consumable-item { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--border); border-radius: 14px; padding: 10px 14px; background: #fbfdfc; transition: border-color .15s, box-shadow .15s; }
.consumable-item:hover { border-color: var(--primary-light); box-shadow: var(--shadow); }
.consumable-item .cname { flex: 1; font-size: 13px; line-height: 1.35; min-width: 0; display: flex; flex-direction: column; }
.consumable-item .cname-main { font-weight: 600; color: #2c3e50; }
.consumable-item .cname-spec { font-size: 12px; color: #7a8ba3; margin-top: 1px; }
.consumable-item input[type=number] { width: 70px; padding: 6px 9px; border: 1.5px solid var(--border); border-radius: 10px; }
.consumable-item .price { color: var(--orange); font-size: 12px; white-space: nowrap; }

/* ---------- 弹窗 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(36,53,47,.32); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: #fff; border-radius: 22px; width: 560px; max-width: 92vw; max-height: 86vh; overflow-y: auto; padding: 26px 28px; box-shadow: var(--shadow-lg); }
.modal h3 { font-size: 16px; margin-bottom: 16px; font-weight: 600; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.confirm-line { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.confirm-line .k { width: 110px; color: var(--text-light); flex-shrink: 0; }

/* ---------- 消息 ---------- */
.msg-panel { position: fixed; right: 16px; top: 66px; width: 340px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 400; overflow: hidden; }
.msg-panel .hd { padding: 13px 18px; font-weight: 600; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; }
.msg-panel .bd { max-height: 380px; overflow-y: auto; }
.msg-item { padding: 12px 18px; border-bottom: 1px solid #f0f6f3; font-size: 13px; cursor: pointer; }
.msg-item:hover { background: #f3fbf7; }
.msg-item.unread { background: #e8f9f0; }
.msg-item .mt { color: var(--text-light); font-size: 11px; margin-top: 4px; }
.msg-empty { padding: 30px; text-align: center; color: var(--text-light); font-size: 13px; }

/* ---------- Toast ---------- */
.toast { position: fixed; top: 72px; left: 50%; transform: translateX(-50%); background: #24352f; color: #fff;
  padding: 11px 24px; border-radius: 999px; font-size: 14px; z-index: 300; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.toast.err { background: var(--red); }
.toast.ok { background: var(--green); }

.hint { font-size: 12px; color: var(--text-light); line-height: 1.7; }
.deadline-warn { background: #fdf6e8; border: 1px solid #f5e0b5; color: #a97b12; border-radius: 14px; padding: 11px 15px; font-size: 13px; margin-bottom: 14px; }
.assist-card { border: 1.5px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; background: #fdfefe; }
.assist-card .hd { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.assist-card .title { font-weight: 600; font-size: 14px; }
.empty-tip { text-align: center; color: var(--text-light); padding: 36px 0; font-size: 13px; }
.section-gap { margin-top: 24px; }

/* ================= 移动端适配 ================= */
@media (max-width: 768px) {
  .layout { flex-direction: column; }
  .sidebar { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: 100%; height: 62px;
    flex-direction: row; z-index: 300; border-right: none; border-top: 1px solid var(--border); background: rgba(255,255,255,.96); backdrop-filter: blur(12px); }
  .sidebar .logo, .sidebar .nav-group { display: none; }
  .sidebar nav { display: flex; flex-direction: row; overflow-x: auto; padding: 0 8px; width: 100%; align-items: center; }
  .sidebar a.nav-item { position: relative; flex-direction: column; justify-content: center; align-items: center; gap: 2px;
    font-size: 11px; padding: 8px 16px; border-radius: 999px; white-space: nowrap; flex-shrink: 0; margin: 4px 2px; }
  .sidebar a.nav-item.active { box-shadow: none; }
  .nav-badge { position: absolute; top: 2px; right: 8px; margin-left: 0; }
  .main { min-height: 100vh; }
  .content { padding: 14px 12px 96px; }
  .topbar { padding: 0 14px; height: 52px; }
  .topbar .page-title { font-size: 15px; }
  .user-chip .role { display: none; }
  .login-box { width: 92vw; padding: 34px 26px; }
  .form-row { flex-direction: column; gap: 12px; }
  .form-item { width: 100%; }
  .form-item input, .form-item select, .form-item textarea { width: 100%; min-width: 0; padding: 11px 14px; }
  .toolbar { align-items: stretch; }
  .toolbar .form-item input, .toolbar .form-item select { min-width: 0; }
  .stat-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px 16px; }
  .stat-card .num { font-size: 23px; }
  .punch-panel { flex-direction: column; gap: 12px; }
  .punch-btn { min-width: 0; padding: 22px; }
  .consumable-grid { grid-template-columns: 1fr; }
  .modal { width: 94vw; padding: 20px 18px; border-radius: 20px; }
  .msg-panel { position: fixed; right: 8px; left: 8px; top: 56px; width: auto; }
  table.grid { font-size: 12px; }
  table.grid th, table.grid td { padding: 7px 9px; }
  .card { padding: 16px 14px; border-radius: 16px; }
  .btn { padding: 10px 18px; }
}

/* ---- 滚轮式时间选择器 ---- */
.wheel-wrap { position: relative; display: flex; justify-content: center; align-items: center; gap: 8px; height: 200px; overflow: hidden; margin: 10px 0 4px; }
.wheel-band { position: absolute; top: 50%; transform: translateY(-50%); left: 14px; right: 14px; height: 40px; background: var(--primary-light); border-radius: 12px; pointer-events: none; z-index: 0; }
.wheel-col { position: relative; z-index: 1; height: 200px; overflow-y: auto; scroll-snap-type: y mandatory; padding: 80px 0 80px; width: 72px; text-align: center; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.wheel-col::-webkit-scrollbar { display: none; }
.wheel-item { height: 40px; line-height: 40px; font-size: 17px; color: #93a89f; scroll-snap-align: center; cursor: pointer; user-select: none; }
.wheel-item.sel { color: #000; font-weight: 700; font-size: 19px; }
.wheel-sep { font-size: 20px; font-weight: 600; color: #41605a; }

/* ---- 销售部工作区 ---- */
.sales-hosp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.sales-hosp-card { border: 1.5px solid var(--border); border-radius: var(--radius); padding: 16px 18px; background: #fbfdfc; cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s; }
.sales-hosp-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--primary-light); }
.sales-hosp-card .shc-name { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.sales-hosp-card .shc-meta { display: flex; gap: 8px; margin-bottom: 8px; }
.sales-hosp-card .shc-last { font-size: 12px; color: var(--text); line-height: 1.6; }
.sched-edit:hover { background: var(--primary-light); }
.timeline { margin: 6px 0 4px; }
.timeline .tl-item { display: flex; gap: 12px; position: relative; padding-bottom: 14px; }
.timeline .tl-item::before { content: ""; position: absolute; left: 5px; top: 16px; bottom: 0; width: 2px; background: var(--border); }
.timeline .tl-item:last-child::before { display: none; }
.timeline .tl-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--primary); flex-shrink: 0; margin-top: 5px; }
.timeline .tl-body { flex: 1; font-size: 13px; }
.timeline .tl-head { color: var(--text-light); font-size: 12px; margin-bottom: 3px; }
@media (max-width: 768px) {
  .sales-hosp-grid { grid-template-columns: 1fr; }
}

/* ---- 销售项目详情：Tab / 跟进卡片 / 日历 ---- */
.sales-tabs { display: flex; gap: 22px; border-bottom: 2px solid var(--border); margin-bottom: 16px; }
.sales-tab { padding: 8px 4px 10px; font-size: 14px; color: var(--text-light); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: color .15s; }
.sales-tab:hover { color: var(--primary-dark); }
.sales-tab.active { color: var(--primary-dark); font-weight: 600; border-bottom-color: var(--primary); }
.fu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.fu-card { border: 1.5px solid var(--border); border-radius: 14px; overflow: hidden; background: #fff; }
.fu-head { display: flex; justify-content: space-between; padding: 7px 12px; color: #fff; font-size: 12px; font-weight: 600; }
.fu-body { padding: 12px 14px; font-size: 13px; line-height: 1.7; }
.fu-author { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.fu-avatar { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; color: #fff; font-size: 12px; }
.fu-assist { margin-top: 10px; background: #fdf4ec; border: 1px solid #f5dfc8; border-radius: 10px; padding: 9px 11px; font-size: 12px; }
.sales-cal { width: 100%; border-collapse: collapse; table-layout: fixed; }
.sales-cal th { border: 1px solid var(--border); padding: 7px; background: #f1f9f4; font-size: 13px; }
.sales-cal td { border: 1px solid var(--border); height: 86px; vertical-align: top; padding: 5px 6px; cursor: pointer; transition: background .12s; }
.sales-cal td.cal-cell:hover { background: #f3fbf7; }
.sales-cal td.cal-empty { background: #fafcfb; cursor: default; }
.sales-cal td.cal-today { outline: 2px solid var(--primary); outline-offset: -2px; }
.cal-day { font-size: 12px; color: var(--text-light); margin-bottom: 3px; }
.cal-today .cal-day { color: var(--primary-dark); font-weight: 700; }
.cal-chip { font-size: 11px; background: #f0f9f4; border-left: 3px solid var(--primary); border-radius: 4px; padding: 2px 6px; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 768px) {
  .fu-grid { grid-template-columns: 1fr; }
  .sales-cal td { height: 64px; padding: 3px 4px; }
  .cal-chip { font-size: 10px; }
}

/* ---------- 侧栏分组折叠 ---------- */
.sidebar .nav-group.nav-g-toggle { cursor: pointer; display: flex; align-items: center; justify-content: space-between; user-select: none; padding: 16px 14px 8px; }
.sidebar .nav-group.nav-g-toggle:hover { color: var(--primary-dark); }
.sidebar .nav-group .nav-arrow { font-size: 22px; letter-spacing: 0; line-height: 1; transition: transform .2s; }

/* ---------- 通用图片查看器（旋转 + 100%）---------- */
.imgv-container { display: inline-flex; flex-direction: column; gap: 6px; flex-shrink: 0; width: var(--imgv-w, 96px); }
.imgv-img-wrap { width: var(--imgv-w, 96px); height: var(--imgv-h, 72px); overflow: hidden; border: 1.5px solid var(--border); border-radius: 10px; background: #f6faf8; display: flex; align-items: center; justify-content: center; cursor: zoom-in; }
.imgv-img-wrap img { max-width: 100%; max-height: 100%; object-fit: contain; transition: transform .25s ease; transform-origin: center center; }
.imgv-toolbar { display: flex; gap: 4px; justify-content: center; align-items: center; font-size: 12px; }
.imgv-btn { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 2px 7px; cursor: pointer; color: var(--text-light); font-size: 12px; line-height: 18px; transition: all .12s; }
.imgv-btn:hover { color: var(--primary-dark); border-color: var(--primary); }
.imgv-btn:disabled { opacity: .4; cursor: not-allowed; }
.imgv-rot { font-size: 11px; color: var(--text-light); min-width: 28px; text-align: center; }
.imgv-link { font-size: 12px; color: var(--primary-dark); cursor: pointer; text-align: center; }

/* 图片查看覆盖层（放大） */
.imgv-mask { position: fixed; inset: 0; background: rgba(20,30,26,.86); z-index: 999; display: flex; flex-direction: column; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.imgv-mask-img { max-width: 92vw; max-height: 72vh; background: #fff; border-radius: 12px; box-shadow: 0 12px 48px rgba(0,0,0,.4); transition: transform .25s ease; transform-origin: center center; }
.imgv-mask-bar { margin-top: 14px; display: flex; gap: 10px; align-items: center; background: rgba(0,0,0,.42); border-radius: 999px; padding: 8px 14px; }
.imgv-mask-bar .imgv-btn { background: rgba(255,255,255,.92); border-color: transparent; color: #24352f; padding: 4px 14px; font-size: 13px; }
.imgv-mask-bar .imgv-btn:hover { background: #fff; color: var(--primary-dark); }
.imgv-mask-tip { color: rgba(255,255,255,.78); font-size: 12px; margin-right: 6px; }

/* ---------- DateInput 短日期输入 ---------- */
.date-input { font-variant-numeric: tabular-nums; }
.date-input.bad { border-color: var(--red) !important; box-shadow: 0 0 0 3px var(--red-bg) !important; }
.date-input.ok-flash { animation: date-ok-flash .6s; }
@keyframes date-ok-flash { 0%{box-shadow:0 0 0 3px var(--primary-light)} 100%{box-shadow:0 0 0 0 transparent} }

/* ---------- 只读模式（页面级权限 view） ---------- */
.perm-view-bar { background: #fff7e6; border: 1px solid #ffd591; color: #ad6800; border-radius: 10px;
  padding: 9px 14px; font-size: 13px; margin-bottom: 14px; }
.perm-view button.btn, .perm-view input, .perm-view select, .perm-view textarea,
.perm-view .row-del, .perm-view a[onclick] { pointer-events: none !important; opacity: .55; }

/* ============= 矩阵表格（销售业务员分配）紧凑样式 ============= */
/* 注意：table 自身带有 class="grid sa-compact"，选择器须直接命中 table，不能用后代选择器 */
table.grid.sa-compact { width: auto; border-collapse: collapse; font-size: 11px; table-layout: auto; }
table.grid.sa-compact th, table.grid.sa-compact td { padding: 2px 3px; white-space: normal; }
table.grid.sa-compact th { font-size: 11px; line-height: 1.2; font-weight: 600; white-space: normal; }
/* 矩阵：去 number input 上下调节箭头 */
.sa-compact input[type="number"].sa-num::-webkit-outer-spin-button,
.sa-compact input[type="number"].sa-num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sa-compact input[type="number"].sa-num { -moz-appearance: textfield; appearance: textfield; }
.sa-compact .sa-price { width: 9ch; padding: 2px 3px; font-size: 11px; }
.sa-compact .sa-comm { width: 6ch; padding: 2px 3px; font-size: 11px; }
.sa-compact .sa-person { padding: 1px 3px; font-size: 11px; }
.sa-compact .sa-rate { padding: 1px 3px; font-size: 11px; }
.sa-compact tr.sa-row-price td { background: #fcfefb; }
.sa-compact .sa-person-dd { position: absolute; z-index: 200; background: #fff; border: 1.5px solid var(--primary); border-radius: 8px; box-shadow: 0 8px 20px rgba(16,185,129,.18); max-height: 220px; overflow-y: auto; min-width: 180px; }
.sa-compact .sa-person-dd .sa-pd-item:hover { background: var(--primary-light); }
.sa-compact th.sa-hosp-th { vertical-align: middle; padding: 3px 2px; }
/* 表头列文字在窄列里自动换行 */
.sa-compact .sa-hosp-th > div { word-break: break-all; line-height: 1.15; }
/* 表头负责人/比例也压缩 */
.sa-compact .sa-hosp-person { font-size: 11px; padding: 2px 4px; }
.sa-compact .sa-hosp-th select { font-size: 11px; padding: 2px 4px; }
.sa-compact .sa-hosp-th input.sa-rate { font-size: 11px; padding: 2px 4px; }
/* 数据行首列名称/规格更紧凑 */
.sa-compact td.sa-fixed { padding: 3px 6px; line-height: 1.2; font-size: 11px; }
/* ===== 销售分配矩阵：首行 + 首列冻结 =====
   sticky 冻结必须配合 border-collapse:separate 才生效（collapse 下会失效），
   故对 .sa-matrix 内的表格单独覆盖，并显式设置各层背景色防止滚动时透出。 */
.sa-matrix table.grid.sa-compact { border-collapse: separate; border-spacing: 0; }
/* 表头整行冻结在顶部 */
.sa-matrix table.grid.sa-compact thead th { position: sticky; top: 0; z-index: 6; background: #f1f9f4; }
/* 数据行首列（耗材名称/规格）冻结在左侧 */
.sa-matrix table.grid.sa-compact tbody td:first-child { position: sticky; left: 0; z-index: 5; background: #fcfefb; }
/* 左上角表头单元格：同时冻结顶部+左侧，层级最高 */
.sa-matrix table.grid.sa-compact thead th:first-child { z-index: 8; background: #f1f9f4; }
/* 悬停时首列背景跟随，避免出现色块断层 */
.sa-matrix table.grid.sa-compact tbody tr:hover td:first-child { background: #f3fbf7; }
