/* Sidebar layout */
.app-layout {
  display: flex;
  min-height: calc(100vh - 56px);
}

.app-sidebar {
  width: 210px;
  min-width: 210px;
  background-color: #f8f9fa;
  border-right: 1px solid #dee2e6;
  padding: 1rem 0;
  flex-shrink: 0;
}

.app-main {
  flex: 1;
  padding: 1.5rem;
  min-width: 0;
}

.sidebar-section-label {
  padding: 0 1rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6c757d;
}

.sidebar-link {
  padding: 0.4rem 1rem;
  color: #212529 !important;
  font-size: 0.9rem;
  border-radius: 0;
}

.sidebar-link:hover {
  background-color: #e9ecef;
  color: #212529 !important;
}

.sidebar-link.active {
  background-color: #0d6efd1a;
  color: #0d6efd !important;
  font-weight: 600;
  border-left: 3px solid #0d6efd;
}

@media (max-width: 767.98px) {
  .app-layout {
    flex-direction: column;
  }

  .app-sidebar {
    width: 100%;
    min-width: 0;
    border-right: none;
    border-bottom: 1px solid #dee2e6;
    padding: 0.5rem 0;
  }

  .app-sidebar .nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0 0.5rem;
  }

  .sidebar-section-label {
    display: none;
  }

  .sidebar-link {
    border-radius: 0.375rem;
    padding: 0.3rem 0.75rem;
    font-size: 0.85rem;
  }

  .sidebar-link.active {
    border-left: none;
    border-bottom: 2px solid #0d6efd;
  }

  .app-main {
    padding: 1rem;
  }
}

html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.change-cell {
  max-width: 420px;
  white-space: normal;
  word-break: break-word;
}

.dt-container {
  width: 100%;
}

.dt-container .dt-layout-row {
  gap: 0.75rem;
  margin: 0.5rem 0;
}

.dt-container .dt-search input,
.dt-container .dt-length select {
  margin-left: 0.35rem;
}

table.dataTable > tbody > tr > td,
table.dataTable > thead > tr > th {
  vertical-align: middle;
}

table.dataTable td.change-cell {
  white-space: normal;
}

/* Bootstrap 5.1 does not include text-bg-* helpers (added in v5.2). Polyfill: */
.text-bg-primary   { color: #fff !important; background-color: #0d6efd !important; }
.text-bg-secondary { color: #fff !important; background-color: #6c757d !important; }
.text-bg-success   { color: #fff !important; background-color: #198754 !important; }
.text-bg-danger    { color: #fff !important; background-color: #dc3545 !important; }
.text-bg-warning   { color: #000 !important; background-color: #ffc107 !important; }
.text-bg-info      { color: #000 !important; background-color: #0dcaf0 !important; }
.text-bg-light     { color: #000 !important; background-color: #f8f9fa !important; }
.text-bg-dark      { color: #fff !important; background-color: #212529 !important; }
