/* 🌐 기본 레이아웃 */
html,
body {
  font-family: 'Noto Sans KR', sans-serif;
  margin: 0;
  font-family: Arial, sans-serif;
  height: 100vh;
  display: flex;
  flex-direction: column;

  overflow: auto;
  /* 상황에 따라서 화면을 길게 보고싶으면 auto로 변경할것 */

}

#mainWrapper {
  flex: 1;
  display: flex;
  overflow: hidden;
  /* ✅ 내부 스크롤을 위해 overflow 적용 hidden */
}


/* 📦 메인 영역 */
.main-area {
  display: flex;
  flex: 1;
  flex-direction: row;
}

.main-content {
  flex: 3;
  padding: 0 5px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

.main-right {
  width: 450px;
  flex: 1;
  padding: 0 5px;
  display: flex;
  overflow-y: hidden;
  overflow-x: hidden;

}

.layout-row {
  display: flex;
  flex-direction: row;
}

.layout-row .pagination-controls {
  display: flex;
  flex-direction: row;
}

.layout-column {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}

.layout-column .main-content {
  flex: 3;
  width: 100%;
}

.layout-column .main-right {
  flex: 1;
  width: 100%;
}


/* 📁 사이드바 */
.sidebar {
  width: 200px;
  min-width: 150px;
  font-size: 16px;
  background: #505152;
  color: white;
  padding-top: 10px;
  height: 100%;
  transition: all 0.3s ease;
  display: none;
  overflow-y: auto;
  /* 세로 스크롤 자동 생성 */
  overflow-x: hidden;
  /* 가로 스크롤은 숨김 */

}

.sidebar.is-visible {
  display: block;
}

.sidebar ul {
  list-style: none;
  padding: 0;
}

.sidebar li {
  padding: 10px 10px;
  cursor: pointer;
  color: white;
  /* 또는 밝은 색상 */

}

.sidebar li:hover {
  background: #a1a5aa;
}

ul li {
  user-select: none;
}

.sidebar ul li {
  opacity: 1;
  visibility: visible;
}

/* 🔝 상단바 */
.topbar {
  flex: 0 0 auto;
  height: auto;
  width: 100%;
  background-color: #ffffff;
  padding: 5px 0;
  display: none;
  align-items: center;
  justify-content: space-between;
  flex-direction: row;
  flex-wrap: wrap;
}

#userInfoBar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 1px;
}

.action-buttons {
  padding-right: 12px;
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

/* 📱 모바일 대응 */
@media (max-width: 768px) {
  .main-area {
    flex-direction: column;
    height: 100%;
  }


  .main-content {
    flex: 2;
    flex-direction: column;
    /* ✅ 세로 정렬 */
    order: 1;
    min-height: 250px;
    /* ✅ 이 부분을 추가: 최소 높이 설정 */
    overflow-y: auto;
    /* ✅ 세로 스크롤을 허용 */
  }

  .main-right {
    flex: 1;
    height: auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    order: 3;
    border-left: none;
    border-top: 1px solid #ccc;
    min-height: 150px;
    /* ✅ 이 부분을 추가: 최소 높이 설정 */
    overflow-y: auto;
    /* ✅ 세로 스크롤을 허용 */

  }

  .myGrid,
  .myGridRight {
    flex: 1;
    /* ✅ 이 부분을 추가: 부모 요소의 남은 공간을 채우도록 함 */
    min-height: 0;

  }

  .pagination-controls {
    display: flex !important;
    flex-direction: row !important;
    /* ✅ 이 줄을 추가 */
    justify-content: center;
    align-items: center;
    gap: 20px;

    /* margin-top: 1px; */
    /* margin-bottom: 5px; */
    padding-top: 1px;
    padding-bottom: 5px;
    order: 2;
  }

  .pagination-controls button {
    padding: 6px 12px;
    font-size: 14px;
    border-radius: 5px;
    border: 1px solid #ccc;
    background-color: #f8f8f8;
    cursor: pointer;
  }

  .pagination-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }

  .page-info {
    font-size: 14px;
    color: #333;
  }


  #toggleLayoutBtn {
    display: none !important;
  }

  .topbar {
    height: auto;
    /* ✅ 높이를 자동으로 설정 */
    flex-wrap: wrap;
    /* ✅ 자식 요소가 다음 줄로 넘어갈 수 있게 함 */
    align-items: flex-start;
    /* ✅ 요소들을 상단에 정렬 */
    padding: 10px;
    /* ✅ 여백 추가 */
  }


  .action-buttons {
    width: 100%;
    /* ✅ 버튼 컨테이너가 한 줄을 모두 차지하게 함 */
    justify-content: center;
    /* ✅ 버튼들을 중앙에 정렬 */
    margin: 0;
    margin-top: 10px;

  }

  .action-buttons button {
    flex: 0 0 auto;
    margin-right: 8px;
  }

  .ag-paging-panel,
  .ag-paging-number,
  .ag-paging-page-summary-panel {
    display: none !important;
  }

}

/* 🎯 버튼 스타일 */
.button1 {
  text-align: center !important;
  margin: 2px 0;
  padding: 5px 10px;
  border: none;
  border-radius: 4px;
  background-color: #bed1e6;
  color: #413b3b;
  font-size: 13px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.button1:hover {
  background-color: #7ca9da;
}

.button2 {
  text-align: center !important;
  margin: 2px 0 1px 1px; /* 상하좌우*/
  padding: 5px 10px;
  border: none;
  border-radius: 4px;
  background-color: #7a7a7aec;
  color: #f5f5f5;
  font-size: 15px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.button2:hover {
  background-color: #7ca9da;
}

.button {
  text-align: center !important;
  margin: 2px 0 2px 20px;
  padding: 5px 10px;
  border: none;
  border-radius: 4px;
  background-color: #faf3f3ec;
  color: #2b2929;
  font-size: 15px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.button:hover {
  background-color: #7ca9da;
}

.hidden {
    display: none;
}

#toggleLayoutBtn {
  padding: 6px 10px;
  border: none;
  border-radius: 4px;
  background-color: #798d67;
  color: #ffffff;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.3s;
}

/* 📊 그리드 스타일 */
#myGrid {
  flex: 1;
  height: 100%;
  width: 100%;
  border: 1px solid #ccc;
  overflow-y: auto;
}

#myGridRight {
  height: 100%;
  width: 100%;
  border: 1px solid #ccc;
  overflow-y: auto;

}

.ag-header-cell-label {
  color: #333;
  font-weight: bold;
}

.ag-cell.custom-ellipsis-cell {
    /* 텍스트 자동 자르기를 위한 세 가지 핵심 속성 */
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
}


.ag-row  {
  border-bottom: 1px solid #e0e0e0;
}

.ag-root-wrapper {
  border: 1px solid #ccc;
}

.ag-paging-panel {
  display: none;
}

.pagination-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  /* margin-top: 2px;*/
  padding-top: 2px;
  position: relative;
  z-index: 10;


}

/* 🔐 로그인 및 모달 */
.modal,
.detailModal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.detailModal {
  display: none;
  z-index: 1000;
}

.login-box {
  background: white;
  padding: 30px;
  border-radius: 10px;
  width: 300px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.login-box h2 {
  margin-bottom: 20px;
  text-align: center;
}

.login-box input {
  width: 100%;
  padding: 10px;
  margin: 10px 0;
  border: 1px solid #ccc;
  border-radius: 5px;
}

.login-box button {
  width: 100%;
  padding: 10px;
  background: #2e3b4e;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px !important;
}

.login-box button:hover {
  background: #445064;
}

#userID,
#password {
  font-size: 16px !important;
  font-family: 'Arial', sans-serif !important;
  appearance: none;
  -webkit-appearance: none;
  padding: 10px;
  border: 1px solid #ccc;
  box-sizing: border-box;
}

/* 🧾 데이터 필드 배치 */
.data-field-row {
  display: flex;
  gap: 20px;
  margin-bottom: 10px;
}

.data-field-row .data-field {
  flex: 1;
}

/* 아이콘 */
.menu-icon {
  font-size: 20px;
  margin-right: 10px;
  cursor: pointer;
  display: inline-block;
}

/* 하단 바 */
.underBar {
  flex: 0 0 auto;
  height: 40px;
  background: #eeeeee;
  padding: 3px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* 경고 모달 스타일 */
#warningModal {
  display: flex;
  justify-content: center;
  align-items: center;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

#warningModal .modal-content {
  background-color: #fefefe;
  padding: 30px;
  border: 1px solid #888;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  width: 350px;
  text-align: center;
}

#extendSessionBtn {
  padding: 10px 10px;
  font-size: 14px;
  cursor: pointer;
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 5px;
}