/* --- Page Header for Description --- */
.page-header {
  padding: 1rem 0 0.2rem 0;
}

.page-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.page-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.page-title i {
  display: flex;
  align-items: center;
}

.page-title svg {
  width: 18px;
  height: 18px;
}

.page-description {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
  opacity: 0.8;
}

/* --- Table View & Filter Styles --- */

.search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem; /* 간격 축소 및 통일 */
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--border-color);
  align-items: flex-end;
  margin-bottom: 0.5rem;
}

.search-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.search-item.flex-1 {
  flex: 1; /* 검색창이 남은 공간을 채우도록 설정 */
  min-width: 250px;
}

.search-actions {
  display: flex;
  gap: 0.5rem; /* 버튼들 간의 간격 */
  align-items: center;
}

.search-actions .btn {
  height: 38px;
  padding: 0 1rem;
}

.search-item label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.search-item input, 
.search-item select {
  height: 38px;
  padding: 0 1rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 14px;
  outline: none;
  background-color: var(--white);
}

/* 셀렉트 박스 화살표 여백 절대 고정 (수정 금지) */
.search-item select {
  padding-right: 2.5rem !important;
  cursor: pointer;
}

.search-item input:focus, 
.search-item select:focus {
  border-color: var(--primary-color);
}

/* 필터 초기화 버튼 크기 조정 (입력창 높이 38px에 맞춤) */
.btn-reset {
  height: 38px !important;
  color: var(--text-muted) !important;
  padding: 0 1.2rem !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0; /* 불필요한 마진 제거 */
}

.table-container {
  flex: 1;
  background-color: var(--white);
  border-top: 1px solid var(--border-color);
  overflow: auto;
  position: relative;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
}

th, td {
  padding: 0.8rem 1.2rem;
  border-bottom: 1px solid #F3F4F6;
  text-align: left; /* 기본은 좌측 정렬 */
  white-space: nowrap;
}

thead {
  position: sticky;
  top: 0;
  z-index: 50;
}

th {
  background-color: #FAFAFA !important;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: inset 0 1px 0 var(--border-color), inset 0 -1px 0 var(--border-color); /* 상하 테두리 보정 */
  text-transform: none;
}

td {
  font-size: 13px;
  color: var(--text-main);
  font-weight: 400;
}

tbody tr:hover {
  background-color: #F9FAFB;
}

/* 정렬 클래스 강제 적용 */
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.text-left { text-align: left !important; }

/* 메모 컬럼 전용: 가장 길게 표시되도록 너비 조정 및 줄바꿈 허용 */
.col-memo {
  width: 20%;
  min-width: 250px;
  white-space: normal !important;
  word-break: break-all;
  line-height: 1.4;
  text-align: left !important;
}

.btn-icon {
  padding: 0.25rem;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.2s;
}

.btn-icon:hover {
  color: var(--primary-color);
}

.btn-icon svg {
  width: 16px;
  height: 16px;
}

/* --- Table Sorting --- */
th.sortable {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s;
  position: relative;
  padding-right: 1.8rem !important; /* 아이콘 공간 확보 */
}

th.sortable:hover {
  background-color: #F3F4F6;
  color: var(--primary-color);
}

th.sortable::after {
  content: '↕';
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  opacity: 0.3;
  transition: all 0.2s;
}

th.sortable.asc::after {
  content: '▲';
  opacity: 1;
  color: var(--primary-color);
}

th.sortable.desc::after {
  content: '▼';
  opacity: 1;
  color: var(--primary-color);
}
