:root { --brand: #1f6feb; --side: #001529; --side-active: #1f6feb; --bg: #f0f2f5; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif; font-size: 14px; color: #1f2329; background: var(--bg); }
#app { height: 100%; }
.boot { display: flex; height: 100%; align-items: center; justify-content: center; color: #888; }
a { color: var(--brand); text-decoration: none; cursor: pointer; }

/* 布局 */
.layout { display: flex; height: 100vh; overflow: hidden; }
.aside { width: 208px; background: var(--side); color: #fff; display: flex; flex-direction: column; flex-shrink: 0; transition: width .2s; }
.aside.collapsed { width: 64px; }
.aside .logo { height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 18px; font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; border-bottom: 1px solid rgba(255,255,255,.08); }
.aside .logo i { width: 28px; height: 28px; border-radius: 7px; background: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-style: normal; flex-shrink: 0; }
.aside .el-menu { border-right: 0; flex: 1; overflow-y: auto; overflow-x: hidden; }
.aside .el-menu::-webkit-scrollbar { width: 0; }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.header { height: 56px; background: #fff; display: flex; align-items: center; padding: 0 16px; gap: 14px; box-shadow: 0 1px 4px rgba(0,21,41,.08); z-index: 2; }
.header .company { font-weight: 600; font-size: 15px; }
.header .spacer { flex: 1; }
.header .hbtn { cursor: pointer; color: #555; display: inline-flex; align-items: center; gap: 4px; }
.tabs-bar { background: #fff; border-bottom: 1px solid #e5e6eb; padding: 0 8px; display: flex; gap: 4px; overflow-x: auto; flex-shrink: 0; }
.tabs-bar::-webkit-scrollbar { height: 0; }
.tabs-bar .tab { padding: 7px 12px; font-size: 13px; color: #555; cursor: pointer; white-space: nowrap; border-bottom: 2px solid transparent; display: flex; align-items: center; gap: 6px; }
.tabs-bar .tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.tabs-bar .tab .x { font-size: 12px; color: #999; border-radius: 50%; width: 14px; height: 14px; display: inline-flex; align-items: center; justify-content: center; }
.tabs-bar .tab .x:hover { background: #ddd; color: #333; }
.content { flex: 1; overflow: auto; padding: 12px; }

/* 卡片/页面 */
.page { background: #fff; border-radius: 6px; padding: 14px 16px; min-height: calc(100% - 4px); }
.page-title { font-size: 16px; font-weight: 600; margin: 0 0 12px; display: flex; align-items: center; gap: 10px; }
.page-title .sub { font-size: 12px; color: #86909c; font-weight: normal; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar .spacer { flex: 1; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.filters .el-input, .filters .el-select { width: 170px; }
.filters .el-date-editor.el-input__wrapper, .filters .el-range-editor { width: 250px !important; flex-grow: 0; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 13px; color: #555; }
.sum-bar { display: flex; gap: 20px; font-size: 13px; color: #555; }
.sum-bar b { color: #1f2329; }
.money { font-variant-numeric: tabular-nums; }
.neg { color: #f53f3f; }
.pos { color: #00b42a; }
.muted { color: #86909c; font-size: 12px; }
.link { color: var(--brand); cursor: pointer; }
.link:hover { text-decoration: underline; }
.row-bold td { font-weight: 600; background: #fafbfc !important; }

/* 单据 */
.bill { position: relative; }
.bill .stamp { position: absolute; right: 120px; top: 70px; border: 3px solid #f53f3f; color: #f53f3f; font-size: 22px; font-weight: 700; padding: 2px 14px; border-radius: 6px; transform: rotate(-12deg); opacity: .55; pointer-events: none; z-index: 5; letter-spacing: 4px; }
.bill .stamp.draft { border-color: #ff7d00; color: #ff7d00; }
.bill-head { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 18px; margin-bottom: 8px; }
.bill-head .el-form-item { margin-bottom: 10px; }
.bill-head .el-select, .bill-head .el-date-editor, .bill-head .el-input { width: 100% !important; }
.bill-foot { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 18px; margin-top: 12px; }
.bill-foot .el-form-item { margin-bottom: 10px; }
.bill-foot .el-select, .bill-foot .el-input-number, .bill-foot .el-input { width: 100% !important; }
.bill-grid .el-table__cell { padding: 3px 0 !important; }
.bill-grid .el-input__wrapper, .bill-grid .el-select__wrapper { box-shadow: none !important; background: transparent; padding: 0 6px; }
.bill-grid .el-input__wrapper:hover, .bill-grid .el-select__wrapper:hover, .bill-grid .is-focus .el-input__wrapper, .bill-grid .el-select__wrapper.is-focused { box-shadow: 0 0 0 1px var(--brand) inset !important; background: #fff; }
.bill-grid .el-input-number { width: 100%; }
.bill-grid .el-input-number .el-input__inner { text-align: right; }
.bill-grid .cell { padding: 0 4px !important; }
.bill-grid .gname { line-height: 1.3; }
.bill-grid .gname small { color: #86909c; display: block; font-size: 12px; }
.bill-info { background: #f7f8fa; border-radius: 4px; padding: 8px 12px; font-size: 13px; color: #4e5969; display: flex; flex-wrap: wrap; gap: 6px 22px; margin-bottom: 10px; }
.bill-info b { color: #1f2329; }
.bill-total { font-size: 15px; }
.bill-total b { color: #f53f3f; font-size: 18px; }
.scan-input { width: 220px !important; }

/* 首页 */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 12px; }
.kpi { background: #fff; border-radius: 6px; padding: 14px 16px; position: relative; overflow: hidden; cursor: default; }
.kpi .t { color: #86909c; font-size: 13px; }
.kpi .v { font-size: 24px; font-weight: 600; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 12px; color: #86909c; margin-top: 4px; }
.kpi.clickable { cursor: pointer; }
.kpi.clickable:hover { box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.panel { background: #fff; border-radius: 6px; padding: 14px 16px; }
.panel h4 { margin: 0 0 10px; font-size: 15px; display: flex; justify-content: space-between; align-items: center; }
.grid2 { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; margin-bottom: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 12px; }
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.quick .q { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.quick .q:hover { background: #f2f3f5; }
.quick .q .ic { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 18px; }
.todo-item { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed #eee; cursor: pointer; }
.todo-item:hover { color: var(--brand); }

/* 报表中心 */
.rpt-group { margin-bottom: 18px; }
.rpt-group h4 { margin: 0 0 10px; font-size: 15px; border-left: 3px solid var(--brand); padding-left: 8px; }
.rpt-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.rpt-item { border: 1px solid #e5e6eb; border-radius: 6px; padding: 12px 14px; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.rpt-item:hover { border-color: var(--brand); color: var(--brand); }

/* 登录 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #0b3d91 0%, #1f6feb 55%, #4f9cff 100%); padding: 20px; }
.login-box { width: 900px; max-width: 100%; display: flex; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.login-left { flex: 1; background: #0f2a5c; color: #fff; padding: 44px 36px; display: flex; flex-direction: column; gap: 14px; }
.login-left h1 { margin: 0; font-size: 26px; }
.login-left ul { padding-left: 18px; line-height: 2; color: #c9d6f2; margin: 6px 0 0; }
.login-right { width: 380px; padding: 40px 34px; }
.login-right h2 { margin: 0 0 22px; }
@media (max-width: 760px) { .login-left { display: none; } .login-right { width: 100%; } .grid2, .grid3 { grid-template-columns: 1fr; } .aside { position: fixed; z-index: 10; height: 100%; } .aside.collapsed { width: 0; } }

/* 权限树 */
.perm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.perm-table td, .perm-table th { border: 1px solid #e5e6eb; padding: 6px 8px; text-align: left; }
.perm-table th { background: #f7f8fa; }
.perm-table .grp { background: #f2f6ff; font-weight: 600; }

/* 打印区不显示 */
.print-frame { position: fixed; right: 0; bottom: 0; width: 0; height: 0; border: 0; }
.el-table .cell { line-height: 1.4; }
.el-table th.el-table__cell { background: #f7f8fa !important; color: #4e5969; font-weight: 600; }
.el-dialog__body { padding-top: 10px !important; }
.goods-cell-img { width: 36px; height: 36px; object-fit: cover; border-radius: 4px; background: #f2f3f5; }
.tag-mini { font-size: 12px; padding: 0 5px; border-radius: 3px; background: #e8f3ff; color: #1f6feb; margin-left: 4px; }
