.table {
    margin: 0;
    font-size: 0.65rem !important;
}

.table thead th {
    background-color: #f8f9fa;
    color: #495057;
    padding: 8px 6px !important;
    font-weight: 600;
    font-size: 0.75rem !important;
    white-space: nowrap;
    vertical-align: middle;
    position: sticky;
    top: 0;
    z-index: 10;
}

.table tbody td {
    padding: 6px 2px !important;
    vertical-align: middle;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.75rem !important;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

.status-badge {
    padding: 4px;
    border-radius: 20px;
    font-size: 0.6rem;
    font-weight: 500;
}

.status-trading {
    background-color: #e3f2fd;
    color: #1976d2;
}

.status-completed {
    background-color: #e8f5e8;
    color: #2e7d32;
}

.profit-positive {
    color: #d32f2f;
    font-weight: 600;
}

.profit-negative {
    color: #1976d2;
    font-weight: 600;
}

.profit-zero {
    color: #666;
    font-weight: 600;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state i {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .ipo-container {
        padding: 10px;
    }

    .d-flex.justify-content-between {
        flex-direction: column !important;
        gap: 15px;
        align-items: flex-start !important;
    }

    .table {
        font-size: 0.55rem !important;
    }

    .table thead th,
    .table tbody td {
        padding: 4px 2px !important;
        font-size: 0.5rem !important;
    }

    .table-container {
        max-height: 70vh;
    }

    .table-container::-webkit-scrollbar {
        width: 0px;
    }

    .table-container:hover::-webkit-scrollbar {
        width: 6px;
    }

    .table-container::-webkit-scrollbar-thumb {
        border: none;
        border-radius: 3px;
    }
}

/* 
인라인 편집 스타일 */
.table-success {
    background-color: rgba(25, 135, 84, 0.1) !important;
}

.table-warning {
    background-color: rgba(255, 193, 7, 0.1) !important;
}

.edit-mode input,
.edit-mode select {
    min-width: 80px;
    font-size: 0.6rem !important;
}

.data-row:hover {
    background-color: rgba(0, 0, 0, 0.02) !important;
}

.status-trading-row td {
    background-color: #e7f3ff !important;
}

/* 테이블 컨테이너 스타일 */
.table-container {
    max-height: 88vh;
    overflow-y: overlay;
    scrollbar-width: none;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
    -ms-overflow-style: none;
}

/* WebKit 브라우저용 완전 오버레이 스크롤바 */
.table-container::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

.table-container:hover::-webkit-scrollbar {
    width: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: transparent;
    margin: 0;
}

.table-container::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    border: none;
    min-height: 30px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.3);
}

.table-container::-webkit-scrollbar-thumb:active {
    background-color: rgba(0, 0, 0, 0.4);
}

.table-container::-webkit-scrollbar-corner {
    background: transparent;
}

/* 자동계산 필드 스타일 */
.text-muted {
    font-style: italic;
    font-size: 0.75rem !important;
}

/* 새로운 행 추가 폼 요소 스타일 */
#add-row .form-control,
#add-row .form-select,
#add-row .btn {
    font-size: 0.6rem !important;
}

#add-row td {
    font-size: 0.6rem !important;
}

/* 새로운 행 추가 버튼 그룹 스타일 */
#add-row td:last-child {
    white-space: nowrap;
}

#add-row .btn {
    padding: 0.25rem 0.5rem !important;
    margin: 0 1px;
    border-radius: 4px !important;
}

.btn-grp {
    white-space: nowrap;
}

.btn-grp .btn {
    padding: 0.25rem 0.5rem !important;
    margin: 0 1px;
    border-radius: 4px !important;
    font-size: 0.6rem !important;
}

/* Autocomplete styles */
.autocomplete-container {
    position: relative;
    display: inline-block;
    width: 100%;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 9999;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: none;
    font-size: 0.7rem;
}

.autocomplete-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    background: white;
    transition: background-color 0.2s ease;
}

.autocomplete-item:hover {
    background-color: #f8f9fa;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item.selected {
    background-color: #007bff;
    color: white;
}

/* Make sure the autocomplete input has proper styling */
.autocomplete-container input {
    width: 100%;
    position: relative;
    z-index: 1;
}
/* 피봇 분석 스타일 */
.pivot-analysis-container {
    margin-bottom: 2rem;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pivot-table .table {
    margin-bottom: 0;
}

.pivot-table .table th {
    background-color: #f8f9fa;
    border-top: none;
    font-weight: 600;
    font-size: 0.875rem;
}

.pivot-table .table td {
    font-size: 0.875rem;
    vertical-align: middle;
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.card-header h5 {
    color: #495057;
}

.table-bordered th,
.table-bordered td {
    border: 1px solid #dee2e6;
}

.table-responsive {
    overflow-x: auto;
}

#crosstab-pivot .table th {
    background-color: #f8f9fa;
}

#crosstab-pivot .table td:first-child,
#crosstab-pivot .table th:first-child {
    background-color: #fff;
}

#crosstab-pivot .table th:first-child {
    background-color: #f8f9fa;
}