/* 三套后台共用。浅色工作台：暖纸底、细线、墨色按钮、等宽金额。 */
:root {
  --ink: #1c1917;
  --side: #fbfaf7;
  --accent: #1f4d3a;
  --paper: #f3f1ec;
  --line: #e6e1d8;
  --text: #1c1917;
  --muted: #6f6a62;
  --el-color-primary: #1c1917;
  --el-color-primary-light-3: #44403c;
  --el-color-primary-light-5: #78716c;
  --el-color-primary-light-7: #d6d3d1;
  --el-color-primary-light-8: #e7e5e4;
  --el-color-primary-light-9: #f5f5f4;
  --el-color-primary-dark-2: #0c0a09;
  --el-border-radius-base: 8px;
  --el-font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; overflow: hidden; }
body {
  background: var(--paper);
  color: var(--text);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.login-page {
  height: 100%;
  display: flex !important;
  align-items: stretch !important;
  justify-content: stretch !important;
  background: var(--paper) !important;
}
.login-brand {
  width: min(480px, 42vw);
  flex: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px 48px;
  color: #f6f3ec;
  background: #1c1917;
  position: relative;
}
.login-brand::after {
  content: "";
  position: absolute;
  left: 48px; right: 48px; top: 48px;
  height: 1px;
  background: rgba(196, 165, 116, .7);
}
.brand-mark {
  width: 44px; height: 44px; border-radius: 10px;
  display: grid; place-items: center;
  background: transparent;
  border: 1px solid rgba(246, 243, 236, .28);
  font-weight: 650; letter-spacing: .12em; font-size: 13px;
  box-shadow: none;
  margin-bottom: 28px;
}
.login-brand h1 { font-size: 40px; font-weight: 620; margin: 0 0 12px; letter-spacing: -.03em; }
.login-brand p { max-width: 380px; color: rgba(246,243,236,.68); line-height: 1.75; margin: 0; font-size: 15px; }
.login-card {
  width: auto !important;
  max-width: 420px;
  flex: 1;
  margin: 0;
  padding: 48px 56px !important;
  background: transparent !important;
  border-radius: 0 !important;
  border: 0;
  box-shadow: none !important;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login-title { font-size: 26px !important; font-weight: 640; color: var(--text) !important; text-align: left !important; margin: 0 0 6px !important; letter-spacing: -.02em; }
.login-sub { text-align: left !important; color: var(--muted); font-size: 13px; margin-bottom: 28px; }
.login-card .el-form-item { margin-bottom: 16px; }
.login-card .el-button { margin-top: 8px; height: 44px; letter-spacing: .12em; }

.layout { display: flex; height: 100%; overflow: hidden; background: var(--paper); }
.sidebar {
  width: 232px !important;
  height: 100%;
  background: var(--side) !important;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden !important;
  border-right: 1px solid var(--line);
}
.logo {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: .02em;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.logo::before {
  content: "四";
  width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center;
  background: #1c1917;
  color: #f6f3ec;
  font-size: 12px;
  font-weight: 650;
  box-shadow: none;
  flex-shrink: 0;
}
.menu {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px 12px 20px;
  scrollbar-width: none;
}
.menu::-webkit-scrollbar { width: 0; height: 0; }
.menu-item, .menu-group-title {
  height: 36px !important;
  display: flex;
  align-items: center;
  padding: 0 10px !important;
  margin: 1px 0;
  border-radius: 8px;
  cursor: pointer;
  color: #5c574e !important;
  font-size: 13px;
  background: transparent;
  transition: background .16s ease, color .16s ease;
}
.menu-group-title {
  justify-content: space-between;
  color: #8a847a !important;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .04em;
  margin-top: 10px;
}
.menu-group-title span { display: flex; align-items: center; gap: 8px; }
.menu-item.sub { height: 34px !important; padding-left: 22px !important; color: #6f6a62 !important; }
.menu-item:hover, .menu-group-title:hover { color: var(--ink) !important; background: #f3efe6; }
.menu-item.active {
  color: var(--ink) !important;
  background: #efeae1 !important;
  box-shadow: inset 2px 0 0 #1c1917;
  font-weight: 650;
}
.chev { transition: transform .2s ease; font-size: 12px; color: #8a847a; }
.chev.open { transform: rotate(180deg); }
.menu-sub { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .22s ease; }
.menu-sub.open { grid-template-rows: 1fr; }
.menu-sub > div { overflow: hidden; }
.menu-item .el-icon, .menu-group-title .el-icon { margin-right: 8px; font-size: 15px; }

.main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--paper); }
.topbar {
  height: 64px;
  background: transparent !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid transparent;
  box-shadow: none !important;
  flex-shrink: 0;
}
.topbar .right, .topbar > div:last-child { display: flex; align-items: center; gap: 12px; }
.crumb { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); }
.crumb em { font-style: normal; letter-spacing: .14em; font-size: 11px; color: #8a847a; }
.crumb b { color: var(--ink); font-weight: 650; font-size: 18px; letter-spacing: -.02em; }
.content { flex: 1; overflow: auto; padding: 4px 28px 36px; }
.content::-webkit-scrollbar { width: 10px; height: 10px; }
.content::-webkit-scrollbar-thumb { background: rgba(28, 25, 23, .16); border-radius: 10px; border: 2px solid var(--paper); }
.page-stage { animation: rise .28s ease; }

.page-card, .stat-card, .kpi {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px !important;
  box-shadow: none !important;
}
.page-card { padding: 18px 18px 16px; overflow: visible; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.card-head b { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.card-head span { color: var(--muted); font-size: 12px; }
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filter-bar .grow { flex: 1; min-width: 8px; }
.filter-bar .el-input { width: 220px; flex: none; }
.filter-bar .el-select { width: 160px; flex: none; }
.filter-bar .el-date-editor { width: 260px !important; flex: none; }
.filter-bar .el-button { height: 32px; margin-left: 0 !important; padding: 0 14px; font-size: 13px; }
.filter-bar .el-input__wrapper,
.filter-bar .el-select__wrapper { min-height: 32px; font-size: 13px; }
.page-card .el-form { max-width: 520px; }
.el-dialog .el-form { max-width: none; width: 100%; }
.page-card .el-form .el-input,
.page-card .el-form .el-select,
.el-dialog .el-input,
.el-dialog .el-select { width: 100%; }
.el-form-item__label {
  white-space: nowrap !important;
  height: 32px !important;
  line-height: 32px !important;
  align-items: center;
}
.el-dialog {
  width: min(760px, calc(100vw - 32px)) !important;
  border-radius: 14px !important;
}
.el-dialog .el-form-item__label { width: 156px !important; flex: none; }
.el-dialog .el-divider { margin: 6px 0 16px; }
.el-dialog .el-divider__text { white-space: nowrap; background: #fff; }

.stat-grid, .kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.kpi, .stat-card { position: relative; overflow: hidden; padding: 16px 16px 14px; animation: rise .35s ease both; }
.kpi:nth-child(2), .stat-card:nth-child(2) { animation-delay: .04s; }
.kpi:nth-child(3), .stat-card:nth-child(3) { animation-delay: .08s; }
.kpi:nth-child(4), .stat-card:nth-child(4) { animation-delay: .12s; }
.kpi:nth-child(5), .stat-card:nth-child(5) { animation-delay: .16s; }
.kpi:nth-child(6), .stat-card:nth-child(6) { animation-delay: .2s; }
.kpi::before, .stat-card::before {
  content: "";
  display: block;
  width: 7px; height: 7px; border-radius: 50%;
  background: #a8a29e;
  margin-bottom: 12px;
}
.kpi.green::before { background: #1f7a4d; }
.kpi.blue::before { background: #1d4e89; }
.kpi.orange::before { background: #a16207; }
.kpi.red::before { background: #b42318; }
.stat-label, .kpi-k { color: var(--muted); font-size: 12px; }
.stat-value, .kpi-v {
  font-size: 28px; font-weight: 640; color: var(--ink);
  margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -.04em;
}
.kpi-s { margin-top: 6px; color: #a8a29e; font-size: 12px; }
.stat-value.green { color: #1f7a4d; }
.stat-value.blue { color: #1d4e89; }
.stat-value.orange { color: #a16207; }
.stat-value.red { color: #b42318; }
.chart-box { height: 300px; width: 100%; }
.money { color: var(--ink); font-weight: 640; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

.el-button--primary {
  --el-button-bg-color: #1c1917;
  --el-button-border-color: #1c1917;
  --el-button-hover-bg-color: #292524;
  --el-button-hover-border-color: #292524;
  --el-button-active-bg-color: #0c0a09;
}
.el-table {
  width: 100%;
  border: 1px solid #e6e1d8 !important;
  border-radius: 10px;
  overflow: hidden;
  --el-table-border-color: #efeae3;
  --el-table-header-bg-color: #faf8f4;
  --el-table-header-text-color: #6f6a62;
  --el-table-row-hover-bg-color: #faf8f4;
  --el-table-bg-color: #fff;
  --el-table-tr-bg-color: #fff;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.el-table th.el-table__cell { font-weight: 650; font-size: 13px; height: 44px; border-bottom: 1px solid #e6e1d8 !important; }
.el-table td.el-table__cell { height: 48px; font-size: 13px; border-bottom: 1px solid #efeae3 !important; }
.el-table__body tr:last-child td.el-table__cell { border-bottom: 1px solid #e6e1d8 !important; }
.el-table .cell { line-height: 22px; }
.el-table .el-button { height: 28px; padding: 0 10px; font-size: 12px; margin-left: 0; }
.el-table .el-button + .el-button { margin-left: 6px; }
.el-table--border::after, .el-table--border::before,
.el-table__inner-wrapper::before, .el-table__border-left-patch { display: none !important; }
.el-table__inner-wrapper, .el-table__header-wrapper, .el-table__body-wrapper { border-radius: inherit; }
.el-table__empty-block {
  width: 100% !important;
  min-height: 148px;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: static !important;
  left: auto !important;
}
.el-table__empty-text { width: auto; line-height: 22px; text-align: center; }
.el-dialog__header { padding-bottom: 8px; }
.el-dialog__title { font-weight: 650; letter-spacing: -.02em; }
.el-tag { border-radius: 999px; }
.el-pagination {
  width: 100%;
  box-sizing: border-box;
  min-height: 48px;
  margin-top: 0;
  padding: 12px 4px 2px;
  border-top: 1px solid var(--line);
  display: flex !important;
  justify-content: center !important;
  align-items: center;
  flex-wrap: wrap;
  row-gap: 8px;
  font-size: 13px;
  --el-pagination-button-width: 32px;
  --el-pagination-button-height: 32px;
  --el-pagination-font-size: 13px;
}
.el-pagination .el-select { width: 108px; }
.el-pagination__editor.el-input { width: 56px; }

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 860px) {
  .login-brand { display: none; }
  .login-card { width: min(440px, calc(100% - 40px)) !important; margin: auto; }
  .sidebar { width: 196px !important; }
  .content { padding: 4px 14px 24px; }
  .topbar { padding: 0 14px; }
}
