.budget-center-page {
  min-width: 0;
  display: grid;
  gap: 14px;
  color: #1f2937;
}



.budget-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.budget-summary-card {
  --accent: var(--theme-primary);
  position: relative;
  min-height: 112px;
  padding: 12px 14px 10px;
  display: flex;
  flex-direction: column;
  border: 1px solid #dbe4ee;
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  animation: dashboardItemIn 520ms var(--ease) both;
  animation-delay: var(--delay, 0ms);
  transition: box-shadow 200ms ease, transform 200ms ease;
}

.budget-summary-card:hover {
  box-shadow: 0 4px 12px rgba(15, 23, 42, .055);
  transform: translateY(-1px);
}

.budget-summary-card.primary {
  --accent: var(--theme-primary);
}

.budget-summary-card.info {
  --accent: var(--theme-secondary);
}

.budget-summary-card.warning {
  --accent: var(--warning);
}

.budget-summary-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  min-width: 0;
}

.summary-icon {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--accent) 10%, white);
  color: var(--accent);
  font-size: 14px;
  flex: 0 0 auto;
  animation: iconPop 560ms var(--ease) both;
  animation-delay: calc(var(--delay, 0ms) + 100ms);
}

.budget-summary-card .summary-label {
  display: block;
  min-width: 0;
  color: #64748b;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.summary-value {
  display: block;
  min-height: 22px;
  margin-bottom: 6px;
  color: #0f172a;
  font-size: clamp(16px, 1.2vw, 20px);
  line-height: 1;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  letter-spacing: 0;
}

.summary-comparison-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px solid #f1f5f9;
  min-width: 0;
  flex-wrap: wrap;
}

.comparison-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  line-height: 1.45;
  font-weight: 700;
  white-space: nowrap;
}

.comparison-pill b {
  color: inherit;
  font-size: 11px;
  font-weight: 600;
}

.comparison-pill em {
  font-style: normal;
  font-variant-numeric: tabular-nums;
}

.comparison-pill i {
  font-size: 11px;
}

.comparison-pill.up {
  background: var(--success-soft);
  color: var(--success);
}

.comparison-pill.down {
  background: var(--danger-soft);
  color: var(--danger-hover);
}

.budget-filter-bar {
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  background: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.budget-filter-set,
.budget-action-set {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
}

.budget-filter-bar label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #64748b;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.budget-filter-bar .enterprise-select {
  min-width: 128px;
}

.budget-primary-btn {
  min-height: 40px;
  border: 0;
  border-radius: 4px;
  background: var(--theme-primary-active);
  color: #fff;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: none;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.budget-primary-btn:hover {
  background: var(--theme-primary-hover);
  box-shadow: none;
}

.budget-ghost-btn {
  min-height: 38px;
  border: 1px solid #d7e0ea;
  border-radius: 4px;
  background: #fff;
  color: #334155;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.budget-ghost-btn:hover {
  border-color: rgba(var(--theme-primary-rgb), .32);
  background: var(--theme-primary-soft);
  color: var(--theme-primary-active);
}

.budget-work-grid {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 10px;
}

.budget-work-grid.single-department {
  grid-template-columns: minmax(0, 1fr);
}

.budget-department-panel,
.budget-table-panel,
.budget-chart-panel,
.budget-alert-panel {
  border: 1px solid #e5eaf1;
  border-radius: 4px;
  background: #fff;
  overflow: hidden;
}

.budget-department-panel header,
.budget-table-panel > header,
.budget-card-head {
  min-height: 48px;
  padding: 13px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #edf1f6;
}

.budget-department-panel strong,
.budget-table-panel > header strong,
.budget-card-head strong {
  color: #111827;
  font-size: 16px;
  font-weight: 800;
}

.budget-table-search {
  width: min(260px, 42%);
  min-width: 190px;
}

.department-search-input {
  width: calc(100% - 28px);
  margin: 12px 14px 8px;
}

.budget-table-search :deep(.el-input__wrapper),
.department-search-input :deep(.el-input__wrapper) {
  min-height: 34px;
  border-radius: 4px;
  background: #fff;
}

.budget-table-search :deep(.el-input__prefix),
.department-search-input :deep(.el-input__prefix) {
  color: #94a3b8;
}

.department-list {
  display: grid;
  gap: 4px;
  padding: 8px 12px 16px;
}

.department-switch-btn {
  width: 100%;
  height: 38px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #4b5563;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  margin-left: 0;
  transition:
    background 160ms ease,
    color 160ms ease;
}

.department-switch-btn.active {
  background: var(--theme-primary-soft);
  color: var(--theme-primary-active);
}

.department-switch-btn + .department-switch-btn {
  margin-left: 0;
}

.budget-table-wrap {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 8px;
}

.budget-data-table {
  width: 100%;
  min-width: 1540px;
}

.budget-table-wrap :deep(.el-table) {
  --el-table-border-color: #edf1f6;
  --el-table-header-bg-color: #f8fafc;
  --el-table-row-hover-bg-color: var(--theme-primary-soft);
  --el-table-current-row-bg-color: var(--theme-primary-soft);
  color: #273142;
  font-size: 14px;
}

.budget-table-wrap :deep(.el-table .el-scrollbar__bar.is-horizontal) {
  display: none !important;
}

.budget-table-wrap :deep(.el-table__inner-wrapper::before),
.budget-table-wrap :deep(.el-table__border-left-patch) {
  display: none;
}

.budget-table-wrap :deep(.el-table th.el-table__cell) {
  background: #f8fafc;
  color: #1f2937;
  font-weight: 800;
}

.budget-table-wrap :deep(.el-table td.el-table__cell) {
  color: #273142;
}

.budget-table-wrap :deep(.el-table .cell) {
  padding: 0 12px;
  white-space: nowrap;
}

.budget-table-wrap :deep(.el-table--border .el-table__cell) {
  border-right-color: #edf1f6;
}

.budget-rate {
  width: 100%;
  max-width: 110px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 auto;
}

.budget-rate span {
  flex: 0 0 auto;
  color: #273142;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  min-width: 32px;
}

.budget-rate div {
  flex: 1;
  min-width: 0;
  height: 6px;
  border-radius: 4px;
  background: #e9edf3;
  overflow: hidden;
}

.budget-rate em {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.budget-rate em.ok {
  background: var(--success);
}

.budget-rate em.warn {
  background: var(--warning);
}

.budget-rate em.danger {
  background: var(--danger);
}

.budget-threshold-badge {
  min-width: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 9px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.budget-threshold-badge.reminder {
  background: var(--theme-primary-soft);
  color: var(--theme-primary-active);
}

.budget-threshold-badge.alert {
  background: rgba(245, 158, 11, .14);
  color: #b45309;
}

.budget-threshold-badge.risk {
  background: rgba(127, 29, 29, .1);
  color: #7f1d1d;
}

.budget-table-foot {
  min-height: 52px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.budget-page-summary {
  color: #64748b;
  font-size: 14px;
  font-weight: 650;
}

.budget-pager {
  display: inline-flex;
  justify-content: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  background: #f8fafc;
}

.budget-pager :deep(.btn-prev),
.budget-pager :deep(.btn-next),
.budget-pager :deep(.el-pager li) {
  min-width: 32px;
  height: 32px;
  border-radius: 4px;
  background: transparent;
  color: #334155;
  font-size: 14px;
  font-weight: 800;
  transition: background 160ms ease, color 160ms ease;
}

.budget-pager :deep(.btn-prev:hover:not(:disabled)),
.budget-pager :deep(.btn-next:hover:not(:disabled)),
.budget-pager :deep(.el-pager li:hover:not(.is-active)) {
  background: #fff;
  color: var(--theme-primary-active);
}

.budget-pager :deep(.el-pager li.is-active) {
  background: var(--theme-primary-active);
  color: #fff;
}

.budget-pager :deep(.btn-prev:disabled),
.budget-pager :deep(.btn-next:disabled) {
  color: #94a3b8;
  cursor: not-allowed;
}

.budget-page-size {
  min-height: 38px;
  min-width: 112px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 14px;
  border: 1px solid #d7e0ea;
  border-radius: 4px;
  background: #fff;
  color: #334155;
  font-size: 14px;
  font-weight: 750;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease;
}

.budget-page-size-select {
  width: 112px;
}

.budget-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.82fr);
  gap: 10px;
}

.budget-link-btn {
  height: 30px;
  padding: 0 8px;
  border-radius: 4px;
  color: var(--theme-primary-active);
  font-size: 14px;
  font-weight: 800;
}

.budget-link-btn:hover {
  background: var(--theme-primary-soft);
  color: var(--theme-primary-active);
}

.budget-chart-legend {
  display: flex;
  align-items: center;
  gap: 22px;
  color: #4b5563;
  font-size: 13px;
}

.budget-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend-line {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--theme-primary);
}

.legend-line.occupied {
  background: var(--warning);
}

.legend-line.available {
  background: #e5edf3;
  border: 1px solid #cbd5e1;
}

.budget-chart-panel {
  padding-bottom: 16px;
}

.budget-chart-panel .budget-trend-chart {
  margin: 12px 18px 0;
}

.budget-alert-list {
  display: grid;
  padding: 12px 20px 18px;
}

.budget-alert-empty {
  min-height: 220px;
  padding: 28px 24px 30px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  text-align: center;
}

.budget-alert-empty-icon {
  width: 44px;
  height: 44px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  background: var(--theme-primary-soft);
  color: var(--theme-primary-active);
  font-size: 24px;
}

.budget-alert-empty strong {
  color: #111827;
  font-size: 16px;
  font-weight: 800;
}

.budget-alert-empty p {
  max-width: 260px;
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.6;
}

.budget-alert-row {
  min-height: 46px;
  display: grid;
  grid-template-columns: 12px 120px minmax(0, 1fr) 92px;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid #edf1f6;
}

.budget-alert-row:last-child {
  border-bottom: 0;
}

.budget-alert-row i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.budget-alert-row i.danger {
  background: var(--danger);
}

.budget-alert-row i.warn {
  background: var(--warning);
}

.budget-alert-row i.ok {
  background: var(--success);
}

.budget-alert-row strong {
  color: #273142;
  font-size: 14px;
  font-weight: 800;
}

.budget-alert-row span {
  min-width: 0;
  color: #4b5563;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.budget-alert-row time {
  color: #6b7280;
  font-size: 13px;
  text-align: right;
}

@keyframes dashboardItemIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes iconPop {
  0% {
    opacity: 0;
    transform: scale(.82);
  }
  70% {
    opacity: 1;
    transform: scale(1.04);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 1280px) {
  .budget-summary-grid,
  .budget-bottom-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .budget-work-grid {
    grid-template-columns: 1fr;
  }

  .budget-department-panel {
    min-height: auto;
  }

  .department-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .budget-summary-grid,
  .budget-bottom-grid {
    grid-template-columns: 1fr;
  }

  .budget-filter-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .budget-filter-bar label,
  .budget-filter-bar .enterprise-select,
  .budget-filter-set,
  .budget-action-set,
  .budget-primary-btn,
  .budget-ghost-btn {
    width: 100%;
  }

  .budget-filter-bar label {
    justify-content: space-between;
  }

  .budget-table-foot {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .budget-pager,
  .budget-page-size {
    width: 100%;
  }

  .department-list {
    grid-template-columns: 1fr;
  }

  .budget-alert-row {
    grid-template-columns: 12px minmax(0, 1fr);
  }

  .budget-alert-row span,
  .budget-alert-row time {
    grid-column: 2;
  }
}
