/* ===== 기본 ===== */
body {
  margin: 0;
  padding: 0;
  background: url("../images/메인화면.png") center center / cover no-repeat;
  background-attachment: fixed;
  color: #fff;
  font-family: "Pretendard", "Noto Sans KR", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 0;
}

/* 컨테이너 */
.incidents-container {
  position: relative;
  z-index: 1;
  max-width: 1300px;
  margin: 120px auto 60px auto;
  padding: 0 20px;
  text-align: center;
}

/* 로고 */
.logo {
  height: 100px;
  margin-bottom: 40px;
  margin-top: -5%;
  margin-right: -10%;
}

/* 박스 */
.section-box {
  background: rgba(0, 0, 0, 0.65);
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
  margin-bottom: 30px;
}

.section-box h2 {
  margin-bottom: 20px;
  font-size: 1.8rem;
}

/* ===== 테이블 ===== */
.table {
  width: 100%;
  min-width: 950px;
  border-collapse: collapse;
  margin-top: 20px;
  font-size: 0.95rem;
}

.table th,
.table td {
  padding: 12px;
  border-bottom: 1px solid #555;
  text-align: center;
}

.table th {
  background: rgba(41, 41, 41, 0.95);
  font-weight: 600;
}

.table tr:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* ✅ 스크롤 제거 (스크롤 대신 페이지 전환만) */
/* ✅ 테이블을 가로로 넘치면 스크롤되게 */
.table-wrapper {
  max-height: none;              /* 세로 제한 제거 */
  overflow-y: visible;
  overflow-x: auto;              /* 가로 스크롤 허용 */
  border-radius: 8px;
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.02);
}
/* 스크롤 시 헤더 고정 제거 */
.table thead th {
  background: rgba(41, 41, 41, 0.95);
  z-index: 2;
}

/* ✅ 액션 버튼 가로 정렬 */
.table th:last-child,
.table td:last-child {
  width: 220px;
  white-space: nowrap;
}

.table td:last-child {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.table td:last-child .btn {
  min-width: 55px;
  text-align: center;
  white-space: nowrap;
}

/* ===== 버튼 ===== */
.btn {
  border: 1px solid #666;
  background: none;
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}

.btn:hover {
  background: #333;
}

.btn.danger {
  border-color: #ff6b35;
  color: #ff6b35;
}

.btn.danger:hover {
  background: #e74c3c;
  color: #fff;
}

/* ✅ 상단 제목 + 버튼 */
.incident-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

/* 제목 */
.incident-header h2 {
  font-size: 1.8rem;
  font-weight: 600;
  margin: 0;
  color: #fff;
}

/* 🍊 추가 버튼 */
#addIncidentBtn {
  font-size: 15px;
  padding: 7px 16px;
  border-radius: 6px;
  background-color: #da6d0d;
  color: #fff;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.15s ease;
  box-shadow: 0 0 8px rgba(255, 123, 0, 0.25);
}

#addIncidentBtn:hover {
  background-color: #ff914d;
  transform: translateY(-1px);
}

#addIncidentBtn:active {
  transform: scale(0.97);
}

/* ✅ 페이지네이션 */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.pagination button {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination button:hover {
  background: #947255;
}

.pagination button.active {
  background: #ff914d;
  color: #fff;
  font-weight: 600;
}

/* 이전/다음 버튼 */
.pagination .nav-btn {
  background: rgba(255, 255, 255, 0.15);
  color: #ddd;
  font-weight: 600;
}

.pagination .nav-btn:hover {
  background: #ff914d;
  color: #fff;
}

/* 반응형 */
@media (max-width: 768px) {
  .section-box {
    padding: 20px;
  }

  .incident-header {
    flex-direction: column;
    gap: 10px;
  }

  .table th,
  .table td {
    font-size: 0.85rem;
    padding: 8px;
  }

  #addIncidentBtn {
    width: 100%;
  }

  .table th:last-child,
  .table td:last-child {
    width: auto;
  }
}

.table td {
  white-space: nowrap;      /* 긴 텍스트 줄바꿈 방지 */
  overflow: hidden;         /* 넘치는 부분 숨김 */
  text-overflow: ellipsis;  /* ... 표시 */
  max-width: 250px;         /* 셀 최대 너비 제한 */
}
