/* ============================================================
   shell.css — 仁护通 v2.0 主管端共享壳（PC + 移动双适配）
   品牌：--primary 橙 / --teal 深青（与 C 端 H5 同源）
   断点：≤960px 侧边栏转抽屉；≤720px 表格转卡片
   ============================================================ */

:root {
  --primary: #F36B21; --primary-hover: #E45F18;
  --primary-soft: #FEF0E8; --primary-soft-2: #FCE0D0;
  --teal: #0A5F6B; --teal-hover: #084C56; --teal-soft: #E6F1F2;
  --bg: #FFF8F5; --surface: #FFFFFF;
  --border: #EDEFF1; --border-strong: #E0E4E7;
  --ink: #1F2A30; --ink-sub: #6E7B82; --ink-faint: #9AA6AC;
  --success: #2E9E5B; --success-soft: #E7F5EC;
  --warning: #D9930D; --warning-soft: #FCF3E2;
  --danger: #D64545; --danger-soft: #FBEAEA;
  --radius-lg: 16px; --radius-md: 12px; --radius-sm: 8px;
  --shadow-md: 0 4px 16px rgba(31, 42, 48, .08);
  --shadow-sm: 0 1px 4px rgba(31, 42, 48, .06);
  --sidebar-w: 236px; --topbar-h: 60px;
  --font: 'Noto Sans SC', 'Source Han Sans SC', 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font); background: var(--bg); color: var(--ink);
  font-size: 14px; line-height: 1.6; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--ink); }
svg { display: block; }

/* ================= 壳布局：侧边栏 + 顶栏 + 内容 ================= */

.app { min-height: 100vh; }

.app-nav {
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w);
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 60;
  transition: transform .25s ease;
}
.brand {
  height: var(--topbar-h); display: flex; align-items: center; gap: 10px;
  padding: 0 18px; border-bottom: 1px solid var(--border); flex: none;
}
.brand-logo {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary) 0%, #F98B4E 100%);
  color: #fff; display: flex; align-items: center; justify-content: center;
}
.brand-logo svg { width: 19px; height: 19px; }
.brand-name { font-size: 16px; font-weight: 800; letter-spacing: .5px; }
.brand-name small { display: block; font-size: 10.5px; font-weight: 500; color: var(--ink-faint); letter-spacing: 2px; }

.nav-scroll { flex: 1; overflow-y: auto; padding: 12px 12px 16px; }
.nav-sec { font-size: 11px; color: var(--ink-faint); font-weight: 600; letter-spacing: 1px; padding: 14px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px;
  border-radius: var(--radius-sm); color: var(--ink-sub); font-size: 14px;
  font-weight: 500; margin-bottom: 2px; transition: .15s;
}
.nav-item svg { width: 18px; height: 18px; flex: none; }
.nav-item:hover { background: var(--bg); color: var(--ink); }
.nav-item.on { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.nav-item .nv-badge {
  margin-left: auto; background: var(--danger); color: #fff; font-size: 11px;
  font-weight: 700; border-radius: 10px; padding: 0 7px; line-height: 18px; min-width: 18px; text-align: center;
}
.nav-foot { flex: none; border-top: 1px solid var(--border); padding: 12px 16px; }
.nv-user { display: flex; align-items: center; gap: 10px; }
.nv-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--teal-soft);
  color: var(--teal); display: flex; align-items: center; justify-content: center; flex: none;
}
.nv-avatar svg { width: 18px; height: 18px; }
.nv-user .u-name { font-size: 13.5px; font-weight: 700; }
.nv-user .u-sub { font-size: 11px; color: var(--ink-faint); }

.app-main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }

.app-topbar {
  height: var(--topbar-h); background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; padding: 0 20px;
  position: sticky; top: 0; z-index: 50;
}
.tb-burger {
  display: none; width: 38px; height: 38px; border-radius: var(--radius-sm);
  color: var(--ink-sub); align-items: center; justify-content: center;
}
.tb-burger svg { width: 21px; height: 21px; }
.tb-title { font-size: 17px; font-weight: 800; }
.tb-sub { font-size: 12px; color: var(--ink-faint); margin-left: 2px; }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.tb-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600;
  color: var(--ink-sub); background: var(--bg); border: 1px solid var(--border);
  border-radius: 999px; padding: 5px 12px;
}
.tb-chip svg { width: 14px; height: 14px; color: var(--teal); }

.app-content { flex: 1; padding: 20px; max-width: 1180px; width: 100%; margin: 0 auto; }

/* 移动抽屉遮罩 */
.drawer-mask {
  position: fixed; inset: 0; background: rgba(31, 42, 48, .45); z-index: 55;
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
body.drawer-open .drawer-mask { opacity: 1; pointer-events: auto; }

/* ================= 组件：卡片 / 统计 ================= */

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px; margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.card-title {
  display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 700;
  margin-bottom: 12px;
}
.card-title svg { width: 17px; height: 17px; color: var(--primary); }
.card-title .ct-extra { margin-left: auto; font-size: 12.5px; font-weight: 500; color: var(--ink-faint); }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 14px 16px; box-shadow: var(--shadow-sm); display: block; transition: .15s;
}
.stat:hover { border-color: var(--primary-soft-2); box-shadow: var(--shadow-md); }
.stat .st-ico {
  width: 34px; height: 34px; border-radius: var(--radius-sm); margin-bottom: 10px;
  display: flex; align-items: center; justify-content: center;
}
.stat .st-ico svg { width: 17px; height: 17px; }
.st-ico.orange { background: var(--primary-soft); color: var(--primary); }
.st-ico.teal { background: var(--teal-soft); color: var(--teal); }
.st-ico.green { background: var(--success-soft); color: var(--success); }
.st-ico.red { background: var(--danger-soft); color: var(--danger); }
.stat .st-num { font-size: 24px; font-weight: 800; line-height: 1.2; }
.stat .st-num em { font-style: normal; font-size: 13px; font-weight: 600; color: var(--ink-faint); margin-left: 2px; }
.stat .st-label { font-size: 12.5px; color: var(--ink-sub); margin-top: 2px; }

/* ================= 组件：表格（移动端自动卡片化） ================= */

.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; font-size: 12px; color: var(--ink-faint); font-weight: 600;
  padding: 9px 12px; border-bottom: 1px solid var(--border-strong); white-space: nowrap;
}
.tbl td { padding: 12px; border-bottom: 1px solid var(--border); font-size: 13.5px; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: var(--bg); }
.tbl .td-strong { font-weight: 700; }
.tbl .td-sub { font-size: 12px; color: var(--ink-sub); }
.tbl .td-num { font-weight: 800; white-space: nowrap; }

/* ================= 组件：标签 / 按钮 / 表单 ================= */

.tag {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600;
  border-radius: 999px; padding: 2px 10px; line-height: 20px; white-space: nowrap;
}
.tag svg { width: 12px; height: 12px; }
.tag-primary { background: var(--primary-soft); color: var(--primary); }
.tag-neutral { background: var(--bg); color: var(--ink-sub); border: 1px solid var(--border); }
.tag-done    { background: var(--success-soft); color: var(--success); }
.tag-serving { background: var(--teal-soft); color: var(--teal); }
.tag-review  { background: var(--warning-soft); color: var(--warning); }
.tag-reject  { background: var(--danger-soft); color: var(--danger); }
.tag-todo    { background: var(--primary-soft); color: var(--primary); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 13.5px; font-weight: 700; border-radius: var(--radius-sm);
  padding: 9px 16px; transition: .15s; white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-teal { background: var(--teal); color: #fff; }
.btn-teal:hover { background: var(--teal-hover); }
.btn-ghost { background: var(--surface); color: var(--ink-sub); border: 1px solid var(--border-strong); }
.btn-ghost:hover { color: var(--primary); border-color: var(--primary); }
.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-soft:hover { background: var(--primary-soft-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #B93A3A; }
.btn-lg { font-size: 15px; padding: 12px 20px; }
.btn-sm { font-size: 12.5px; padding: 6px 12px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field label .req { color: var(--danger); margin-left: 2px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 10px 12px; background: var(--surface); outline: none; transition: .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
.field textarea { resize: vertical; min-height: 72px; }
.field .field-err { display: none; font-size: 12px; color: var(--danger); margin-top: 4px; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--danger); }
.field.invalid .field-err { display: block; }
.field .f-hint { font-size: 12px; color: var(--ink-faint); margin-top: 4px; }

.seg { display: flex; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; gap: 3px; flex-wrap: wrap; }
.seg button {
  flex: 1; font-size: 13px; font-weight: 600; color: var(--ink-sub);
  border-radius: 6px; padding: 7px 10px; transition: .15s; white-space: nowrap;
}
.seg button.on { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); font-weight: 700; }

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 13.5px; }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--ink-sub); flex: none; }
.kv .v { font-weight: 600; text-align: right; }

/* ================= 组件：弹窗 / 提示 / 空态 / 骨架 ================= */

.modal-mask {
  position: fixed; inset: 0; background: rgba(31, 42, 48, .5); z-index: 90;
  display: flex; align-items: center; justify-content: center; padding: 18px;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-mask.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--surface); border-radius: var(--radius-lg); width: 100%;
  max-width: 560px; max-height: 88vh; overflow-y: auto; padding: 20px;
  box-shadow: var(--shadow-md); transform: translateY(10px); transition: transform .2s;
}
.modal-mask.open .modal { transform: translateY(0); }
.modal-sm { max-width: 420px; }
.modal-title {
  display: flex; align-items: center; font-size: 16px; font-weight: 800; margin-bottom: 14px;
}
.modal-title button { margin-left: auto; color: var(--ink-faint); display: flex; padding: 4px; }
.modal-title button:hover { color: var(--danger); }
.modal-title button svg { width: 18px; height: 18px; }

#toast {
  position: fixed; left: 50%; bottom: 36px; transform: translateX(-50%) translateY(16px);
  background: var(--ink); color: #fff; font-size: 13.5px; font-weight: 600;
  border-radius: 999px; padding: 10px 20px; z-index: 120; opacity: 0;
  pointer-events: none; transition: .25s; box-shadow: var(--shadow-md); max-width: 86vw; text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--danger); }

.empty { text-align: center; padding: 44px 16px; color: var(--ink-faint); }
.empty svg { width: 44px; height: 44px; margin: 0 auto 10px; opacity: .5; }
.empty .e-t { font-size: 14.5px; font-weight: 600; color: var(--ink-sub); }
.empty .e-d { font-size: 12.5px; margin-top: 3px; }

.skel { background: linear-gradient(90deg, var(--bg) 25%, var(--border) 50%, var(--bg) 75%); background-size: 200% 100%; animation: skel 1.1s infinite; border-radius: var(--radius-sm); }
@keyframes skel { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skel-line { height: 38px; margin-bottom: 10px; }
.skel-card { height: 88px; margin-bottom: 12px; border-radius: var(--radius-md); }
.skel-bar { height: 14px; margin-bottom: 8px; }

/* 通用排版 */
.t-sub { font-size: 12.5px; color: var(--ink-sub); }
.t-faint { font-size: 12px; color: var(--ink-faint); }
.t-big { font-size: 20px; font-weight: 800; }
.money { color: var(--primary); font-weight: 800; }
.flex { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.mb-12 { margin-bottom: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.reveal { animation: reveal .35s ease both; }
@keyframes reveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* 凭证照片格（审核页复用） */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo-cell {
  position: relative; aspect-ratio: 4/3; border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid var(--border-strong);
}
.photo-cell .ph-link {
  position: absolute; left: 0; right: 0; bottom: 0; font-size: 10.5px; line-height: 1.4;
  background: rgba(31, 42, 48, .58); color: #fff; padding: 4px 7px; word-break: break-all;
}
.photo-cell .ph-badge {
  position: absolute; top: 6px; left: 6px; background: rgba(31, 42, 48, .55); color: #fff;
  font-size: 10.5px; font-weight: 600; border-radius: 6px; padding: 2px 7px;
}

/* 关键项徽标 */
.badge-key {
  display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 700;
  color: var(--danger); background: var(--danger-soft); border-radius: 5px; padding: 1px 6px;
}
.badge-key svg { width: 11px; height: 11px; }

/* 打卡项列表（评估 / 审核复用） */
.check-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 8px;
  cursor: pointer; transition: .15s; background: var(--surface);
}
.check-item:hover { border-color: var(--primary-soft-2); }
.check-item .ck {
  flex: none; width: 20px; height: 20px; border: 2px solid var(--border-strong);
  border-radius: 6px; display: flex; align-items: center; justify-content: center;
  color: transparent; transition: .15s; margin-top: 1px;
}
.check-item .ck svg { width: 13px; height: 13px; }
.check-item.checked { border-color: var(--primary); background: var(--primary-soft); }
.check-item.checked .ck { background: var(--primary); border-color: var(--primary); color: #fff; }
.ci-name { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ci-note { font-size: 12px; color: var(--ink-sub); margin-top: 2px; }

/* 三档单选（评估项） */
.opt-row { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.opt {
  flex: 1; min-width: 76px; text-align: center; font-size: 12.5px; font-weight: 600;
  border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 6px 8px; color: var(--ink-sub); transition: .15s;
}
.opt.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 700; }

/* 候选护工行（派单弹窗） */
.cand {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 8px;
  cursor: pointer; transition: .15s;
}
.cand:hover { border-color: var(--primary-soft-2); }
.cand.on { border-color: var(--primary); background: var(--primary-soft); }
.cand.dis { opacity: .5; cursor: not-allowed; }
.cand .cd-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--teal-soft); color: var(--teal);
  display: flex; align-items: center; justify-content: center; flex: none;
}
.cand .cd-avatar svg { width: 18px; height: 18px; }
.cand .cd-main { flex: 1; min-width: 0; }
.cand .cd-name { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cand .cd-sub { font-size: 12px; color: var(--ink-sub); }
.cand .cd-ck {
  flex: none; width: 20px; height: 20px; border: 2px solid var(--border-strong);
  border-radius: 50%; display: flex; align-items: center; justify-content: center; color: transparent;
}
.cand.on .cd-ck { background: var(--primary); border-color: var(--primary); color: #fff; }
.cand .cd-ck svg { width: 12px; height: 12px; }

/* 响应式：≤960px 抽屉化 */
@media (max-width: 960px) {
  .app-nav { transform: translateX(-100%); box-shadow: var(--shadow-md); }
  body.drawer-open .app-nav { transform: none; }
  .app-main { margin-left: 0; }
  .tb-burger { display: flex; }
  .app-content { padding: 14px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
/* 响应式：≤720px 表格转卡片 */
@media (max-width: 720px) {
  .tbl-wrap table.tbl, .tbl-wrap tbody, .tbl-wrap tr, .tbl-wrap td { display: block; width: 100%; }
  .tbl-wrap thead { display: none; }
  .tbl-wrap tr {
    border: 1px solid var(--border); border-radius: var(--radius-md);
    padding: 6px 4px; margin-bottom: 10px; background: var(--surface);
  }
  .tbl-wrap tr:hover { background: var(--surface); }
  .tbl-wrap td { border-bottom: 1px dashed var(--border); padding: 8px 12px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  .tbl-wrap td:last-child { border-bottom: none; }
  .tbl-wrap td::before {
    content: attr(data-th); font-size: 12px; color: var(--ink-faint); font-weight: 600; flex: none;
  }
  .tbl-wrap td.td-actions { justify-content: flex-end; }
  .tbl-wrap td.td-actions::before { display: none; }
  .stat-grid { gap: 8px; }
  .tb-title { font-size: 15.5px; }
}
/* 响应式：≤480px 单列微调 */
@media (max-width: 480px) {
  .app-content { padding: 12px 10px; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .modal { padding: 16px; }
}
