/* =========================================================
   PC 工作台样式
   ========================================================= */
:root { --side-w: 226px; }

body { background: #f1f5f9; }

.d-shell { display: flex; min-height: 100vh; }

/* ---------- 侧边栏 ---------- */
.d-side {
  width: var(--side-w); flex-shrink: 0; background: #0f172a;
  color: #cbd5e1; display: flex; flex-direction: column;
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 60;
}
.d-logo {
  padding: 20px 18px; display: flex; align-items: center; gap: 11px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.d-logo-mark {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: var(--brand-grad);
  display: grid; place-items: center; color: #fff; font-size: 18px; font-weight: 700;
}
.d-logo-name { font-size: 14.5px; font-weight: 700; color: #fff; line-height: 1.3; }
.d-logo-sub { font-size: 11px; color: #64748b; margin-top: 1px; }

.d-nav { flex: 1; padding: 14px 11px; overflow-y: auto; }
.d-nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 13px; border-radius: 9px; margin-bottom: 3px;
  color: #94a3b8; font-size: 14.5px; font-weight: 500;
  cursor: pointer; transition: .15s; text-decoration: none;
  position: relative;
}
.d-nav-item:hover { background: rgba(255, 255, 255, .06); color: #e2e8f0; }
.d-nav-item.active { background: var(--brand-grad); color: #fff; font-weight: 600; }
.d-nav-item .ico { font-size: 17px; width: 20px; text-align: center; }
.d-nav-badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 10px; background: #dc2626; color: #fff;
  font-size: 11.5px; font-weight: 700; display: grid; place-items: center;
}
.d-side-foot { padding: 14px 15px; border-top: 1px solid rgba(255, 255, 255, .08); }
.d-user { margin-bottom: 11px; }
.d-user .n { font-size: 14px; font-weight: 600; color: #e2e8f0; }
.d-user .r { font-size: 11.5px; color: #64748b; margin-top: 2px; }
.d-logout {
  width: 100%; padding: 9px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .13);
  background: transparent; color: #94a3b8; font-size: 13.5px; cursor: pointer;
  font-family: var(--font); transition: .15s;
}
.d-logout:hover { background: rgba(220, 38, 38, .16); border-color: rgba(220, 38, 38, .4); color: #fca5a5; }

/* ---------- 主区 ---------- */
.d-main { flex: 1; margin-left: var(--side-w); min-width: 0; display: flex; flex-direction: column; }
.d-topbar {
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 17px 27px; display: flex; align-items: center;
  justify-content: space-between; gap: 20px; position: sticky; top: 0; z-index: 50;
}
.d-page-title { font-size: 21px; font-weight: 800; letter-spacing: -.3px; }
.d-page-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.d-topbar-actions { display: flex; align-items: center; gap: 12px; }
.d-patient-pick { display: flex; align-items: center; gap: 9px; }
.d-patient-pick label { font-size: 13px; color: var(--muted); white-space: nowrap; }

.d-content { padding: 24px 27px 46px; flex: 1; }

/* ---------- 统计卡 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card {
  background: #fff; border-radius: 14px; padding: 18px 20px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat-card .label { font-size: 13px; color: var(--muted); margin-bottom: 7px; display: flex; align-items: center; gap: 6px; }
.stat-card .value { font-size: 30px; font-weight: 800; letter-spacing: -.7px; line-height: 1.1; }
.stat-card .value small { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.stat-card .foot { font-size: 12.5px; color: var(--muted); margin-top: 7px; }
.stat-card .accent {
  position: absolute; right: -18px; top: -18px; width: 84px; height: 84px;
  border-radius: 50%; opacity: .1;
}
.stat-card.brand .accent { background: var(--brand); }
.stat-card.ok .accent { background: var(--ok); }
.stat-card.warn .accent { background: var(--warn); }
.stat-card.danger .accent { background: var(--danger); }
.stat-card.brand .value { color: var(--brand); }
.stat-card.ok .value { color: var(--ok); }
.stat-card.warn .value { color: var(--warn); }
.stat-card.danger .value { color: var(--danger); }

/* ---------- 图表 ---------- */
.d-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.d-grid-3 { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
.chart-wrap { position: relative; height: 268px; }
.chart-wrap.sm { height: 216px; }

/* ---------- 患者卡片网格 ---------- */
.pt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(276px, 1fr)); gap: 16px; }
.pt-card {
  background: #fff; border-radius: 14px; padding: 18px;
  box-shadow: var(--shadow); cursor: pointer; transition: .18s;
  border: 1.5px solid transparent;
}
.pt-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #a5f3fc; }
.pt-head { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }
.pt-avatar {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 17px; font-weight: 700;
  background: linear-gradient(135deg, var(--brand-light), #e0f2fe); color: var(--brand-dark);
}
.pt-name { font-size: 16px; font-weight: 700; margin-bottom: 3px; }
.pt-meta { font-size: 12.5px; color: var(--muted); }
.pt-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.pt-metric { background: #f8fafc; border-radius: 9px; padding: 9px 11px; }
.pt-metric .k { font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.pt-metric .v { font-size: 16px; font-weight: 700; }
.pt-metric .v small { font-size: 10.5px; font-weight: 500; color: var(--muted); }

/* ---------- 筛选栏 ---------- */
.filter-bar {
  background: #fff; border-radius: 13px; padding: 15px 18px;
  box-shadow: var(--shadow); margin-bottom: 18px;
  display: flex; align-items: center; gap: 13px; flex-wrap: wrap;
}
.filter-bar .input { padding: 9px 12px; font-size: 14px; width: auto; min-width: 156px; }
.filter-bar label { font-size: 13px; color: var(--muted); }

/* ---------- 数据表增强 ---------- */
.tbl-card { background: #fff; border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.tbl-card-head {
  padding: 17px 20px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.row-badge { font-weight: 700; }
.level-pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600;
}

/* ---------- 详情面板 ---------- */
.detail-head {
  background: var(--brand-grad);
  border-radius: 14px; padding: 24px; color: #fff; margin-bottom: 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 22px; flex-wrap: wrap;
}
.detail-head .n { font-size: 23px; font-weight: 800; margin-bottom: 6px; }
.detail-head .m { font-size: 13.5px; opacity: .92; }
.detail-stats { display: flex; gap: 32px; flex-wrap: wrap; }
.detail-stat .k { font-size: 12px; opacity: .85; margin-bottom: 3px; }
.detail-stat .v { font-size: 23px; font-weight: 800; }
.detail-stat .v small { font-size: 12px; font-weight: 500; opacity: .85; }

/* ---------- 预警行 ---------- */
.alert-row {
  display: flex; gap: 14px; padding: 15px 20px;
  border-bottom: 1px solid #f1f5f9; align-items: flex-start;
}
.alert-row:last-child { border-bottom: none; }
.alert-row.danger { background: #fff7f7; }
.alert-row .ico-box {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 18px;
}
.alert-row.danger .ico-box { background: var(--danger-bg); }
.alert-row.warn .ico-box { background: var(--warn-bg); }
.alert-row .body { flex: 1; min-width: 0; }
.alert-row .t { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.alert-row .c { font-size: 13.5px; color: var(--ink-2); line-height: 1.6; margin-bottom: 5px; }
.alert-row .meta { font-size: 12px; color: var(--muted); }

/* ---------- 通用小卡 ---------- */
.mini-stat { background: #f8fafc; border-radius: 11px; padding: 13px 15px; }
.mini-stat .k { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.mini-stat .v { font-size: 20px; font-weight: 800; letter-spacing: -.4px; }
.mini-stat .v small { font-size: 11.5px; font-weight: 500; color: var(--muted); margin-left: 3px; }

@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .d-grid-2, .d-grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .d-side { width: 66px; }
  .d-logo-name, .d-logo-sub, .d-nav-item span:not(.ico):not(.d-nav-badge), .d-user, .d-logout { display: none; }
  .d-nav-item { justify-content: center; padding: 13px 8px; }
  .d-main { margin-left: 66px; }
  .stat-grid { grid-template-columns: 1fr; }
}
