html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  width: 100%;
  font-family: "Noto Sans KR", "Noto Sans SC";
  font-weight: 400;
  font-style: normal;
  color: #333;
  margin: 0;
  scroll-behavior: smooth;
  box-sizing: border-box;
  /* font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; */

  /* min-height: 400px; */
  /* margin-bottom: 100px; */
  clear: both;
}

html,
body {
  min-height: 100vh;
}

main {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: center;
}

.hide {
  display: none !important;
}

a {
  text-decoration: none;
}

a:hover {}

a:visited {}

label {
  display: block;
}

p {
  margin: 0;
}

input,
button,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  -webkit-padding: 0.4em 0;
  padding: 0.4em;
  margin: 0 0 0 0;
  box-sizing: border-box;
  border: 1px solid #ccc;
  border-radius: 2px;
}

input:disabled {
  color: #ccc;
}

button {
  color: #333;
  background-color: #f4f4f4;
  outline: none;
}

button:disabled {
  color: #999;
}

button:not(:disabled):active {
  background-color: #ddd;
}

button:focus {
  border-color: #666;
}

@media all and (max-width:360px) {

  html,
  body {
    overflow-x: visible;
  }

  body {
    position: relative
  }
}

@media all and (min-width:361px) and (max-width:1280px) {

  html,
  body {
    overflow-x: visible;
  }

}

@media all and (max-width:840px) {
}

@media all and (min-width:841px) {

  html,
  body {
    overflow-x: unset;
    height: unset;
    padding-bottom: unset;
  }
}

/* ===== 모바일 반응형 공통 스타일 ===== */

/* 테이블 래퍼: 가로 스크롤 보장 */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* 모바일: 모달 */
@media all and (max-width: 768px) {
  /* 모달 폼 그리드를 1열로 */
  .detail-grid,
  .form-grid,
  .modal-grid {
    grid-template-columns: 1fr !important;
  }

  /* 모달 너비 조정 */
  .modal-content,
  .modal-body,
  [class*="modal"] > div {
    min-width: unset !important;
    max-width: 95vw !important;
    width: 95vw !important;
  }

  /* 검색 툴바 줄바꿈 */
  .toolbar,
  .search-bar,
  .filter-bar {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* 통계 카드 1열 */
  .stats-cards {
    grid-template-columns: 1fr !important;
  }

  /* 페이지 타이틀 축소 */
  .page-title,
  h2 {
    font-size: 18px !important;
  }

  /* 테이블 폰트 축소 */
  table {
    font-size: 12px;
  }
  thead th, tbody td {
    padding: 6px 8px;
  }

  /* 버튼 그룹 줄바꿈 */
  .btn-group,
  .action-buttons {
    flex-wrap: wrap;
    gap: 4px;
  }
}

/* 소형 모바일 */
@media all and (max-width: 480px) {
  .stats-cards {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .stat-card {
    padding: 12px !important;
  }

  .stat-value {
    font-size: 20px !important;
  }

  table {
    font-size: 11px;
  }
  thead th, tbody td {
    padding: 4px 6px;
  }
}
