/*
 * 颐养云 · 养老院 SaaS 管理系统
 * Copyright (c) 2026 颐养云. All rights reserved.
 * 商业授权软件：未经书面许可，不得复制、修改、反编译或分发。
 */
:root {
  --bg: #f4f6fa;
  --panel: #ffffff;
  --line: #e5e9f0;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-weak: #eff6ff;
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(20, 40, 80, .06);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--text); background: var(--bg);
}
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

/* ---------- 登录 ---------- */
#loginPage {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; padding: 28px 24px 18px;
  background:
    radial-gradient(900px 520px at 12% 8%, #e4edff 0%, rgba(228,237,255,0) 62%),
    radial-gradient(760px 460px at 92% 88%, #e2f6f1 0%, rgba(226,246,241,0) 64%),
    linear-gradient(160deg, #f3f7fe 0%, #f8fafc 55%, #eef6f7 100%);
}
.login-shell { width: min(1180px, 100%); display: grid; grid-template-columns: 1.12fr .88fr; gap: 30px; align-items: stretch; }

.login-visual {
  position: relative; border-radius: 24px; overflow: hidden; min-height: 610px;
  box-shadow: 0 26px 60px rgba(16, 44, 92, .18); background: #0f2a5c;
}
.lv-photo { position: absolute; inset: 0; }
.lv-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 52% 42%; display: block; }
.login-visual::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(10,30,70,.66) 0%, rgba(10,30,70,.10) 34%, rgba(8,24,56,.76) 100%);
}
.lv-brand { position: absolute; z-index: 2; top: 26px; left: 28px; display: flex; align-items: center; gap: 12px; color: #fff; }
.lv-mark {
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center;
  background: rgba(37, 99, 235, .92); box-shadow: 0 8px 18px rgba(9, 30, 70, .3);
}
.lv-mark svg { width: 26px; height: 26px; }
.lv-text b { display: block; font-size: 18px; letter-spacing: .6px; font-weight: 700; }
.lv-text i { font-style: normal; font-size: 12px; opacity: .85; letter-spacing: .5px; }
.lv-features {
  position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; margin: 0; padding: 0 10px 24px;
  list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
}
.lv-features li { text-align: center; color: #fff; padding: 0 6px; }
.lv-ico {
  width: 36px; height: 36px; border-radius: 50%; margin: 0 auto 8px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .32);
}
.lv-ico svg { width: 17px; height: 17px; }
.lv-features b { display: block; font-size: 13px; font-weight: 600; }
.lv-features em { display: block; font-style: normal; font-size: 11px; opacity: .78; margin-top: 3px; }

.login-panel { display: flex; align-items: center; justify-content: center; }
.login-card {
  width: 100%; max-width: 424px; background: #fff; border: 1px solid rgba(226, 234, 246, .9);
  border-radius: 22px; padding: 42px 38px 28px; box-shadow: 0 26px 60px rgba(16, 44, 92, .12);
}
.login-welcome { margin: 0; text-align: center; font-size: 26px; letter-spacing: 2px; font-weight: 700; }
.login-welcome-sub { margin: 8px 0 0; text-align: center; color: #8a94a6; font-size: 13px; }
.login-rule { display: block; width: 34px; height: 3px; border-radius: 3px; background: var(--primary); margin: 16px auto 26px; }
.lp-field { position: relative; margin-bottom: 14px; }
.lp-field .lp-ico {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: #9aa3b2; display: flex; pointer-events: none;
}
.lp-ico svg { width: 18px; height: 18px; }
.lp-field input {
  width: 100%; height: 46px; padding: 0 44px 0 42px; font-size: 14px; color: var(--text);
  border: 1px solid #e3e9f2; border-radius: 10px; background: #fbfcfe; outline: none; transition: .15s;
}
.lp-field input::placeholder { color: #aab3c2; }
.lp-field input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
.lp-eye {
  position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
  border: 0; background: none; color: #9aa3b2; padding: 8px; display: flex; border-radius: 8px;
}
.lp-eye:hover { color: #4b5563; background: #f3f6fb; }
.lp-eye svg { width: 18px; height: 18px; }
.lp-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: #6b7280; margin: 6px 0 20px; }
.lp-check { display: flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; }
.lp-check input { width: 15px; height: 15px; accent-color: var(--primary); }
.lp-link { border: 0; background: none; color: var(--primary); font-size: 13px; padding: 0; }
.lp-link:hover { text-decoration: underline; }
.lp-submit {
  width: 100%; height: 46px; border: 0; border-radius: 10px; color: #fff; font-size: 16px; letter-spacing: 2px;
  font-weight: 600; background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 10px 22px rgba(37, 99, 235, .28); transition: .18s;
}
.lp-submit:hover { filter: brightness(1.04); transform: translateY(-1px); }
.lp-submit:disabled { opacity: .72; cursor: default; transform: none; }
.login-error {
  margin-top: 12px; padding: 8px 10px; text-align: center; font-size: 13px; color: var(--danger);
  background: #fff5f5; border: 1px solid #fde2e2; border-radius: 8px;
}
.lp-browsers { margin-top: 24px; }
.lp-browsers-title { display: flex; align-items: center; gap: 10px; color: #a6afbf; font-size: 12px; }
.lp-browsers-title::before, .lp-browsers-title::after { content: ''; flex: 1; height: 1px; background: #eef2f7; }
.lp-browsers-list { display: flex; justify-content: center; gap: 16px; margin-top: 14px; font-size: 12px; color: #7b8598; flex-wrap: wrap; }
.lp-browsers-list span { display: flex; align-items: center; gap: 6px; }
.lp-browsers-list i { width: 9px; height: 9px; border-radius: 50%; }
.login-demo {
  margin-top: 20px; padding-top: 14px; border-top: 1px dashed #eef2f7;
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: #a6afbf;
}
.lp-chip { border: 1px solid #e3e9f2; background: #fff; color: #5b6577; font-size: 12px; padding: 3px 9px; border-radius: 999px; }
.lp-chip:hover { border-color: var(--primary); color: var(--primary); }
.login-foot { color: #9aa3b2; font-size: 12px; text-align: center; }
@media (max-width: 980px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-card { max-width: 440px; padding: 34px 26px 26px; }
}

/* ---------- 通用表单控件（登录页之外的页面共用） ---------- */
.field {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--text); outline: none;
}
.field:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
.field[readonly] { background: #f4f6fa; color: #8a94a6; cursor: not-allowed; }
.btn {
  border: 1px solid var(--line); background: #fff; color: var(--text);
  padding: 8px 14px; border-radius: 8px; transition: .15s;
}
.btn:hover { border-color: #c8d3e4; background: #f9fbfd; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-danger { color: var(--danger); }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.btn-block { width: 100%; padding: 11px; font-weight: 600; }
.login-mark {
  width: 40px; height: 40px; border-radius: 12px; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; flex: none;
}

/* ---------- 主框架 ---------- */
#app { display: flex; min-height: 100vh; }
#sidebar {
  width: 218px; flex: 0 0 218px; background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { padding: 20px 18px 16px; display: flex; gap: 10px; align-items: center; border-bottom: 1px solid var(--line); }
.brand-name { font-weight: 700; font-size: 16px; }
.brand-sub { font-size: 11px; color: var(--muted); }
.nav { padding: 12px 10px; overflow: auto; flex: 1; }
.nav-group { font-size: 11px; color: #9aa3b2; padding: 12px 10px 6px; letter-spacing: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 8px;
  color: #4b5563; cursor: pointer; margin-bottom: 2px;
}
.nav-item:hover { background: #f5f8fc; }
.nav-item.active { background: var(--primary-weak); color: var(--primary); font-weight: 600; }
.nav-dot { width: 6px; height: 6px; border-radius: 50%; background: #cbd5e1; }
.nav-item.active .nav-dot { background: var(--primary); }
.side-foot { padding: 12px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
#main { flex: 1; min-width: 0; }
#topbar {
  height: 58px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
  position: sticky; top: 0; z-index: 5;
}
.crumb { font-size: 13px; color: var(--muted); }
.crumb b { color: var(--text); font-size: 15px; }
.user-box { display: flex; align-items: center; gap: 12px; }
.badge { background: var(--primary-weak); color: var(--primary); padding: 3px 9px; border-radius: 20px; font-size: 12px; }
#content { padding: 22px 24px 40px; }

/* ---------- 通用组件 ---------- */
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.page-title { font-size: 20px; font-weight: 700; margin: 0; }
.page-desc { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-pad { padding: 18px; }
.grid { display: grid; gap: 14px; }
.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: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }
.stat { padding: 18px; }
.stat-label { color: var(--muted); font-size: 13px; }
.stat-value { font-size: 27px; font-weight: 700; margin-top: 6px; letter-spacing: -.5px; }
.stat-tip { font-size: 12px; color: var(--muted); margin-top: 4px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .field { width: auto; min-width: 150px; padding: 7px 10px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tab { padding: 9px 14px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.table-wrap { overflow: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: #f8fafc; color: #64748b; font-weight: 600; font-size: 12px; }
tbody tr:hover { background: #fafcff; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 12px; background: #f1f5f9; color: #475569; }
.tag-primary { background: var(--primary-weak); color: var(--primary); }
.tag-ok { background: #e8f8ef; color: var(--ok); }
.tag-warn { background: #fff6e6; color: var(--warn); }
.tag-danger { background: #feecec; color: var(--danger); }
.empty { text-align: center; color: var(--muted); padding: 36px 12px; }
.pager { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 12px; color: var(--muted); font-size: 13px; }
.kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 22px; }
@media (max-width: 780px) { .kv { grid-template-columns: repeat(2, 1fr); } }
.kv-item label { display: block; font-size: 12px; color: var(--muted); }
.kv-item div { padding: 3px 0; word-break: break-all; }
.section-title { font-size: 15px; font-weight: 700; margin: 0 0 12px; }
.app-card { padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.app-card .app-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.app-icon { width: 36px; height: 36px; border-radius: 9px; background: var(--primary-weak); color: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.app-desc { color: var(--muted); font-size: 13px; min-height: 38px; }
.switch { width: 42px; height: 23px; border-radius: 20px; background: #cbd5e1; position: relative; border: 0; transition: .2s; flex: none; }
.switch::after { content: ''; position: absolute; width: 17px; height: 17px; background: #fff; border-radius: 50%; top: 3px; left: 3px; transition: .2s; }
.switch.on { background: var(--primary); }
.switch.on::after { left: 22px; }
.bar-track { height: 8px; border-radius: 8px; background: #eef2f7; overflow: hidden; }
.bar-fill { height: 100%; background: var(--primary); border-radius: 8px; }

/* ---------- 弹层 / 提示 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .42); z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: #fff; border-radius: 12px; width: 640px; max-width: 100%;
  max-height: 88vh; display: flex; flex-direction: column; box-shadow: 0 24px 70px rgba(10, 25, 50, .24);
}
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; font-weight: 700; }
.modal-body { padding: 18px 20px; overflow: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
@media (max-width: 620px) { .form-grid { grid-template-columns: 1fr; } }
.form-item label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.form-item.full { grid-column: 1 / -1; }
.help { font-size: 12px; color: var(--muted); margin-top: 5px; }
#toast {
  position: fixed; top: 18px; right: 18px; z-index: 100; padding: 11px 16px;
  border-radius: 8px; background: #111827; color: #fff; box-shadow: var(--shadow); font-size: 13px;
}
#toast.ok { background: var(--ok); }
#toast.err { background: var(--danger); }
.loading { color: var(--muted); padding: 20px; text-align: center; }

/* ---------- v2.0：照片 / 明细行 / 财务强调 ---------- */
.avatar-sm { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); vertical-align: middle; }
.avatar-ph { display: inline-flex; align-items: center; justify-content: center; background: #e0e7ff; color: #3730a3; font-weight: 700; }
.detail-head { display: flex; gap: 14px; align-items: center; }
.detail-photo { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; border: 1px solid var(--line); flex: 0 0 auto; }
.photo-ph { display: flex; align-items: center; justify-content: center; background: #eef2ff; color: #4f46e5; font-size: 26px; font-weight: 700; }
.item-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; padding: 8px; background: #f8fafc; border-radius: 8px; }
.item-row .field { flex: 1 1 120px; min-width: 100px; }
.item-row button { flex: 0 0 auto; }
.text-danger { color: var(--danger); font-weight: 700; }
/* AI 助手对话 */
.ai-msgs { display: flex; flex-direction: column; gap: 10px; padding: 8px; background: #f8fafc; border-radius: 10px; }
.ai-msg { display: flex; }
.ai-msg.user { justify-content: flex-end; }
.ai-msg.assistant { justify-content: flex-start; }
.ai-bubble { max-width: 82%; padding: 10px 13px; border-radius: 12px; line-height: 1.75; font-size: 13px; white-space: normal; word-break: break-word; }
.ai-msg.user .ai-bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 3px; }
.ai-msg.assistant .ai-bubble { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 3px; }

/* ---------- 实时床位图（按分区的房态看板） ---------- */
.bedmap-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.bedmap-tab { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff;
  cursor: pointer; font-size: 13px; color: var(--text); transition: all .15s; }
.bedmap-tab:hover { border-color: var(--primary); color: var(--primary); }
.bedmap-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.bedmap-tab .cnt { opacity: .75; font-size: 12px; margin-left: 4px; }
.bedmap-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.bedmap-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
/* 房间按床位数量自适应宽度：2 床就只占 2 张床的宽度，房间之间同行排列，放不下才换行 */
.bedmap-rooms { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }
.bedmap-room {
  flex: 0 1 auto; min-width: 0; max-width: 100%; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px 12px 12px; background: #fbfcfe;
}
.bedmap-room-head {
  font-size: 13px; font-weight: 700; margin-bottom: 8px; display: flex;
  align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.bedmap-room-head .sub { font-weight: 400; color: var(--muted); font-size: 11.5px; }
.bedmap-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.bed-card {
  width: 112px; flex: 0 0 auto; border-radius: 8px; padding: 9px 10px; min-height: 70px;
  display: flex; flex-direction: column; justify-content: space-between; cursor: pointer;
  border: 1px solid transparent; transition: transform .12s, box-shadow .12s;
}
@media (max-width: 700px) { .bed-card { width: 104px; } }
.bed-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(20, 40, 80, .12); }
.bed-card .bed-code { font-size: 12px; opacity: .8; display: flex; justify-content: space-between; }
.bed-card .bed-name { font-size: 14px; font-weight: 700; line-height: 1.25; word-break: break-all; }
.bed-card .bed-meta { font-size: 11px; opacity: .8; margin-top: 2px; }
.bed-card.occupied { background: #feecec; border-color: #f7b6b6; color: #b91c1c; }
.bed-card.vacant { background: #e8f8ef; border-color: #a7e0bd; color: #15803d; }
.bed-card.reserved { background: #fff6e6; border-color: #f5d79a; color: #b45309; }
.bed-card.cleaning { background: #eef2f7; border-color: #d5dde8; color: #475569; }
.bed-card.maintenance { background: #f1f5f9; border-color: #cbd5e1; color: #64748b; }
.bedmap-sum { display: flex; gap: 20px; flex-wrap: wrap; font-size: 13px; margin-bottom: 12px; color: var(--muted); }
.bedmap-sum b { color: var(--text); font-size: 16px; }

/* ---------- 工作台看板（v3.0.5 重做） ---------- */
.dash-hero {
  position: relative; overflow: hidden; border-radius: 18px; padding: 26px 30px;
  display: flex; align-items: center; justify-content: space-between; gap: 26px; color: #fff;
  background: linear-gradient(118deg, #1e3a8a 0%, #2563eb 56%, #0d9488 100%);
  box-shadow: 0 16px 36px rgba(30, 64, 175, .22);
}
.dash-hero::before, .dash-hero::after {
  content: ''; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .07); pointer-events: none;
}
.dash-hero::before { width: 300px; height: 300px; right: -70px; top: -120px; }
.dash-hero::after { width: 210px; height: 210px; right: 160px; bottom: -140px; }
.dash-hero.is-platform { background: linear-gradient(118deg, #312e81 0%, #4338ca 58%, #0e7490 100%); }
.dash-hero-main { position: relative; z-index: 1; }
.dash-eyebrow { font-size: 12px; letter-spacing: 1.2px; opacity: .82; margin-bottom: 8px; }
.dash-title { margin: 0 0 6px; font-size: 25px; font-weight: 700; letter-spacing: .4px; }
.dash-sub { margin: 0; font-size: 13px; opacity: .88; }
.dash-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.dash-btn {
  border: 1px solid rgba(255, 255, 255, .34); background: rgba(255, 255, 255, .16); color: #fff;
  padding: 7px 15px; border-radius: 999px; font-size: 13px; transition: .16s;
}
.dash-btn:hover { background: rgba(255, 255, 255, .3); transform: translateY(-1px); }
.dash-hero-stat { position: relative; z-index: 1; text-align: center; flex: 0 0 auto; }
.ring { width: 128px; height: 128px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.ring-in {
  width: 100px; height: 100px; border-radius: 50%; background: rgba(13, 34, 86, .55);
  display: flex; flex-direction: column; align-items: center; justify-content: center; backdrop-filter: blur(2px);
}
.ring-in b { font-size: 24px; letter-spacing: -.5px; }
.ring-in span { font-size: 11px; opacity: .82; margin-top: 2px; }
.dash-hero-note { margin-top: 9px; font-size: 12px; opacity: .82; }
.dash-plat-badge {
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 16px; padding: 18px 26px; text-align: center; min-width: 140px;
}
.dash-plat-badge b { display: block; font-size: 30px; line-height: 1.2; }
.dash-plat-badge span { font-size: 12px; opacity: .85; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.kpi {
  display: flex; gap: 14px; align-items: flex-start; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 16px 18px; box-shadow: 0 2px 10px rgba(20, 40, 80, .05); transition: .18s;
}
.kpi:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(20, 40, 80, .1); }
.kpi-ico { width: 44px; height: 44px; border-radius: 13px; display: flex; align-items: center; justify-content: center; flex: none; }
.kpi-ico svg { width: 22px; height: 22px; }
.kpi-ico.indigo { background: #eef2ff; color: #4f46e5; }
.kpi-ico.green { background: #e8f8ef; color: #15803d; }
.kpi-ico.amber { background: #fff6e6; color: #b45309; }
.kpi-ico.blue { background: #eff6ff; color: #2563eb; }
.kpi-body { min-width: 0; }
.kpi-label { font-size: 12.5px; color: var(--muted); }
.kpi-value { font-size: 23px; font-weight: 700; letter-spacing: -.4px; margin: 2px 0 2px; color: #101828; white-space: nowrap; }
.kpi-foot { font-size: 11.5px; color: #8a94a6; }

.dash-split { display: grid; grid-template-columns: 1.62fr 1fr; gap: 14px; margin-top: 16px; }
.dash-thirds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
@media (max-width: 1200px) {
  .dash-split, .dash-thirds { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .dash-hero { flex-direction: column; align-items: flex-start; }
}

.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.panel-sub { font-size: 12px; color: var(--muted); }
.chart-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.lg-income { background: #2563eb; }
.lg-expense { background: #f59e0b; }
.trend-svg { width: 100%; height: auto; display: block; }
.chart-grid { stroke: #eef2f7; stroke-width: 1; }
.chart-axis { fill: #9aa3b2; font-size: 10px; }
.line-income { fill: none; stroke: #2563eb; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.line-expense { fill: none; stroke: #f59e0b; stroke-width: 2; stroke-dasharray: 5 4; stroke-linejoin: round; }
.dot-income { fill: #2563eb; stroke: #fff; stroke-width: 1.5; }
.dot-expense { fill: #f59e0b; stroke: #fff; stroke-width: 1.5; }
.chart-foot { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; }

.donut-wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.donut-svg { width: 140px; height: 140px; flex: none; }
.donut-num { font-size: 21px; font-weight: 700; fill: #101828; }
.donut-cap { font-size: 10px; fill: #8a94a6; }
.donut-legend { flex: 1; min-width: 120px; display: flex; flex-direction: column; gap: 9px; }
.donut-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #475569; }
.donut-row i { width: 9px; height: 9px; border-radius: 3px; }
.donut-row b { margin-left: auto; color: #101828; }
.donut-row em { font-style: normal; color: #98a2b3; width: 36px; text-align: right; }

.todo-list { display: flex; flex-direction: column; gap: 2px; }
.todo-item { display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-radius: 8px; cursor: pointer; transition: .15s; }
.todo-item:hover { background: #f7faff; }
.todo-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.todo-dot.warn { background: #f59e0b; }
.todo-dot.danger { background: #ef4444; }
.todo-dot.primary { background: #2563eb; }
.todo-name { font-size: 13px; color: #475569; }
.todo-num { margin-left: auto; font-size: 15px; color: #101828; }

.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 10px; align-items: flex-start; padding: 9px 4px; border-bottom: 1px dashed #eef2f7; }
.feed-item:last-child { border-bottom: 0; }
.feed-item.is-link { cursor: pointer; }
.feed-item.is-link:hover { background: #f9fbff; }
.feed-dot { width: 7px; height: 7px; border-radius: 50%; background: #c7d2fe; margin-top: 6px; flex: none; }
.feed-main { font-size: 13px; color: #1f2937; }
.feed-main em { font-style: normal; color: #98a2b3; font-size: 11.5px; margin-left: 4px; }
.feed-sub { font-size: 12px; color: #8a94a6; margin-top: 1px; word-break: break-all; }
.feed-item time { font-size: 11px; color: #a6afbf; margin-left: auto; white-space: nowrap; }
.mini-avatar {
  width: 26px; height: 26px; border-radius: 50%; background: #eef2ff; color: #4f46e5;
  font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none;
}

.mix-list { display: flex; flex-direction: column; gap: 11px; }
.mix-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: #475569; }
.mix-label { width: 68px; flex: none; }
.mix-track { flex: 1; height: 8px; border-radius: 8px; background: #eef2f7; overflow: hidden; }
.mix-track i { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, #93c5fd, #2563eb); }
.mix-track.is-green i { background: linear-gradient(90deg, #86efac, #16a34a); }
.mix-row b { width: 26px; text-align: right; color: #101828; }
.dash-quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.dash-quick-item {
  display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: #fbfcfe; font-size: 13px; color: #334155; transition: .15s;
}
.dash-quick-item:hover { border-color: var(--primary); color: var(--primary); background: #fff; }
@media (max-width: 900px) { .dash-quick { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
