/* ✅ 전체 레이아웃 */
body {
  font-family: 'Segoe UI', 'Noto Sans KR', sans-serif;
  margin: 0;
  background: #f9f9f9;
  color: #333;
  font-size: 15px;
}

.section-title {
  font-size: 22px;
  margin: 24px 0 12px 0;
  padding-left: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
}

/* ✅ 검색 바 */
.filter-card {
  background: #fff;
  padding: 16px;
  margin: 0 16px 16px 16px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: flex-start;
}

.filter-form input[type="text"],
.filter-form input[type="date"] {
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
  width: 160px;
}

.filter-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.filter-buttons button {
  padding: 8px 16px;
  font-size: 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-buttons button[type="submit"],
.filter-buttons .btn-download {
  background-color: #2196f3;
  color: #fff;
}

.filter-buttons .btn-reset {
  background-color: #f5f5f5;
  color: #333;
  border: 1px solid #ccc;
  transition: all 0.2s ease-in-out;
}

.filter-buttons .btn-reset:hover {
  background-color: #e0e0e0;
}

/* ✅ 액션 바 */
.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #fff;
  margin: 0 16px 12px 16px;
  border-radius: 8px;
}

.actions input[type="text"] {
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}

.actions button {
  padding: 8px 12px;
  font-size: 13px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background-color: #2196f3;
  color: #fff;
}

.actions .btn-add {
  background-color: #4caf50;
}

/* ✅ 테이블 */
.table-wrapper {
  overflow-x: auto;
  margin: 0 16px 16px 16px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 1000px;
}

.data-table th, .data-table td {
  border: 1px solid #eee;
  padding: 10px;
  text-align: center;
}

.data-table th {
  background-color: #f2f2f2;
  font-weight: bold;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}

.data-table tbody tr:hover {
  background-color: #f5faff;
}

.data-table tbody tr.selected {
  background-color: #e6f7ff;
}

.data-table td.product-name {
  white-space: normal;
  word-break: break-word;
  max-width: 280px;
  text-align: left;
}

/* ✅ 페이지네이션 */
.pagination {
  display: flex;
  justify-content: center;
  margin: 20px;
  flex-wrap: wrap;
  gap: 6px;
}

.pagination a {
  padding: 6px 12px;
  text-decoration: none;
  border: 1px solid #ccc;
  border-radius: 6px;
  color: #333;
  font-weight: 500;
}

.pagination a.active {
  background-color: #2196f3;
  color: white;
  border-color: #2196f3;
}

/* ✅ 새 항목 추가 버튼 */
.btn-add {
  background-color: #4caf50;
  color: white;
  padding: 8px 16px;
  font-size: 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.btn-add:hover {
  background-color: #45a049;
}

/* ✅ 말줄임 표시 및 툴팁 스타일 */
.tooltip-ellipsis {
  display: block;
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

/* ✅ 마우스 호버 시 툴팁 */
.tooltip-cell:hover::after {
  content: attr(title);
  position: absolute;
  background-color: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: pre-wrap;
  font-size: 13px;
  z-index: 100;
  top: 100%;
  left: 0;
  min-width: 240px;
  max-width: 600px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  word-break: break-word;
}

/* ✅ 테이블 셀 정렬 */
.data-table th,
.data-table td {
  text-align: center; /* ⬅️ 중앙 정렬 */
  vertical-align: middle; /* ⬅️ 수직 정렬 (선택) */
}

/* 특정 열 좌측 정렬 유지 */
.data-table td.product-name,
.data-table td.note {
  text-align: left;
}

.expandable-cell {
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

.expandable-cell.expanded {
  white-space: normal;
  max-width: none;
  word-break: break-word;
  background-color: #f9f9f9;
}

/* add.html */
.add-card {
  background: #fff;
  padding: 16px;
  margin: 16px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.add-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.add-table th,
.add-table td {
  border: 1px solid #e0e0e0;
  padding: 10px;
  text-align: center;
}

.add-table input {
  width: 100%;
  padding: 6px 8px;
  font-size: 15px;
  box-sizing: border-box;
}

.add-actions {
  margin-top: 16px;
  text-align: right;
}

.btn {
  padding: 8px 16px;
  font-size: 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.btn-primary {
  background-color: #2196f3;
  color: white;
}

.btn-secondary {
  background-color: #4caf50;
  color: white;
  margin-right: 8px;
}

.btn-delete-row {
  background-color: #f44336;
  color: white;
  font-size: 14px;
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
}

/* 수량 input을 숫자 전용으로 좁게 설정 */
#input-table input[name="quantity"] {
  width: 30px;         /* 기본보다 좁게 */
  text-align: center;  /* 숫자 정렬 */
  font-size: 13px;
  padding: 4px 6px;
}

/* 📤 CSV 업로드 모달 스타일 */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
  background-color: #fff;
  margin: 10% auto;
  padding: 24px;
  border: 1px solid #ccc;
  width: 400px;
  border-radius: 8px;
  position: relative;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.modal-close {
  position: absolute;
  top: 8px; right: 12px;
  font-size: 24px;
  cursor: pointer;
}

/* 버튼 추가 스타일 */
.btn-upload {
  background-color: #607d8b;
  color: white;
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
.btn-upload:hover {
  background-color: #455a64;
}

/* 페이퍼 박스 스타일 */
.per-page-select {
  padding: 6px 10px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  margin-left: 6px;
  margin-right: 10px;
}

.per-page-select {
  padding: 4px 8px;
  font-size: 14px;
  border-radius: 4px;
}

.data-table th, .data-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #ddd;
    vertical-align: middle;
}

.data-table select,
.data-table button {
    font-size: 14px;
}