/* OneBot ERP - Compact density overrides (scoped)
   Applies ONLY when <body class="ob-list-page"> is set.
   Keep this file LAST (after ob_ui.css).
*/

.ob-list-page{
  --ob-font: 12.5px;
  --ob-font-sm: 12px;

  --ob-row-h: 28px;
  --ob-th-py: 8px;
  --ob-td-py: 6px;
  --ob-cell-px: 10px;

  /* ✅ 统一：工具栏更窄 */
  --ob-toolbar-h: 30px;
  --ob-btn-h: 30px;
}

/* overall density */
.ob-list-page .ob-wrap{ font-size: var(--ob-font); }

/* =========================
   标题：更紧凑 + 往上抬（只保留这一段）
   ========================= */
.ob-list-page .ob-title{
  margin: 0 0 6px !important;
  font-size: 20px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
}
.ob-list-page .ob-title i{
  font-size: 20px !important;
}

/* =========================
   Toolbar：输入 + 按钮高度统一
   ========================= */
.ob-list-page .ob-toolbar{
  padding: 8px 10px !important;
}

.ob-list-page .ob-toolbar .form-control,
.ob-list-page .ob-toolbar .form-select{
  height: var(--ob-toolbar-h) !important;
  font-size: var(--ob-font) !important;
  padding: 0 10px !important;
}

.ob-list-page .ob-toolbar .input-group-text{
  height: var(--ob-toolbar-h) !important;
  padding: 0 10px !important;
  font-size: var(--ob-font-sm) !important;
}

.ob-list-page .ob-toolbar .btn{
  height: var(--ob-btn-h) !important;
  padding: 0 10px !important;
  font-size: var(--ob-font) !important;
  line-height: 1 !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
}

/* =========================
   Table：更紧凑 + 省略号（关键：不要 max-content）
   ========================= */
.ob-list-page .ob-table thead th{
  font-size: var(--ob-font-sm) !important;
  font-weight: 900 !important;
  padding: var(--ob-th-py) var(--ob-cell-px) !important;
  white-space: nowrap !important;
}

.ob-list-page .ob-table tbody td{
  font-size: var(--ob-font) !important;
  padding: var(--ob-td-py) var(--ob-cell-px) !important;
  height: var(--ob-row-h) !important;
  vertical-align: middle !important;

  /* ✅ 放不下就 ...（配合 table-layout:fixed） */
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* ✅ th/td 自身也裁剪，避免子元素撑宽 */
.ob-list-page .ob-table th,
.ob-list-page .ob-table td{
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

/* ✅ ellipsis helper */
.ob-list-page .ob-ellipsis{
  display:block !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  white-space:nowrap !important;
  min-width:0 !important;
}

/* ===========================
   FIX: 列表页不要“中间框框竖向滚动”
   - 竖向：走页面滚动
   - 横向：仅需要时出现
   =========================== */
.ob-list-page .ob-tablewrap .table-responsive{
  max-height: none !important;
  overflow-y: visible !important;
  overflow-x: auto !important;
}

/* ✅ 表格宽度策略（关键）：
   - 宽度先铺满容器
   - 需要横向滚动时，通过 min-width 制造“超出”
*/
.ob-list-page .ob-table{
  width: 100% !important;        /* ✅ 不要 max-content */
  min-width: 1400px !important;  /* ✅ 你列多，建议 1400~2200 之间 */
  table-layout: fixed !important;
}

/* pills slightly smaller */
.ob-list-page .ob-pill{
  padding: 1px 8px !important;
  font-size: 12px !important;
}

/* pager controls */
.ob-list-page .ob-pager .btn,
.ob-list-page .ob-pager .form-control,
.ob-list-page .ob-pager .form-select{
  height: 32px !important;
  font-size: var(--ob-font-sm) !important;
}

/* action buttons: ensure text vertically centered */
.ob-list-page .ob-actions .btn,
.ob-list-page .ob-actions-row .btn,
.ob-list-page .ob-pager .btn{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  line-height:1 !important;
}

/* 操作区永不换行（列表页） */
.ob-list-page .ob-actions-row{
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
}
.ob-list-page .ob-actions-row .btn,
.ob-list-page .ob-actions-row .ob-pill{
  flex: 0 0 auto !important;
}

/* ====== Sticky 表头：表格区域滚动（推荐） ====== */
.ob-list-page .ob-tablewrap .table-responsive{
  max-height: calc(100vh - 180px) !important; /* 220px 你可调：topbar+tabs+标题+工具栏+分页 */
  overflow-y: auto !important;
  overflow-x: auto !important;
}

/* 表头 sticky */
.ob-list-page .ob-table thead th{
  position: sticky !important;
  top: 0 !important;
  z-index: 20 !important;
  background: #f8fafc !important;
}

/* 可选：防止表头被圆角裁切 */
.ob-list-page .ob-tablewrap{ overflow: visible !important; }

/* ===== Fix: pager 的 btn-group 不要连体胶囊 ===== */
.ob-list-page .ob-pager .btn-group{
  display: flex !important;
  gap: 8px !important;              /* 按钮之间留缝 */
}

.ob-list-page .ob-pager .btn-group > .btn{
  border-radius: 10px !important;    /* 不要 999px */
  margin-left: 0 !important;         /* 覆盖 btn-group 的贴合逻辑 */
}

/* 如果 bootstrap 还在做“连体”边框，这条能彻底断开 */
.ob-list-page .ob-pager .btn-group > .btn + .btn{
  border-left: 1px solid var(--ob-line) !important;
}