/* --------------------------------------------------------------------------
   RS-IN ERP 공통 표 스타일
   - 셀 내용이 표 밖으로 튀어나오지 않도록 기본 안전장치를 둡니다.
   - 사용자가 열을 넓히면 숨겨진 내용이 다시 보일 수 있게 말줄임으로 처리합니다.
-------------------------------------------------------------------------- */

.table-card,
.table-scroll,
.data-table-wrap,
.rs-table-wrap {
  max-width: 100%;
  overflow: auto;
}

.table-card table,
.data-table,
.rs-table {
  width: 100%;
  border-collapse: collapse;
}

.table-card th,
.table-card td,
.data-table th,
.data-table td,
.rs-table th,
.rs-table td {
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.rs-col-no {
  width: 70px;
  min-width: 70px;
  max-width: 70px;
}

.rs-col-date,
.rs-col-status,
.rs-col-customer,
.rs-col-qty,
.rs-col-user {
  width: 100px;
  min-width: 90px;
}

.rs-col-name,
.rs-col-product-name {
  width: 220px;
  min-width: 180px;
}

.table-card td button,
.data-table td button,
.rs-table td button {
  min-height: 30px;
  padding: 5px 10px;
}

.rs-col-resize {
  position: absolute;
  top: 0;
  right: -12px;
  z-index: 4;
  width: 24px;
  height: 100%;
  cursor: col-resize;
}

.rs-col-resize::after {
  content: "";
  position: absolute;
  top: 7px;
  bottom: 7px;
  left: 11px;
  width: 2px;
  background: rgba(255, 255, 255, 0.52);
}

.rs-table-enhanced th:hover .rs-col-resize::after,
.rs-col-resize:hover::after,
.rs-is-resizing-table .rs-col-resize::after {
  width: 3px;
  background: #fff;
}

.rs-is-resizing-table {
  cursor: col-resize;
  user-select: none;
}

/* Page tables can be expanded vertically from their bottom edge. */
.rs-table-height-resizable {
  box-sizing: border-box;
  height: var(--rs-table-height) !important;
  min-height: var(--rs-table-min-height) !important;
  max-height: none !important;
  overflow: auto !important;
}

.rs-table-height-handle {
  position: fixed;
  z-index: 2400;
  height: 14px;
  border: 0;
  border-radius: 0 0 7px 7px;
  background: linear-gradient(to bottom, transparent 0 3px, rgba(42, 105, 189, 0.12) 3px 100%);
  cursor: ns-resize;
  touch-action: none;
  user-select: none;
}

.rs-table-height-handle::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  width: 54px;
  height: 3px;
  border-radius: 999px;
  background: #9db5d5;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.74);
  transform: translateX(-50%);
  transition: width 120ms ease, background-color 120ms ease;
}

.rs-table-height-handle:hover,
.rs-table-height-handle:focus-visible,
.rs-table-height-handle.is-active {
  outline: none;
  background: linear-gradient(to bottom, transparent 0 2px, rgba(30, 104, 210, 0.2) 2px 100%);
}

.rs-table-height-handle:hover::before,
.rs-table-height-handle:focus-visible::before,
.rs-table-height-handle.is-active::before {
  width: 82px;
  background: #1767cc;
}

.rs-is-resizing-table-height,
.rs-is-resizing-table-height * {
  cursor: ns-resize !important;
  user-select: none !important;
}

.rs-width-tooltip {
  position: fixed;
  z-index: 30000;
  display: grid;
  gap: 2px;
  min-width: 118px;
  padding: 8px 10px;
  border: 1px solid rgba(8, 28, 64, 0.14);
  border-radius: 6px;
  background: rgba(7, 26, 61, 0.94);
  color: #fff;
  box-shadow: 0 10px 26px rgba(8, 28, 64, 0.22);
  pointer-events: none;
  transform: translateY(4px);
  opacity: 0;
  transition: opacity 120ms ease, transform 120ms ease;
}

.rs-width-tooltip.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.rs-width-tooltip b {
  font-size: 13px;
  line-height: 1.15;
}

.rs-width-tooltip span {
  color: rgba(255, 255, 255, 0.74);
  font-size: 11px;
  line-height: 1.15;
}

.rs-width-meter {
  position: fixed;
  top: calc(var(--topbar-height, 70px) + 12px);
  right: 18px;
  z-index: 30001;
  display: grid;
  gap: 2px;
  min-width: 150px;
  padding: 10px 12px;
  border: 1px solid rgba(13, 87, 200, 0.2);
  border-radius: 6px;
  background: #fff;
  color: var(--navy-900);
  box-shadow: 0 12px 28px rgba(8, 28, 64, 0.2);
  pointer-events: none;
  transform: translateY(-6px);
  opacity: 0;
  transition: opacity 120ms ease, transform 120ms ease;
}

.rs-width-meter.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.rs-width-meter b {
  font-size: 14px;
  line-height: 1.15;
}

.rs-width-meter span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.15;
}

/* Mobile tables remain inside their cards and clearly indicate horizontal scrolling. */
@media (max-width: 780px) {
  .rs-table-height-handle {
    height: 18px;
  }

  .rs-table-height-handle::before {
    top: 8px;
    width: 68px;
  }

  .table-scroll,
  .data-table-wrap,
  .rs-table-wrap {
    overscroll-behavior-inline: contain;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    box-shadow: inset -14px 0 12px -16px rgba(8, 28, 64, 0.5);
  }

  .table-scroll::-webkit-scrollbar,
  .data-table-wrap::-webkit-scrollbar,
  .rs-table-wrap::-webkit-scrollbar {
    height: 8px;
  }
}
