body {
  background-color: #f8f9fa;
}

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

@media (min-width: 992px) {
  .app-shell {
    flex-direction: row;
    align-items: flex-start;
  }
}

.app-sidebar {
  --sidebar-width: 15.5rem;
  --sidebar-width-collapsed: 4.5rem;
  width: var(--sidebar-width);
  flex-shrink: 0;
  background-color: #0d6efd;
  color: #fff;
  transition: width 0.2s ease;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 1030;
}

.app-sidebar.is-collapsed {
  width: var(--sidebar-width-collapsed);
}

.app-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  height: 3.75rem;
  min-height: 3.75rem;
  padding: 0 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  position: relative;
  flex-shrink: 0;
  box-sizing: border-box;
}

.app-sidebar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

.app-sidebar-brand:hover {
  color: #fff;
}

.app-sidebar-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.16);
  flex-shrink: 0;
}

.app-sidebar-brand-mark svg {
  width: 1.125rem;
  height: 1.125rem;
}

.app-sidebar-brand-text,
.app-sidebar-label,
.app-sidebar-user-text {
  transition: opacity 0.15s ease, width 0.15s ease;
}

.app-sidebar.is-collapsed .app-sidebar-brand-text,
.app-sidebar.is-collapsed .app-sidebar-label,
.app-sidebar.is-collapsed .app-sidebar-user-text:not(.app-sidebar-user-text--visible) {
  opacity: 0;
  width: 0;
  overflow: hidden;
  white-space: nowrap;
  pointer-events: none;
}

.app-sidebar-toggle {
  flex-shrink: 0;
  line-height: 1;
}

.app-sidebar.is-collapsed .app-sidebar-toggle svg {
  transform: rotate(180deg);
}

.app-sidebar-nav {
  padding: 0.75rem 0.5rem;
  overflow-y: auto;
}

.app-sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: rgba(255, 255, 255, 0.82);
  border-radius: 0.5rem;
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.15rem;
  white-space: nowrap;
}

.app-sidebar-nav .nav-link:hover,
.app-sidebar-nav .nav-link:focus {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.app-sidebar-nav .nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  font-weight: 600;
}

.app-sidebar-footer {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.app-sidebar-user-toggle {
  gap: 0;
  padding: 0.85rem;
  width: 100%;
}

.app-sidebar-user-toggle::after {
  margin-left: auto;
  flex-shrink: 0;
}

.app-sidebar-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 0;
  margin-inline-end: 0.5rem;
}

.app-sidebar-avatar svg {
  width: 1.5rem;
  height: 1.5rem;
}

.app-sidebar-user-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
  line-height: 1.5rem;
}

.app-sidebar.is-collapsed .app-sidebar-brand {
  display: none;
}

.app-sidebar.is-collapsed .app-sidebar-user-toggle {
  justify-content: center;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.app-sidebar.is-collapsed .app-sidebar-avatar {
  margin-inline-end: 0;
}

.app-sidebar.is-collapsed .app-sidebar-user-toggle::after {
  margin-left: 0.15rem;
}

.app-sidebar.is-collapsed .app-sidebar-avatar svg {
  width: 1.25rem;
  height: 1.25rem;
}

.app-sidebar .dropdown-item svg,
.app-sidebar-offcanvas .dropdown-item svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.app-sidebar.is-collapsed .app-sidebar-nav .nav-link {
  justify-content: center;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.app-sidebar.is-collapsed .app-sidebar-header {
  justify-content: center;
  padding: 0 0.5rem;
}

.app-sidebar.is-collapsed .app-sidebar-toggle {
  margin: 0;
}

.app-main {
  flex: 1;
  min-width: 0;
}

.app-mobile-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: sticky;
  top: 0;
  z-index: 1020;
  background: #fff;
  border-bottom: 1px solid #dee2e6;
  padding: 0.35rem 0.5rem;
}

.app-sidebar-offcanvas {
  --bs-offcanvas-width: min(18rem, 88vw);
}

.app-sidebar-offcanvas .app-sidebar-nav .nav-link {
  color: #212529;
}

.app-sidebar-offcanvas .app-sidebar-nav .nav-link:hover,
.app-sidebar-offcanvas .app-sidebar-nav .nav-link:focus {
  color: #0d6efd;
  background: #e7f1ff;
}

.app-sidebar-offcanvas .app-sidebar-nav .nav-link.active {
  color: #0d6efd;
  background: #e7f1ff;
}

.app-sidebar-offcanvas .app-sidebar-footer {
  border-top-color: #dee2e6;
}

.nav-link-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.nav-link-icon-graphic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.25rem;
}

.nav-link-icon-graphic svg,
.nav-icon-btn svg,
.app-sidebar-toggle svg,
.app-mobile-header svg {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
}

.nav-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.combobox {
  position: relative;
}

.combobox-menu {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  right: 0;
  z-index: 1050;
  max-height: 240px;
  overflow-y: auto;
  margin: 0;
  border-radius: 0.375rem;
}

.combobox-item {
  cursor: pointer;
  white-space: normal;
}

.combobox-item.active,
.combobox-item:hover {
  background-color: #e7f1ff;
}

.address-picker-btn {
  align-self: stretch;
}

.address-picker-menu {
  max-height: 280px;
  overflow-y: auto;
  min-width: 100%;
}

.address-picker-item {
  white-space: normal;
}

.table thead th {
  white-space: nowrap;
}

.job-table-wrap {
  overflow: auto;
  min-height: 0;
}

.job-table {
  margin-bottom: 0;
}

.job-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background-color: #f8f9fa;
  box-shadow: inset 0 -1px 0 #dee2e6;
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.3rem 0.75rem;
  border-top: 1px solid #dee2e6;
  font-size: 0.8125rem;
  background: #fff;
  flex-shrink: 0;
}

.job-table-stack {
  display: flex;
  flex-direction: column;
}

.job-table-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  max-height: calc(100vh - 14rem);
  border: 1px solid #dee2e6;
  border-radius: 0 0 0.375rem 0.375rem;
  overflow: hidden;
  background: #fff;
}

@media (max-width: 991.98px) {
  .job-table-panel {
    max-height: calc(100vh - 17rem);
  }
}

.job-table-filters {
  flex-shrink: 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid #dee2e6;
  border-bottom: none;
  border-radius: 0.375rem 0.375rem 0 0;
  background: #f8f9fa;
  overflow-x: auto;
}

.job-table-filter-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
}

.job-table-search-group {
  flex: 1 1 16rem;
  max-width: 28rem;
  min-width: 12rem;
}

.job-table-search-icon {
  color: #6c757d;
  background: #fff;
}

.job-table-search-icon .bi {
  display: block;
}

.job-table-date-input {
  width: 9.25rem;
  flex: 0 0 9.25rem;
}

.job-table-filter-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 0.35rem;
}

.table-pagination-range {
  white-space: nowrap;
}

.table-pagination-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.table-pagination-page {
  min-width: 4.5rem;
  text-align: center;
  color: #6c757d;
}

.table-pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
  color: #495057;
  text-decoration: none;
  line-height: 1;
  font-size: 1rem;
}

.table-pagination-btn:hover {
  background-color: #f8f9fa;
  color: #0d6efd;
}

.table-pagination-btn.is-disabled {
  pointer-events: none;
  opacity: 0.45;
}

.col-address,
.col-description,
.col-notes {
  min-width: 180px;
  max-width: 280px;
}

.card {
  border: 0;
}

.client-picker-table-wrap,
.client-addresses-table-wrap {
  max-height: 420px;
  overflow-y: auto;
}

@media (min-width: 992px) {
  .client-edit-layout .client-picker-table-wrap,
  .client-edit-layout .client-addresses-table-wrap {
    max-height: calc(100vh - 20rem);
    min-height: 360px;
  }
}

.client-picker-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background-color: #f8f9fa;
}

.client-picker-table tbody tr {
  cursor: pointer;
}

.client-picker-sort-indicator::after {
  content: '↕';
  margin-left: 0.25rem;
  color: #adb5bd;
  font-size: 0.75rem;
}

.client-picker-sort.is-active .client-picker-sort-indicator::after {
  color: #0d6efd;
}

.client-picker-sort.is-asc .client-picker-sort-indicator::after {
  content: '↑';
}

.client-picker-sort.is-desc .client-picker-sort-indicator::after {
  content: '↓';
}

.page-header {
  padding-bottom: 0.25rem;
}

.page-header-breadcrumb {
  --bs-breadcrumb-divider: '›';
  font-size: 0.875rem;
}

.page-header-breadcrumb .breadcrumb-item a {
  color: #6c757d;
  text-decoration: none;
}

.page-header-breadcrumb .breadcrumb-item a:hover {
  color: #0d6efd;
}

.page-header-title {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-header-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-header-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  color: #6c757d;
  text-decoration: none;
}

.page-header-meta-item:hover {
  color: #0d6efd;
}

.page-header-meta-icon {
  display: inline-flex;
  align-items: center;
  color: #6c757d;
}

.page-header-meta-icon svg {
  width: 1rem;
  height: 1rem;
}

.page-header-meta-item:hover .page-header-meta-icon {
  color: #0d6efd;
}

.btn-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.btn-with-icon .btn-icon {
  display: inline-flex;
  line-height: 1;
}

.btn-with-icon svg {
  width: 1.125rem;
  height: 1.125rem;
}

.login-card {
  max-width: 420px;
}

.flash-toast-container {
  z-index: 1090;
  pointer-events: none;
}

.flash-toast {
  pointer-events: auto;
  min-width: min(20rem, calc(100vw - 2rem));
}

.job-form-body {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.job-form-body .form-label {
  margin-bottom: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
}

.job-form-label-optional {
  font-weight: 600;
}

.job-form-block:last-child {
  margin-bottom: 0;
}

.job-form-status-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.job-form-status-chip {
  --bs-btn-padding-y: 0.15rem;
  --bs-btn-padding-x: 0.55rem;
  --bs-btn-font-size: 0.75rem;
  border-radius: 999px;
}

.job-form-section {
  border-top: 1px solid #e9ecef;
  padding-top: 0.85rem;
}

.job-form-layout {
  display: grid;
  gap: 1.25rem;
  align-items: start;
}

@media (min-width: 992px) {
  .job-form-layout {
    grid-template-columns: minmax(0, 1fr) 20.125rem;
  }

  .job-form-sidebar {
    position: sticky;
    top: 1rem;
  }
}

@media (max-width: 991.98px) {
  .job-form-layout {
    grid-template-columns: 1fr;
  }

  .job-form-sidebar {
    margin-top: 0.25rem;
  }
}

.job-form-main {
  min-width: 0;
}

.job-form-sidebar {
  min-width: 0;
}

.job-form-sidebar-panel {
  padding: 0.85rem 1rem;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 0.5rem;
}

.job-form-sidebar-title {
  margin-bottom: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #212529;
}

.job-form-sidebar-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.job-form-sidebar-stack .form-label {
  margin-bottom: 0.25rem;
}

.job-form-section-label {
  font-size: 0.8125rem;
  font-weight: 600;
}

.job-form-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #212529;
  text-align: left;
}

.job-form-section-toggle:hover {
  color: #0d6efd;
}

.job-form-section-chevron::after {
  content: '';
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin-left: 0.5rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}

.job-form-section-toggle:not(.collapsed) .job-form-section-chevron::after {
  transform: rotate(-135deg);
  margin-top: 0.2rem;
}

.job-form-section-body {
  padding-top: 0.75rem;
}

.job-form-doc-list .list-group-item {
  border-left: 0;
  border-right: 0;
}

.job-form-doc-list .list-group-item:first-child {
  border-top: 0;
}

.job-form-doc-list .list-group-item:last-child {
  border-bottom: 0;
}

.job-form-autogrow {
  resize: none;
  overflow-y: hidden;
  line-height: 1.4;
}

.job-form-header-actions {
  max-width: 100%;
}

.job-form-assign-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.job-form-header-project {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
}

.job-form-header-project-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6c757d;
}

.job-form-header-project-value {
  font-size: 0.9375rem;
  font-weight: 600;
}

.report-kpi {
  border: 1px solid #e9ecef;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

a.report-kpi:hover {
  transform: translateY(-1px);
  box-shadow: 0 0.35rem 1rem rgba(15, 23, 42, 0.08) !important;
}

.report-kpi-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
  color: #212529;
}

.report-kpi-label {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-top: 0.35rem;
}

.report-kpi-hint {
  font-size: 0.75rem;
  color: #6c757d;
  margin-top: 0.15rem;
}

.report-kpi--primary {
  border-top: 3px solid #0d6efd;
}

.report-kpi--info {
  border-top: 3px solid #0dcaf0;
}

.report-kpi--warning {
  border-top: 3px solid #ffc107;
}

.report-kpi--success {
  border-top: 3px solid #198754;
}

.report-kpi--secondary {
  border-top: 3px solid #6c757d;
}

.report-kpi--danger {
  border-top: 3px solid #dc3545;
}

.report-stat-list dt {
  font-weight: 500;
  color: #495057;
}

.report-stat-list dd {
  font-weight: 600;
}

.report-stat-list > * {
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid #f1f3f5;
}

.report-stat-list > :last-child,
.report-stat-list > :nth-last-child(2) {
  border-bottom: 0;
}

.report-bar-chart {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.report-bar-row {
  display: grid;
  grid-template-columns: minmax(8rem, 11rem) 1fr auto;
  gap: 0.75rem;
  align-items: center;
}

.report-bar-label {
  font-size: 0.8125rem;
  line-height: 1.3;
}

.report-bar-label a {
  color: inherit;
  text-decoration: none;
}

.report-bar-label a:hover {
  color: #0d6efd;
  text-decoration: underline;
}

.report-bar-track {
  height: 0.65rem;
  background: #e9ecef;
  border-radius: 999px;
  overflow: hidden;
}

.report-bar-fill {
  height: 100%;
  background: #0d6efd;
  border-radius: 999px;
}

.report-bar-fill--muted {
  background: #6c757d;
}

.report-bar-count {
  min-width: 1.75rem;
  text-align: right;
  font-size: 0.875rem;
  font-weight: 600;
}

@media (max-width: 575.98px) {
  .report-bar-row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "label count"
      "track track";
  }

  .report-bar-label {
    grid-area: label;
  }

  .report-bar-track {
    grid-area: track;
  }

  .report-bar-count {
    grid-area: count;
  }
}

.role-permissions-matrix .form-check-input {
  float: none;
  margin: 0;
}

.role-permissions-matrix__locked {
  background-color: var(--bs-secondary-bg);
  color: var(--bs-secondary-color);
}

.role-permissions-matrix__locked .form-check-input:disabled {
  opacity: 1;
}
