/* ==========================================================
   云账通 · 多租户前端样式
   颜色约定：涨=红(#f5455c) 跌=绿(#12b886)
   ========================================================== */
:root {
  --primary: #2f6bff;
  --primary-dk: #1e4fd6;
  --up: #f5455c;
  --down: #12b886;
  --ok: #12b886;
  --warn: #f59f00;
  --danger: #f5455c;
  --info: #15aabf;

  --bg: #f4f6fa;
  --panel: #ffffff;
  --bg-side: #131a2b;
  --bg-side-2: #1b2438;
  --line: #e8ecf3;
  --line-2: #eef1f6;

  --tx: #1f2937;
  --tx-2: #5b6674;
  --tx-3: #8b95a5;
  --tx-inv: #e8eefc;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 2px 10px rgba(24, 39, 75, 0.06);
  --shadow-lg: 0 12px 40px rgba(24, 39, 75, 0.16);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 14px; color: var(--tx); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; cursor: pointer; }
b, strong { font-weight: 600; }
em { font-style: normal; }
i { font-style: normal; }
input, select, button, textarea { font-family: inherit; font-size: 14px; outline: none; }

.muted { color: var(--tx-3); }
.text-up { color: var(--up); }
.text-down { color: var(--down); }
.text-warn { color: var(--warn); }
.text-danger { color: var(--danger); }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.mb12 { margin-bottom: 12px; }

/* ================= 登录页 ================= */
.login-wrap {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0f1729 0%, #1b2a4a 55%, #24406e 100%);
  padding: 20px; z-index: 50;
}
.login-card {
  width: 100%; max-width: 460px; background: #fff; border-radius: 16px;
  padding: 38px 40px 30px; box-shadow: var(--shadow-lg);
}
.login-brand { text-align: center; margin-bottom: 26px; }
.login-logo {
  width: 58px; height: 58px; margin: 0 auto 14px; border-radius: 16px;
  background: linear-gradient(135deg, var(--primary) 0%, #6f5cff 100%);
  color: #fff; font-size: 26px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 22px rgba(47, 107, 255, .35);
}
.login-brand h1 { font-size: 23px; letter-spacing: 2px; }
.login-brand p { color: var(--tx-3); font-size: 13px; margin-top: 6px; }

.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 13px; color: var(--tx-2); margin-bottom: 6px; }
.field > span i { color: var(--danger); }
.field input, .field select, .field textarea {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: #fbfcfe; transition: .15s;
}
.field textarea { height: auto; padding: 10px 12px; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary); background: #fff;
  box-shadow: 0 0 0 3px rgba(47, 107, 255, .12);
}
.field input:disabled { background: #f1f3f7; color: var(--tx-3); }
.inline-field { display: inline-flex; align-items: center; gap: 8px; }
.inline-field > span { font-size: 13px; color: var(--tx-2); white-space: nowrap; }
.inline-field input { height: 36px; padding: 0 10px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: #fff; }

.login-err { color: var(--danger); font-size: 13px; min-height: 20px; margin-bottom: 4px; }
.login-tip { margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--line); }
.lt-title { font-size: 12px; color: var(--tx-3); margin-bottom: 10px; }
.demo-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.demo-btn {
  text-align: left; padding: 8px 10px; border: 1px solid var(--line); background: #fbfcfe;
  border-radius: var(--radius-sm); cursor: pointer; transition: .15s;
}
.demo-btn:hover { border-color: var(--primary); background: #f3f7ff; }
.demo-btn b { display: block; font-size: 13px; }
.demo-btn em { font-size: 11px; color: var(--tx-3); }
.login-tip .muted { font-size: 12px; }

/* ================= 按钮 ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 16px; border: 1px solid transparent; border-radius: var(--radius-sm);
  cursor: pointer; background: #f1f3f7; color: var(--tx); transition: .15s; white-space: nowrap;
}
.btn:hover { filter: brightness(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dk); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--tx-2); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-block { width: 100%; }
.btn-sm { height: 30px; padding: 0 11px; font-size: 13px; }
.btn-danger-text { color: var(--danger); }
.icon-btn {
  width: 28px; height: 28px; border: none; background: transparent; cursor: pointer;
  color: var(--tx-3); border-radius: var(--radius-sm);
}
.icon-btn:hover { background: #f1f3f7; color: var(--tx); }

/* ================= 主框架 ================= */
.app { display: flex; align-items: flex-start; min-height: 100vh; width: 100%; }
.sidebar {
  width: 232px; flex: 0 0 232px; background: linear-gradient(180deg, #131a2b 0%, #16203a 100%);
  color: var(--tx-inv); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; max-height: 100vh; overflow-y: auto;
  z-index: 30;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: #2c3a55; border-radius: 3px; }

.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; }
.brand-logo {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), #6f5cff);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 17px; color: #fff;
}
.brand-text strong { display: block; font-size: 15px; letter-spacing: 1px; }
.brand-text em { font-size: 11px; color: #8494b5; display: block; margin-top: 2px;
  max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.book-switch {
  margin: 4px 12px 12px; padding: 10px 12px; border-radius: var(--radius);
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08);
  cursor: pointer; transition: .15s;
}
.book-switch:hover { background: rgba(255, 255, 255, .1); }
.bs-label { font-size: 11px; color: #8494b5; margin-bottom: 4px; }
.bs-cur { display: flex; align-items: center; justify-content: space-between; }
.bs-name { font-size: 13px; font-weight: 600; max-width: 150px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bs-arrow { color: #8494b5; font-size: 11px; }
.bs-meta { font-size: 11px; color: #6d7c9b; margin-top: 3px; }

.nav { flex: 1; padding: 4px 0 12px; }
.nav-group { margin-bottom: 6px; }
.nav-group-title {
  font-size: 11px; color: #5d6c8c; padding: 8px 18px 4px; letter-spacing: .5px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 18px;
  cursor: pointer; font-size: 13.5px; color: #b9c4da; transition: .12s;
  border-left: 2px solid transparent;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(47, 107, 255, .26), rgba(47, 107, 255, .04));
  color: #fff; border-left-color: var(--primary); font-weight: 600;
}
.nav-icon {
  width: 18px; height: 18px; flex: 0 0 18px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #8b98b8;
}
.nav-item:hover .nav-icon, .nav-item.active .nav-icon { color: inherit; }
/* 通用内联 SVG 图标（菜单、搜索结果等） */
svg.ic { width: 18px; height: 18px; display: block; }
.nav-icon svg.ic { width: 17px; height: 17px; }
.nav-empty { padding: 20px 18px; font-size: 12px; color: #6d7c9b; line-height: 1.8; }

.sidebar-foot { padding: 12px; border-top: 1px solid rgba(255, 255, 255, .08); }
.tenant-mini { font-size: 12px; margin-bottom: 10px; }
.tm-row { display: flex; justify-content: space-between; padding: 3px 2px; color: #8494b5; }
.tm-row b { color: #d5deef; font-weight: 600; }
.sidebar-foot .btn-ghost {
  background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .12); color: #cbd6ea;
}
.sidebar-foot .btn-ghost:hover { background: rgba(255, 255, 255, .12); color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
/* 移动端汉堡按钮（桌面端隐藏） */
.nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--tx); cursor: pointer; font-size: 16px; line-height: 1;
  flex-shrink: 0;
}
.nav-toggle:hover { background: #f4f6fa; }
.nav-mask { display: none; }
.topbar {
  height: 58px; flex-shrink: 0; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 22px;
  position: sticky; top: 0; z-index: 20; gap: 12px;
}
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.crumb { font-size: 14px; display: flex; align-items: center; gap: 8px; }
.crumb-group { color: var(--tx-3); }
.crumb-sep { color: var(--line); }
.crumb-cur { font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.global-search input {
  width: 220px; height: 34px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: 17px; background: #f7f9fc;
}
.global-search input:focus { border-color: var(--primary); background: #fff; }
.user-chip { display: flex; align-items: center; gap: 9px; cursor: pointer;
  padding: 4px 10px 4px 4px; border-radius: 20px; transition: .15s; }
.user-chip:hover { background: #f4f6fa; }
.uc-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), #6f5cff); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 600;
}
.uc-info b { display: block; font-size: 13px; line-height: 1.2; }
.uc-info em { font-size: 11px; color: var(--tx-3); }

.view { flex: 1; padding: 20px 22px 40px; min-width: 0; }

/* ================= 页面通用 ================= */
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 18px; flex-wrap: wrap;
}
.page-head h2 { font-size: 20px; }
.page-head .sub { font-size: 13px; color: var(--tx-3); margin-top: 5px; }
.page-head-sm { display: flex; align-items: center; justify-content: space-between;
  margin: 4px 0 14px; }
.page-head-sm h3 { font-size: 16px; }
.ph-actions { display: flex; gap: 8px; }

.page-bar { display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.filter-bar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.filter-input, .filter-select {
  height: 34px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: #fff;
}
.filter-input { min-width: 240px; }
.filter-input:focus, .filter-select:focus { border-color: var(--primary); }

/* KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi-grid.kpi-sm { grid-template-columns: repeat(4, 1fr); gap: 10px; }
.kpi {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
}
.kpi-label { font-size: 12.5px; color: var(--tx-3); margin-bottom: 7px; }
.kpi-value { font-size: 21px; font-weight: 700; letter-spacing: .3px; line-height: 1.25; }
.kpi-sm .kpi-value { font-size: 17px; }
.kpi-sub { font-size: 12px; color: var(--tx-3); margin-top: 6px; }

/* 卡片 */
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px; border-bottom: 1px solid var(--line-2);
}
.card-head h3 { font-size: 14.5px; }
.card-body { padding: 14px 16px; }
.card-body:has(.table-wrap) { padding: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

/* 表格 */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th {
  text-align: left; padding: 10px 12px; background: #f8fafd; color: var(--tx-2);
  font-weight: 600; font-size: 12.5px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); }
.data-table tbody tr:hover { background: #fafbfe; }
.data-table tbody tr.clickable { cursor: pointer; }
.data-table tfoot td { padding: 10px 12px; border-top: 2px solid var(--line); background: #f8fafd; }
.data-table .right, .data-table .align-right { text-align: right; }
.data-table .center { text-align: center; }
.data-table td.empty { text-align: center; color: var(--tx-3); padding: 34px 12px; }
.vtable td { padding: 5px 6px; }
.cell-input { width: 100%; height: 30px; padding: 0 8px; text-align: right;
  border: 1px solid var(--line); border-radius: var(--radius-sm); }

/* 标签 */
.tag {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px;
  border-radius: 4px; font-size: 12px; white-space: nowrap;
}
.tag-ok { background: rgba(18, 184, 134, .12); color: #0b8a63; }
.tag-danger { background: rgba(245, 69, 92, .12); color: #d12b42; }
.tag-warn { background: rgba(245, 159, 0, .14); color: #b87b00; }
.tag-info { background: rgba(21, 170, 191, .12); color: #0d7d8c; }
.tag-muted { background: #f1f3f7; color: var(--tx-3); }

/* 分页 */
.pager { display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-top: 1px solid var(--line-2); flex-wrap: wrap; gap: 10px; }
.pager-info { font-size: 12.5px; color: var(--tx-3); }
.pager-btns { display: flex; align-items: center; gap: 8px; }
.pager-cur { font-size: 12.5px; color: var(--tx-2); }

/* 警报 */
.alert { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; line-height: 1.7; }
.alert-info { background: #eef4ff; color: #24509c; border: 1px solid #d6e3ff; }
.alert-warn { background: #fff8e8; color: #9a6a00; border: 1px solid #ffe7b3; }
.alert-danger { background: #fdeef0; color: #b32338; border: 1px solid #fbd3d9; }

/* 信息列表 */
.info-list { list-style: none; }
.info-list li { padding: 7px 0 7px 2px; font-size: 13.5px; color: var(--tx-2);
  border-bottom: 1px dashed var(--line-2); line-height: 1.6; }
.info-list li:last-child { border-bottom: none; }

/* 待办 */
.todo-list { display: flex; flex-direction: column; }
.todo-item { display: flex; align-items: center; gap: 12px; padding: 11px 4px;
  border-bottom: 1px solid var(--line-2); cursor: pointer; }
.todo-item:last-child { border-bottom: none; }
.todo-item:hover { background: #fafbfe; }
.todo-num { width: 30px; height: 30px; border-radius: 8px; display: flex;
  align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
  background: #f1f3f7; color: var(--tx-3); }
.todo-num.has { background: rgba(245, 159, 0, .15); color: #b87b00; }
.todo-name { flex: 1; font-size: 13.5px; }
.todo-arrow { color: var(--tx-3); }

/* 标签页 */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab { padding: 9px 18px; cursor: pointer; font-size: 14px; color: var(--tx-2);
  border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--primary); }
.tab.cur { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* 图表 */
.chart-box { width: 100%; }
.chart { width: 100%; height: auto; display: block; }
.chart-axis { font-size: 10px; fill: #8b95a5; }
.legend { display: flex; gap: 16px; justify-content: center; margin-top: 8px; flex-wrap: wrap; }
.legend-col { flex-direction: column; gap: 9px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--tx-2); }
.legend-item i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend-item b { color: var(--tx); }
.legend-item em { color: var(--tx-3); font-size: 11.5px; margin-left: 2px; }

.donut-box { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.donut { width: 140px; height: 140px; flex-shrink: 0; }

.hbars { display: flex; flex-direction: column; gap: 11px; }
.hbar { display: grid; grid-template-columns: 130px 1fr 110px; align-items: center; gap: 10px; }
.hbar-label { font-size: 12.5px; color: var(--tx-2); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 9px; background: #f1f3f7; border-radius: 5px; overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 5px; transition: width .4s; }
.hbar-val { font-size: 12.5px; text-align: right; color: var(--tx); }

/* 现金流行 */
.cf-row { display: flex; justify-content: space-between; padding: 8px 2px;
  border-bottom: 1px dashed var(--line-2); font-size: 13.5px; }
.cf-row:last-child { border-bottom: none; }
.cf-net { border-top: 1px solid var(--line); border-bottom: none; margin-top: 4px; padding-top: 10px; }

/* 风险 / 洞察 / 诊断 */
.risk-item, .insight-item, .diag-item {
  border: 1px solid var(--line); border-left: 3px solid var(--info);
  border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 10px; background: #fbfcfe;
}
.risk-item:last-child, .insight-item:last-child, .diag-item:last-child { margin-bottom: 0; }
.risk-danger { border-left-color: var(--danger); background: #fef7f8; }
.risk-warn { border-left-color: var(--warn); background: #fffcf4; }
.risk-info { border-left-color: var(--info); }
.ri-head, .ii-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ri-head b, .ii-head b { font-size: 14px; }
.ri-body, .ii-body { font-size: 13px; color: var(--tx-2); line-height: 1.7; }
.ri-sug, .ii-sug, .di-sug { margin-top: 7px; font-size: 12.5px; color: #0d7d8c;
  background: rgba(21, 170, 191, .08); padding: 7px 10px; border-radius: var(--radius-sm); }

.diag-item { display: flex; gap: 12px; align-items: flex-start; }
.diag-item.ok { border-left-color: var(--ok); background: #f6fdfa; }
.diag-item.bad { border-left-color: var(--danger); background: #fef7f8; }
.di-icon { width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 13px; color: #fff; }
.diag-item.ok .di-icon { background: var(--ok); }
.diag-item.bad .di-icon { background: var(--danger); }
.di-main { flex: 1; }
.di-main b { display: block; font-size: 13.5px; margin-bottom: 3px; }
.di-main em { font-size: 12.5px; color: var(--tx-2); line-height: 1.6; display: block; }

/* 向导 / 步骤 */
.wizard-steps { display: flex; gap: 0; margin-bottom: 20px; flex-wrap: wrap; }
.wstep { display: flex; align-items: center; gap: 8px; padding: 10px 20px 10px 0;
  font-size: 13px; color: var(--tx-3); }
.wstep:not(:last-child)::after { content: '›'; margin-left: 20px; color: var(--line); }
.wstep span { width: 24px; height: 24px; border-radius: 50%; background: #f1f3f7;
  color: var(--tx-3); display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; }
.wstep.cur { color: var(--primary); font-weight: 600; }
.wstep.cur span { background: var(--primary); color: #fff; }

.migrate-steps { display: flex; align-items: center; gap: 10px; margin-bottom: 20px;
  flex-wrap: wrap; }
.ms-item { padding: 8px 16px; border-radius: 20px; background: #f1f3f7; font-size: 13px;
  color: var(--tx-2); }
.ms-item.cur { background: var(--primary); color: #fff; font-weight: 600; }
.ms-arrow { color: var(--line); }
.migrate-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.migrate-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 16px;
  text-align: center; cursor: pointer; transition: .15s; background: #fbfcfe; }
.migrate-card:hover { border-color: var(--primary); background: #f3f7ff; transform: translateY(-2px); }
.mc-icon { font-size: 26px; color: var(--primary); margin-bottom: 10px; }
.migrate-card b { display: block; font-size: 14px; margin-bottom: 5px; }
.migrate-card em { font-size: 12px; color: var(--tx-3); line-height: 1.6; }

/* 账套卡片 */
.book-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.book-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); }
.book-card.cur { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47, 107, 255, .1); }
.bc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.bc-head b { font-size: 15.5px; }
.bc-code { font-size: 12px; color: var(--tx-3); margin-bottom: 12px; }
.bc-rows { font-size: 13px; }
.bc-rows > div { display: flex; justify-content: space-between; padding: 5px 0;
  border-bottom: 1px dashed var(--line-2); }
.bc-rows > div:last-child { border-bottom: none; }
.bc-rows span { color: var(--tx-3); }
.bc-foot { display: flex; gap: 8px; margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--line-2); flex-wrap: wrap; }

/* 结转 */
.carry-list { display: flex; flex-direction: column; }
.carry-item { display: flex; align-items: center; gap: 14px; padding: 13px 4px;
  border-bottom: 1px solid var(--line-2); }
.carry-item:last-child { border-bottom: none; }
.ci-icon { width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: #eef4ff; color: var(--primary); display: flex; align-items: center;
  justify-content: center; font-size: 17px; }
.ci-main { flex: 1; }
.ci-main b { display: block; font-size: 14px; margin-bottom: 3px; }
.ci-main em { font-size: 12.5px; color: var(--tx-3); }

/* 权限矩阵 */
.perm-table th.center, .perm-table td.center { text-align: center; }
.perm-yes { color: var(--ok); font-weight: 700; }
.perm-no { color: #cfd6e0; }

/* 凭证录入 */
.vch-head { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  padding: 12px; background: #f8fafd; border-radius: var(--radius-sm); }
.vch-head > div span { display: block; font-size: 12px; color: var(--tx-3); margin-bottom: 4px; }
.vch-foot-bar { display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; }
.vsum { font-size: 13px; color: var(--tx-2); }
.vsum b { color: var(--tx); }
.v-sum, .v-acc, .v-d, .v-c { width: 100%; height: 30px; padding: 0 8px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.v-d, .v-c { text-align: right; }

/* 科目选择 */
.acc-pick-list { max-height: 320px; overflow-y: auto; }
.acc-pick { padding: 8px 12px; border-bottom: 1px solid var(--line-2);
  cursor: pointer; font-size: 13.5px; }
.acc-pick:hover { background: #f3f7ff; }
.acc-pick b { color: var(--primary); margin-right: 8px; }

/* 账套切换列表 */
.book-list { display: flex; flex-direction: column; gap: 8px; }
.book-item { display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  cursor: pointer; transition: .15s; }
.book-item:hover { border-color: var(--primary); background: #f3f7ff; }
.book-item.cur { border-color: var(--primary); background: #f3f7ff; }
.bi-main b { display: block; font-size: 14px; }
.bi-main em { font-size: 12px; color: var(--tx-3); }
.bi-side { display: flex; gap: 6px; }

/* 用户信息 */
.uinfo { font-size: 13.5px; }
.uinfo-row { display: flex; justify-content: space-between; padding: 7px 0;
  border-bottom: 1px dashed var(--line-2); }
.uinfo-row:last-child { border-bottom: none; }
.uinfo-row span { color: var(--tx-3); }
.uinfo-sep { height: 1px; background: var(--line); margin: 12px 0; }
.confirm-text { font-size: 14px; line-height: 1.8; }

/* 余额平衡条 */
.bal-bar { margin-top: 12px; padding: 10px 14px; background: #f8fafd;
  border-radius: var(--radius-sm); font-size: 13px; }
.bal-bar b { color: var(--tx); }

/* ================= 加载 / 空态 ================= */
.loading { padding: 60px; text-align: center; color: var(--tx-3); }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid #dbe2ed;
  border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite;
  vertical-align: -3px; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { padding: 48px 20px; text-align: center; color: var(--tx-3); }
.empty-icon { font-size: 34px; color: #dbe2ed; margin-bottom: 10px; }
.empty-state p { font-size: 14px; margin-bottom: 6px; }
.empty-state span { font-size: 12.5px; }

/* ================= Toast ================= */
.toast-wrap { position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  z-index: 9999; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.toast { display: flex; align-items: center; gap: 9px; padding: 10px 18px;
  background: #fff; border-radius: 24px; box-shadow: var(--shadow-lg);
  font-size: 13.5px; animation: toastIn .25s; border: 1px solid var(--line); }
.toast.out { opacity: 0; transform: translateY(-10px); transition: .25s; }
.toast-icon { width: 20px; height: 20px; border-radius: 50%; color: #fff; font-size: 12px;
  display: flex; align-items: center; justify-content: center; }
.toast-ok .toast-icon { background: var(--ok); }
.toast-err .toast-icon { background: var(--danger); }
.toast-warn .toast-icon { background: var(--warn); }
.toast-info .toast-icon { background: var(--info); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px); } }

/* ================= Modal ================= */
.modal-wrap { position: fixed; inset: 0; z-index: 9000; display: flex;
  align-items: center; justify-content: center; padding: 20px; }
.modal-mask { position: absolute; inset: 0; background: rgba(15, 23, 41, .5); }
.modal-box { position: relative; background: #fff; border-radius: 14px; width: 100%;
  max-width: 560px; max-height: 88vh; display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg); animation: modalIn .2s; }
@keyframes modalIn { from { opacity: 0; transform: scale(.96) translateY(10px); } }
.modal-head { display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 16px; }
.modal-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px;
  border-top: 1px solid var(--line); }

/* ================= 响应式 ================= */
@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh;
    transform: translateX(-100%); transition: transform .22s ease;
    z-index: 200;
  }
  .sidebar.open { transform: translateX(0); box-shadow: 8px 0 24px rgba(0, 0, 0, .3); }
  /* 遮罩层：仅在侧栏展开时可见 */
  .nav-mask {
    display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, .42); z-index: 150;
  }
  .nav-mask.show { display: block; }
  /* 移动端在顶栏显示汉堡按钮 */
  .nav-toggle { display: inline-flex !important; }
  .global-search { display: none; }
  .kpi-grid, .grid-3 { grid-template-columns: 1fr; }
  .hbar { grid-template-columns: 100px 1fr 90px; }
  .view { padding: 16px 14px 40px; }
}
