/* 电脑后台：左侧菜单，右侧功能 */
.layout { display: flex; min-height: 100vh; min-width: 1280px; }
.side { width: 232px; flex: 0 0 232px; background: #fff; border-right: 1px solid var(--line); padding: 18px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; font-weight: 600; }
.brand .logo { width: 32px; height: 32px; border-radius: 10px; background: var(--primary); color: #fff; display: grid; place-items: center; }
.brand small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.nav-mod { margin-top: 6px; }
.nav-mod > .mod { display: flex; align-items: center; gap: 10px; padding: 8px 10px; color: var(--text-2); font-weight: 500; font-size: 13px;
  width: 100%; border: 0; background: none; border-radius: 10px; cursor: pointer; font-family: inherit; text-align: left; }
.nav-mod > .mod:hover { background: var(--soft); color: var(--text); }
.nav-mod > .mod-link.active { background: var(--primary-soft); color: var(--primary-strong); font-weight: 600; }
.nav-mod > .mod .grow { flex: 1; }
.nav-mod .chev { width: 7px; height: 7px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(-45deg); transition: transform .15s; margin-right: 4px; opacity: .7; }
.nav-mod.open .chev { transform: rotate(45deg); }
.nav-mod[data-mod]:not(.open) > .nav-sub { display: none; }
.nav-mod.open .mod-badge { display: none; }
.mod-badge { min-width: 20px; height: 18px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; display: grid; place-items: center; }
.nav-all { margin: 14px 10px 4px; border: 0; background: none; color: var(--muted); font-size: 12px; cursor: pointer; padding: 0; font-family: inherit; }
.nav-all:hover { color: var(--primary-strong); }
.nav-mod > .mod svg { width: 18px; height: 18px; flex: none; }
.nav-item { display: flex; align-items: center; justify-content: space-between; padding: 7px 12px 7px 38px; border-radius: 999px; color: var(--text); font-size: 13px; }
.nav-item:hover { background: var(--soft); }
.nav-item.active { background: var(--primary-soft); color: var(--primary-strong); font-weight: 600; }
.nav-item.later { color: #A8A493; cursor: default; }
.nav-item.later:hover { background: none; }
.nav-item .badge { min-width: 20px; height: 18px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; display: grid; place-items: center; }
.nav-item .later-tag { font-size: 11px; color: #A8A493; }
.main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 60px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; border-bottom: 1px solid var(--line); background: rgba(246, 245, 238, .92); position: sticky; top: 0; z-index: 5; }
.crumb { color: var(--muted); font-size: 13px; }
.crumb b { color: var(--text); font-weight: 600; }
.content { padding: 24px 28px 48px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs a { padding: 6px 14px; border-radius: 999px; color: var(--text-2); background: #fff; border: 1px solid var(--line); font-size: 13px; }
.tabs a.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.stat .v { font-size: 26px; font-weight: 600; margin-top: 6px; }
.stat .k { color: var(--muted); font-size: 13px; }
.stat.link:hover { border-color: var(--primary); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--soft); border: 1px solid var(--line); }
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(180deg, #EEF1E4, var(--bg)); }
.login { width: 380px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar input, .toolbar select { width: auto; min-width: 200px; }

/* 角色与权限 */
.role-layout { display: grid; grid-template-columns: 240px 1fr; gap: 16px; align-items: start; }
.role-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; color: var(--text); }
.role-item:hover { background: var(--soft); }
.role-item.on { background: var(--primary); color: #fff; } .role-item.on .muted { color: rgba(255,255,255,.8); }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.perm { display: flex; gap: 8px; align-items: flex-start; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 14px; line-height: 1.4; }
.perm input { margin-top: 2px; } .perm.on { border-color: var(--primary); background: var(--soft); }
.perm:has(input:disabled) { cursor: default; opacity: .85; }
tr.diff td { background: #FFF6E5; }
@media (max-width: 900px) { .role-layout { grid-template-columns: 1fr; } }

.role-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; }
.role-row .scope-pick { opacity: .35; pointer-events: none; } .role-row.on { border-color: var(--primary); background: var(--soft); } .role-row.on .scope-pick { opacity: 1; pointer-events: auto; }
.self-flag { display: inline-block; margin-top: 4px; padding: 2px 8px; border-radius: 6px; background: #FBE3DD; color: #A83E26; font-size: 12px; font-weight: 600; }
tr.self-row td { background: #FFF4F1; }

/* 表格：表头、编号、金额不折行（如“QH-01-\n007”）；操作按钮排成一行；万一太宽就在卡片里横向滚动，不撑破页面 */
.card:has(> table.list) { overflow-x: auto; }
table.list th { white-space: nowrap; }
table.list td.num, table.list td.right { white-space: nowrap; }
table.list td.right > .row { flex-wrap: nowrap; }

/* 月度报表 */
.rp-good { color: var(--primary-strong, #2f6b1f); font-weight: 600; }
.rp-bad { color: var(--danger); font-weight: 600; }
.rp-bars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; height: 160px; align-items: end; margin-top: 10px; }
.rp-bars > div { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; text-align: center; }
.rp-bars i { display: block; background: var(--primary); border-radius: 3px 3px 0 0; min-height: 1px; }
.rp-bars span { font-size: 11px; color: var(--muted); height: 16px; }

/* 大字模式：后台整体放大 1.15 倍 */
html.big body { zoom: 1.15; }
html.big { --muted: #5A5648; --text-2: #46433A; }
html.big .modal { max-height: 78vh; }
.scope-pick .vills { display: flex; flex-direction: column; gap: 4px; }
