/* ============================================================
   中恒数智中台 — 视觉优化补丁 v3 (polish.css)
   基于实际测量：按钮压到 32px，筛选栏紧凑，表格撑满内容区
   ============================================================ */

:root {
  --zh-primary: #1e3a5f;
  --zh-primary-hover: #1a3050;
  --zh-border: #e2e8f0;
}

/* ---------- 1. 全局紧凑化 ---------- */
body {
  background-color: #f0f2f5 !important;
  -webkit-font-smoothing: antialiased;
}

/* 主内容区：减少左右 padding，让表格更宽 */
.main-content {
  padding: 8px 12px !important;
}

/* 顶部标题栏：减少上下间距 */
.main-content > .d-flex.justify-content-between {
  padding-bottom: 6px !important;
  margin-bottom: 8px !important;
  border-bottom: 1px solid var(--zh-border);
}

/* ---------- 2. 按钮统一紧凑尺寸（核心改动） ---------- */
/* 所有按钮统一高度，文字垂直水平居中 */
.btn {
  height: 34px;
  padding: 4px 12px !important;
  font-size: 13px !important;
  line-height: 1 !important;
  border-radius: 4px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px;
  white-space: nowrap;
}

.btn-sm {
  height: 28px !important;
  padding: 2px 10px !important;
  font-size: 12px !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* 主色按钮统一深蓝 */
.btn-primary,
.btn-success,
.btn-danger {
  background-color: var(--zh-primary) !important;
  border-color: var(--zh-primary) !important;
  color: #fff !important;
}

.btn-primary:hover, .btn-primary:focus,
.btn-success:hover, .btn-success:focus,
.btn-danger:hover, .btn-danger:focus {
  background-color: var(--zh-primary-hover) !important;
  border-color: var(--zh-primary-hover) !important;
}

/* outline 按钮统一 */
.btn-outline-secondary {
  border-color: #cbd5e1 !important;
  color: #475569 !important;
}

.btn-outline-secondary:hover {
  background-color: #f1f5f9 !important;
  border-color: #94a3b8 !important;
  color: var(--zh-primary) !important;
}

/* outline-primary 按钮（表格里的详情/编辑） */
.btn-outline-primary {
  border-color: #94a3b8 !important;
  color: var(--zh-primary) !important;
}

.btn-outline-primary:hover {
  background-color: #f0f7ff !important;
  border-color: var(--zh-primary) !important;
}

/* ---------- 3. 筛选栏紧凑化 ---------- */
/* 筛选卡片：减少 padding */
.compact-filter .card-body,
.card.mb-2 .card-body,
.card.mb-3 .card-body {
  padding: 6px 10px !important;
}

/* 筛选标签：更小更紧凑 */
.form-label {
  font-size: 11px !important;
  margin-bottom: 2px !important;
  font-weight: 600 !important;
  color: #334155 !important;
}

/* 输入框：统一高度 28px */
.form-control,
.form-select,
.alita-msel-input {
  height: 28px !important;
  padding: 2px 8px !important;
  font-size: 12px !important;
  border-radius: 4px !important;
}

.form-control-sm,
.form-select-sm {
  height: 28px !important;
  padding: 2px 8px !important;
  font-size: 12px !important;
}

/* 筛选按钮：和输入框对齐 */
.compact-filter .btn,
.card.mb-2 .btn,
.card.mb-3 .btn {
  height: 28px !important;
  padding: 2px 10px !important;
  font-size: 12px !important;
}

/* ---------- 4. 卡片细化 ---------- */
.card {
  border: 1px solid var(--zh-border) !important;
  border-radius: 6px !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
}

.card-header {
  background: #f8fafc !important;
  border-bottom: 1px solid var(--zh-border) !important;
  padding: 6px 12px !important;
  font-size: 12px !important;
  font-weight: 600;
}

/* ---------- 5. 表格撑满 + 可读性优先 ---------- */
/* 表格宽度 100% 撑满内容区 */
.table {
  width: 100% !important;
  font-size: 12px !important;
}

/* 表头紧凑 + sticky 钉住 */
.table thead th {
  padding: 5px 10px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  background: #f1f5f9 !important;
  color: #475569 !important;
  border-bottom: 2px solid #cbd5e1 !important;
  white-space: nowrap;
  position: sticky !important;
  top: 0 !important;
  z-index: 10 !important;
}

/* 表格容器内部滚动，sticky 相对容器生效 */
.table-responsive,
.table-container,
.card-body > .table {
  overflow: auto !important;
}

/* 确保表头背景实色，不透明 */
.table thead th {
  background-color: #f1f5f9 !important;
  background-image: none !important;
}

/* 单元格紧凑（对齐询价明细行高标准，再压一档） */
.table tbody td {
  padding: 3px 8px !important;
  font-size: 12px !important;
  border-bottom: 1px solid #eef2f7 !important;
  vertical-align: middle;
  line-height: 1.4 !important;
}

/* 覆盖模板内联样式：purchaser 表格的硬编码（更高优先级） */
XXX
  font-size: 12px !important;
  padding: 3px 8px !important;
}

table.table#purchaserTable > thead > tr > th {
  font-size: 12px !important;
}

/* 品类树页面字体统一 14px（覆盖所有硬编码小字号） */
.category-tree-container,
.category-detail-panel,
.category-tree-node,
.tree-node-label,
.tree-detail-item,
.tree-node,
.tree-node span,
.tree-node a,
.tree-node i,
.category-detail-panel span,
.category-detail-panel div,
.category-detail-panel p,
.category-detail-panel a,
.category-detail-panel td,
.category-detail-panel th,
.category-detail-panel label,
.category-detail-panel .detail-label,
.category-detail-panel .detail-value,
.category-detail-panel .param-name,
.category-detail-panel .param-value {
  font-size: 14px !important;
}

/* 品类树详情面板内的表格也统一 */
.category-detail-panel .table,
.category-tree-container .table,
.category-detail-panel .table td,
.category-detail-panel .table th {
  font-size: 14px !important;
}

/* 斑马纹 */
.table tbody tr:nth-child(even) {
  background-color: #fafbfc;
}

.table tbody tr:hover {
  background-color: #f0f7ff !important;
}

/* 表格链接 */
.table td a {
  color: #2c5282;
  text-decoration: none;
}

.table td a:hover {
  color: var(--zh-primary);
  text-decoration: underline;
}

/* 表格滚动容器：确保占满剩余空间 */
.table-scroll-container {
  flex: 1 1 auto !important;
  overflow: auto !important;
  min-height: 100px !important;
  background: #fff;
}

/* 表格滚动条 */
.table-scroll-container::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.table-scroll-container::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.table-scroll-container::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.table-scroll-container::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ---------- 6. 侧边栏层级优化 ---------- */
.sidebar {
  background: linear-gradient(180deg, #1e3c72 0%, #2a5298 100%) !important;
  box-shadow: 2px 0 6px rgba(0, 0, 0, 0.1);
}

/* 一级模块标题（商品中心、业务售前等）：大气、加粗、紧凑 */
.sidebar-module-title {
  background: linear-gradient(90deg, #2a5298 0%, #1e3c72 100%) !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  padding: 6px 14px !important;
  letter-spacing: 2px;
  border-left: 4px solid #60a5fa !important;
  margin-top: 2px;
  display: flex;
  align-items: center;
}

/* 二级分组标题（品类树、品牌库、CRM、询报价等）：14px 加粗 */
.sidebar-group-title {
  font-size: 13px !important;
  font-weight: 400 !important;
  padding: 3px 18px !important;
  color: #cbd5e1 !important;
  letter-spacing: 0.5px;
}

.sidebar-group-title span {
  cursor: pointer;
}

/* 三级菜单项（项目管理、客户管理、工作台等）：13px 紧凑 */
.nav-item.level3 .nav-link {
  font-size: 12px !important;
  padding: 3px 16px 3px 36px !important;
  color: #e2e8f0 !important;
  transition: background 0.15s ease, color 0.15s ease;
}

/* hover：比一级稍亮的蓝，明显不同于选中态亮蓝实心 */
.nav-item.level3 .nav-link:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #fff !important;
}

/* 三级选中态：亮蓝实心 #3b82f6，去掉左侧竖条，白色加粗 */
.nav-item.level3 .nav-link.active {
  background: #3b82f6 !important;
  color: #fff !important;
  border-left: none !important;
  font-weight: 700;
}

.nav-item.level3 .nav-link.active i {
  color: #fff !important;
}

/* 四级菜单项（询价草稿单等）：12px */
.nav-item.level4 .nav-link {
  font-size: 11px !important;
  padding: 3px 16px 3px 52px !important;
  color: #94a3b8 !important;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-item.level4 .nav-link:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #cbd5e1 !important;
}

/* 四级选中态：亮蓝实心 #3b82f6，去掉左侧竖条 */
.nav-item.level4 .nav-link.active {
  background: #3b82f6 !important;
  color: #fff !important;
  border-left: none !important;
  font-weight: 600;
}

.nav-item.level4 .nav-link.active i {
  color: #fff !important;
}

/* 侧边栏展开/收缩箭头：15px、贴最左、扩大热区 */
.sidebar .sidebar-group-title .bi-chevron-down,
.sidebar .sidebar-group-title .bi-chevron-up,
.sidebar .sidebar-module-title .bi-chevron-down,
.sidebar .sidebar-module-title .bi-chevron-up {
  font-size: 15px !important;
  margin-left: 0 !important;
  margin-right: 6px !important;
  padding: 4px 2px !important;
  opacity: 0.9;
  transition: transform 0.2s ease;
}

.sidebar .sidebar-group-title:hover .bi-chevron-down,
.sidebar .sidebar-group-title:hover .bi-chevron-up,
.sidebar .sidebar-module-title:hover .bi-chevron-down,
.sidebar .sidebar-module-title:hover .bi-chevron-up {
  opacity: 1;
}

/* ---------- 7. 状态徽章统一 ---------- */
.badge {
  font-size: 12px !important;
  padding: 3px 8px !important;
  border-radius: 3px !important;
  font-weight: 500 !important;
}

.badge.bg-success { background-color: #d1fae5 !important; color: #065f46 !important; }
.badge.bg-warning { background-color: #fef3c7 !important; color: #92400e !important; }
.badge.bg-secondary { background-color: #e2e8f0 !important; color: #475569 !important; }
.badge.bg-info, .badge.bg-primary { background-color: #dbeafe !important; color: #1e40af !important; }
.badge.bg-danger { background-color: #fee2e2 !important; color: #991b1b !important; }

/* ---------- 8. 分页器紧凑 ---------- */
.pagination .page-link {
  padding: 2px 8px !important;
  font-size: 11px !important;
  border-radius: 3px !important;
  border: 1px solid var(--zh-border);
  color: var(--zh-text, #1e293b);
}

.pagination .page-link:hover {
  background-color: #f1f5f9;
  color: var(--zh-primary);
}

.pagination .page-item.active .page-link {
  background-color: var(--zh-primary) !important;
  border-color: var(--zh-primary) !important;
  color: #fff !important;
}

/* 分页容器：紧贴表格底部 */
.pagination-wrapper {
  padding-top: 4px !important;
  padding-bottom: 4px !important;
}

/* ---------- 9. 下拉菜单 ---------- */
.dropdown-menu {
  border: 1px solid var(--zh-border) !important;
  border-radius: 4px !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08) !important;
  font-size: 12px !important;
}

.dropdown-item {
  padding: 5px 12px !important;
  font-size: 12px !important;
}

.dropdown-item:hover {
  background-color: #f0f7ff !important;
  color: var(--zh-primary) !important;
}

/* ---------- 10. 提示消息 ---------- */
.alert {
  border-radius: 4px !important;
  font-size: 12px !important;
  padding: 6px 10px !important;
}

/* ---------- 11. 批量操作栏（询价明细采购端等） ---------- */
.mt-1.d-flex,
.mb-1.d-flex {
  padding-top: 4px !important;
  padding-bottom: 4px !important;
  gap: 6px !important;
}

/* 批量下载/导入按钮行：紧凑 */
#batchForm > .mt-1 {
  padding: 4px 0 !important;
}

/* ---------- 12. 全页面巡检微调（v14） ---------- */
/* 全宽筛选按钮紧凑化 */
.btn-block,
.d-grid .btn,
form .btn-block {
  height: 36px !important;
  font-size: 14px !important;
  padding: 6px 16px !important;
}

/* 分页器字体对齐表格 14px */
.pagination .page-link {
  font-size: 13px !important;
  padding: 3px 10px !important;
}

/* 分页总条数文字 */
.pagination-wrapper,
.dataTables_info,
.pagination + div,
.pagination-wrapper + div {
  font-size: 13px !important;
  color: #64748b !important;
}

/* 下拉菜单字体对齐 */
.dropdown-menu {
  font-size: 13px !important;
}

.dropdown-item {
  font-size: 13px !important;
  padding: 6px 12px !important;
}

/* 提示消息字体对齐 */
.alert {
  font-size: 13px !important;
  padding: 8px 12px !important;
}

/* 表单标签字体 */
.form-label,
label {
  font-size: 14px !important;
  font-weight: 500 !important;
  color: #475569 !important;
}

/* 表单输入框紧凑 */
.form-control,
.form-select {
  font-size: 14px !important;
  padding: 6px 10px !important;
  height: 36px !important;
}

/* 表格列宽优化：允许内容自然撑开 */
.table td,
.table th {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

/* 长文本列不截断 */
.table td.text,
.table td.title,
.table td.name {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  max-width: none;
}

/* ---------- 13. 登录页密码可见性切换（小眼睛） ---------- */
.password-input-wrapper {
  position: relative;
}

.password-input-wrapper .form-control {
  padding-right: 40px !important;
}

.password-toggle-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #94a3b8;
  font-size: 16px;
  transition: color 0.15s ease;
  user-select: none;
  z-index: 5;
}

.password-toggle-icon:hover {
  color: #3b82f6;
}

/* ---------- 17. 单行报价页布局修复 ---------- */
/* 覆盖模板内联 12px，统一为 14px */
.quote-page-unified,
.quote-page-unified * {
  font-size: 14px !important;
}

.quote-page-unified .form-label,
.quote-page-unified label.col-form-label {
  font-size: 14px !important;
  white-space: nowrap !important;
  text-align: right !important;
  font-weight: 600 !important;
}

.quote-page-unified .form-control,
.quote-page-unified .form-select {
  font-size: 14px !important;
  padding: 6px 10px !important;
  height: 36px !important;
}

/* 标签列统一加宽，防止文字竖排换行 */
.quote-page-unified .col-form-label,
.quote-page-unified label[class*="col-"] {
  min-width: 120px !important;
  max-width: 140px !important;
  padding-right: 8px !important;
  white-space: nowrap !important;
  overflow: visible !important;
}

/* 红星和标签同一行，不换行 */
.quote-page-unified .text-danger {
  display: inline !important;
  margin-left: 2px !important;
  white-space: nowrap !important;
}

/* 预计发货日标签不折行 */
.quote-page-unified label[for*="lead_time"],
.quote-page-unified .col-form-label:contains("工作日") {
  white-space: nowrap !important;
  min-width: 140px !important;
}

/* 销售侧询价信息区：标签不竖排 */
.quote-page-unified .card-body .col-1,
.quote-page-unified .card-body .col-2 {
  white-space: nowrap !important;
}

/* 按钮区对齐 */
.quote-page-unified .btn {
  height: 36px !important;
  font-size: 14px !important;
  min-width: 100px !important;
}

/* 卡片间距收紧 */
.quote-page-unified .card {
  margin-bottom: 8px !important;
}

.quote-page-unified .card-body {
  padding: 10px 12px !important;
}

/* 确保输入框不溢出 */
.quote-page-unified input[type="text"],
.quote-page-unified input[type="number"],
.quote-page-unified textarea {
  width: 100% !important;
}

/* ---------- 18. 客户管理列表操作列 + 详情页对齐 ---------- */
/* 客户列表操作列：去掉无意义的 0，按钮紧凑 */
.table td:last-child {
  white-space: nowrap !important;
}

/* 客户详情页：三个卡片宽度一致 */
.crm-customer-detail .card,
.customer-detail .card {
  width: 100% !important;
  margin-bottom: 12px !important;
}

/* 详情页主内容区撑宽 */
.detail-page .container,
.detail-page .card-body {
  max-width: 100% !important;
}

/* 商机/售后详情主内容区放宽 */
.opportunity-detail,
.aftersale-detail,
.inquiry-detail {
  max-width: 100% !important;
}

.opportunity-detail .row,
.aftersale-detail .row {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* ---------- 14. Alita 可搜索单选下拉样式优化 ---------- */
.alita-wrapper .alita-search {
  height: 36px !important;
  font-size: 14px !important;
  border-radius: 4px !important;
}

.alita-wrapper .alita-arrow {
  font-size: 12px !important;
  color: #94a3b8 !important;
}

.alita-wrapper .alita-dropdown {
  border-radius: 6px !important;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12) !important;
  border: 1px solid #e2e8f0 !important;
  max-height: 300px !important;
}

.alita-wrapper .alita-dropdown .list-group-item {
  font-size: 14px !important;
  padding: 8px 12px !important;
  border-bottom: 1px solid #f1f5f9 !important;
}

.alita-wrapper .alita-dropdown .list-group-item:hover {
  background-color: #f0f7ff !important;
  color: #2563eb !important;
}

.alita-wrapper .alita-dropdown .list-group-item.active,
.alita-wrapper .alita-dropdown .list-group-item[style*="background"] {
  background-color: #dbeafe !important;
  color: #1e40af !important;
  font-weight: 600 !important;
}

/* ---------- 15. 统计卡片样式统一 ---------- */
/* 工作台统计卡片容器 */
.card {
  border-radius: 8px !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
  overflow: hidden;
}

.card-header {
  background: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0 !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #334155 !important;
  padding: 8px 12px !important;
}

.card-body {
  padding: 12px !important;
}

/* 统计数字统一 */
.card .display-4,
.card .display-3,
.card .h2,
.card .h3,
.card h4,
.card h5 {
  font-size: 28px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
}

/* 商机管理管道统计行 */
.text-primary {
  color: #2563eb !important;
}

.text-success {
  color: #059669 !important;
}

.text-warning {
  color: #d97706 !important;
}

.text-danger {
  color: #dc2626 !important;
}

/* 统计标签文字 */
.card .text-muted,
.card .small {
  font-size: 13px !important;
  color: #64748b !important;
}

/* 商机统计行文字统一 */
p span[class*="text-"] {
  font-size: 14px !important;
  font-weight: 600 !important;
  margin-right: 16px !important;
}

/* ---------- 16. 备注框加高 + 并排框对齐 ---------- */
/* 报价备注、采购备注等 textarea 加高到 8 行 */
textarea[name*="remark"],
textarea[name*="note"],
textarea[name*="comment"],
textarea[name*="memo"],
.form-control[type="textarea"],
textarea.form-control {
  min-height: 120px !important;
  resize: vertical;
}

/* 单行报价详情页的两个备注框特别加高 */
textarea[name*="remark"],
textarea[name*="purchase_remark"],
textarea[name*="internal_note"] {
  min-height: 160px !important;
  rows: 8;
}

/* 新建询价页并排文本框高度统一 */
.row textarea.form-control,
.row .form-control[type="textarea"] {
  height: auto !important;
  min-height: 120px !important;
}

/* 确保并排框顶部对齐 */
.row > [class*="col-"] {
  display: flex;
  flex-direction: column;
}

.row > [class*="col-"] .form-control {
  flex: 1;
}

/* v30: force table font-size to 13px with higher specificity */
table.table, table.table td, table.table th {
  font-size: 12px !important;
}


/* v31: purchaser and opportunity tables 12px (other pages stay 13px) */
#purchaserTable,
#purchaserTable td,
#purchaserTable th,
#opportunityTable,
#opportunityTable td,
#opportunityTable th {
  font-size: 12px !important;
}


/* v31b: more specific override for purchaser table */
table.table#purchaserTable > tbody > tr > td,
table.table#purchaserTable > thead > tr > th {
  font-size: 12px !important;
}


/* v32: fix long labels on quote page */
.quote-page-unified .card label.col-form-label {
  width: 140px !important;
  min-width: 140px !important;
  max-width: 140px !important;
  white-space: normal !important;
  word-wrap: break-word !important;
  line-height: 1.2 !important;
  padding-right: 8px !important;
  display: flex !important;
  align-items: center !important;
}
.quote-page-unified .card label.col-form-label .text-danger {
  display: inline !important;
}
/* Make input columns flex to fill remaining space */
.quote-page-unified .card .row > div {
  flex: 1 !important;
  min-width: 0 !important;
}


/* v32b: better fix for long labels - just widen them */
.quote-page-unified label.col-form-label {
  flex: 0 0 150px !important;
  width: 150px !important;
  max-width: 150px !important;
  white-space: normal !important;
  word-wrap: break-word !important;
  line-height: 1.2 !important;
  padding-right: 6px !important;
  text-align: left !important;
}
.quote-page-unified label.col-form-label.text-end {
  text-align: left !important;
}


/* v33: final label rule - template handles lbl-main/lbl-sub, just ensure width */
.quote-page-unified label.col-form-label {
  width: 150px !important;
  min-width: 150px !important;
  max-width: 150px !important;
}


/* v34: unify all quote page labels font-size and weight */
.quote-page-unified label.col-form-label,
.quote-page-unified label.col-form-label .lbl-main {
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
}
.quote-page-unified label.col-form-label .lbl-sub {
  font-size: 10px !important;
  font-weight: normal !important;
  color: #6c757d !important;
  line-height: 1.2 !important;
}


/* v36: fix category row button alignment + increase vertical spacing */

/* 1. Category row: force single line flex */
.quote-page-unified .col-4 .row:first-of-type {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
}
.quote-page-unified .col-4 .row:first-of-type .col-7 {
  flex: 0 0 auto !important;
  width: auto !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}
.quote-page-unified .col-4 .row:first-of-type input {
  width: 220px !important;
}
.quote-page-unified .col-4 .row:first-of-type button {
  margin: 0 !important;
  flex-shrink: 0 !important;
}

/* 2. Increase input/select/file heights */
.quote-page-unified input[type="text"],
.quote-page-unified input[type="number"],
.quote-page-unified select,
.quote-page-unified .form-control {
  height: 38px !important;
  padding: 6px 10px !important;
  font-size: 12px !important;
  line-height: 1.4 !important;
}

/* 3. Increase row spacing */
.quote-page-unified .card-body .row {
  margin-bottom: 12px !important;
  --bs-gutter-y: 12px !important;
  min-height: 48px !important;
  align-items: center !important;
}

/* 4. Increase textarea heights */
.quote-page-unified textarea[name="quote_remark"],
.quote-page-unified textarea[name="purchase_remark"] {
  height: 150px !important;
  min-height: 150px !important;
  padding: 8px 10px !important;
  font-size: 12px !important;
  line-height: 1.5 !important;
}

/* 5. Increase card padding */
.quote-page-unified .card {
  margin-bottom: 12px !important;
}
.quote-page-unified .card-body {
  padding: 16px 18px !important;
}
.quote-page-unified .card-header {
  padding: 8px 12px !important;
  margin-bottom: 8px !important;
  font-size: 12px !important;
}

/* 6. Keep file input height reasonable */
.quote-page-unified input[type="file"] {
  height: 35px !important;
  min-height: 35px !important;
  font-size: 11px !important;
  padding: 0 8px !important;
  line-height: 33px !important;
  display: block !important;
}
.quote-page-unified input[type="file"]::file-selector-button,
.quote-page-unified input[type="file"]::-webkit-file-upload-button {
  height: 26px !important;
  margin: 0 10px 0 0 !important;
  padding: 0 12px !important;
  vertical-align: middle !important;
  font-size: 11px !important;
  line-height: 24px !important;
  border-radius: 4px !important;
  cursor: pointer !important;
}


/* v36b: more specific fixes */

/* Category row: force flex on the row containing category input + button */
.quote-page-unified .card-body .row.d-flex {
  flex-wrap: nowrap !important;
}
.quote-page-unified .card-body .row input[readonly] + button,
.quote-page-unified .card-body .row .input-group button {
  margin-left: 8px !important;
  align-self: center !important;
}

/* Force all quote page inputs to 38px */
.quote-page-unified .form-control,
.quote-page-unified input.form-control,
.quote-page-unified select.form-control,
.quote-page-unified textarea.form-control {
  height: 38px !important;
  min-height: 38px !important;
  padding-top: 6px !important;
  padding-bottom: 6px !important;
}

/* Force textareas to 150px */
.quote-page-unified textarea[name="quote_remark"],
.quote-page-unified textarea[name="purchase_remark"] {
  height: 150px !important;
  min-height: 150px !important;
}

/* Increase row spacing */
.quote-page-unified .card-body .row {
  margin-bottom: 14px !important;
  padding-top: 6px !important;
  padding-bottom: 6px !important;
}

/* Increase card padding */
.quote-page-unified .card-body {
  padding: 18px 20px !important;
}
.quote-page-unified .card-header {
  padding: 10px 14px !important;
  margin-bottom: 10px !important;
}


/* v38: fix category change button width overflow */
.cat-change-btn {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  flex: 0 0 auto !important;
  white-space: nowrap !important;
}


/* v39: final pixel adjustments for category change button */
.cat-change-btn {
  flex: 0 0 46px !important;
  width: 46px !important;
  min-width: 0 !important;
  max-width: none !important;
  align-self: center !important;
  padding: 4px 0 !important;
}


/* v40: fix final 6px/20px category row deviation */
/* Remove margin from category readonly input */
.quote-page-unified .col-4 .row input[readonly] {
  margin: 0 !important;
}

/* Remove margin from category change button */
.cat-change-btn {
  margin: 0 !important;
}


/* v41: card padding structure + input height adjustments */

/* Fix card padding structure - title and content separation */
.quote-page-unified .card {
  overflow: hidden !important;
}
.quote-page-unified .card-header {
  padding: 10px 16px !important;
  margin: 0 !important;
  border-bottom: 1px solid #e2e8f0 !important;
}
.quote-page-unified .card-body {
  padding: 14px 16px 6px !important;
}

/* Adjust input heights from 38 to 35px */
.quote-page-unified .form-control,
.quote-page-unified input.form-control,
.quote-page-unified select.form-control {
  height: 35px !important;
  min-height: 35px !important;
  padding-top: 5px !important;
  padding-bottom: 5px !important;
}

/* Textarea heights */
.quote-page-unified textarea[name="quote_remark"],
.quote-page-unified textarea[name="purchase_remark"] {
  height: 100px !important;
  min-height: 100px !important;
}

/* Ensure the flex container aligns with bottom purchase card */
.quote-page-unified[style*="display:flex"] {
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}


/* v42: fix right card alignment - make top flex container truly full width */

/* Force the quote page unified container to be full width */
.quote-page-unified[style*="display:flex"] {
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  max-width: 100% !important;
  flex-wrap: nowrap !important;
}

/* Ensure left and right cards take their flex share */
.quote-page-unified[style*="display:flex"] > div {
  min-width: 0 !important;
  max-width: none !important;
}

/* Override any Bootstrap row negative margins */
.quote-page-unified.row,
.row.quote-page-unified {
  margin-left: 0 !important;
  margin-right: 0 !important;
}


/* v44: fix row negative margins and vertical centering */

/* 1. Remove negative margins from all form rows */
.quote-page-unified .card .row {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* 2. Make rows flex containers with proper padding and centering */
.quote-page-unified .card .row {
  display: flex !important;
  align-items: center !important;
  padding: 8px 12px !important;
  box-sizing: border-box !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

/* 3. Remove last row border */
.quote-page-unified .card .row:last-child {
  border-bottom: none !important;
}

/* 4. Ensure inputs are vertically centered */
.quote-page-unified .card .row .form-control,
.quote-page-unified .card .row input,
.quote-page-unified .card .row select {
  margin: 0 !important;
  height: 35px !important;
}

/* 5. Ensure labels are vertically centered */
.quote-page-unified .card .row label {
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
}


/* v45: fix input vertical centering - more aggressive selectors */

/* All rows in all cards */
.quote-page-unified .card-body .row,
.quote-page-unified .card .row,
.card .row {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
  display: flex !important;
  align-items: center !important;
}

/* Force inputs to be centered */
.quote-page-unified .card .row .form-control,
.quote-page-unified .card .row input,
.quote-page-unified .card .row select,
.card .row .form-control {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  align-self: center !important;
}


/* v46: high-priority row padding fix */
.quote-page-unified .card-body .row{
  margin-left:0 !important;
  margin-right:0 !important;
  margin-top:0 !important;
  margin-bottom:0 !important;
  display:flex !important;
  align-items:center !important;
  flex-wrap:nowrap !important;
  padding:9px 14px !important;
  box-sizing:border-box !important;
  border-bottom:1px solid #e2e8f0 !important;
}
.quote-page-unified .card-body .row:last-child{
  border-bottom:none !important;
}
.quote-page-unified .card-body .row > label,
.quote-page-unified .card-body .row > div{
  flex-shrink:0;
}
.quote-page-unified .card-body input,
.quote-page-unified .card-body select{
  margin:0 !important;
  height:35px !important;
}


/* v48 FINAL: force all three quote-card rows vertically centered, override earlier conflicting rules */
.quote-page-unified form .card .card-body > .row{
  margin-top:0 !important;
  margin-bottom:0 !important;
  margin-left:0 !important;
  margin-right:0 !important;
  padding-top:9px !important;
  padding-bottom:9px !important;
  padding-left:14px !important;
  padding-right:14px !important;
  display:flex !important;
  align-items:center !important;
  flex-wrap:nowrap !important;
  min-height:0 !important;
  box-sizing:border-box !important;
}
.quote-page-unified form .card .card-body > .row > input,
.quote-page-unified form .card .card-body > .row .col-9 input,
.quote-page-unified form .card .card-body > .row .col-4 input,
.quote-page-unified form .card .card-body > .row input,
.quote-page-unified form .card .card-body > .row select{
  margin-top:0 !important;
  margin-bottom:0 !important;
  align-self:center !important;
  height:35px !important;
}

/* v49: center input inside its Bootstrap column wrapper (scoped to quote page) */
.quote-page-unified .card-body .row > div{
  display:flex !important;
  align-items:center !important;
}
.quote-page-unified .card-body .row > div textarea{ align-self:center !important; }
.quote-page-unified .card-body .row > div .invalid-feedback,
.quote-page-unified .card-body .row > div .hint{ align-self:center !important; }

/* v50: zero vertical margins on column wrappers so row align-items:center truly centers input */
.quote-page-unified .card .row > [class*="col-"]{
  margin-top:0 !important;
  margin-bottom:0 !important;
}

/* v51: row compression + category alignment + readonly bg + sticky buttons */

/* 1. Compress row padding from 9px to 5px */
.quote-page-unified .card-body .row {
  padding: 4px 14px !important;
}

/* 2. Fix category input left alignment */
.quote-page-unified .col-4 .row:first-of-type {
  gap: 0 !important;
}
.quote-page-unified .col-4 .row:first-of-type input[readonly] {
  margin-left: 0 !important;
}

/* 3. Darken readonly input background */
.quote-page-unified .col-4 input[readonly] {
  background-color: #e9ecef !important;
  color: #39414a !important;
}

/* v57: disabled over-broad v51 sticky bar; .quote-action-bar fixed + JS align handles it */

/* Add padding-bottom to content container to prevent button overlap */
.quote-page-unified {
  padding-bottom: 70px !important;
}


/* v52: compress row vertical padding 9->5px, keep symmetric centering */
.quote-page-unified form .card .card-body > .row{
  padding-top:4px !important;
  padding-bottom:4px !important;
  padding-left:14px !important;
  padding-right:14px !important;
}

/* v53: category alignment + readonly bg all 7 inputs + fixed bottom buttons */

/* 1. Fix category input left alignment */
.quote-page-unified .col-4 .row:first-of-type {
  gap: 0 !important;
}
.quote-page-unified .col-4 .row:first-of-type input[readonly] {
  margin-left: 2px !important;
}

/* 2. Apply readonly bg to ALL readonly inputs */
.quote-page-unified .card input.form-control[readonly] {
  background-color: #e9ecef !important;
  color: #39414a !important;
}

/* v56: removed duplicate over-broad fixed-bar rule; use .quote-action-bar + JS align */

/* Add padding-bottom to prevent content overlap */
.quote-page-unified {
  padding-bottom: 76px !important;
}


/* v54: fixed bottom action bar (quote page only) */
.quote-action-bar{
  position:fixed !important;
  bottom:0 !important; left:0; right:auto; width:100%; margin-left:0; box-sizing:border-box;
  z-index:1030 !important;
  background:#fff !important;
  border-top:1px solid #e2e8f0 !important;
  box-shadow:0 -2px 8px rgba(0,0,0,.06) !important;
  padding:10px 20px !important;
}
.quote-page-unified{ padding-bottom:76px !important; }

/* v54: all readonly inputs on quote page deep gray */
.quote-page-unified .card input.form-control[readonly]{
  background-color:#e9ecef !important;
  color:#39414a !important;
}


/* ===== v60 菜单：行高收紧 + 二级直达项 ===== */
.sidebar-group-title { line-height: 1.25 !important; }
.nav-item.level3 .nav-link,
.nav-item.level4 .nav-link { line-height: 1.25 !important; }
.nav-item.level2-direct .nav-link {
  font-size: 13px !important;
  font-weight: 400 !important;
  padding: 3px 18px !important;
  color: #cbd5e1 !important;
  letter-spacing: 0.5px;
  line-height: 1.25 !important;
  border-radius: 0;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-item.level2-direct .nav-link:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #fff !important;
}
.nav-item.level2-direct .nav-link.active {
  background: #3b82f6 !important;
  color: #fff !important;
  border-left: none !important;
  font-weight: 400;
}
.nav-item.level2-direct .nav-link.active i { color: #fff !important; }

/* v63: 二级分组标题与直达项严格左对齐（补3px透明左边框，对齐 .nav-link 的 border-left 占位） */
.sidebar .sidebar-group-title { border-left: 3px solid transparent; }
