/* 月度开票管理系统 Web版 - 自定义样式 */

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: #f0f2f5;
}

#app {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* 登录页 */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.login-card {
  width: 400px;
  padding: 30px 40px 40px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}
.login-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}
.login-logo {
  display: block;
  width: 132px;
  height: 132px;
  object-fit: contain;
}
.login-title {
  text-align: center;
  font-size: 22px;
  font-weight: 600;
  color: #303133;
  margin-top: 2px;
  margin-bottom: 8px;
}
.login-subtitle {
  text-align: center;
  font-size: 13px;
  color: #909399;
  margin-bottom: 30px;
}

/* 主布局 */
.app-layout {
  width: 100%;
  height: 100%;
  min-width: 0;
  overflow: hidden;
}
.app-layout > .el-container {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.app-aside {
  background: #304156;
  transition: width 0.3s;
  flex: 0 0 auto;
  overflow-x: hidden;
  overflow-y: auto;
  border-right: 0;
}
.app-aside .el-menu {
  width: 100%;
  border-right: 0 !important;
}
.app-aside:not(.is-collapsed) .el-menu-item,
.app-aside:not(.is-collapsed) .el-sub-menu__title {
  height: 54px;
  padding: 0 !important;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0;
  line-height: 1;
  text-align: center;
}
.app-aside:not(.is-collapsed) .el-menu-item .el-icon,
.app-aside:not(.is-collapsed) .el-sub-menu__title .el-icon {
  display: none;
}
.app-aside:not(.is-collapsed) .el-menu-item span,
.app-aside:not(.is-collapsed) .el-sub-menu__title span {
  display: block;
  width: 100%;
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
  text-align: center;
}
.app-aside .el-menu-item,
.app-aside .el-sub-menu__title {
  color: #fff;
}
.app-aside .el-menu-item.is-active {
  color: #55b2ff;
  background: rgba(64, 158, 255, 0.13) !important;
}
.app-aside:not(.is-collapsed) .el-sub-menu__icon-arrow {
  display: none;
}
.app-header {
  background: #fff;
  border-bottom: 1px solid #e4e7ed;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 56px;
}
.app-main {
  width: auto;
  max-width: 100%;
  flex: 1 1 auto;
  min-width: 0;
  background: #f0f2f5;
  padding: 16px;
  overflow: auto;
}

/* 侧边栏 */
.sidebar-logo {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 0;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  background: #2b3a4d;
  white-space: nowrap;
  overflow: hidden;
}
.app-aside.is-collapsed .sidebar-logo {
  justify-content: center;
  padding-left: 0;
}
.sidebar-logo .logo-icon {
  width: 42px;
  height: 42px;
  margin: 0;
  object-fit: contain;
  padding: 5px;
  background: #fff;
  border-radius: 9px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.16);
  flex: 0 0 auto;
}

.navigation-sort-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 58vh;
  overflow-y: auto;
}
.navigation-sort-item {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #dcdfe6;
  border-radius: 6px;
  background: #fff;
  cursor: grab;
  user-select: none;
}
.navigation-sort-item:hover {
  border-color: #409eff;
  background: #f5f9ff;
}
.navigation-drag-handle {
  margin-right: 10px;
  color: #909399;
  font-size: 18px;
  letter-spacing: -4px;
}

/* 仪表盘卡片 */
.stat-card {
  display: flex;
  align-items: center;
  padding: 20px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-right: 16px;
  color: #fff;
}
.stat-value { font-size: 24px; font-weight: 700; color: #303133; }
.stat-label { font-size: 13px; color: #909399; margin-top: 4px; }

/* 表格页 */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.page-title { font-size: 18px; font-weight: 600; color: #303133; }

.filter-bar {
  background: #fff;
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.filter-bar .el-input, .filter-bar .el-select { width: 200px; }

/* 筛选框前字段名标签（如：发票类别 / 开票状态） */
.filter-field-label {
  color: #606266;
  font-size: 14px;
  white-space: nowrap;
  line-height: 32px;
  user-select: none;
}
.filter-bar .filter-field-label + .el-select { width: auto; }

/* 让 el-select 的 placeholder 字色/字号与 el-input placeholder 一致（用户反馈 "没文字提示是什么筛选"） */
/* v34: 仅强化未选中状态，已选中的文字保持 Element Plus 默认深色 #303133 */
/* v35: Element Plus 真实状态 = .is-transparent 类（带=未选中，不带=已选中）
   - 未选中（.is-transparent）= 浅灰 #909399（比 Element Plus 默认 #a8abb2 深 2 档，能看清）
   - 已选中（无 .is-transparent）= 深色 #303133 + 加粗，绝对清晰可见 */
.filter-bar .el-select__placeholder.is-transparent {
  color: #909399;
  font-size: 13px;
  font-weight: 400;
}
.filter-bar .el-select:hover .el-select__placeholder.is-transparent,
.filter-bar .el-select.is-focus .el-select__placeholder.is-transparent {
  color: #606266;
}
/* 选中后：强制深色 + 加粗 + 加大字号，确保绝对可见 */
.filter-bar .el-select__placeholder:not(.is-transparent) {
  color: #303133 !important;
  opacity: 1 !important;
  font-size: 14px !important;
  font-weight: 500 !important;
}
/* 已选中时 el-input 内部 input 也用深色（防御性） */
.filter-bar .el-select .el-input__inner {
  color: #303133;
}

/* 防止筛选栏多选框因标签过多撑高整行 */
.filter-bar .el-select__wrapper,
.filter-bar .el-select .el-input__wrapper,
.filter-bar .el-select .el-input__inner {
  min-height: 32px !important;
  height: 32px !important;
  max-height: 32px !important;
}
.filter-bar .el-select__tags,
.filter-bar .el-select__selection {
  flex-wrap: nowrap !important;
  overflow: hidden;
}
.filter-bar .el-select__tags-text {
  display: inline-block;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
.filter-bar .el-select__selected-item {
  display: inline-block;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.table-card {
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* 状态标签 */
.status-active { color: #67c23a; }
.status-inactive { color: #f56c6c; }

/* 金额 */
.amount { font-weight: 600; color: #409eff; }
.amount-danger { font-weight: 600; color: #f56c6c; }

.chasing-summary { margin-bottom: 16px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.chasing-summary > .chasing-card { min-width: 0; }
.chasing-card {
  background: #fff;
  border-radius: 8px;
  padding: 14px 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border-left: 4px solid #409eff;
  overflow: hidden;
  min-width: 0;
}
.chasing-card-label { color: #909399; font-size: 12px; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chasing-card-value { color: #303133; font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.5px; }
.chasing-card-value.success { color: #67c23a; }
.chasing-card-value.danger { color: #f56c6c; }
.chasing-card-value.warning { color: #e6a23c; }
.chasing-card-purple { border-left-color: #8e44ad; }
.chasing-card-value.purple { color: #8e44ad; }
.chasing-table { padding: 12px; overflow: hidden; }

/* 1688采购汇总：账号金额显示摘要，完整明细按需展开，避免撑高整行 */
.account-summary-cell {
  min-height: 70px;
  padding: 4px 2px;
  font-size: 12px;
  line-height: 18px;
}
.account-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 20px;
  color: #909399;
}
.account-summary-line {
  display: grid;
  grid-template-columns: minmax(82px, 1.25fr) minmax(80px, 1fr) minmax(78px, 1fr) minmax(68px, .8fr);
  gap: 6px;
  align-items: center;
  white-space: nowrap;
}
.account-summary-line strong {
  overflow: hidden;
  text-overflow: ellipsis;
}
.account-deducted { color: #e6a23c; }
.account-remaining { color: #67c23a; margin-left: 8px; }
.account-muted { color: #909399; }
.account-overage { color: #f56c6c; }
.account-empty { color: #c0c4cc; }
.account-adjust-button { margin-top: 1px; padding: 0; height: 18px; }

/* 1688 summary: keep the right-side totals readable at every viewport width. */
.purchase-summary-table .remaining-quota-column {
  padding-right: 18px !important;
}
.purchase-summary-table .el-table__fixed-right,
.purchase-summary-table .el-table__fixed-right-patch {
  right: 0 !important;
}
.account-detail-title {
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #303133;
}
.account-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 5px;
}
.account-detail-item {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #ebeef5;
  border-radius: 6px;
  background: #fafcff;
  font-size: 12px;
  line-height: 19px;
}
.account-detail-name {
  overflow: hidden;
  color: #303133;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.adjustment-range-summary {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 540px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #dcdfe6;
  border-radius: 5px;
  background: #f8faff;
  color: #606266;
}
.adjustment-range-summary b { color: #409eff; }
.adjustment-month-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 650px;
  max-height: 190px;
  overflow-y: auto;
}
.adjustment-month-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid #ebeef5;
  border-radius: 5px;
  background: #fafcff;
  color: #606266;
  font-size: 12px;
  line-height: 18px;
}
.adjustment-month-item b { color: #303133; }
.adjustment-month-item em { color: #67c23a; font-style: normal; font-weight: 600; }

/* 响应式 */
@media (max-width: 768px) {
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar .el-input, .filter-bar .el-select { width: 100%; }
}


/* 20260819-12: 删除破坏 Popper 定位的 overflow:visible hack。el-date-picker 默认 append-to-body，
   面板挂载到 document.body 下，不受 el-card overflow 截断。无需全局覆盖 .el-popper overflow。 */

/* 20260825-04 筛选区字段名标签 */
.filter-label {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  color: #606266;
  height: 32px;
  padding: 0 4px 0 0;
  white-space: nowrap;
}

/* 20260825-06 强制显示 el-select / el-date-picker 占位文字 */
.filter-bar .el-select__placeholder.is-transparent {
  color: #909399;
  opacity: 1;
  font-size: 13px;
}
/* v35 兜底：已选中文字深色 */
.filter-bar .el-select__placeholder:not(.is-transparent) {
  color: #303133;
  opacity: 1;
}
.filter-bar .el-date-editor.el-input input.el-input__inner::placeholder,
.filter-bar .el-date-editor .el-input__inner::placeholder {
  color: #909399 !important;
  opacity: 1 !important;
  font-size: 13px;
}

/* 20260825-07 暴力覆盖 placeholder 节点（Element Plus v2.7+ 动态 class 不确定） */
.filter-bar {
  --el-text-color-placeholder: #909399 !important;
  --el-input-placeholder-color: #909399 !important;
}
.filter-bar .el-select__placeholder,
.filter-bar .el-select [class*="placeholder"],
.filter-bar .el-select [class*="Placeholder"],
.filter-bar [class*="el-select"] [class*="placeholder"],
.filter-bar [class*="el-select"] [class*="Placeholder"] {
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
  color: #909399 !important;
  position: absolute !important;
  left: 12px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: auto !important;
  max-width: calc(100% - 40px) !important;
  height: auto !important;
  font-size: 13px !important;
  pointer-events: none !important;
  z-index: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* filterable 模式：input 原生 placeholder */
.filter-bar .el-select .el-input__inner::placeholder,
.filter-bar .el-select .el-select__input::placeholder,
.filter-bar .el-date-editor .el-input__inner::placeholder {
  color: #909399 !important;
  opacity: 1 !important;
  font-size: 13px !important;
}
.filter-bar .el-select.is-focus .el-select__placeholder,
.filter-bar .el-select.is-focused .el-select__placeholder {
  display: none !important;
}
.filter-bar .el-select.has-value .el-select__placeholder {
  display: none !important;
}

/* 20260825-08 字段名标签视觉强化（兜底） */
.filter-bar .filter-label {
  display: inline-flex !important;
  align-items: center;
  height: 32px;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: #303133 !important;
  padding: 0 2px 0 4px !important;
  white-space: nowrap;
  user-select: none;
  line-height: 32px !important;
  letter-spacing: 0;
}
.filter-bar .filter-label::after {
  content: "：";
  color: #909399;
  margin: 0 1px 0 -1px;
}

/* 20260825-09 强制 native input placeholder 颜色（filterable el-select 走 input 原生 placeholder） */
.filter-bar .el-select .el-input__inner::placeholder,
.filter-bar .el-select input::placeholder,
.filter-bar .el-date-editor .el-input__inner::placeholder,
.filter-bar .el-date-editor input::placeholder {
  color: #909399 !important;
  opacity: 1 !important;
  font-size: 13px !important;
  font-weight: 400 !important;
}


/* ========================================================================
   v20260826-36 暴力兜底：所有可能显示"选中文字"的 DOM 元素都强制深色
   原因：v35 的 :not(.is-transparent) 只改 .el-select__placeholder，但 
   Element Plus 2.7+ 单选 el-select 选中后文字实际渲染在 .el-input__inner 
   <input> 里。v36 改为给所有可能显示文字的 DOM 元素都强制深色 + !important 
   + -webkit-text-fill-color 兜底 webkit autofill。
   ======================================================================== */
.filter-bar .el-select__placeholder,
.filter-bar .el-select .el-input__inner,
.filter-bar .el-select .el-select__selection,
.filter-bar .el-select .el-select__selected-item,
.filter-bar .el-select .el-select__wrapper,
.filter-bar .el-select .el-select__input {
  color: #303133 !important;
  opacity: 1 !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  -webkit-text-fill-color: #303133 !important;
}
/* placeholder 模式（未选中）：覆盖为浅灰 */
.filter-bar .el-select__placeholder.is-transparent {
  color: #909399 !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  -webkit-text-fill-color: #909399 !important;
}
/* 强制显示（兜底） */
.filter-bar .el-select__placeholder,
.filter-bar .el-select .el-select__selection {
  display: block !important;
  visibility: visible !important;
}


/* ========================================================================
   v20260826-38 修复 v37 引入的致命问题
   根因：v37 把 .filter-bar .el-select input / wrapper / selection 等节点设成
   position:absolute + pointer-events:none，导致所有模块的筛选下拉无法点击
   （点击无反应）且文字错位悬浮。v38 只保留颜色覆盖，移除全部布局与点击属性。
   ======================================================================== */
.filter-bar .el-select [class*="placeholder"],
.filter-bar .el-select [class*="Placeholder"],
.filter-bar [class*="el-select"] [class*="placeholder"],
.filter-bar [class*="el-select"] [class*="Placeholder"],
.filter-bar .el-select__placeholder,
.filter-bar .el-select .el-select__selected-item,
.filter-bar .el-select .el-select__selection,
.filter-bar .el-select .el-select__wrapper,
.filter-bar .el-select .el-select__input,
.filter-bar .el-select input {
  color: #303133 !important;
  opacity: 1 !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  -webkit-text-fill-color: #303133 !important;
}
/* 未选中（placeholder 模式）：覆盖为浅灰 */
.filter-bar .el-select [class*="placeholder"].is-transparent,
.filter-bar .el-select [class*="Placeholder"].is-transparent,
.filter-bar [class*="el-select"] [class*="placeholder"].is-transparent,
.filter-bar [class*="el-select"] [class*="Placeholder"].is-transparent,
.filter-bar .el-select__placeholder.is-transparent {
  color: #909399 !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  -webkit-text-fill-color: #909399 !important;
}

/* ========================================================================
   v20260826-41 修复 el-select placeholder 不显示
   根因：v07 块把 .el-select__placeholder 设成 position:absolute 且 left/top
   等布局属性；v36/v38 块又把 input / placeholder 相关节点颜色/text-fill-color
   强制为深色，导致部分 placeholder 看不见或位置错乱。
   本块只重置 placeholder 的颜色与布局，不动已选中文字的深色样式。
   ======================================================================== */
.filter-bar .el-select .el-input__inner::placeholder,
.filter-bar .el-select input::placeholder,
.filter-bar .el-select .el-select__input::placeholder,
.filter-bar .el-select__placeholder,
.filter-bar .el-select [class*="placeholder"] {
  color: #909399 !important;
  opacity: 1 !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  -webkit-text-fill-color: #909399 !important;
  position: static !important;
  transform: none !important;
  left: auto !important;
  top: auto !important;
  width: auto !important;
  height: auto !important;
}


/* ====== 20260827-53: 发票列表 咨询账号 列(只读态+编辑按钮) ====== */
.consult-readonly-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
}
.consult-readonly-cell .ca-value {
  flex: 1;
  min-width: 0;
  color: #303133;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.consult-readonly-cell .ca-value.empty {
  color: #c0c4cc;
  font-style: italic;
}
.consult-edit-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
}
.consult-edit-cell .el-input { flex: 1; min-width: 0; }
.consult-edit-cell .el-input__inner { padding: 0 8px !important; height: 28px; line-height: 28px; font-size: 13px; }
