:root {
  --line: #95b8e7;
  --line-soft: #c5d5ea;
  --head-text: #0e2d5f;
  --head-bg: linear-gradient(#eff5ff, #e0ecff);
  --muted: #7a8699;
  --primary: #1d5bb8;
  --sidebar-w: 180px;
  --el-color-primary: #1d5bb8;
  --el-border-radius-base: 2px;
  --el-font-size-base: 12px;
  --el-border-color: #a5bcd9;
  --el-text-color-regular: #222;
}

* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; }
body {
  font-family: "Microsoft YaHei", "宋体", SimSun, Arial, sans-serif;
  font-size: 12px;
  color: #222;
  background: #dfe8f6;
}

.flex-1 { flex: 1; }
.w100 { width: 100%; }
.mb { margin-bottom: 8px; }
.muted { color: var(--muted); font-size: 12px; }
.pre { margin: 0; white-space: pre-wrap; font-family: inherit; }
.opt-sub { float: right; color: var(--muted); font-size: 12px; margin-left: 12px; }

/* ---------- 登录 ---------- */
.login-wrap {
  height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 0%, #e8f1fc 0%, #b9d0ee 45%, #8eb0dd 100%);
}
.login-box {
  width: 640px; background: #fff; padding: 8px; box-shadow: 0 0 0 1px #c9d8ee, 0 6px 24px rgba(30, 70, 140, .25);
}
.login-inner {
  display: flex; align-items: center; height: 220px;
  background: linear-gradient(#e6f0fc, #b8d1f1); border: 1px solid #a7c2e6;
}
.login-left { flex: 1; display: flex; align-items: center; justify-content: center; gap: 16px; border-right: 1px solid #c4d8f1; height: 70%; }
.login-left .lock { font-size: 64px; color: #5a7fb6; }
.login-left .title { font-size: 30px; font-weight: bold; color: #1d4c94; letter-spacing: 6px; font-family: "黑体", SimHei, sans-serif; }
.login-right { width: 290px; padding: 0 24px; }
.login-row { display: flex; align-items: center; margin-bottom: 12px; }
.login-row label { width: 56px; color: #1d4c94; }
.login-row .el-input { flex: 1; }
.login-btns { padding-left: 56px; display: flex; gap: 10px; }
.login-footer { margin-top: 14px; color: #fff; text-align: center; font-weight: bold; text-shadow: 0 1px 1px rgba(0,0,0,.25); }
.login-footer .sub { font-weight: normal; font-size: 12px; margin-top: 4px; }

/* ---------- 框架 ---------- */
.layout { height: 100%; display: grid; grid-template-columns: var(--sidebar-w) 1fr; grid-template-rows: 40px 1fr 24px; }
.layout.collapsed { grid-template-columns: 0 1fr; }
.topbar {
  grid-column: 1 / 3; display: flex; align-items: center; gap: 18px; padding: 0 16px 0 10px; color: #fff;
  background: linear-gradient(#3d7bd1, #1c4f9f); border-bottom: 1px solid #163f80;
}
.brand { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: bold; letter-spacing: 1px; cursor: pointer; white-space: nowrap; color: #f6e65b; text-shadow: 0 1px 1px rgba(0,0,0,.35); }
.brand-logo { width: 26px; height: 26px; border-radius: 4px; background: #fff; color: #1c4f9f; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.top-info { font-weight: bold; }
.top-links a { color: #fff; text-decoration: underline; cursor: pointer; margin: 0 6px; }
.top-links span { opacity: .7; }
.footbar { grid-column: 1 / 3; background: var(--head-bg); border-top: 1px solid var(--line); text-align: center; line-height: 23px; color: var(--head-text); font-weight: bold; }

.sidebar { background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; overflow: hidden; }
.nav-title { height: 26px; line-height: 25px; padding: 0 6px; font-weight: bold; color: var(--head-text); background: var(--head-bg); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; }
.nav-title .el-icon { cursor: pointer; margin-top: 6px; border: 1px solid var(--line); border-radius: 2px; background: #fff; }
.nav-scroll { flex: 1; overflow-y: auto; }
.nav-group-head {
  height: 26px; display: flex; align-items: center; gap: 5px; padding: 0 6px; cursor: pointer; user-select: none;
  background: linear-gradient(#f5f9fe, #dbe7f7); border-bottom: 1px solid var(--line); color: var(--head-text); font-weight: bold;
}
.nav-group-head:hover { background: linear-gradient(#fff, #e6eefa); }
.nav-group-head .arrow { margin-left: auto; color: #6b8fc5; }
.nav-group-head > .el-icon:first-child { color: #2f6cbf; font-size: 15px; }
.nav-items { padding: 6px 0 8px; border-bottom: 1px solid var(--line); }
.nav-item { display: flex; align-items: center; gap: 8px; height: 28px; padding-left: 18px; cursor: pointer; color: #222; border: 1px solid transparent; margin: 0 4px; }
.nav-item .el-icon { color: #3b78c4; font-size: 15px; }
.nav-item:hover { background: #eaf1fb; border-color: #c5d8f1; }
.nav-item.active { background: #dbe8f8; border-color: #99bbe8; font-weight: bold; color: var(--head-text); }

.main { overflow: hidden; display: flex; flex-direction: column; background: #dfe8f6; padding: 4px 4px 0; position: relative; }
.page-tabs { height: 100%; display: flex; flex-direction: column; }
.page-tabs > .el-tabs__header { margin: 0; padding: 2px 4px 0; background: var(--head-bg); border: 1px solid var(--line); border-bottom: none; }
.page-tabs > .el-tabs__header .el-tabs__nav { border: none !important; }
.page-tabs > .el-tabs__header .el-tabs__item {
  height: 23px; line-height: 23px; padding: 0 10px !important; margin-right: 2px; font-size: 12px; color: #15428b;
  border: 1px solid #8db2e3 !important; border-bottom: none !important; border-radius: 3px 3px 0 0;
  background: linear-gradient(#fdfeff, #d7e4f6);
}
.page-tabs > .el-tabs__header .el-tabs__item.is-active { background: #fff; font-weight: bold; }
.page-tabs > .el-tabs__header .el-tabs__nav-wrap { margin-bottom: 0; }
.page-tabs > .el-tabs__content { flex: 1; overflow: auto; background: #dce8f8; border: 1px solid var(--line); }
.tab-label { display: inline-flex; align-items: center; gap: 4px; }
.tab-actions { position: absolute; right: 10px; top: 7px; }
.page-wrap { padding: 8px; min-height: 100%; }

/* ---------- 面板（原 card） ---------- */
.card { background: #fff; border: 1px solid var(--line); margin-bottom: 8px; padding: 8px; }
.card-title {
  display: flex; align-items: center; gap: 5px; margin: -8px -8px 8px; padding: 0 8px; height: 24px;
  background: var(--head-bg); border-bottom: 1px solid var(--line); color: var(--head-text); font-weight: bold; font-size: 12px;
}
.card-title .el-icon { color: #2f6cbf; }
.card-title .actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.search-form { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.search-form .el-form-item { margin: 0; }
.toolbar { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.toolbar .right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 6px; }
.section-title { font-weight: bold; color: var(--head-text); margin: 6px 0 4px; }

/* ---------- 表格 ---------- */
.el-table {
  --el-table-border-color: #ccd9ec;
  --el-table-header-bg-color: #e0ecff;
  --el-table-row-hover-bg-color: #e6e6e6;
  --el-table-current-row-bg-color: #ffe48d;
  font-size: 12px;
}
.el-table th.el-table__cell { background: linear-gradient(#eff5ff, #e0ecff) !important; color: #0e2d5f; font-weight: bold; border-color: #95b8e7 !important; }
.el-table__body tr:has(.el-checkbox.is-checked) > td.el-table__cell { background: #ffe48d !important; }
.el-table .el-table__cell { padding: 3px 0; }
.el-table .cell { padding: 0 6px; line-height: 20px; }
.el-table--striped .el-table__body tr.el-table__row--striped td.el-table__cell { background: #f7faff; }
.el-table__footer-wrapper td.el-table__cell { background: #fff8e1; color: #c00; font-weight: bold; }
.el-pagination { --el-pagination-font-size: 12px; }
.cust-popper .el-select-dropdown__item, .cust-popper li { height: auto; line-height: 22px; padding: 2px 10px; }
.cust-opt b { color: #0e2d5f; margin-right: 4px; }
.cust-opt em { font-style: normal; color: #7a8699; margin-left: 10px; font-size: 12px; }
.op-col .cell { white-space: nowrap; display: flex; align-items: center; gap: 4px; }

/* ---------- 按钮 & 表单 ---------- */
.el-button {
  --el-button-text-color: #000;
  --el-button-bg-color: transparent;
  --el-button-border-color: #a3a3a3;
  --el-button-hover-text-color: #000;
  --el-button-hover-bg-color: transparent;
  --el-button-hover-border-color: #7eb4ea;
  background-image: linear-gradient(#fdfdfd, #e3e3e3);
  border-radius: 3px; font-size: 12px; height: 23px; padding: 3px 10px;
}
.el-button:hover { background-image: linear-gradient(#f2f9ff, #d7ebfd); }
.el-button--primary, .el-button--primary.is-plain, .el-button--success.is-plain, .el-button--danger.is-plain, .el-button--warning.is-plain {
  --el-button-text-color: #000; --el-button-hover-text-color: #000; --el-button-active-text-color: #000;
  --el-button-border-color: #a3a3a3; --el-button-hover-border-color: #7eb4ea;
  --el-button-bg-color: transparent; --el-button-hover-bg-color: transparent;
  background-image: linear-gradient(#fdfdfd, #e3e3e3);
}
.el-button--primary:hover { background-image: linear-gradient(#f2f9ff, #d7ebfd); }
.el-button--danger { --el-button-text-color: #b42318; }
.el-button--success { --el-button-text-color: #217a2f; }
.el-button.is-link, .el-button.is-text { background-image: none; height: auto; padding: 0 2px; border: none; }
.el-button.is-link { --el-button-text-color: #1d5bb8; }
.el-button.is-disabled { opacity: .55; }
.el-input__wrapper, .el-select__wrapper, .el-textarea__inner { border-radius: 0 !important; box-shadow: 0 0 0 1px #9fb6d6 inset !important; }
.el-input__wrapper.is-focus, .el-select__wrapper.is-focused { box-shadow: 0 0 0 1px #3b78c4 inset !important; }
.el-radio-button__inner { font-size: 12px; padding: 5px 10px; }
.el-tag { border-radius: 2px; }
.el-dialog { padding: 0; border: 1px solid var(--line); border-radius: 4px; box-shadow: 2px 2px 8px rgba(0,0,0,.25); }
.el-dialog__header { margin: 0; padding: 5px 10px; background: var(--head-bg); border-bottom: 1px solid var(--line); border-radius: 4px 4px 0 0; }
.el-dialog__title { color: var(--head-text); font-size: 12px; font-weight: bold; }
.el-dialog__headerbtn { top: 0; height: 28px; }
.el-dialog__body { padding: 10px 14px; background: #f4f8fe; }
.el-dialog__footer { padding: 6px 14px; background: #f4f8fe; border-top: 1px solid var(--line-soft); }
.el-drawer__header { margin: 0; padding: 6px 12px; background: var(--head-bg); border-bottom: 1px solid var(--line); color: var(--head-text); font-weight: bold; }
.el-descriptions__label.is-bordered-label { background: #eef3fa !important; color: #15428b; }

.money { font-variant-numeric: tabular-nums; }
.money.strong { font-weight: bold; }
.money.pos { color: #cc0000; }
.money.neg { color: #1a7f2a; }

.summary-bar { display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 4px 8px; margin-bottom: 6px; background: #fff8e1; border: 1px solid #f0d58c; }
.summary-item .label { color: #555; margin-right: 4px; }
.summary-item .value { font-weight: bold; color: #cc0000; font-variant-numeric: tabular-nums; }
.summary-item .value.green { color: #1a7f2a; }

/* ---------- 系统主页 ---------- */
.home-grid { display: grid; grid-template-columns: 1fr 300px; gap: 8px; }
.todo-item { display: flex; justify-content: space-between; align-items: center; padding: 5px 4px; border-bottom: 1px dotted #c5d5ea; cursor: pointer; }
.todo-item:hover { background: #eaf1fb; }
.todo-item b { color: #cc0000; }

/* ---------- 订单录入 ---------- */
.order-form .el-form-item { margin-bottom: 6px; }
.credit-line { display: flex; gap: 18px; padding: 4px 8px; flex-wrap: wrap; }
.credit-line b { color: #cc0000; margin-left: 4px; }
.edit-table .el-input__wrapper { box-shadow: none !important; padding: 0 3px; background: transparent; }
.edit-table .el-input__wrapper:hover, .edit-table .el-input__wrapper.is-focus { box-shadow: 0 0 0 1px #3b78c4 inset !important; }
.edit-table .el-input-number { width: 100%; }
.edit-table .cell { padding: 0 3px !important; }
.batch-field { display: inline-flex; align-items: center; gap: 3px; }
.batch-field label { color: #555; }
.calc-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px 12px; }
.calc-item label { display: block; color: #555; margin-bottom: 2px; }
.calc-item.total .el-input__inner { font-weight: bold; color: #cc0000; }
.form-footer { position: sticky; bottom: 0; background: #eef3fa; border: 1px solid var(--line); padding: 6px 10px; display: flex; align-items: center; gap: 12px; z-index: 5; }
.big-money { font-size: 14px; font-weight: bold; color: #cc0000; font-variant-numeric: tabular-nums; }

/* ---------- 经典表单（订单录入） ---------- */
.classic-form { max-width: 1060px; }
.inner-tabs { background: #fff; border: 1px solid var(--line); margin-bottom: 6px; }
.inner-tabs > .el-tabs__header { margin: 0; background: var(--head-bg); border-bottom: 1px solid var(--line) !important; padding: 2px 4px 0; }
.inner-tabs > .el-tabs__header .el-tabs__nav { border: none !important; }
.inner-tabs > .el-tabs__header .el-tabs__item { height: 22px; line-height: 22px; font-size: 12px; padding: 0 10px !important; border: 1px solid var(--line) !important; border-bottom: none !important; margin-right: 2px; background: linear-gradient(#fff, #e0ecff); color: #0e2d5f; }
.inner-tabs > .el-tabs__header .el-tabs__item.is-active { background: #fff; font-weight: bold; }
.inner-tabs > .el-tabs__content { padding: 8px 10px; background: linear-gradient(#f4f9ff, #ffffff); }
.kv-grid { display: grid; grid-template-columns: 70px 1fr 70px 1fr; gap: 5px 4px; align-items: center; }
.kv-grid > label { text-align: right; color: #0e2d5f; }
.kv-grid .span3 { grid-column: 2 / 5; }
.bar-title { height: 22px; line-height: 21px; padding: 0 6px; margin-top: 4px; background: var(--head-bg); border: 1px solid var(--line); border-bottom: none; color: #15428b; font-weight: bold; cursor: pointer; user-select: none; }
.bar-title b { color: #c00; margin-left: 4px; }
.bar-title.plain { cursor: default; }
.fline { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; padding: 4px 6px; background: #fff; border: 1px solid var(--line); border-bottom: none; }
.fline:last-child { border-bottom: 1px solid var(--line); }
.calc-box { margin-bottom: 6px; }
.calc-box .fline { background: #f7fbff; }
.fline .n { width: 70px !important; }
.fline .n.red .el-input__inner { color: #c00; font-weight: bold; -webkit-text-fill-color: #c00; }
.pair { display: flex; align-items: center; gap: 2px; }
.pair > * { flex: 1; }

/* ---------- 订单详情 ---------- */
.order-detail { padding: 0 4px; }
.detail-head { display: flex; align-items: center; gap: 12px; margin: 8px 0; }
.money-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line-soft); border-left: 1px solid var(--line-soft); }
.money-grid > div { display: flex; justify-content: space-between; padding: 4px 8px; border-bottom: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft); }
.money-grid > div span:first-child { color: #15428b; }

/* ---------- 权限 ---------- */
.perm-group { margin-bottom: 6px; padding: 6px 8px; border: 1px solid var(--line-soft); }
.perm-group-title { font-weight: bold; color: var(--head-text); margin-bottom: 4px; }
