body {
  height: 100%;
  margin: 0;
  background-color: #f5f5f5;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  background-color: white;
  box-shadow: 0 .2rem .65rem rgba(0, 0, 0, 0.5);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.content-area {
  padding: 0;
  flex: 1;
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.sub-content-header {
  font-size: 1.2rem;
  font-weight: bold;
  color: #333333;
  margin-bottom: 1.5rem;
}

.sub-content-description {
  font-size: 1rem;
  color: #666;
  margin-bottom: 1rem;
}

.content-area .form-control {
  max-width: 500px;
}

.content-area .btn {
  margin-top: 10px;
}

#content {
  position: relative;
  height: calc(100vh - 100px);
  overflow: hidden;
  margin-top: 100px;
}

.fixed-header {
  position: fixed;
  top: 100px;
  width: calc(1200px - 270px);
  background-color: #fff;
  padding: 10px 20px;
  z-index: 900;
}

.loading-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 5px solid #ccc;
  border-top: 5px solid #0d5ef0;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-screen p {
  margin-top: 10px;
  font-size: 1.2rem;
  color: #333;
}

.scrollable-content {
  scrollbar-width: none;
  margin-top: 50px;
  height: calc(100vh - 150px);
  overflow-y: auto;
  padding: 15px;
}

@media (max-width: 767px) {
  .fixed-header {
    display: none;
  }

  header::after {
    content: attr(data-breadcrumb);
    position: absolute;
    left: 100px;
  }

  .scrollable-content {
    margin-top: 0;
    height: calc(100vh - 100px);
  }

  #content {
    margin-top: 100px;
  }
}

.sidebar {
  position: fixed;
  left: -270px;
  width: 270px;
  height: 100%;
  background-color: #f8f9fa;
  transition: left 0.3s ease;
  z-index: 1000;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
}

.sidebar.open {
  left: 0;
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 900;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

.sidebar-header {
  padding: 20px;
  text-align: center;
}

.list-group-item {
  border: none;
  padding: 10px 15px;
}

.list-group-item:hover {
  background-color: #e9ecef;
}

.list-group-item.active-subtab {
  font-weight: bold;
}

.accordion-button {
  background-color: #e9ecef;
  transition: background-color 0.3s ease;
}

.accordion-button::after {
  display: none !important;
}

.accordion-button:not(.collapsed)::after {
  display: inline-block !important;
}

.accordion-button.active-tab {
  font-weight: bold;
}

.status-led-container {
  display: flex;
  align-items: center;
}

.status-led-label {
  font-weight: bold;
  color: #333;
}

.status-led {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: #ccc;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
  transition: background-color 0.3s ease;
}

.status-led.led-green {
  background-color: #28a745;
  box-shadow: 0 0 9px rgba(40, 167, 69, 0.8);
}

.status-led.led-red {
  background-color: #dc3545;
  box-shadow: 0 0 9px rgba(220, 53, 69, 0.8);
}

.custom-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
  appearance: none;
  border: 2px solid #555;
  border-radius: 4px;
  background-color: #fff;
  position: relative;
  transition: all 0.2s ease;
}

.custom-checkbox:checked {
  background-color: #28a745;
  border-color: #28a745;
}

.custom-checkbox:checked::after {
  content: '\2713'; /* Unicode tick (✔) */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 14px;
  font-weight: bold;
}

.custom-checkbox:disabled {
  background-color: #ccc;
  border-color: #999;
  cursor: not-allowed;
}

.category-div {
  border: 1px solid #dee2e6;
  padding: 15px;
  margin-bottom: 20px;
  background-color: #f8f9fa;
  border-radius: 5px;
}

.category-div h4 {
  margin-top: 0;
  font-size: 1.1rem;
  color: #333;
  border-bottom: 1px solid #dee2e6;
  padding-bottom: 5px;
  margin-bottom: 15px;
}

.list-item-container {
  border: 1px solid #dee2e6;
  padding: 15px;
  margin-bottom: 20px;
  background-color: #f8f9fa;
  border-radius: 5px;
}

.list-item-container h4 {
  margin-top: 0;
  font-size: 1.1rem;
  color: #333;
  border-bottom: 1px solid #dee2e6;
  padding-bottom: 5px;
  margin-bottom: 15px;
}

.list-item {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.list-item input {
  flex: 1;
  margin-right: 10px;
}

.custom-list-container {
  border: 1px solid #dee2e6;
  padding: 15px;
  margin-bottom: 20px;
  background-color: #f8f9fa;
  border-radius: 5px;
}

.custom-list-container h4 {
  margin-top: 0;
  font-size: 1.1rem;
  color: #333;
  border-bottom: 1px solid #dee2e6;
  padding-bottom: 5px;
  margin-bottom: 15px;
}

.custom-list-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 15px;
}

.custom-list-table th,
.custom-list-table td {
  padding: 8px;
  border: 1px solid #dee2e6;
  text-align: left;
}

.custom-list-table th {
  background-color: #e9ecef;
  font-weight: bold;
}

.custom-list-table input,
.custom-list-table select {
  width: 100%;
  padding: 5px;
  border: none;
  background: transparent;
}

.text-value {
  align-items: center;
  gap: 5px;
}

.text-value-label {
  font-weight: bold;
}

.text-value-content {
  color: #333;
}

.file-reader-container textarea {
  width: 100%;
  height: 650px;
  overflow-y: auto;
  resize: vertical;
}

@media (min-width: 768px) {
  .content-wrapper { flex: 1; display: flex; }
  .content-area {
      margin-left: 270px;
  }
  .sidebar {
      position: fixed;
      top: 100px;
      left: max(0px, calc((100% - 1200px) / 2));
      height: calc(100vh - 100px);
  }
  .sidebar-header {
      display: none;
  }
  .sidebar-overlay {
      display: none;
  }
  #menuToggle {
      display: none;
  }
  .accordion {
      margin-top: 20px;
  }

  header .col-md-2 {
    width: 270px;
    display: flex;
    justify-content: center;
    padding: 0;
  }

  header .col-md-2 img {
    width: auto;
  }
}