/* 사이드바 */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 16.6667%; /* col-2 크기 */
  height: 100vh;
  background-color: #000b41;
  display: flex;
  flex-direction: column;
  padding-top: 1rem;
  box-sizing: border-box;
  z-index: 1030;
}
.sidebar .navbar-brand {
  text-align: center;
  margin-bottom: 1rem;
}
.sidebar .navbar-nav .nav-link {
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 0.3rem;
}
.sidebar .navbar-nav .nav-link:hover {
  background-color: #7d7d7d;
}
.sidebar .navbar-nav .nav-link.current {
  background-color: #29406f;
  box-shadow: 2px 3px 3px #111;
  transform: translateY(-1px);
}
@media (max-width: 768px) {
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
  }
}

.content-wrapper {
  width: calc(100% - 16.6667% - 1rem);
  margin-left: calc(16.6667% + 1rem);
  padding-right: 1rem;
  box-sizing: border-box;
  margin-top: 1rem;
}

/* 그리드 영역 */
.grid-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 300px);
  gap: 1.5rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* 그리드 아이템 위치 */
.grid-item.current {
  grid-column: 1 / 2;
  grid-row: 1 / 2;
}
.grid-item.temperature {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
}
.grid-item.table {
  grid-column: 3 / 4;
  grid-row: 1 / 3;
  overflow: hidden;
}
.grid-item.rpt {
  grid-column: 1 / 3;
  grid-row: 2 / 3;
}

/* 카드 공통 */
.card {
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
}

/* 카드 바디 */
.card-body {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow: hidden;
}

/* 테이블 카드 바디 */
/* 카드 바디 공통 flex 제거 - 테이블 카드만 */
.card-table .card-body {
  display: block !important;
  padding: 1rem;
  height: 100%;
  overflow: hidden;
}

/* 테이블 감싸는 래퍼에 스크롤 부여 */
.card-table .table-wrapper {
  overflow-y: auto;
  height: 100%;
  width: 100%;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.2) transparent;
}
/* 스크롤바 스타일 (파이어폭스 등) */
.card-table .table-wrapper::-webkit-scrollbar {
  width: 8px;
}
.card-table .table-wrapper::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

/* 테이블 */
.card-table table {
  width: calc(100% - 8px);  /* 스크롤바 너비 제외 */
  border-collapse: collapse;
  table-layout: fixed;
}

/* thead 고정 및 스타일 */
.card-table thead {
  position: sticky;
  top: 0;
  background-color: white;
  z-index: 10;
  border-bottom: 2px solid #dee2e6;
}

/* thead 내부 tr 경계선 없애기 */
.card-table thead tr {
  border-bottom: none;
}

/* 셀 공통 */
.card-table th,
.card-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  box-sizing: border-box;
  font-size: 0.75rem;
  vertical-align: middle;
  width: 25%;
}

/* thead 스타일 */
.card-table thead th {
  border-bottom: none !important;
  box-shadow: none !important;
  color: #323232;
}

/* tbody 셀 */
.card-table tbody td {
  border-bottom: none !important;
}

/* 스트라이프 배경 제거 */
table.table-striped tbody tr:nth-of-type(odd) {
  background-color: transparent !important;
}

/* 테두리 제거 */
table.table,
table.table-striped,
table thead tr,
table tbody tr {
  border-bottom: none !important;
}

/* 캔버스 크기 고정 */
canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* 버튼 원형 스타일 */
.btn-circle {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  padding: 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  display: inline-block;
  vertical-align: middle;
}

/* 하단 구분선 */
.bottom-border {
  border-bottom: 2px groove #eee;
}

/* section 간격 */
section {
  margin-top: 2rem;
}

/* 반응형 모바일 */
@media (max-width: 768px) {
  .grid-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
  }
  .grid-item {
    grid-column: auto !important;
    grid-row: auto !important;
    width: 90%;
    min-height: 220px;
  }
  .card-table {
    width: 90%;
  }
  .content-wrapper {
    margin-left: 0;
    width: 100%;
    padding-right: 0;
  }
  section {
    padding-bottom: 2rem;
  }
  .grid-item.table {
    height: 500px; /* 모바일 기준 테이블 카드 높이 설정 */
  }

  .card-table .card-body {
    height: 100%;
    padding: 0.5rem;
  }

  .card-table .table-wrapper {
    height: 100%;
    overflow-y: auto;
  }
}
