/* ============================================================
   テーブル一元管理（logikan方式）
   ・table-layout: fixed + colgroup で列幅を厳密制御
   ・各テーブルに .tbl-XXX クラスで全幅 + col:nth-child(N) で各列幅
   ============================================================ */

.table-area { display: inline-block; min-width: 0; }
.table-wrap { overflow-x: auto; }
.pagination-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px;
}
.pagination-row .pagination { padding: 0; }
.page-size-select {
  padding: 4px 8px; font-size: 12px;
  border: 1px solid var(--gray-300); border-radius: 6px;
  background: #fff; cursor: pointer;
}

table.fixed-table { table-layout: fixed; border-collapse: collapse; }
table.fixed-table thead { background: var(--gray-50); }
table.fixed-table th {
  padding: 8px 6px;
  font-weight: 600; font-size: 12px;
  color: var(--gray-600); letter-spacing: .3px;
  border-bottom: 1px solid var(--gray-200);
  border-right: 1px solid var(--gray-100);
  text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
table.fixed-table td {
  padding: 6px 6px;
  border-bottom: 1px solid var(--gray-100);
  border-right: 1px solid var(--gray-100);
  text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  vertical-align: middle;
  position: relative;
}
table.fixed-table th:last-child, table.fixed-table td:last-child { border-right: none; }
table.fixed-table tr:hover td { background: var(--gray-50); }
table.fixed-table tr.row-clickable { cursor: pointer; }
table.fixed-table tr.row-clickable:hover td { background: var(--primary-light); }

table.fixed-table td.text-left, table.fixed-table th.text-left { text-align: left; }
table.fixed-table td.text-right, table.fixed-table th.text-right { text-align: right; }

table.fixed-table .badge { vertical-align: middle; }
.fixed-table .btn-sm { padding: 4px 8px; font-size: 12px; }

/* 見切れセルの全文ツールチップ（文字を範囲選択してコピー可） */
.cell-tip {
  position: absolute;
  z-index: 9999;
  display: none;
  max-width: 480px;
  padding: 6px 10px;
  background: #1e293b;
  color: #fff;
  font-size: 12px;
  line-height: 1.5;
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
  white-space: pre-wrap;
  word-break: break-all;
  user-select: text;        /* 文字選択を許可（選択してコピー） */
}
.cell-tip.show { display: block; }


/* ===== 商品管理 (products.html) =====
   チェック36 + Item_id110 + Brand110 + Name160 + Color180 + 入数70 + 在庫90 + 登録150 + 更新150 = 1056 */
.tbl-products { width: 1056px; }
.tbl-products col:nth-child(1) { width:  36px; }
.tbl-products col:nth-child(2) { width: 110px; }
.tbl-products col:nth-child(3) { width: 110px; }
.tbl-products col:nth-child(4) { width: 160px; }
.tbl-products col:nth-child(5) { width: 180px; }
.tbl-products col:nth-child(6) { width:  70px; }
.tbl-products col:nth-child(7) { width:  90px; }
.tbl-products col:nth-child(8) { width: 150px; }
.tbl-products col:nth-child(9) { width: 150px; }

/* ===== ラックマスタ詳細 (右側パネル) =====
   Item_id110 + Brand110 + Name240 + Color110 + Num90 = 660 */
.tbl-rack-detail { width: 660px; }
.tbl-rack-detail col:nth-child(1) { width: 110px; } /* Item_id */
.tbl-rack-detail col:nth-child(2) { width: 110px; } /* Brand */
.tbl-rack-detail col:nth-child(3) { width: 240px; } /* Name */
.tbl-rack-detail col:nth-child(4) { width: 110px; } /* Color */
.tbl-rack-detail col:nth-child(5) { width:  90px; } /* Num */


/* ===== FBA予定 (fba.html) ===== チェック36+ID60+Task120+Rack80+Item110+Brand90+Name160+Color180+Num70+Box70 = 976 */
.tbl-fba-plan { width: 1126px; }
.tbl-fba-plan col:nth-child(1) { width:  36px; } /* チェック */
.tbl-fba-plan col:nth-child(2) { width:  60px; } /* ID */
.tbl-fba-plan col:nth-child(3) { width: 120px; } /* Task */
.tbl-fba-plan col:nth-child(4) { width:  80px; } /* Rack_id */
.tbl-fba-plan col:nth-child(5) { width: 110px; } /* Item_id */
.tbl-fba-plan col:nth-child(6) { width:  90px; } /* Brand */
.tbl-fba-plan col:nth-child(7) { width: 160px; } /* Name */
.tbl-fba-plan col:nth-child(8) { width: 180px; } /* Color */
.tbl-fba-plan col:nth-child(9) { width:  70px; } /* Num */
.tbl-fba-plan col:nth-child(10) { width: 70px; } /* Box_num */
.tbl-fba-plan col:nth-child(11) { width: 150px; } /* 登録日時 */

/* ===== FBA実績 ===== チェック36+ID40+Task120+Rack60+Item110+Brand90+Name100+Color180+Num50+LOT100+備考180+登録135+完了135+User80+Elapsed90+Photo60 = 1566 */
.tbl-fba-record { width: 1636px; }
.tbl-fba-record col:nth-child(1)  { width:  36px; } /* チェック */
.tbl-fba-record col:nth-child(2)  { width:  40px; } /* ID */
.tbl-fba-record col:nth-child(3)  { width: 120px; } /* Task */
.tbl-fba-record col:nth-child(4)  { width:  60px; } /* Rack_id */
.tbl-fba-record col:nth-child(5)  { width: 110px; } /* Item_id */
.tbl-fba-record col:nth-child(6)  { width:  90px; } /* Brand */
.tbl-fba-record col:nth-child(7)  { width: 100px; } /* Name */
.tbl-fba-record col:nth-child(8)  { width: 180px; } /* Color */
.tbl-fba-record col:nth-child(9)  { width:  50px; } /* Num */
.tbl-fba-record col:nth-child(10) { width: 100px; } /* LOT */
.tbl-fba-record col:nth-child(11) { width: 180px; } /* 備考 */
.tbl-fba-record col:nth-child(12) { width: 135px; } /* 登録日時 */
.tbl-fba-record col:nth-child(13) { width: 135px; } /* 完了日時 */
.tbl-fba-record col:nth-child(14) { width:  80px; } /* User */
.tbl-fba-record col:nth-child(15) { width:  90px; } /* 経過時間 */
.tbl-fba-record col:nth-child(16) { width:  60px; } /* 写真 */
.tbl-fba-record td.fba-photo-cell { padding: 2px; }
.tbl-fba-record td.fba-photo-cell img { width: 44px; height: 44px; object-fit: cover; border-radius: 4px; cursor: pointer; }


/* ===== 棚卸し予定 ===== チェック36+ID60+Rack80+Status100+作成日時160 = 436 */
.tbl-stocktaking-plan { width: 326px; }
.tbl-stocktaking-plan col:nth-child(1) { width:  36px; } /* チェック */
.tbl-stocktaking-plan col:nth-child(2) { width:  60px; } /* ID */
.tbl-stocktaking-plan col:nth-child(3) { width:  80px; } /* Rack_id */
.tbl-stocktaking-plan col:nth-child(4) { width: 150px; } /* 登録日時 */

/* ===== 棚卸し実績 ===== chk36+ID60+Rack80+Item110+Brand90+Name160+Color180+登録150+完了150+User80+Original90+入数70+箱数70+端数70+総数90+差異80 = 1646 */
.tbl-stocktaking-record { width: 1646px; }
.tbl-stocktaking-record col:nth-child(1)  { width:  36px; } /* チェック */
.tbl-stocktaking-record col:nth-child(2)  { width:  60px; } /* ID */
.tbl-stocktaking-record col:nth-child(3)  { width:  80px; } /* Rack_id */
.tbl-stocktaking-record col:nth-child(4)  { width: 110px; } /* Item_id */
.tbl-stocktaking-record col:nth-child(5)  { width:  90px; } /* Brand */
.tbl-stocktaking-record col:nth-child(6)  { width: 160px; } /* Name */
.tbl-stocktaking-record col:nth-child(7)  { width: 180px; } /* Color */
.tbl-stocktaking-record col:nth-child(8)  { width: 150px; } /* 登録日時 */
.tbl-stocktaking-record col:nth-child(9)  { width: 150px; } /* 完了日時 */
.tbl-stocktaking-record col:nth-child(10) { width:  80px; } /* User */
.tbl-stocktaking-record col:nth-child(11) { width:  90px; } /* Original_num */
.tbl-stocktaking-record col:nth-child(12) { width:  70px; } /* 入数 */
.tbl-stocktaking-record col:nth-child(13) { width:  70px; } /* 箱数 */
.tbl-stocktaking-record col:nth-child(14) { width:  70px; } /* 端数 */
.tbl-stocktaking-record col:nth-child(15) { width:  90px; } /* 総数 */
.tbl-stocktaking-record col:nth-child(16) { width:  80px; } /* 差異 */


/* ===== ラック間移動 予定 ===== チェック36+ID60+Rack80+Moved100+Item110+Brand90+Name160+Color180+Num70+Box70 = 956 */
.tbl-rackmove-plan { width: 1106px; }
.tbl-rackmove-plan col:nth-child(1)  { width:  36px; } /* チェック */
.tbl-rackmove-plan col:nth-child(2)  { width:  60px; } /* ID */
.tbl-rackmove-plan col:nth-child(3)  { width:  80px; } /* Rack_id */
.tbl-rackmove-plan col:nth-child(4)  { width: 100px; } /* Moved_rack_id */
.tbl-rackmove-plan col:nth-child(5)  { width: 110px; } /* Item_id */
.tbl-rackmove-plan col:nth-child(6)  { width:  90px; } /* Brand */
.tbl-rackmove-plan col:nth-child(7)  { width: 160px; } /* Name */
.tbl-rackmove-plan col:nth-child(8)  { width: 180px; } /* Color */
.tbl-rackmove-plan col:nth-child(9)  { width:  70px; } /* Num */
.tbl-rackmove-plan col:nth-child(10) { width:  70px; } /* Box_num */
.tbl-rackmove-plan col:nth-child(11) { width: 150px; } /* 登録日時 */

/* ===== ラック間移動 実績 ===== チェック36+ID60+Datetime140+User80+Rack80+Moved100+Item110+Brand90+Name160+Color180+Num70 = 1106 */
.tbl-rackmove-record { width: 1506px; }
.tbl-rackmove-record col:nth-child(1)  { width:  36px; } /* チェック */
.tbl-rackmove-record col:nth-child(2)  { width:  60px; } /* ID */
.tbl-rackmove-record col:nth-child(3)  { width:  80px; } /* Rack_id */
.tbl-rackmove-record col:nth-child(4)  { width: 100px; } /* Moved_rack_id */
.tbl-rackmove-record col:nth-child(5)  { width: 110px; } /* Item_id */
.tbl-rackmove-record col:nth-child(6)  { width:  90px; } /* Brand */
.tbl-rackmove-record col:nth-child(7)  { width: 160px; } /* Name */
.tbl-rackmove-record col:nth-child(8)  { width: 180px; } /* Color */
.tbl-rackmove-record col:nth-child(9)  { width:  70px; } /* Num */
.tbl-rackmove-record col:nth-child(10) { width:  70px; } /* Box_num */
.tbl-rackmove-record col:nth-child(11) { width: 150px; } /* 登録日時 */
.tbl-rackmove-record col:nth-child(12) { width: 150px; } /* 完了日時 */
.tbl-rackmove-record col:nth-child(13) { width:  80px; } /* User */
.tbl-rackmove-record col:nth-child(14) { width:  90px; } /* 計測時間 */


/* ===== 納品 / 町田搬送 予定 ===== チェック36+ID60+Rack80+Item110+Brand90+Name160+Color180+Num70 = 786 */
.tbl-simple-plan { width: 936px; }
.tbl-simple-plan col:nth-child(1) { width:  36px; } /* チェック */
.tbl-simple-plan col:nth-child(2) { width:  60px; } /* ID */
.tbl-simple-plan col:nth-child(3) { width:  80px; } /* Rack_id */
.tbl-simple-plan col:nth-child(4) { width: 110px; } /* Item_id */
.tbl-simple-plan col:nth-child(5) { width:  90px; } /* Brand */
.tbl-simple-plan col:nth-child(6) { width: 160px; } /* Name */
.tbl-simple-plan col:nth-child(7) { width: 180px; } /* Color */
.tbl-simple-plan col:nth-child(8) { width:  70px; } /* Num */
.tbl-simple-plan col:nth-child(9) { width: 150px; } /* 登録日時 */

/* ===== 納品 / 町田搬送 実績 ===== チェック36+ID60+Datetime140+User80+Rack80+Item110+Brand90+Name160+Color180+Num70 = 1006 */
.tbl-simple-record { width: 1166px; }
.tbl-simple-record col:nth-child(1)  { width:  36px; } /* チェック */
.tbl-simple-record col:nth-child(2)  { width:  60px; } /* ID */
.tbl-simple-record col:nth-child(3)  { width:  80px; } /* Rack_id */
.tbl-simple-record col:nth-child(4)  { width: 110px; } /* Item_id */
.tbl-simple-record col:nth-child(5)  { width:  90px; } /* Brand */
.tbl-simple-record col:nth-child(6)  { width: 160px; } /* Name */
.tbl-simple-record col:nth-child(7)  { width: 180px; } /* Color */
.tbl-simple-record col:nth-child(8)  { width:  70px; } /* Num */
.tbl-simple-record col:nth-child(9)  { width: 150px; } /* 登録日時 */
.tbl-simple-record col:nth-child(10) { width: 150px; } /* 完了日時 */
.tbl-simple-record col:nth-child(11) { width:  80px; } /* User */

/* ===== 不良・破損 実績 ===== */
.tbl-defect-record { width: 1266px; }
.tbl-defect-record col:nth-child(1)  { width:  36px; } /* チェック */
.tbl-defect-record col:nth-child(2)  { width:  60px; } /* ID */
.tbl-defect-record col:nth-child(3)  { width:  80px; } /* Rack_id */
.tbl-defect-record col:nth-child(4)  { width: 110px; } /* Item_id */
.tbl-defect-record col:nth-child(5)  { width:  90px; } /* Brand */
.tbl-defect-record col:nth-child(6)  { width: 160px; } /* Name */
.tbl-defect-record col:nth-child(7)  { width: 180px; } /* Color */
.tbl-defect-record col:nth-child(8)  { width:  70px; } /* Num */
.tbl-defect-record col:nth-child(9)  { width: 120px; } /* 理由 */
.tbl-defect-record col:nth-child(10) { width: 150px; } /* 登録日時 */
.tbl-defect-record col:nth-child(11) { width:  80px; } /* User */
.tbl-defect-record col:nth-child(12) { width:  60px; } /* 画像 */


/* ===== 在庫変動履歴 (stock-history.html) =====
   Item110 + Brand90 + Name160 + Color180 + 日時150 + Kind110 + Original90 + 変動80 + After90 = 1060 */
.tbl-stock-history { width: 1060px; }
.tbl-stock-history col:nth-child(1) { width: 110px; } /* Item_id */
.tbl-stock-history col:nth-child(2) { width:  90px; } /* Brand */
.tbl-stock-history col:nth-child(3) { width: 160px; } /* Name */
.tbl-stock-history col:nth-child(4) { width: 180px; } /* Color */
.tbl-stock-history col:nth-child(5) { width: 150px; } /* 日時 */
.tbl-stock-history col:nth-child(6) { width: 110px; } /* Kind */
.tbl-stock-history col:nth-child(7) { width:  90px; } /* Original_num */
.tbl-stock-history col:nth-child(8) { width:  80px; } /* 変動数 */
.tbl-stock-history col:nth-child(9) { width:  90px; } /* After_num */


/* ===== レポート FBA集計 =====
   Task160 + 件数90 + 合計Num90 + 合計時間110 + 平均時間110 = 560 */
.tbl-reports-fba { width: 560px; }
.tbl-reports-fba col:nth-child(1) { width: 160px; } /* Task */
.tbl-reports-fba col:nth-child(2) { width:  90px; } /* 件数 */
.tbl-reports-fba col:nth-child(3) { width:  90px; } /* 合計Num */
.tbl-reports-fba col:nth-child(4) { width: 110px; } /* 合計時間 */
.tbl-reports-fba col:nth-child(5) { width: 110px; } /* 平均時間 */


/* ===== 設定 ユーザー管理 =====
   ID60 + ユーザー名220 + ロール130 + 登録日160 = 570 */
.tbl-settings-users { width: 570px; }
.tbl-settings-users col:nth-child(1) { width:  60px; } /* ID */
.tbl-settings-users col:nth-child(2) { width: 220px; } /* ユーザー名 */
.tbl-settings-users col:nth-child(3) { width: 130px; } /* ロール */
.tbl-settings-users col:nth-child(4) { width: 160px; } /* 登録日 */
