/* 테이블 스크롤 컨테이너 */
.table-scroll-container {
    overflow-x: auto;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 10px;
    background: var(--bg-surface, #ffffff);
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

/* Resizable 테이블 스타일 */
.resizable-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    font-size: 13px;
    background: var(--bg-surface, #ffffff);
    color: var(--text-primary, #1e293b);
}

.resizable-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.resizable-table thead tr {
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.resizable-table th {
    padding: 10px 8px;
    text-align: center;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    position: relative;
    user-select: none;
}

.resizable-table th.sortable {
    cursor: pointer;
    transition: background-color 0.2s;
}

.resizable-table th.sortable:hover {
    background-color: var(--hover-bg, #f8f8f8);
}

.resizable-table tbody tr {
    transition: background-color 0.15s;
    border-bottom: 1px solid var(--border-color-light, #e5e7eb);
}

.resizable-table tbody tr:last-child {
    border-bottom: 1px solid var(--border-color-light, #e5e7eb);
}

.resizable-table tbody tr:hover {
    background-color: var(--hover-bg, #f8f8f8);
}

.resizable-table td {
    padding: 10px 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Sort 아이콘 - 정렬 중일 때만 표시 */
.sort-icon {
    display: inline-block;
    margin-left: 4px;
    font-size: 12px;
    opacity: 1;
    vertical-align: middle;
}

.resizable-table th.sortable:hover .sort-icon {
    opacity: 1;
}

/* Column Resizer */
.column-resizer {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 6px;
    cursor: col-resize;
    user-select: none;
    background: transparent;
    transition: background 0.15s;
}

.column-resizer:hover {
    background: rgba(100, 150, 255, 0.5) !important;
}

/* 텍스트 정렬 유틸리티 */
.text-center {
    text-align: center;
}

.text-end {
    text-align: right;
}

.text-muted {
    color: var(--text-muted, #666);
    font-size: 12px;
}

/* 코드 텍스트 */
.code-text {
    font-family: 'Courier New', monospace;
    font-weight: 500;
    color: var(--code-text, #003366);
}

/* 가격 셀 */
.price-cell {
    font-weight: 600;
    color: var(--amount-text, #d4521d);
}

/* 아이템 이름 */
.item-name {
}

/* 타입 배지 */
.type-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.type-product {
    background: #e8f5e9;
    color: #2e7d32;
}

.type-semi {
    background: #fff8e1;
    color: #f57f17;
}

.type-material {
    background: #e1f5fe;
    color: #0277bd;
}

.type-default {
    background: #f5f5f5;
    color: #616161;
}

/* 버튼 액션 */
.btn-action {
    padding: 4px 8px;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 3px;
    background: var(--bg-surface, #ffffff);
    color: var(--text-secondary, inherit);
    cursor: pointer;
    transition: all 0.15s;
    font-size: 12px;
}

.btn-action:hover {
    border-color: var(--text-muted, #999);
    background: var(--hover-bg, #f5f5f5);
}

.btn-info {
    color: #0066cc;
}

.btn-info:hover {
    color: #0052a3;
}

.btn-warn {
    color: #d4521d;
}

.btn-warn:hover {
    color: #a23d16;
}

/* No-resize 클래스 (체크박스, 관리 열) */
.resizable-table th.no-resize .column-resizer {
    display: none !important;
}

/* 모바일 대응 */
@media (max-width: 768px) {
    .resizable-table {
        font-size: 12px;
    }

    .resizable-table th,
    .resizable-table td {
        padding: 8px 4px;
    }

    .column-resizer {
        width: 4px;
    }
}
