/* 龙光记账 · 腾讯云控制台风格 UI
   规范：品牌蓝 #006eff / 白色顶栏 / 白色分组侧栏 / 浅灰内容区 / 小圆角卡片 / 紧凑控件 */
:root {
  /* 品牌色（腾讯云控制台 Tea Design） */
  --primary: #006eff;
  --primary-dark: #0052cc;
  --primary-hover: #2a7bff;
  --primary-light: #e8f1ff;
  --primary-light-2: #d3e4ff;
  /* 功能色 */
  --success: #0abf5b;
  --success-light: #e6f8ee;
  --warn: #ff9c1a;
  --warn-light: #fff4e5;
  --danger: #e54545;
  --danger-light: #fdecec;
  /* 中性色 */
  --bg: #f3f4f7;
  --card: #ffffff;
  --text: #1f2329;
  --text-2: #4b5563;
  --muted: #8a94a6;
  --border: #e7e9ef;
  --border-2: #d5d9e2;
  --fill: #f7f8fa;
  --fill-2: #f2f3f6;
  /* 圆角 / 阴影（控制台：小圆角、弱阴影） */
  --radius: 4px;
  --radius-lg: 6px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .03);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, .12);
  --header-h: 50px;
  --sidebar-w: 208px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5715;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

/* ---------- 登录 ---------- */
#loginPage {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  position: relative;
  background: #0d2a5e url('../login-bg.jpg') center center / cover no-repeat;
}
#loginPage::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(9,28,64,.62) 0%, rgba(16,52,118,.38) 55%, rgba(5,20,50,.62) 100%);
  z-index: 0;
}
#loginPage > * { position: relative; z-index: 1; }
.login-box {
  width: 100%; max-width: 420px;
  background: rgba(255,255,255,.98); backdrop-filter: blur(8px);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(0,0,0,.3);
  padding: 40px 38px;
}
.login-box .logo { text-align: center; margin-bottom: 28px; }
.login-box .logo-icon {
  width: 56px; height: 56px; margin: 0 auto 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff;
  border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 28px; box-shadow: 0 8px 20px rgba(0,110,255,.28);
}
.login-box h1 { font-size: 22px; margin-bottom: 4px; color: var(--text); letter-spacing: .5px; }
.login-box .sub { color: var(--muted); font-size: 13px; }
.login-box .field { margin-bottom: 16px; }
.login-box label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 7px; font-weight: 500; }
.login-box input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border-2);
  border-radius: var(--radius); outline: none; transition: border-color .15s, box-shadow .15s;
}
.login-box input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }
.login-tip {
  margin-top: 18px; padding: 11px 13px; background: var(--primary-light);
  border-radius: var(--radius); font-size: 12px; color: #1e40af; line-height: 1.7;
}
/* 登录方式切换 */
.login-tabs { display: flex; gap: 4px; margin-bottom: 22px; background: var(--fill); border-radius: 6px; padding: 4px; }
.login-tabs button {
  flex: 1; padding: 8px 0; border: 0; background: transparent; color: var(--text-2);
  border-radius: 4px; cursor: pointer; font-weight: 500; transition: all .15s;
}
.login-tabs button.active { background: #fff; color: var(--primary); box-shadow: var(--shadow); }
/* 扫码登录 */
.qr-login { text-align: center; }
.qr-box {
  width: 200px; height: 200px; margin: 0 auto 12px; border: 1px solid var(--border);
  border-radius: var(--radius-lg); background: #fff; display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
}
.qr-box img { width: 100%; height: 100%; object-fit: contain; }
.qr-box .qr-loading { color: var(--muted); font-size: 13px; }
.qr-box .qr-expired-mask {
  position: absolute; inset: 0; background: rgba(255,255,255,.95);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
}
.qr-code-num {
  font-size: 24px; font-weight: 700; letter-spacing: 6px; color: var(--primary);
  margin: 4px 0 2px; font-variant-numeric: tabular-nums;
}
.qr-hint { color: var(--muted); font-size: 12px; line-height: 1.7; margin-top: 6px; }
.qr-status { margin-top: 12px; font-size: 13px; color: var(--muted); min-height: 20px; }
.qr-status.ok { color: var(--success); font-weight: 600; }
.qr-refresh { display: inline-block; margin-top: 10px; color: var(--primary); cursor: pointer; font-size: 13px; }

/* ---------- 控制台主框架 ---------- */
#app { display: flex; flex-direction: column; min-height: 100vh; }
/* 顶部通栏（白色） */
.g-header {
  height: var(--header-h); flex: none;
  background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; position: sticky; top: 0; z-index: 40;
}
.g-header-left { display: flex; align-items: center; gap: 14px; }
.g-logo { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 600; color: var(--text); letter-spacing: .3px; }
.g-logo-mark {
  width: 26px; height: 26px; border-radius: 5px;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700;
}
.g-logo-text { white-space: nowrap; }
.g-header-divider { width: 1px; height: 18px; background: var(--border-2); }
.g-header-console { color: var(--text-2); font-size: 13px; }
.g-header-right { display: flex; align-items: center; gap: 14px; }
.g-header-env {
  font-size: 12px; color: var(--success); background: var(--success-light);
  padding: 2px 9px; border-radius: 10px;
}
/* 只读账号（老板）标识 */
.g-ro-badge {
  font-size: 12px; color: #b45309; background: #fff7e6; border: 1px solid #ffe1a8;
  padding: 1px 9px; border-radius: 10px; white-space: nowrap; font-weight: 600;
}
.g-icon-btn {
  width: 28px; height: 28px; border: 0; background: transparent; color: var(--text-2);
  border-radius: var(--radius); cursor: pointer; font-size: 17px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.g-icon-btn:hover { background: var(--fill); color: var(--primary); }
.g-user { display: flex; align-items: center; gap: 8px; }
.avatar-mini { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); flex: none; }
.avatar-fallback { display: inline-flex; align-items: center; justify-content: center; background: var(--primary-light); color: var(--primary); font-weight: 700; font-size: 12px; }
.g-user-name { font-size: 13px; color: var(--text); }
.g-role-tag { font-size: 11px; color: var(--primary); background: var(--primary-light); padding: 1px 8px; border-radius: 10px; }
.g-logout { border: 0; background: transparent; color: var(--text-2); cursor: pointer; font-size: 13px; padding: 4px 6px; }
.g-logout:hover { color: var(--primary); }

/* 主体：白色分组侧栏 + 浅灰内容区 */
.g-body { flex: 1; display: flex; min-height: 0; }
.sidebar {
  width: var(--sidebar-w); flex: none; background: #fff; color: var(--text-2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); z-index: 20;
}
.sidebar .nav { flex: 1; padding: 10px 0; overflow-y: auto; }
.nav-section {
  padding: 14px 20px 6px; font-size: 11px; color: var(--muted);
  letter-spacing: .5px; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 20px; margin: 1px 8px; border-radius: var(--radius);
  cursor: pointer; font-size: 13px; color: var(--text-2); transition: .12s;
  border-left: 2px solid transparent;
}
.nav-item:hover { background: var(--fill-2); color: var(--text); }
.nav-item.active { background: var(--primary-light); color: var(--primary); font-weight: 500; border-left-color: var(--primary); }
.nav-item .ico { width: 18px; text-align: center; font-size: 14px; flex: none; }
.nav-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar .foot { padding: 12px 20px; border-top: 1px solid var(--border); font-size: 11px; color: var(--muted); }

/* 三级菜单：二级菜单带展开箭头，三级为子分类节点 */
.nav-caret {
  margin-left: auto; font-size: 11px; line-height: 1; color: var(--muted); padding: 0 2px;
  transition: transform .15s; transform: rotate(-90deg); flex: none;
}
.nav-item:hover .nav-caret { color: var(--text); }
.nav-caret.open { transform: rotate(0deg); }
.nav-sub { padding: 2px 8px 6px 34px; }
.nav-sub-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px; margin: 1px 0;
  border-radius: 4px; font-size: 12.5px; color: var(--text-2); cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-sub-item:hover { background: var(--fill-2); color: var(--text); }
.nav-sub-item.active { background: var(--primary-light); color: var(--primary); font-weight: 500; }
.ns-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--border-2); flex: none; }
.nav-sub-item.active .ns-dot { background: var(--primary); }
.nav-sub-group {
  font-size: 10px; color: var(--muted); letter-spacing: .4px;
  padding: 7px 8px 3px; margin-top: 2px; border-top: 1px dashed var(--border);
}
.nav-sub-group:first-child { border-top: 0; padding-top: 3px; }
.ns-label { overflow: hidden; text-overflow: ellipsis; }
/* 分组型菜单（子分类管理）：本身只负责展开/收起 */
.nav-item.nav-group { color: var(--text-2); }
.nav-item.nav-group .nav-caret { display: block; }
.nav-sub-entry { color: var(--text); font-weight: 500; }
.nav-sub-entry .ns-dot { width: 6px; height: 6px; background: var(--primary); opacity: .55; }
.nav-sub-entry.active .ns-dot { opacity: 1; }

/* 分类管理（大分类属性） */
.cat-form .field { margin-bottom: 12px; }
.cat-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: 0; }
.cat-colors { display: flex; gap: 8px; flex-wrap: wrap; }
.cat-color {
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer; display: flex;
  align-items: center; justify-content: center; font-size: 10.5px; color: var(--text-2);
  border: 1px solid var(--border); background: var(--fill-2); user-select: none;
}
.cat-color.on { outline: 2px solid var(--primary); outline-offset: 1px; }
.cat-color:not([style*="background"]) { color: var(--muted); }
.cat-check { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-2); margin-top: 6px; cursor: pointer; }
.stat-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
tr.is-off .cat-swatch { opacity: .45; }

/* 子分类管理页 */
.sub-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.sub-form .field { margin: 0; }
.sub-form .field > label { white-space: nowrap; }
.sub-form-tip { font-size: 12px; color: var(--muted); margin-top: 10px; }
.sub-tip { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
/* 账目/模板明细表：带竖线分隔，避免一眼看串行 */
.grid-table th, .grid-table td { border-right: 1px solid var(--border); }
.grid-table th:last-child, .grid-table td:last-child { border-right: 0; }
.grid-table thead th { border-bottom: 1px solid var(--border-2); }
.grid-table tbody tr:nth-child(even) { background: #fcfcfd; }
.grid-table tfoot td { border-top: 1px solid var(--border-2); }

/* 表单模板 / 表格智能导入 */
.modal.wide { max-width: 1000px; }
.modal.mid { max-width: 760px; }
/* 图标预览编辑器 */
.logo-ed { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.logo-ed-stage { flex: none; }
.logo-ed-frame {
  position: relative; overflow: hidden; border-radius: 10px; cursor: grab;
  border: 1px dashed var(--border-2); touch-action: none;
  background-color: var(--fill-2);
  background-image:
    linear-gradient(45deg, rgba(0,0,0,.055) 25%, transparent 25%, transparent 75%, rgba(0,0,0,.055) 75%),
    linear-gradient(45deg, rgba(0,0,0,.055) 25%, transparent 25%, transparent 75%, rgba(0,0,0,.055) 75%);
  background-size: 16px 16px; background-position: 0 0, 8px 8px;
}
.logo-ed-frame.square { width: 236px; height: 236px; }
.logo-ed-frame.wide { width: 300px; height: 169px; }
.logo-ed-frame.dragging { cursor: grabbing; }
.logo-ed-frame > img { pointer-events: none; }
.logo-ed-tip { font-size: 12px; color: var(--muted); margin-top: 8px; max-width: 300px; line-height: 1.65; }
.logo-ed-panel { flex: 1; min-width: 250px; }
.logo-ed-panel .field { margin-bottom: 10px; }
.logo-ed-panel .field > label b { color: var(--primary); font-variant-numeric: tabular-nums; }
.logo-ed-range { width: 100%; accent-color: var(--primary); }
.logo-ed-mini {
  display: flex; gap: 22px; align-items: flex-end; margin-top: 14px;
  padding: 12px 14px; background: var(--fill-2); border-radius: 8px;
}
.logo-ed-mini-cell { text-align: center; }
.logo-ed-mini-cell .logo-frame.login { margin-bottom: 0; }
.logo-ed-mini-label { font-size: 11px; color: var(--muted); margin-top: 6px; }
.imp-sum { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); margin-bottom: 12px; }
.imp-sum .spacer { flex: 1; }
.imp-sec { font-size: 12px; font-weight: 600; color: var(--text-2); margin: 16px 0 8px; padding-left: 8px; border-left: 3px solid var(--primary); }
.imp-warn { background: #fff8e6; border: 1px solid #f5d68a; color: #8a5a00; border-radius: 6px; padding: 9px 12px; font-size: 12.5px; margin-bottom: 10px; }
.imp-warn.ok { background: #eef8f0; border-color: #b7dfc0; color: #21683a; }
.imp-map-wrap, .imp-prev { max-height: 260px; overflow: auto; border: 1px solid var(--border); border-radius: 6px; }
.imp-map td, .imp-map th { vertical-align: top; }
.imp-map tr.is-warn td { background: #fffdf5; }
.imp-new { display: flex; gap: 6px; margin-top: 6px; }
.imp-new .f { height: 30px; font-size: 12.5px; }
.imp-newlist { font-size: 13px; line-height: 1.9; background: var(--fill-2); border-radius: 6px; padding: 10px 12px; }
.imp-result { text-align: center; padding: 10px 0 4px; }
.imp-res-num { font-size: 34px; font-weight: 700; color: var(--primary); }
.imp-res-num span { font-size: 14px; color: var(--text-2); font-weight: 400; }
.imp-res-sub { font-size: 13px; color: var(--text-2); margin-top: 4px; }

/* 站点管理：图标 / ICO / 登录背景 */
/* 图标显示框：图片在框内定位/缩放，超出部分裁掉（站点管理里可预览调整） */
.logo-frame { position: relative; overflow: hidden; display: block; flex: none; }
.logo-frame > img {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  transform-origin: 50% 50%; user-select: none; -webkit-user-drag: none;
}
.logo-frame.g-hd.square { width: 26px; height: 26px; border-radius: 6px; }
.logo-frame.g-hd.wide { width: 58px; height: 32px; border-radius: 4px; }
.logo-frame.login { margin: 0 auto 14px; }
.logo-frame.login.square { width: 64px; height: 64px; border-radius: 14px; }
.logo-frame.login.wide { width: 168px; height: 94px; border-radius: 10px; }
.logo-frame.prev.square { width: 72px; height: 72px; border-radius: 8px; }
.logo-frame.prev.wide { width: 150px; height: 84px; border-radius: 8px; }
.site-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.site-grid .card { margin: 0; }
@media (max-width: 1180px) { .site-grid { grid-template-columns: 1fr; } }
.site-flex { display: flex; gap: 16px; align-items: flex-start; }
.site-prev-box {
  width: 152px; flex: none; min-height: 100px; padding: 10px; border-radius: 8px;
  background: var(--fill-2); display: flex; align-items: center; justify-content: center;
}
.site-prev-fav { width: 32px; height: 32px; object-fit: contain; }
.site-prev-empty { font-size: 12px; color: var(--muted); text-align: center; line-height: 1.7; }
.site-prev-empty span { font-size: 11px; opacity: .8; }
.site-prev-empty.square {
  width: 72px; height: 72px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; border: 1px dashed var(--border-2); border-radius: 8px;
}
.site-prev-empty.wide {
  width: 150px; height: 84px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; border: 1px dashed var(--border-2); border-radius: 8px;
}
.site-prev-empty.fav {
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--border-2); border-radius: 4px; font-size: 10px;
}
.site-prev-bgbox { border-radius: 8px; overflow: hidden; background: var(--fill-2); }
.site-prev-bg { width: 100%; height: 172px; object-fit: cover; display: block; }
.site-prev-empty.bg { height: 172px; display: flex; align-items: center; justify-content: center; border: 1px dashed var(--border-2); border-radius: 8px; }
.site-ratio { display: flex; gap: 12px; font-size: 13px; }
.site-ratio label {
  display: flex; align-items: center; gap: 6px; padding: 7px 12px;
  border: 1px solid var(--border); border-radius: 6px; cursor: pointer; color: var(--text-2);
}
.site-ratio label.on { border-color: var(--primary); background: var(--primary-light); color: var(--primary); font-weight: 500; }
.site-ratio label { white-space: nowrap; }
.site-ratio label input[type="radio"] { margin: 0; flex: none; }
.logo-ed-panel .site-ratio label { padding: 6px 10px; }
.sub-foot { color: var(--muted); font-size: 12px; }
a.link { color: var(--primary); cursor: pointer; text-decoration: none; }
a.link:hover { text-decoration: underline; }
.badge.ok { background: var(--success-light); color: var(--success); }
tr.is-off td { color: var(--muted); }
tr.is-off a.link { color: var(--muted); }
.common-chip.is-sub { border-style: dashed; border-color: var(--primary); color: var(--primary); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
.topbar {
  height: 42px; flex: none; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 20px;
  position: sticky; top: var(--header-h); z-index: 15;
}
.crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.crumb-root { color: var(--muted); }
.crumb-sep { color: var(--border-2); }
#pageTitle { color: var(--text); font-weight: 500; }
.content { padding: 18px 20px 60px; flex: 1; }
.demo-flag {
  background: var(--warn-light); color: #a85a12; padding: 7px 20px; font-size: 12px;
  border-bottom: 1px solid #ffe0b8; text-align: center;
}

/* ---------- 通用组件（控制台紧凑风格） ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); margin-bottom: 16px; }
.card-head {
  padding: 12px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; min-height: 48px;
}
.card-head h3 { font-size: 14px; font-weight: 600; color: var(--text); }
.card-head > div { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-body { padding: 18px; }
.g-muted { color: var(--muted); font-size: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  height: 30px; padding: 0 14px; border: 1px solid transparent; border-radius: var(--radius);
  background: var(--primary); color: #fff; cursor: pointer; font-weight: 500; font-size: 13px;
  transition: .12s; white-space: nowrap;
}
.btn:hover { background: var(--primary-hover); }
.btn:active { background: var(--primary-dark); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--text-2); border-color: var(--border-2); }
.btn.ghost:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-light); }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #cf3535; }
.btn.sm { height: 26px; padding: 0 10px; font-size: 12px; }
.btn.success { background: var(--success); }
.btn.success:hover { background: #09a04c; }
.btn.warn { background: var(--warn); }
.btn.warn:hover { background: #ec8b0b; }

input.f, select.f, textarea.f {
  width: 100%; height: 30px; padding: 0 10px; border: 1px solid var(--border-2);
  border-radius: var(--radius); outline: none; background: #fff; color: var(--text);
  transition: border-color .12s, box-shadow .12s;
}
input.f:hover, select.f:hover, textarea.f:hover { border-color: var(--primary-hover); }
input.f:focus, select.f:focus, textarea.f:focus { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }
input.f[readonly], input.f:disabled { background: var(--fill); color: var(--text-2); }
textarea.f { resize: vertical; min-height: 70px; height: auto; padding: 8px 10px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.field label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.req::after { content: " *"; color: var(--danger); }

.toolbar { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .field { min-width: 130px; }
.spacer { flex: 1; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; }
th { color: var(--text-2); font-weight: 600; background: var(--fill); white-space: nowrap; }
tbody tr:hover { background: var(--primary-light); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.actions { white-space: nowrap; }
td.actions .btn { margin-right: 5px; }
.table-wrap { overflow-x: auto; }

/* 月度报账单整篇编辑表格（列多，需紧凑 + 固定列宽） */
.rr-table { min-width: 900px; }
.rr-table th, .rr-table td { padding: 6px 6px; vertical-align: middle; }
.rr-table th { font-size: 12px; }
.rr-table .rr-day { max-width: 62px; }
.rr-table .rr-name { min-width: 150px; }
.rr-table .rr-amount { max-width: 100px; }
.rr-table .rr-note { min-width: 120px; }
.rr-table .rr-file-name { font-size: 11px; color: var(--muted); display: block; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rr-table input[readonly] { background: var(--fill); cursor: default; }
.rr-table tr.rr-total td { background: var(--fill); font-weight: 700; }

.empty { text-align: center; padding: 44px 20px; color: var(--muted); }

/* 汇总表样式 */
.summary-title { text-align: center; font-size: 20px; font-weight: 700; color: var(--text); padding: 6px 0 20px; letter-spacing: .5px; }
.summary-title small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 6px; letter-spacing: 0; }
.cat-block { margin-bottom: 20px; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.cat-head {
  padding: 11px 18px; font-weight: 600; font-size: 14px;
  background: linear-gradient(90deg, var(--primary-light), #fff);
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.cat-head .amount { color: var(--primary); font-size: 15px; }
.cat-total td { font-weight: 700; background: var(--fill); }
.grand-total {
  text-align: right; font-size: 17px; font-weight: 700; color: var(--danger);
  padding: 14px 20px; background: var(--danger-light); border-radius: var(--radius-lg);
}

/* 月度汇总：统计视图（点击区块下钻到对应分类报表） */
.sum-total-card {
  display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 22px 26px; margin-bottom: 16px;
  background: linear-gradient(120deg, #006eff 0%, #2a7bff 100%);
  border-radius: var(--radius-lg); color: #fff;
  box-shadow: 0 6px 18px rgba(0, 110, 255, .18);
}
.sum-total-card .stc-label { font-size: 13px; opacity: .92; letter-spacing: .3px; }
.sum-total-card .stc-value { font-size: 32px; font-weight: 700; line-height: 1.25; margin-top: 4px; font-variant-numeric: tabular-nums; }
.sum-total-card .stc-sub { font-size: 12px; opacity: .82; margin-top: 2px; }
.sum-total-card .stc-side { display: flex; gap: 34px; text-align: right; }
.sum-total-card .stc-side b { display: block; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sum-total-card .stc-side span { font-size: 12px; opacity: .85; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; align-items: start; }
.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 16px 18px 14px; cursor: pointer;
  display: flex; flex-direction: column;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.stat-card:hover { border-color: var(--primary); box-shadow: 0 6px 18px rgba(0, 110, 255, .12); transform: translateY(-1px); }
.stat-card.is-empty { background: var(--fill); }
.stat-card.is-empty .stat-amount { color: var(--muted); }
.stat-top { display: flex; justify-content: space-between; align-items: center; }
.stat-name { font-size: 14px; font-weight: 600; color: var(--text); }
.stat-go { font-size: 12px; color: var(--primary); opacity: 0; transition: opacity .15s; }
.stat-card:hover .stat-go { opacity: 1; }
.stat-amount { font-size: 25px; font-weight: 700; color: var(--text); margin: 10px 0 6px; font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.stat-meta { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); }
/* 子分类（按账目名头聚合的小计）：不限制高度、不出现滚动条，卡片按内容自适应 */
.stat-subs { margin: 10px 0 2px; padding-top: 8px; border-top: 1px dashed var(--border); }
.stat-sub { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 12px; }
.stat-sub .ss-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.stat-sub .ss-amt { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.stat-sub .ss-pct { width: 36px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.stat-subs.is-empty-sub { font-size: 12px; color: var(--muted); }
/* 「各人报账」并入山下账目：可点击下钻 */
.stat-sub.is-reimb { cursor: pointer; border-radius: 6px; padding: 4px 6px; margin: 0 -6px; background: var(--primary-light, rgba(0,110,255,.06)); }
.stat-sub.is-reimb:hover { background: rgba(0,110,255,.12); }
.stat-sub .ss-go { font-style: normal; color: var(--primary); font-size: 11px; }
/* 子分类「锁定用户」多选 */
.lock-list { display: flex; flex-wrap: wrap; gap: 6px 10px; max-height: 132px; overflow-y: auto; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--fill); }
.lock-item { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text); cursor: pointer;
  padding: 3px 8px; border-radius: 14px; background: #fff; border: 1px solid var(--border); }
.lock-item:has(input:checked) { border-color: var(--primary); color: var(--primary); background: rgba(0,110,255,.07); }
.lock-item input { margin: 0; }
.lock-item em { font-style: normal; font-size: 11px; color: var(--muted); }
.stat-bar { margin-top: auto; height: 4px; border-radius: 2px; background: var(--fill-2); overflow: hidden; margin-bottom: 8px; }
.stat-bar i { display: block; height: 100%; border-radius: 2px; background: linear-gradient(90deg, #006eff, #4a94ff); }
.stat-foot { font-size: 12px; color: var(--muted); }
.sum-tip { margin-top: 14px; font-size: 12px; color: var(--muted); }

/* 月度汇总：下钻后的单分类明细报表 */
.sum-detail-title h3 { font-size: 15px; }
.sum-detail-ops { justify-content: flex-end; }
.sum-detail-foot { color: var(--muted); font-size: 12px; border-top: 1px solid var(--border); }

.badge { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 12px; background: var(--primary-light); color: var(--primary); font-weight: 500; }
.badge.staff { background: var(--warn-light); color: #c25a13; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 3px; font-size: 12px; font-weight: 500; }
.tag.pending { background: var(--warn-light); color: #c25a13; }
.tag.approved { background: var(--success-light); color: #008a5c; }
.tag.rejected { background: var(--danger-light); color: #c93847; }
.voucher-link { color: var(--primary); text-decoration: none; font-size: 12px; }
.voucher-link:hover { text-decoration: underline; }

/* 常用费用项目快捷栏 */
.common-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 14px; margin-bottom: 14px;
  background: var(--primary-light); border: 1px solid var(--primary-light-2);
  border-radius: var(--radius);
}
.common-bar-label { font-size: 12px; color: var(--text-2); font-weight: 500; }
.common-chip {
  padding: 4px 11px; border: 1px solid var(--primary-light-2); border-radius: 14px;
  background: #fff; color: var(--primary); font-size: 12px; cursor: pointer; transition: .12s;
}
.common-chip:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.cm-row .cm-name { flex: 1; }
.cip-name { max-width: 360px; }

/* 模态框 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0, 10, 30, .45);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal {
  background: #fff; border-radius: var(--radius-lg); width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg);
  animation: modalIn .18s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
.modal-head { padding: 14px 20px; border-bottom: 1px solid var(--border); font-size: 15px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.modal-head .x { cursor: pointer; color: var(--muted); font-size: 20px; line-height: 1; }
.modal-head .x:hover { color: var(--text); }
.modal-body { padding: 20px; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.file-drop { border: 1px dashed var(--border-2); border-radius: var(--radius); padding: 18px; text-align: center; color: var(--muted); cursor: pointer; transition: .15s; }
.file-drop:hover { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.file-name { margin-top: 8px; font-size: 12px; color: var(--success); }

/* 提示 */
.toast {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: #fff; padding: 10px 22px; border-radius: var(--radius);
  z-index: 999; box-shadow: var(--shadow-lg); font-size: 13px;
  animation: slideDown .2s ease;
}
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }
@keyframes slideDown { from { opacity: 0; transform: translate(-50%, -10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- 欢迎页 ---------- */
.welcome-hero {
  background: linear-gradient(100deg, #006eff 0%, #2f88ff 60%, #5aa2ff 100%);
  color: #fff; border-radius: var(--radius-lg); padding: 26px 28px; margin-bottom: 18px;
  box-shadow: 0 6px 18px rgba(0,110,255,.18);
}
.wh-title { font-size: 22px; font-weight: 600; letter-spacing: .5px; }
.wh-sub { font-size: 13px; opacity: .9; margin-top: 8px; }
.welcome-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.welcome-tile {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px;
  background: #fff; cursor: pointer; transition: .12s;
}
.welcome-tile:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(0,110,255,.1); transform: translateY(-1px); }
.wt-ico { width: 30px; height: 30px; border-radius: 5px; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 15px; flex: none; }
.wt-label { font-size: 13px; color: var(--text); flex: 1; }
.wt-arrow { color: var(--muted); font-size: 18px; }

/* ---------- 占位页 ---------- */
.placeholder-box { text-align: center; padding: 46px 20px 52px; }
.ph-ico { width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 12px; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 26px; }
.ph-title { font-size: 17px; font-weight: 600; color: var(--text); }
.ph-sub { font-size: 13px; color: var(--muted); line-height: 1.9; margin-top: 10px; }

/* ---------- 权限管理 ---------- */
.perm-note {
  background: var(--primary-light); border: 1px solid var(--primary-light-2); color: var(--text-2);
  border-radius: var(--radius); padding: 11px 14px; font-size: 12.5px; line-height: 1.8; margin-bottom: 16px;
}
.perm-note b { color: var(--primary); }
.perm-roles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.perm-role { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; background: #fff; }
.perm-role.is-admin { border-color: var(--primary-light-2); background: linear-gradient(180deg, var(--primary-light), #fff 60%); }
.pr-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pr-name { font-size: 14px; font-weight: 600; color: var(--text); }
.pr-tag { font-size: 11px; color: #fff; background: var(--primary); padding: 1px 8px; border-radius: 10px; white-space: nowrap; }
.pr-tag.ghost { color: var(--muted); background: var(--fill); border: 1px solid var(--border); }
.pr-tag.ro { color: #b45309; background: #fff7e6; border: 1px solid #ffe1a8; }
.pr-code { font-size: 11px; color: var(--muted); margin-top: 6px; font-family: monospace; }
.pr-ops { margin-top: 10px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; min-height: 26px; }
.perm-table { min-width: 640px; }
.perm-table th, .perm-table td { padding: 8px 10px; }
.perm-table thead th { background: var(--fill); }
.perm-menu { min-width: 200px; }
.pm-ico { display: inline-block; width: 20px; text-align: center; margin-right: 6px; color: var(--primary); }
.pm-key { font-size: 11px; color: var(--muted); font-family: monospace; margin-left: 26px; }
.pm-off { font-size: 11px; color: var(--warn); background: var(--warn-light); padding: 1px 6px; border-radius: 3px; margin-left: 6px; }
.perm-group td { background: var(--fill-2); font-weight: 600; color: var(--text-2); font-size: 12px; padding: 7px 12px; }
.perm-col { text-align: center !important; min-width: 96px; }
.perm-col.admin-col { background: var(--primary-light) !important; }
.perm-cell { text-align: center !important; }
.perm-cell.admin-col { background: rgba(232,241,255,.5); }
.perm-cb { width: 14px; height: 14px; accent-color: var(--primary); cursor: pointer; margin: 0; vertical-align: -2px; }
.perm-cb:disabled { cursor: not-allowed; opacity: .6; }
/* 管理员列是「固定全选」的展示，保持清晰可读 */
.perm-cell.admin-col .perm-cb:disabled { opacity: .9; }
/* 查看 / 编辑 双勾（一个单元格两档） */
.perm-dual { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.perm-dual label { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-2); cursor: pointer; line-height: 1.25; white-space: nowrap; }
.perm-dual label:hover { color: var(--primary); }
.perm-dual input:disabled + span { opacity: .55; }
.perm-note .perm-lg { display: inline-block; font-weight: 600; color: var(--primary); background: #fff; border: 1px solid var(--primary-light-2); border-radius: 4px; padding: 0 6px; margin: 0 1px; }
.perm-off td { opacity: .55; }

@media (max-width: 860px) {
  :root { --sidebar-w: 100%; }
  .g-header { padding: 0 12px; }
  .g-header-console, .g-header-divider, .g-header-env, .g-user-name, .g-role-tag { display: none; }
  .g-body { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; border-right: 0; border-bottom: 1px solid var(--border); }
  .sidebar .nav { display: flex; overflow-x: auto; padding: 6px; }
  .nav-section, .sidebar .foot { display: none; }
  .nav-item { padding: 6px 12px; margin: 0; border-left: 0; white-space: nowrap; }
  .nav-item.active { border-left: 0; }
  .topbar { position: static; padding: 0 14px; }
  .content { padding: 14px 12px 40px; }
  .welcome-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* ===== 页面内页签（工资管理 等） ===== */
.page-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.pt-item {
  padding: 9px 16px; font-size: 13.5px; color: var(--text-2); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; user-select: none;
}
.pt-item:hover { color: var(--primary); }
.pt-item.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ===== 工资管理 ===== */
.pay-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.pay-kpi { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.pay-kpi span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.pay-kpi b { font-size: 19px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.pay-kpi b.muted { color: var(--text-2); font-weight: 600; }
.pay-kpi.hl { background: var(--primary-light); border-color: transparent; }
.pay-kpi.hl b { color: var(--primary); }
.pay-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: -4px 0 14px; }
.pay-chip {
  font-size: 12px; padding: 4px 10px; border-radius: 20px; background: var(--fill-2);
  color: var(--text-2); cursor: pointer; border: 1px solid transparent;
}
.pay-chip i { font-style: normal; color: var(--muted); }
.pay-chip:hover { border-color: var(--primary); color: var(--primary); }
.pay-chip.on { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.pay-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 14px; }
.kind-tag {
  display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 3px;
  background: var(--fill-2); color: var(--text-2); margin-left: 4px; font-weight: 400;
}
.kind-tag.earning { background: var(--success-light); color: #008a5c; }
.kind-tag.deduction { background: var(--danger-light); color: #c93847; }
.imp-map tr.is-auto td { background: #f4fbf6; }
