:root {
  --bs-primary: #2563eb;
  --bs-primary-rgb: 37, 99, 235;
  --bs-body-bg: #f8f9fa;
}

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #1f2937;
}

/* 列表页整页布局：body 锁死视口高度且不出现整页滚动条，
   仅列表表格区域内部滚动 */
.maycur-list-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.maycur-topnav {
  flex-shrink: 0;
}

.maycur-list-page main.container-fluid {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 1rem 1rem 0;
}

.maycur-list-page main.container-fluid > .row,
.maycur-list-page main.container-fluid > .nav-tabs,
.maycur-list-page main.container-fluid > .card:not(.maycur-list-card) {
  flex-shrink: 0;
}

.maycur-list-page .maycur-list-card {
  flex: 1 1 auto;
  min-height: 0;
  height: auto !important;
}

.maycur-topnav {
  background-color: #1677ff;
  box-shadow: 0 2px 8px rgba(22, 119, 255, 0.25);
}

.maycur-topnav .navbar-brand {
  color: #fff !important;
  font-size: 1.125rem;
}

.maycur-topnav .nav-link {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  padding: 0.5rem 1rem !important;
  border-radius: 0.375rem;
  transition: color 0.2s, background-color 0.2s;
}

.maycur-topnav .nav-link:hover,
.maycur-topnav .nav-link:focus {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.12);
}

.maycur-topnav .nav-link.active {
  color: #fff !important;
  background-color: rgba(255, 255, 255, 0.12);
  position: relative;
}

.maycur-topnav .nav-link.active::after {
  content: "";
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 0.25rem;
  height: 2px;
  background-color: #fff;
  border-radius: 1px;
}

.maycur-topnav .navbar-toggler-icon {
  filter: invert(1) brightness(2);
}

.card {
  border-radius: 0.75rem;
}

.table thead th {
  font-weight: 600;
  font-size: 0.875rem;
  color: #4b5563;
  border-bottom: 1px solid #e5e7eb;
}

.table tbody td {
  font-size: 0.875rem;
  color: #374151;
  border-bottom: 1px solid #f3f4f6;
}

.badge-status {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.25;
  padding: 0.3em 0.7em;
  border-radius: 999px;
  border: 1px solid transparent;
  /* 默认（兜底，不依赖 Bootstrap 背景工具类） */
  background-color: #f0f1f3;
  color: #5b6168;
}

/* 状态配色：浅底深字，对齐每刻官方风格（独立 .st-* 选择器，列表/详情页通用） */
.st-blue {
  background-color: #e8f1ff !important;
  color: #1668dc !important;
  border-color: #cfe0ff !important;
}
.st-green {
  background-color: #e7f7ec !important;
  color: #18a058 !important;
  border-color: #c9eed6 !important;
}
.st-orange {
  background-color: #fff3e6 !important;
  color: #d9730d !important;
  border-color: #ffe1bf !important;
}
.st-red {
  background-color: #fdecec !important;
  color: #d4380d !important;
  border-color: #f9cfcf !important;
}
.st-gray {
  background-color: #f0f1f3 !important;
  color: #5b6168 !important;
  border-color: #e3e5e8 !important;
}

.form-label {
  font-weight: 500;
}

.btn {
  border-radius: 0.5rem;
}

.min-vh-100 {
  min-height: 100vh;
}

/* 报销单列表：全宽 + 横向滚动 + 表头不换行 + 操作列固定 */
.maycur-list-card {
  display: flex;
  flex-direction: column;
}

/* 列表页整体 flex 布局下，卡片占满 main 剩余空间；高度由父级 flex 决定 */
.maycur-list-page main.container-fluid > .card.maycur-list-card {
  flex: 1 1 auto;
  min-height: 0;
  height: auto !important;
}

.maycur-list-card > .card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 0;
}

.list-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  background-color: #fff;
  flex-shrink: 0;
  gap: 0.75rem;
}

.maycur-table-wrap {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.list-footer {
  flex-shrink: 0;
  padding: 0.75rem 1rem;
  border-top: 1px solid #e5e7eb;
  background-color: #fff;
}

@media (max-width: 767.98px) {
  .list-toolbar {
    padding: 0.625rem 0.75rem;
  }
  .list-footer {
    padding: 0.625rem 0.75rem;
  }
}

.maycur-table {
  width: 100%;
  min-width: 1100px;
  table-layout: auto;
}

.maycur-table thead th {
  white-space: nowrap;
  vertical-align: middle;
  background-color: #f8f9fa;
  position: sticky;
  top: 0;
  z-index: 5;
}

.maycur-table thead th.sticky-col-left,
.maycur-table thead th.sticky-col-right {
  z-index: 6;
}

.maycur-table tbody td {
  vertical-align: middle;
}

/* 固定列：左侧 checkbox 列 + 右侧操作列 */
.sticky-col-left,
.sticky-col-right {
  position: sticky;
  z-index: 2;
  background-color: inherit;
}

.sticky-col-left {
  left: 0;
}

.sticky-col-right {
  right: 0;
}

.maycur-table thead th.sticky-col-left,
.maycur-table thead th.sticky-col-right {
  z-index: 3;
  background-color: #f8f9fa;
}

/* 给固定列加一道右侧/左侧阴影，滚动时视觉分割更明显 */
.sticky-col-left::after,
.sticky-col-right::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 6px;
  pointer-events: none;
}

.sticky-col-left::after {
  right: -6px;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.06), transparent);
}

.sticky-col-right::after {
  left: -6px;
  background: linear-gradient(to left, rgba(0, 0, 0, 0.06), transparent);
}

@media (max-width: 576px) {
  .card-body {
    padding: 1rem;
  }
}

/* ---------- 详情页附件卡片 ---------- */
.attachment-card {
  transition: box-shadow 0.2s, transform 0.15s, border-color 0.2s;
  border-radius: 0.625rem;
}

.attachment-card:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.35);
}

.attachment-card .card-footer .btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

.attachment-card .bi {
  line-height: 1;
}

/* 发票预览卡片 */
#invoicePreviewBody .card {
  border-radius: 0.75rem;
}

#invoicePreviewBody .card-header {
  border-radius: 0.75rem 0.75rem 0 0 !important;
}

/* ---------- 单据列表筛选区（紧凑） ---------- */
.filter-card .card-body {
  padding: 0.625rem 1rem;
}

.filter-row {
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid #e9ecef;
}

.filter-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #6c757d;
  white-space: nowrap;
  min-width: 4rem;
  text-align: right;
}

#statusGroups .btn {
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: 0.8125rem;
}

#statusChecks .form-check {
  min-height: auto;
  margin-bottom: 0;
}

#statusChecks .form-check-label {
  font-size: 0.8125rem;
}

#statusChecks .form-check-input {
  margin-top: 0.15rem;
}

#datePresets .btn {
  min-width: 4rem;
  padding: 0.15rem 0.5rem;
  font-size: 0.8125rem;
}

/* 让日期输入框和关键词输入框高度一致 */
#customDateRange .input-group-sm,
#keyword {
  height: 31px;
}

#customDateRange .form-control {
  font-size: 0.8125rem;
}

@media (max-width: 991.98px) {
  .filter-label {
    text-align: left;
    min-width: auto;
  }
  #statusChecks {
    padding-left: 0 !important;
  }
}

/* 列表行：整行可点击（鼠标手势）+ 选中蓝色高亮 + hover 轻提示 */
.maycur-table tbody tr {
  cursor: pointer;
}

.maycur-table tbody tr:hover {
  background-color: rgba(37, 99, 235, 0.06);
}

.maycur-table tbody tr.row-selected {
  background-color: rgba(37, 99, 235, 0.15);
}

.maycur-table tbody tr.row-selected:hover {
  background-color: rgba(37, 99, 235, 0.22);
}
