:root {
  --lq-brand: #1f4e79;
  --lq-brand-dark: #163a5a;
  --lq-accent: #2a9d8f;
  --lq-surface: #f3f6f9;
  /* 3D viewer stage only. Keep identical to STAGE_BACKGROUND_HEX in scene.js. */
  --ws-stage: #e8e8e8;
  --ws-viewer-bar: #ffffff;
  --ws-viewer-ink: #3c3c3c;
  --ws-viewer-line: #d0d0d0;
  --ws-viewer-blue: #0696d7;
}

body {
  background: var(--lq-surface);
}

.nav-sidebar .nav-link.active {
  background-color: var(--lq-brand);
  color: #fff;
}

.sidebar-dark-primary .nav-sidebar > .nav-item > span.nav-link {
  color: #c2c7d0;
  cursor: default;
}

.content-wrapper {
  min-height: calc(100vh - 3.5rem);
  padding-bottom: 2.5rem;
}

.content-wrapper > .content {
  padding-bottom: 1.5rem;
}

.main-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.main-footer-brand {
  min-width: 0;
}

.locale-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
}

.locale-switch-label {
  margin: 0 0.35rem 0 0;
  font-size: 0.8125rem;
  color: #6c757d;
}

.locale-switch button {
  border: 1px solid #ced4da;
  background: #fff;
  border-radius: 0.2rem;
  padding: 0.1rem 0.45rem;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: #1f4e79;
}

.locale-switch button.is-active {
  background: #1f4e79;
  border-color: #1f4e79;
  color: #fff;
}

.auth-footer {
  margin-top: 1.25rem;
  text-align: center;
}

.locale-switch-on-dark .locale-switch-label {
  color: rgba(255, 255, 255, 0.85);
}

.locale-switch-on-dark button {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.55);
}

.locale-switch-on-dark button.is-active {
  background: #fff;
  border-color: #fff;
  color: #1f4e79;
}

.login-page {
  background: linear-gradient(145deg, #163a5a 0%, #1f4e79 45%, #2a9d8f 100%);
}

.login-card {
  border: 0;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.login-helper {
  margin: 0;
}

.login-helper a {
  font-size: 0.875rem;
}

.table thead th a {
  color: inherit;
  text-decoration: none;
}

.badge-status {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.03em;
}

.empty-state {
  padding: 2.5rem 1rem;
  text-align: center;
  color: #6c757d;
}

/*
 * List pager. Shared partial, not Bootstrap boxed .pagination.
 * Quiet range meta on the left; squared page hits centered in the footer.
 */
.card-footer.list-pager,
.list-pager {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.55rem 1rem;
  background: #fff;
  border-top: 1px solid #e9ecef;
}

.list-pager-meta {
  margin: 0;
  min-width: 0;
  justify-self: start;
  color: #868e96;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}

.list-pager-nav {
  grid-column: 2;
  justify-self: center;
  margin: 0;
}

.list-pager-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.list-pager-item {
  display: flex;
  margin: 0;
}

.list-pager-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 2rem;
  height: 1.75rem;
  padding: 0 0.45rem;
  border: 0;
  border-radius: 0.25rem;
  background: transparent;
  color: #495057;
  font-size: 0.8125rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-decoration: none;
}

a.list-pager-btn:hover,
a.list-pager-btn:focus {
  color: var(--lq-brand);
  background: #eef4f9;
  text-decoration: none;
}

a.list-pager-btn:focus-visible {
  outline: 2px solid var(--lq-accent);
  outline-offset: 2px;
}

.list-pager-btn.is-current {
  background: var(--lq-brand);
  color: #fff;
  font-weight: 600;
}

.list-pager-btn.list-pager-step {
  color: var(--lq-brand);
  font-size: 0.7rem;
}

.list-pager-item.is-disabled .list-pager-btn {
  color: #ced4da;
  background: transparent;
  pointer-events: none;
  cursor: default;
}

.list-pager-btn.is-ellipsis {
  min-width: 1.15rem;
  padding: 0;
  color: #adb5bd;
  font-weight: 400;
  letter-spacing: 0.05em;
  pointer-events: none;
}

@media (max-width: 575.98px) {
  .card-footer.list-pager,
  .list-pager {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
  }

  .list-pager-meta {
    width: 100%;
    text-align: center;
  }

  .list-pager-nav {
    grid-column: auto;
  }
}

/*
 * List bulk bar. Appears when one or more eligible rows are checked.
 * Same quiet chrome as .list-pager: white surface, hairline, brand count.
 */
.list-check-col {
  width: 2.25rem;
  text-align: center;
  vertical-align: middle;
}

.list-check-col input[type="checkbox"] {
  margin: 0;
  vertical-align: middle;
  accent-color: var(--lq-brand);
}

.list-check-col input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--lq-accent);
  outline-offset: 2px;
}

.list-check-col input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.mobile-sync-group:nth-child(odd) {
  background: #f7fafc;
  border-color: #e4ebf2 !important;
}

.mobile-sync-group:nth-child(even) {
  background: #fbfbfc;
  border-color: #eceef1 !important;
}

.mobile-sync-group-toggle {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  border: 0;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.mobile-sync-group-toggle:focus {
  outline: 2px solid var(--lq-accent);
  outline-offset: -2px;
}

.mobile-sync-group-copy {
  min-width: 0;
}

.mobile-sync-group-chevron {
  flex: 0 0 auto;
  margin-top: 0.2rem;
  color: #6c757d;
  transition: transform 0.15s ease;
}

.mobile-sync-group-toggle[aria-expanded="false"] .mobile-sync-group-chevron {
  transform: rotate(-90deg);
}

.mobile-sync-group-head {
  background: rgba(31, 78, 121, 0.035);
}

.mobile-sync-group:nth-child(even) .mobile-sync-group-head {
  background: rgba(0, 0, 0, 0.02);
}

.mobile-sync-group .mobile-sync-files,
.mobile-sync-group .mobile-sync-files thead th,
.mobile-sync-group .mobile-sync-files tbody td {
  background-color: transparent;
}

.mobile-sync-files .list-check-col {
  width: 2.75rem;
  overflow: visible;
}

.mobile-sync-files .list-check-col input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--lq-brand);
  vertical-align: middle;
}

.mobile-sync-file {
  overflow-wrap: anywhere;
}

.mobile-sync-device {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  margin-bottom: 1rem;
  padding: 0.7rem 1rem;
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 0.25rem;
}

.mobile-sync-device-item span {
  display: block;
  color: #6c757d;
  font-size: 0.75rem;
  line-height: 1.2;
}

.mobile-sync-device-item strong {
  color: #495057;
  font-weight: 600;
}

.mobile-sync-device-note {
  flex: 1 1 18rem;
  margin: 0;
  color: #6c757d;
  font-size: 0.75rem;
  line-height: 1.4;
}

.mobile-sync-project + .mobile-sync-project {
  border-top: 1px solid #e9ecef;
}

.mobile-sync-project-head {
  padding: 0.85rem 1rem 0.45rem;
  background: #f8f9fa;
}

.mobile-sync-project-title {
  color: #212529;
  font-weight: 600;
}

.mobile-sync-project-company {
  color: #6c757d;
  font-size: 0.8125rem;
}

.mobile-sync-section {
  padding: 0.7rem 1rem 0.15rem;
}

.mobile-sync-section-level {
  color: #6c757d;
  font-size: 0.8125rem;
}

.mobile-sync-section-doc {
  color: #343a40;
  font-size: 0.875rem;
}

.mobile-sync-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  padding: 0.55rem 1rem;
  border-top: 1px solid #f1f3f5;
  cursor: pointer;
}

.mobile-sync-row input[type="checkbox"] {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--lq-brand);
}

.mobile-sync-row:has(input:checked) {
  background: #f4f8fb;
  box-shadow: inset 3px 0 0 var(--lq-brand);
}

.mobile-sync-row-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  color: #343a40;
  font-weight: 600;
}

.mobile-sync-row-meta {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mobile-sync-profile {
  padding: 0.1rem 0.45rem;
  border: 1px solid #d5dee8;
  border-radius: 999px;
  background: #fff;
  color: var(--lq-brand);
  font-size: 0.75rem;
  line-height: 1.4;
  white-space: nowrap;
}

.mobile-sync-size {
  color: #6c757d;
  font-size: 0.8125rem;
  white-space: nowrap;
}

.mobile-sync-save {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: #fff;
  border-top: 1px solid #e9ecef;
}

.list-bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin: 0 0 0.75rem;
  padding: 0.5rem 1rem;
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 0.25rem;
}

.list-bulk-bar[hidden] {
  display: none !important;
}

.list-bulk-count {
  margin: 0;
  color: var(--lq-brand);
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.list-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.list-bulk-clear {
  padding: 0.2rem 0.15rem;
  border: 0;
  background: transparent;
  color: #6c757d;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

.list-bulk-clear:hover,
.list-bulk-clear:focus {
  color: var(--lq-brand);
}

.list-bulk-clear:focus-visible {
  outline: 2px solid var(--lq-accent);
  outline-offset: 2px;
}

.btn.list-bulk-delete {
  color: #9b2c2c;
  background: #fff;
  border: 1px solid #e2b6b6;
  font-weight: 600;
}

.btn.list-bulk-delete:hover,
.btn.list-bulk-delete:focus {
  color: #fff;
  background: #9b2c2c;
  border-color: #9b2c2c;
}

.list-cascade-confirm {
  margin: 0 0 0.75rem;
  padding: 0.85rem 1rem;
  background: #fff;
  border: 1px solid #e2b6b6;
  border-radius: 0.25rem;
  box-shadow: inset 3px 0 0 #9b2c2c;
}

.list-cascade-confirm .h5 {
  margin: 0 0 0.4rem;
  color: var(--lq-brand-dark, #163a5a);
  font-size: 0.95rem;
  font-weight: 600;
}

.list-cascade-confirm p {
  margin: 0 0 0.75rem;
  color: #495057;
  font-size: 0.875rem;
}

.flash-stack {
  position: sticky;
  top: 0.75rem;
  z-index: 1030;
}

/*
 * Form footers. A form with class "card" is a column flex container
 * (AdminLTE .card), so unwrapped buttons stretch to full width and stack.
 * Keep primary and secondary actions in this row instead.
 */
.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.form-actions > .btn,
.form-actions > form {
  width: auto;
  flex: 0 0 auto;
}

/*
 * Classifications value rows: Save and Delete stay next to each other.
 * Do not put them in a growing column or use space-between / ms-auto.
 */
.classification-row-actions {
  flex: 0 0 auto;
  white-space: nowrap;
}

.classification-values-table {
  table-layout: fixed;
  width: 100%;
}

.classification-values-table th,
.classification-values-table td {
  vertical-align: middle;
}

.classification-values-table .classification-col-key { width: 18%; }
.classification-values-table .classification-col-label { width: 22%; }
.classification-values-table .classification-col-parent { width: 24%; }
.classification-values-table .classification-col-order { width: 8%; }
.classification-values-table .classification-col-active { width: 10%; }
.classification-values-table .classification-col-actions { width: 18%; }

/*
 * Project-tree page header. Breadcrumb is a quiet text trail. Back sits on
 * the right of that trail (`.page-header-nav`), not in the action cluster.
 * Title and meta sit left of the title row; other actions sit right.
 */
.page-header {
  margin-bottom: 1rem;
}

.page-header-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  width: 100%;
  margin: 0 0 30px;
  padding: 0 0 0.35rem;
  border-bottom: 1px solid #e9ecef;
}

.page-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
  margin-left: auto;
  padding: 0.25rem 0.15rem 0.25rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--lq-brand);
  background: transparent;
  border: 0;
  border-left: 1px solid #dee2e6;
  text-decoration: none;
  white-space: nowrap;
}

.page-back i {
  font-size: 0.7rem;
}

.page-back:hover,
.page-back:focus {
  color: var(--lq-brand-dark);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.page-breadcrumb {
  --bs-breadcrumb-divider: ">";
  --bs-breadcrumb-divider-color: #adb5bd;
  --bs-breadcrumb-item-active-color: #495057;
  flex: 1 1 12rem;
  min-width: 0;
  width: auto;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.page-breadcrumb .breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  min-width: 0;
  background: transparent;
  margin: 0;
  padding: 0;
  font-size: 0.8125rem;
  line-height: 1.3;
  justify-content: flex-start;
  float: none;
}

.page-breadcrumb .breadcrumb-item {
  color: #6c757d;
  font-weight: 400;
}

.page-breadcrumb .breadcrumb-item.active {
  color: #495057;
  font-weight: 500;
}

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

.page-breadcrumb .breadcrumb-item a:hover,
.page-breadcrumb .breadcrumb-item a:focus-visible {
  color: var(--lq-brand);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.page-breadcrumb .breadcrumb-item + .breadcrumb-item {
  padding-left: 0.5rem;
}

.page-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
  float: none;
  padding-right: 0.5rem;
  color: #adb5bd;
  content: ">";
}

/*
 * Page title row: heading left, other actions right.
 * Back is not here; it lives in .page-header-nav.
 * Do not put Back in .form-actions; that row is Save/Cancel at the form footer.
 */
.page-header-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.page-header-title h1,
.page-header-bar > h1 {
  margin-top: 0;
  margin-bottom: 0;
}

.page-header-meta {
  margin: 0.25rem 0 0;
  color: #6c757d;
  font-size: 0.875rem;
}

.page-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.page-header-actions > .btn,
.page-header-actions > form {
  width: auto;
  flex: 0 0 auto;
}

/*
 * Search typeahead. Positioned under the field without changing input-group
 * flex (the list is a sibling of the input-group, not a child of it).
 */
.search-suggest {
  position: relative;
  width: 100%;
}

.search-suggest-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1050;
  display: none;
  margin-top: 0.125rem;
  max-height: 20rem;
  overflow-y: auto;
  list-style: none;
}

.search-suggest-menu.show {
  display: block;
}

/*
 * Navbar search. AdminLTE's default is ~200px; give more room to type
 * without filling the header. Scoped to .navbar so the Search page form
 * stays full-width of its card.
 */
.navbar .search-suggest {
  width: 22.5rem; /* 360px at 16px root */
  max-width: 100%;
}

.navbar .search-suggest .input-group {
  width: 100%;
}

.navbar .search-suggest .form-control {
  flex: 1 1 auto;
  min-width: 0;
}

.navbar .search-suggest-menu {
  width: 100%;
  min-width: 0;
  right: 0;
}

@media (max-width: 767.98px) {
  .navbar .search-suggest {
    width: 16rem;
  }
}

.search-suggest-item.is-active,
.search-suggest-item:hover {
  background-color: #e9ecef;
}

.search-suggest-status {
  cursor: default;
  color: #6c757d;
}

/*
 * Dashboard KPIs (FR-135 / ADR-72). Neutral lq-list chrome, not coloured
 * AdminLTE small-boxes. Three equal cards per admin row.
 */
.dashboard-stat-row > [class*="col-"] {
  display: flex;
}

.dashboard-kpi {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 0.25rem;
  box-shadow: none;
  color: #212529;
  text-decoration: none;
}

a.dashboard-kpi-link {
  color: #212529;
  text-decoration: none;
}

a.dashboard-kpi-link:hover,
a.dashboard-kpi-link:focus {
  color: #212529;
  text-decoration: none;
  border-color: #ced4da;
  background: #fafbfc;
}

.dashboard-kpi-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.35rem;
  background: #f1f3f5;
  color: var(--lq-brand, #1f4e79);
  font-size: 1.05rem;
}

.dashboard-kpi-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 0.1rem;
}

.dashboard-kpi-value {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
  color: #212529;
}

.dashboard-kpi-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6c757d;
}

.dashboard-kpi-meta {
  font-size: 0.8rem;
  color: #6c757d;
}

.dashboard-list-card .card-header.dashboard-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  background: #fff;
  border-bottom: 1px solid #e9ecef;
}

.dashboard-list-card .card-header.dashboard-list-head::after {
  display: none;
}

.dashboard-list-title {
  margin: 0;
  float: none;
  flex: 1 1 auto;
  font-size: 0.95rem;
  font-weight: 600;
  color: #212529;
}

.dashboard-list-action {
  float: none;
  flex: 0 0 auto;
  margin-left: auto;
}

.dashboard-lists-row {
  align-items: stretch;
}

.dashboard-lists-row > [class*="col-"] {
  display: flex;
}

.dashboard-lists-row > [class*="col-"] > .dashboard-list-card {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  width: 100%;
  margin-bottom: 1rem;
}

.dashboard-lists-row > [class*="col-"] > .dashboard-list-card > .dashboard-list-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.dashboard-lists-row .dashboard-list-empty-panel {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  text-align: center;
  color: #6c757d;
  font-size: 0.875rem;
}

.dashboard-page .dashboard-quick-links {
  margin-bottom: 0;
}

.dashboard-page .dashboard-quick-links .btn {
  margin-left: 0.35rem;
}

.dashboard-page .dashboard-quick-links .btn:first-child {
  margin-left: 0;
}

/*
 * Software Administration panel (FR-192). The factory layout has neither
 * the brand line nor the top-bar mark. Heights stay on the AdminLTE header
 * so the sidebar and the navbar still meet.
 */
.software-admin .main-header {
  box-shadow: inset 0 -3px 0 var(--lq-brand);
}

.software-admin .software-admin-mark {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lq-brand-dark);
}

.software-admin .main-sidebar .brand-link {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: calc(3.5rem + 1px);
  overflow: hidden;
  white-space: normal;
  line-height: 1.15;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
  box-shadow: inset 0 -3px 0 var(--lq-accent);
}

.software-admin .main-sidebar .brand-link .app-brand {
  font-size: 1.05rem;
  line-height: 1.15;
}

.software-admin-brand-label {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.2;
}

body.sidebar-mini.sidebar-collapse .main-sidebar:not(:hover) .software-admin-brand-label {
  display: none;
}

.dashboard-list-count {
  margin-left: 0.35rem;
  font-weight: 600;
  color: #6c757d;
}

.dashboard-customers {
  margin-bottom: 1rem;
}

.dashboard-customer-owner {
  display: block;
  margin-top: 0.15rem;
  font-weight: 400;
  font-size: 0.8125rem;
  color: #6c757d;
}

.dashboard-count-link,
.dashboard-license-link,
.dashboard-countdown {
  font-weight: 600;
  color: #212529;
  text-decoration: none;
}

.dashboard-count-link {
  font-variant-numeric: tabular-nums;
}

.dashboard-count-link:hover,
.dashboard-count-link:focus,
.dashboard-license-link:hover,
.dashboard-license-link:focus,
.dashboard-countdown:hover,
.dashboard-countdown:focus {
  color: var(--lq-brand);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.dashboard-countdown.is-ended {
  color: #c62828;
}

.dashboard-countdown.is-ended:hover,
.dashboard-countdown.is-ended:focus {
  color: #8e1c1c;
}

/*
 * Document detail review surface (FR-86). Left column is the 3D embed or
 * empty-state uploader, then Works; right rail is Revision History, Related,
 * Evidence. Override Bootstrap .mb-3 (1rem) so the stacked rail cards have a
 * consistent 1.5rem gap below each block. min-width: 0 lets a wide works
 * table scroll inside the column instead of expanding the page.
 */
.document-show > [class*="col-"] {
  min-width: 0;
}

.document-show-works {
  margin-top: 1.5rem;
  max-width: 100%;
}

.document-show-rail > .card {
  margin-bottom: 1.5rem !important;
}

.works-panel-table .work-title {
  overflow-wrap: anywhere;
}

.document-preview-pane {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 560px;
  min-height: 560px;
  background: var(--ws-stage);
  border: 1px solid var(--ws-viewer-line);
  border-radius: 0.25rem;
  overflow: hidden;
}

@media (min-width: 992px) {
  .document-preview-pane {
    height: calc(100vh - 14rem);
  }

  .document-preview-pane.is-empty,
  .document-preview-pane.is-message {
    height: auto;
    min-height: 0;
  }
}

.document-preview-pane.is-empty,
.document-preview-pane.is-message {
  background: #f8f9fa;
  height: auto;
  min-height: 0;
}

.document-preview-host {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  background: var(--ws-stage);
}

.workspace-host,
.ws-stage {
  background: var(--ws-stage);
}

canvas.ws-cursor-orbit {
  cursor: url('../img/cursor-orbit.png?v=3') 16 16, default;
}

.ws-view-cube {
  --cube-edge: 28%;
  position: absolute;
  top: 8px;
  right: 10px;
  width: 112px;
  height: 112px;
  z-index: 6;
  touch-action: none;
  user-select: none;
}

.ws-view-cube canvas {
  display: block;
  width: 112px !important;
  height: 112px !important;
  max-width: none !important;
  cursor: pointer;
}

.ws-cube-arrows {
  display: none;
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ws-view-cube.is-aligned .ws-cube-arrows {
  display: block;
}

.ws-cube-arrow {
  position: absolute;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  appearance: none;
  box-shadow: none;
  background: transparent;
  color: #9a9a9a;
  cursor: pointer;
  pointer-events: auto;
  line-height: 0;
  min-width: 0;
}

.ws-cube-arrow:hover,
.ws-cube-arrow:focus-visible {
  color: #5a5a5a;
}

.ws-cube-arrow svg {
  display: block;
  width: 100%;
  height: 100%;
}

.ws-cube-arrow.is-side {
  width: 16px;
  height: 14px;
}

.ws-cube-arrow.is-roll {
  width: 20px;
  height: 20px;
}

.ws-cube-arrow.is-n {
  left: 50%;
  top: calc(var(--cube-edge) - 22px);
  transform: translateX(-50%);
}

.ws-cube-arrow.is-s {
  left: 50%;
  bottom: calc(var(--cube-edge) - 22px);
  transform: translateX(-50%);
}

.ws-cube-arrow.is-s svg {
  transform: rotate(180deg);
}

.ws-cube-arrow.is-e {
  top: 50%;
  right: calc(var(--cube-edge) - 20px);
  transform: translateY(-50%);
}

.ws-cube-arrow.is-e svg {
  transform: rotate(90deg);
}

.ws-cube-arrow.is-w {
  top: 50%;
  left: calc(var(--cube-edge) - 20px);
  transform: translateY(-50%);
}

.ws-cube-arrow.is-w svg {
  transform: rotate(-90deg);
}

.ws-cube-arrow.is-nw {
  left: calc(var(--cube-edge) - 24px);
  top: calc(var(--cube-edge) - 24px);
}

.ws-cube-home {
  position: absolute;
  left: -23px;
  top: 4px;
  z-index: 2;
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  appearance: none;
  box-shadow: none;
  background: transparent;
  color: #6a6a6a;
  cursor: pointer;
  line-height: 0;
}

.ws-cube-home:hover,
.ws-cube-home:focus-visible {
  color: #222;
}

.ws-cube-home svg {
  display: block;
  width: 100%;
  height: 100%;
}

.ws-cube-arrow.is-ne {
  right: calc(var(--cube-edge) - 24px);
  top: calc(var(--cube-edge) - 24px);
}

.ws-cube-arrow.is-se {
  right: calc(var(--cube-edge) - 24px);
  bottom: calc(var(--cube-edge) - 24px);
}

.ws-cube-arrow.is-se svg {
  transform: rotate(180deg);
}

.ws-cube-arrow.is-sw {
  left: calc(var(--cube-edge) - 24px);
  bottom: calc(var(--cube-edge) - 24px);
}

.ws-cube-arrow.is-sw svg {
  transform: rotate(180deg);
}

.document-preview-pane canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
}

.document-preview-message {
  padding: 1.5rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 1rem;
}

.document-preview-message .alert {
  margin-bottom: 0;
}

.document-preview-pane.is-empty .document-uploader,
.document-preview-pane.is-message .document-uploader {
  padding: 0;
}

.document-preview-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  text-align: center;
  padding: 2rem 1.5rem;
}

.document-preview-loading .spinner-border {
  width: 2.5rem;
  height: 2.5rem;
}

.revision-processing-layout {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.revision-processing-layout .spinner-border {
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
  margin-top: 0.15rem;
}

.export-card {
  position: relative;
}

.export-card.is-busy .card-body {
  pointer-events: none;
}

.export-busy {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.82);
}

.export-busy[hidden] {
  display: none;
}

.export-status-live {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.revision-processing-body {
  min-width: 0;
  flex: 1 1 auto;
}

.revision-processing-steps {
  list-style: none;
  margin: 0;
  padding: 0;
}

.revision-processing-step {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-top: 1px solid #e9ecef;
}

.revision-processing-step:first-child {
  border-top: 0;
  padding-top: 0;
}

.revision-processing-mark {
  flex: 0 0 6.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #6c757d;
  padding-top: 0.15rem;
}

.revision-processing-step.is-current .revision-processing-mark {
  color: #0d6efd;
}

.revision-processing-step.is-done .revision-processing-mark {
  color: #198754;
}

.revision-processing-step.is-failed .revision-processing-mark {
  color: #dc3545;
}

.revision-processing-copy {
  min-width: 0;
}

.revision-processing-steps--compact {
  text-align: left;
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
}

.revision-processing-steps--compact .revision-processing-mark {
  flex-basis: 5.5rem;
}

.document-preview-toolbar {
  position: relative;
  flex: 0 0 auto;
  z-index: 4;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.35rem;
  background: var(--ws-viewer-bar);
  border-bottom: 1px solid var(--ws-viewer-line);
  color: var(--ws-viewer-ink);
  width: 100%;
  box-sizing: border-box;
}

.dd-toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  min-width: 0;
}

.dd-toolbar-group.is-start {
  justify-content: flex-start;
}

.dd-toolbar-group.is-center {
  justify-content: center;
}

.dd-toolbar-group.is-end {
  justify-content: flex-end;
}

.document-preview-toolbar .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.55rem;
  font-size: 0.8125rem;
  line-height: 1.2;
  color: var(--ws-viewer-ink);
  background: transparent;
  border-color: transparent;
  border-radius: 2px;
  box-shadow: none;
}

.dd-tool-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  display: block;
}

.document-preview-dock {
  position: relative;
  flex: 0 0 auto;
  z-index: 5;
}

.document-preview-measurebar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  padding: 0.15rem 0.65rem 0.2rem;
  background: #fff;
  border-top: 1px solid var(--ws-viewer-line);
  border-bottom: 1px solid var(--ws-viewer-line);
  color: var(--ws-viewer-ink);
}

.document-preview-measurebar[hidden] {
  display: none;
}

.dd-measure-side {
  display: flex;
  align-items: center;
  min-width: 0;
}

.dd-measure-side.is-end {
  justify-content: flex-end;
}

.dd-measure-tools {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  min-width: 0;
}

.document-preview-measurebar .btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  min-width: 4.4rem;
  padding: 0.2rem 0.35rem 0.12rem;
  font-size: 0.68rem;
  line-height: 1.1;
  color: var(--ws-viewer-ink);
  background: transparent;
  border-color: transparent;
  border-radius: 2px;
  box-shadow: none;
}

.document-preview-measurebar .dd-tool-icon {
  width: 20px;
  height: 20px;
}

.document-preview-measurebar .btn:hover,
.document-preview-measurebar .btn:focus {
  color: #222;
  background: #f2f2f2;
  border-color: transparent;
}

.document-preview-measurebar .btn.active,
.document-preview-measurebar .btn.active:hover,
.document-preview-measurebar .btn.active:focus {
  color: var(--ws-viewer-blue);
  background: #e7f4fb;
  border-color: transparent;
}

.dd-measure-clear {
  flex: 0 0 auto;
  padding: 0.35rem 1.15rem;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: #3c3c3c;
  background: #fff;
  border: 1px solid #c8c8c8;
  border-radius: 2px;
  cursor: pointer;
}

.dd-measure-clear:hover,
.dd-measure-clear:focus-visible {
  color: #111;
  border-color: #9a9a9a;
  background: #f7f7f7;
}

.document-preview-bottombar {
  position: relative;
  flex: 0 0 auto;
  z-index: 4;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  padding: 0.2rem 0.5rem 0.28rem;
  background: var(--ws-viewer-bar);
  border-top: 1px solid var(--ws-viewer-line);
  color: var(--ws-viewer-ink);
}

.dd-bottom-side {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  min-width: 0;
}

.dd-bottom-side.is-start {
  justify-content: flex-end;
}

.dd-bottom-side.is-end {
  justify-content: flex-start;
}

.document-preview-bottombar .btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  min-width: 3.4rem;
  padding: 0.2rem 0.45rem 0.15rem;
  font-size: 0.68rem;
  line-height: 1.1;
  color: var(--ws-viewer-ink);
  background: transparent;
  border-color: transparent;
  border-radius: 2px;
  box-shadow: none;
}

.document-preview-bottombar .dd-tool-icon {
  width: 20px;
  height: 20px;
}

.document-preview-bottombar .btn:hover,
.document-preview-bottombar .btn:focus {
  color: #222;
  background: #f2f2f2;
  border-color: transparent;
}

.document-preview-bottombar .btn.active,
.document-preview-bottombar .btn.active:hover,
.document-preview-bottombar .btn.active:focus {
  color: var(--ws-viewer-blue);
  background: #e7f4fb;
  border-color: transparent;
}

.document-preview-toolbar .btn:hover,
.document-preview-toolbar .btn:focus {
  color: #222;
  background: #f2f2f2;
  border-color: transparent;
}

.document-preview-toolbar .btn.active {
  color: var(--ws-viewer-blue);
  background: transparent;
  border-color: transparent;
  box-shadow: inset 0 -2px 0 var(--ws-viewer-blue);
}

.document-preview-toolbar-search {
  flex: 1 1 8rem;
  width: auto;
  min-width: 6rem;
  height: calc(1.5em + 0.4rem);
  padding: 0.15rem 0.4rem;
  font-size: 0.75rem;
  color: #222;
  background: #fff;
  border: 1px solid #ccc;
}

.document-preview-popover {
  position: absolute;
  left: 0.6rem;
  right: auto;
  top: 2.75rem;
  bottom: auto;
  z-index: 8;
  display: none;
  min-width: 0;
  max-width: calc(100% - 1.2rem);
  padding: 0.5rem;
  color: var(--ws-viewer-ink);
  background: #fff;
  border: 1px solid var(--ws-viewer-line);
  border-radius: 2px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.document-preview-popover.show {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}

.document-preview-popover[hidden] {
  display: none !important;
}

.document-preview-popover .btn,
.document-preview-popover a.btn {
  margin: 0.1rem;
  color: var(--ws-viewer-ink) !important;
  background: #fff;
  border-color: #ccc;
}

.document-preview-popover .btn:hover,
.document-preview-popover .btn:focus,
.document-preview-popover a.btn:hover,
.document-preview-popover a.btn:focus {
  color: #222 !important;
  background: #f2f2f2;
  border-color: #aaa;
}

.ws-side {
  width: 280px;
  background: #1e1e1e;
  color: #eee;
  overflow-x: hidden;
  overflow-y: auto;
  font: 12px/1.4 system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.ws-side.is-browser {
  width: 300px;
  background: #fff;
  color: #222;
  border-right: 1px solid var(--ws-viewer-line);
  font: 13px/1.4 "Segoe UI", system-ui, sans-serif;
}

.ws-browser-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px 4px;
  font-weight: 600;
}

.ws-browser-close {
  border: 0;
  background: transparent;
  color: #666;
  font-size: 20px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
}

.ws-browser-close:hover,
.ws-browser-close:focus {
  color: #222;
}

.ws-browser-search {
  display: block;
  width: calc(100% - 24px);
  margin: 4px 12px 8px;
  padding: 6px 8px;
  font-size: 13px;
  color: #222;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 2px;
  box-sizing: border-box;
}

.ws-side.is-browser .ws-tree {
  max-height: none;
  color: #222;
}

.ws-side.is-browser .ws-tree-row:hover {
  background: #f5f5f5;
}

.ws-side.is-browser .ws-tree-row.is-selected,
.ws-side.is-browser .ws-tree-row.is-selected:hover {
  background: #d6eaf8;
}

.ws-measure-overlay {
  position: absolute;
  left: 12px;
  bottom: 10px;
  z-index: 2;
  max-width: min(28rem, calc(100% - 24px));
  margin: 0;
  padding: 6px 8px;
  border: 1px solid var(--ws-viewer-line);
  background: rgba(255, 255, 255, 0.94);
  color: #333;
  pointer-events: none;
}

.ws-measure-overlay.is-idle {
  display: none;
}

/* A hosted review canvas draws the numbers on the model. The status strip
   stays on the full-workspace side panel (FR-211). */
.ws-stage > .ws-measure-overlay {
  display: none !important;
}

.document-preview-popover.is-end {
  left: auto;
  right: 0.6rem;
}

.ws-distance-layer {
  position: absolute;
  z-index: 4;
  overflow: hidden;
  pointer-events: none;
}

.ws-distance-layer svg {
  display: block;
  overflow: visible;
}

.ws-dist-len,
.ws-dist-axis {
  position: absolute;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font: 600 13px/1.2 "Segoe UI", system-ui, sans-serif;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.28));
  user-select: none;
}

.ws-dist-len {
  padding: 3px 8px;
  border-radius: 3px;
  background: #1e88e5;
  color: #fff;
}

.ws-dist-axis {
  border-radius: 3px;
  background: #fff;
  color: #222;
}

.ws-dist-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  padding: 3px 5px;
  border-radius: 3px 0 0 3px;
  color: #fff;
  font-weight: 700;
}

.ws-dist-axis.is-x .ws-dist-badge {
  background: #e53935;
}

.ws-dist-axis.is-y .ws-dist-badge {
  background: #2e7d32;
}

.ws-dist-axis.is-z .ws-dist-badge {
  background: #1565c0;
}

.ws-dist-value {
  padding: 3px 8px 3px 6px;
}

.ws-dist-len.is-selected,
.ws-dist-axis.is-selected {
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px #0d47a1;
}

.ws-coord {
  position: absolute;
  padding: 4px 8px;
  border-radius: 4px;
  background: #fff;
  color: #1e88e5;
  font: 600 13px/1.35 "Segoe UI", system-ui, sans-serif;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.28));
  user-select: none;
  white-space: nowrap;
}

.ws-coord.is-selected {
  background: #1e88e5;
  color: #fff;
}

.ws-toolbar {
  flex: 0 0 auto;
  padding: 8px;
  border-bottom: 1px solid #333;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.ws-tree {
  flex: 1 1 auto;
  min-height: 14rem;
  max-height: 50vh;
  overflow: auto;
  padding: 8px;
}

.ws-tree-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  cursor: pointer;
  padding: 3px 4px;
  border-radius: 2px;
}

.ws-tree-row.is-selected {
  background: #335;
}

.ws-tree-name {
  flex: 1 1 auto;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
}

.ws-tree-vis {
  width: 14px;
  height: 14px;
  margin: 0.15rem 0 0;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: #0d6efd;
}

.ws-measure-status {
  flex: 0 0 auto;
  margin: 0;
  padding: 8px 10px;
  border-top: 1px solid #444;
  background: #252526;
  color: #bbb;
  font-size: 11px;
  line-height: 1.4;
}

.ws-prepare {
  flex: 0 0 auto;
  padding: 8px;
  border-top: 1px solid #333;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.ws-export-groups {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  min-height: 0;
}

.ws-export-groups-list {
  overflow: visible;
  min-height: 0;
  max-height: none;
}

.ws-export-groups-list:has(> :nth-child(6)) {
  min-height: 14rem;
  max-height: 40vh;
  overflow: auto;
}

.ws-export-group-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 11px;
  margin-bottom: 4px;
  padding: 6px;
  background: #111;
  border: 1px solid #333;
}

.ws-export-group-name {
  flex: 1 1 auto;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
}

.ws-export-group-remove {
  flex: 0 0 auto;
  background: #522;
  color: #fff;
  border: 0;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
}

.ws-export-groups-footer {
  flex: 0 0 auto;
  position: static;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  background: #1e1e1e;
}

.ws-save-btn {
  display: block;
  width: 100%;
  box-sizing: border-box;
  font-weight: 600;
}

.document-preview-pane:fullscreen,
.document-preview-pane:-webkit-full-screen {
  width: 100%;
  height: 100%;
  min-height: 100%;
  background: var(--ws-stage);
}

/* Project browse surface (FR-87). Tree, review pane, metadata rail. */

.pb-view-toggle .btn.active {
  background: #6c757d;
  border-color: #6c757d;
  color: #fff;
}

/* Works tab: labeled selects in the card header. Not a second tab row. */
.works-card-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
}

.works-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
}

.works-filter-field {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #6c757d;
}

.works-filter-field select.form-control {
  width: auto;
  min-width: 8.5rem;
  max-width: 16rem;
  height: calc(1.5em + 0.5rem + 2px);
}

.pb-tree-card {
  display: flex;
  flex-direction: column;
  height: 480px;
  margin-bottom: 0;
}

.pb-tree-filter {
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid #e9ecef;
}

.pb-tree-filter .form-control-sm {
  height: calc(1.4em + 0.45rem);
  padding: 0.15rem 0.4rem;
  font-size: 0.72rem;
}

.pb-tree-scroll {
  --pb-col-status: 5.4rem;
  --pb-col-export: 6.2rem;
  --pb-col-actions: 7.35rem;
  --pb-indent: 0.55rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 0;
}

.pb-tree-list,
.pb-tree-scroll .pb-tree-list {
  margin: 0;
  padding: 0;
  padding-inline-start: 0;
  list-style: none;
}

.pb-tree-item {
  margin: 0;
  padding: 0;
}

/* Nested lists keep Status / Actions under the header. Guide lines (FR-114)
   are drawn on structured trees only (not a flat list). */
.pb-tree-list .pb-tree-list {
  padding-inline-start: 0;
}

.pb-tree-col {
  min-width: 0;
}

.pb-tree-cols,
.pb-tree-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--pb-col-status) var(--pb-col-actions);
  align-items: center;
  column-gap: 0.25rem;
  width: 100%;
  box-sizing: border-box;
  padding: 0.08rem 0.45rem;
}

.pb-tree-scroll.has-export .pb-tree-cols,
.pb-tree-scroll.has-export .pb-tree-row {
  grid-template-columns: minmax(0, 1fr) var(--pb-col-status) var(--pb-col-export) var(--pb-col-actions);
}

.pb-tree-cols {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0;
  padding-top: 0.28rem;
  padding-bottom: 0.22rem;
  background: #f4f6f8;
  border-bottom: 1px solid #e9ecef;
  color: #6c757d;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.2;
}

.pb-tree-cols-main,
.pb-tree-cols-status,
.pb-tree-cols-export,
.pb-tree-cols-actions {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.pb-tree-cols-status,
.pb-tree-status {
  justify-self: start;
  text-align: left;
}

.pb-tree-cols-export,
.pb-tree-export {
  justify-self: start;
  text-align: left;
}

.pb-export-chip {
  font-size: 0.65rem;
  font-weight: 600;
  white-space: nowrap;
}

.project-detail-panel {
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
  background: #fff;
  padding: 0.75rem 1rem;
}

.pb-tree-cols-actions {
  justify-self: end;
  text-align: right;
}

.pb-tree-row {
  min-height: 1.35rem;
  border-radius: 0.15rem;
  cursor: pointer;
  font-size: 0.72rem;
  line-height: 1.25;
}

.pb-tree-main {
  display: flex;
  align-items: center;
  gap: 0.14rem;
  min-width: 0;
  padding-left: calc(var(--pb-depth, 0) * var(--pb-indent));
}

.pb-tree-status {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.pb-tree-row .badge-status {
  padding: 0.08rem 0.28rem;
  font-size: 0.58rem;
  line-height: 1.15;
}

.badge-status.is-approved {
  background: #2e7d32;
  color: #fff;
}

.badge-status.is-review {
  background: #f9a825;
  color: #1a1a1a;
}

.badge-status.is-rejected {
  background: #c62828;
  color: #fff;
}

.badge-status.is-in-work {
  background: #6c757d;
  color: #fff;
}

.badge-status.is-obsolete {
  background: #adb5bd;
  color: #fff;
}

.pb-tree-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  gap: 0.18rem;
}

.pb-tree-btn {
  padding: 0.04rem 0.32rem;
  font-size: 0.62rem;
  line-height: 1.2;
  white-space: nowrap;
  border-radius: 0.15rem;
}

.pb-tree-row:hover {
  background: #eef2f7;
}

.pb-tree-row.is-selected {
  background: var(--lq-brand-dark);
  color: #fff;
}

.pb-tree-row.is-selected .pb-tree-icon {
  color: #dbe6f0;
}

.pb-tree-row.is-selected .badge-status {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.pb-tree-row.is-selected .pb-tree-btn {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.75);
  color: #fff;
}

.pb-tree-row.is-muted {
  cursor: default;
  color: #868e96;
  font-style: italic;
}

.pb-tree-row.is-muted:hover {
  background: none;
}

.pb-tree-twisty {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  min-width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  padding: 0;
  border: 1px solid #c5cdd6;
  border-radius: 0.12rem;
  background: #fff;
  color: #495057;
  font-size: 0.62rem;
  line-height: 1;
  cursor: pointer;
}

.pb-tree-twisty-spacer {
  flex: 0 0 auto;
  width: 1.15rem;
}

.pb-tree-icon {
  flex: 0 0 auto;
  width: 0.75rem;
  color: #6c757d;
  font-size: 0.7rem;
  text-align: center;
}

.pb-tree-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pb-tree-3d {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.95rem;
  height: 0.95rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font-size: 0.72rem;
  line-height: 1;
}

button.pb-tree-3d {
  cursor: pointer;
}

.pb-tree-3d.is-ready {
  color: #2e7d32;
}

.pb-tree-3d.is-missing {
  color: #c62828;
}

.pb-tree-row.is-selected .pb-tree-3d.is-ready {
  color: #b9f6ca;
}

.pb-tree-row.is-selected .pb-tree-3d.is-missing {
  color: #ffcdd2;
}

/* Levels (FR-96 to FR-99). A level row is an organizational node, so it reads
   as a heading against the document rows below it. */
.pb-tree-row.pb-tree-level {
  font-weight: 400;
}

.pb-tree-row.pb-tree-level .pb-tree-icon {
  color: var(--lq-brand-dark, #34495e);
}

.pb-tree-row.is-selected.pb-tree-level .pb-tree-icon {
  color: #dbe6f0;
}

.pb-tree-row.is-selected .level-path-badge,
.pb-tree-row.is-selected .pb-tree-works {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.pb-tree-row.is-selected .pb-tree-twisty {
  color: #dbe6f0;
}

.pb-tree-scroll:not(.is-flat) .pb-tree-list .pb-tree-list {
  margin-left: 0.32rem;
  padding-left: 0.5rem;
  border-left: 1px solid #c5cdd6;
}

.pb-tree-scroll:not(.is-flat) .pb-tree-list .pb-tree-item {
  position: relative;
}

.pb-tree-scroll:not(.is-flat) .pb-tree-list .pb-tree-item::before {
  content: "";
  position: absolute;
  left: -0.5rem;
  top: 0.7rem;
  width: 0.42rem;
  border-top: 1px solid #c5cdd6;
}

.pb-tree-scroll:not(.has-levels) .pb-tree-cols,
.pb-tree-scroll:not(.has-levels) .pb-tree-row {
  grid-template-columns: minmax(0, 1fr) var(--pb-col-status);
}

.pb-tree-scroll:not(.has-levels) .pb-tree-cols-actions,
.pb-tree-scroll:not(.has-levels) .pb-tree-actions {
  display: none;
}

.pb-tree-row .level-path-badge {
  padding: 0 0.1rem;
  font-size: 0.62rem;
  line-height: 1.25;
  border-radius: 0.12rem;
}

.pb-tree-row .pb-tree-works {
  min-width: 0.95rem;
  padding: 0 0.22rem;
  font-size: 0.58rem;
  line-height: 1.1rem;
}

/* The separator the client asked for: `1-2-2-2-4`, computed from sibling
   position at render time. It is never stored and is never an identifier. */
.level-path-badge {
  flex: 0 0 auto;
  display: inline-block;
  padding: 0.05rem 0.35rem;
  border-radius: 0.2rem;
  background: #e9ecef;
  color: #495057;
  font-family: var(--bs-font-monospace, monospace);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.level-path-badge-lg {
  padding: 0.1rem 0.45rem;
  font-size: 0.85rem;
  vertical-align: middle;
}

/* Open works on that node alone. It never counts a child level's works. */
.pb-tree-works {
  flex: 0 0 auto;
  min-width: 1.25rem;
  padding: 0 0.3rem;
  border-radius: 0.75rem;
  background: #f1b44c;
  color: #3d3013;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.25rem;
  text-align: center;
}

.work-title {
  font-weight: 500;
}

.pb-tree-hint,
.pb-tree-empty-filter {
  margin: 0;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: #6c757d;
  border-top: 1px solid #e9ecef;
}

.project-browse-pane {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 480px;
  background: var(--ws-stage);
  border: 1px solid var(--ws-viewer-line);
  border-radius: 0.25rem;
  overflow: hidden;
}

.project-browse-host {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  background: var(--ws-stage);
}

.project-browse-host[hidden],
.project-browse-message[hidden] {
  display: none !important;
}

/* The pane keeps its height in every state, so moving between nodes does not
   make the two columns jump. */
.project-browse-message {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.5rem;
  background: #f8f9fa;
}

.project-browse-pane > .project-browse-host .ws-stage > canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
}

.project-browse-pane .document-preview-toolbar {
  overflow-x: auto;
}

.project-browse-pane .document-preview-toolbar .btn {
  padding: 0.28rem 0.4rem;
  font-size: 0.75rem;
  white-space: nowrap;
}

.project-browse-pane .dd-toolbar-group {
  min-width: max-content;
}

.pb-processing-steps {
  margin: 0.5rem 0;
  padding: 0;
  list-style: none;
  font-size: 0.85rem;
  color: #6c757d;
}

.pb-processing-steps .done::before {
  content: "\2713 ";
}

.pb-processing-steps .current {
  color: #212529;
  font-weight: 600;
}

.project-facts {
  align-items: stretch;
}

.project-facts > [class*="col-"] {
  display: flex;
  flex-direction: column;
}

.project-facts .card {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  width: 100%;
  margin-bottom: 0;
}

.project-facts .card[hidden] {
  display: none !important;
  flex: none;
}

.project-facts .card-header {
  padding: 0.3rem 0.75rem;
  min-height: 0;
}

.project-facts .card-header .card-title {
  font-size: 0.875rem;
  margin: 0;
}

.project-facts .card-body {
  flex: 1 1 auto;
  padding: 0.4rem 0.75rem;
}

.project-facts .card-footer {
  padding: 0.3rem 0.75rem;
}

.project-facts dl {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content minmax(0, 1fr);
  column-gap: 0.65rem;
  row-gap: 0.12rem;
  align-items: baseline;
  font-size: 0.8125rem;
}

.project-facts dt {
  font-size: 0.7rem;
  color: #6c757d;
  font-weight: 600;
  margin: 0;
}

.project-facts dd {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-facts dt.project-facts-wide,
.project-facts dd.project-facts-wide {
  grid-column: 1 / -1;
}

.project-facts dd.project-facts-wide {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  overflow: hidden;
}

@media (max-width: 1199.98px) {
  .project-facts dl {
    grid-template-columns: max-content minmax(0, 1fr);
  }
}

.project-facts-description {
  margin: 0;
  font-size: 0.8125rem;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  line-clamp: 4;
  overflow: hidden;
}

.pb-notes-heading {
  font-size: 0.8rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
}

.pb-notes-heading + .pb-notes-body + .pb-notes-heading {
  margin-top: 1rem;
}

.pb-notes-body {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.project-classifications {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  line-height: 1.25;
}

.project-classifications-row {
  padding-left: calc(var(--classification-depth, 0) * 0.75rem);
}

.project-classifications-label {
  color: #6c757d;
  font-weight: 600;
  margin-right: 0.3rem;
}

.project-facts dt.classification-fact,
.project-facts dd.classification-fact {
  padding-left: calc(var(--classification-depth, 0) * 0.75rem);
}

.project-browse-pane:fullscreen,
.project-browse-pane:-webkit-full-screen {
  width: 100%;
  height: 100%;
  background: var(--ws-stage);
}

@media (min-width: 992px) {
  .pb-tree-card,
  .project-browse-pane {
    height: calc(100vh - 16rem);
  }
}

.revision-history-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.revision-history-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #e9ecef;
}

.revision-history-item:last-child {
  border-bottom: 0;
}

.revision-history-item.is-obsolete {
  opacity: 0.65;
}

.revision-history-item.is-selected {
  background: #e8f1f8;
  box-shadow: inset 3px 0 0 var(--lq-brand);
}

.revision-history-main {
  flex: 1 1 auto;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.revision-history-main:hover {
  color: var(--lq-brand);
  text-decoration: none;
}

.revision-history-actions {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.document-uploader {
  padding: 1.25rem;
}

.document-uploader-dropzone {
  display: block;
  padding: 2.5rem 1rem;
  text-align: center;
  color: #495057;
  background: #fff;
  border: 2px dashed #adb5bd;
  border-radius: 0.35rem;
  cursor: pointer;
}

.document-uploader-dropzone:hover,
.document-uploader-dropzone.hover,
.document-uploader-dropzone.in {
  border-color: var(--lq-brand);
  background: #f3f7fb;
}

.document-uploader-file {
  display: none;
}

.document-uploader-list {
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}

.document-uploader-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #e9ecef;
}

.document-uploader-progress {
  width: 100%;
  height: 0.4rem;
  margin-top: 0.35rem;
}

.document-uploader-error {
  color: #c0392b;
}

/*
 * Revision detail Files table. A SHA-256 hex string has no wrap points.
 * Default min-width:auto on the Bootstrap column lets that min-content
 * width expand the main column under the sidebar and clip Download.
 */
.revision-detail > [class*="col-"] {
  min-width: 0;
}

.revision-files {
  table-layout: fixed;
  width: 100%;
}

.revision-files .revision-files-name {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.revision-files .revision-files-role,
.revision-files .revision-files-size {
  width: 1%;
  white-space: nowrap;
}

.revision-files .revision-files-hash {
  min-width: 0;
}

.revision-files .revision-files-hash code {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  word-break: break-all;
  overflow-wrap: anywhere;
  white-space: normal;
}

.revision-files .revision-files-download {
  width: 1%;
  white-space: nowrap;
}

.card-header.d-flex > .card-title {
  margin-bottom: 0;
}

/*
 * AdminLTE floats .card-title left and inserts a clearfix ::after.
 * That keeps header actions from sitting on the far right.
 */
.card-header-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.card-header-actions::after {
  display: none;
}

.card-header-actions > .card-title {
  float: none;
  flex: 1 1 auto;
  margin: 0;
}

.card-header-actions > .card-tools {
  float: none;
  margin: 0 0 0 auto;
  flex: 0 0 auto;
}

.card-header-actions .btn i {
  margin-right: 0.35rem;
}

.classification-tabs .classification-tab-add {
  min-width: 2.5rem;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  text-align: center;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.classification-tabs .classification-tab-add .fa-plus {
  font-size: 0.8rem;
}

.classification-cascade-root {
  margin-bottom: 0.75rem;
}

.classification-cascade-root > label {
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.classification-cascade-step {
  max-width: 28rem;
}

.level-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.level-chip {
  border: 0;
  border-radius: 0.25rem;
  padding: 0.35rem 0.7rem;
  background: #4a90c8;
  color: #fff;
  font-size: 0.8rem;
  line-height: 1.2;
  cursor: pointer;
}

.level-chip.active {
  background: #2c5f8a;
}

.level-child-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.level-child {
  border-bottom: 1px solid #e9ecef;
}

.level-child-toggle {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  margin: 0;
  padding: 0.55rem 0.85rem;
  border: 0;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.level-child-toggle:hover {
  background: #f4f6f8;
}

.level-child.is-open > .level-child-toggle {
  background: #eef4f9;
}

.level-child-twisty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  border: 1px solid #c5cdd6;
  border-radius: 0.12rem;
  font-size: 0.55rem;
  color: #495057;
}

.level-child-copy {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
}

.level-child-name {
  font-weight: 600;
}

.level-child-desc {
  font-size: 0.75rem;
  font-weight: 400;
  color: #6c757d;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.level-child-work-warn {
  color: #c9a227;
  font-size: 0.85rem;
}

.level-child-signals {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}

.level-child-body {
  padding: 0.75rem 0.85rem 0.35rem 1.75rem;
  background: #fafbfc;
  border-top: 1px solid #e9ecef;
}

.level-child-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.75rem;
}

.level-child-heading {
  font-size: 0.8rem;
  font-weight: 600;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0.5rem 0 0.25rem;
}

.impersonation-banner {
  position: sticky;
  top: 0;
  z-index: 1040;
}

/*
 * Admin → Users and Factory users create/edit. Factory-role fields are
 * sectioned cards (membership, company, screen access), not one dump.
 * Super administrator only sees Account and Sign-in in the main column.
 * Layout is main (2fr) + sticky aside (1fr) from 992px; stacked below that.
 */
.account-form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
  margin-bottom: 1.5rem;
}

.account-form-layout--single {
  grid-template-columns: minmax(0, 1fr);
}

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

  .account-form-layout--single {
    grid-template-columns: minmax(0, 1fr);
  }

  .account-form-aside {
    position: sticky;
    top: 0.75rem;
  }
}

.account-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: none;
  margin-bottom: 0;
}

.account-form > .form-actions {
  padding: 0.15rem 0 0.25rem;
}

.account-form-section {
  margin-bottom: 0;
  border-color: #e9ecef;
  box-shadow: 0 1px 2px rgba(31, 78, 121, 0.05);
}

.account-form-section > .card-header {
  background: #fff;
  border-bottom: 1px solid #e9ecef;
  padding: 0.8rem 1.15rem;
}

.account-form-section > .card-header::after {
  display: none;
}

.account-form-section > .card-header .card-title {
  float: none;
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--lq-brand);
}

.account-form-section > .card-body {
  padding: 1.1rem 1.15rem 1.2rem;
}

.account-form-lead {
  margin: 0 0 1rem;
  color: #6c757d;
  font-size: 0.875rem;
  line-height: 1.45;
}

.account-form-note {
  margin: 0.85rem 0 0;
  padding: 0.65rem 0.85rem;
  background: #f4f8fb;
  border: 0;
  border-left: 3px solid var(--lq-accent);
  color: #495057;
  font-size: 0.875rem;
  line-height: 1.45;
}

.account-form-note.is-warning {
  background: #fffbeb;
  border-left-color: #d4a017;
}

.factory-type-fieldset {
  margin: 0;
  min-width: 0;
  border: 0;
  padding: 0;
}

.factory-type-legend {
  display: block;
  float: none;
  width: 100%;
  margin: 0 0 0.55rem;
  padding: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #495057;
}

.factory-type-list {
  display: grid;
  gap: 0.5rem;
}

@media (min-width: 768px) {
  .factory-type-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.factory-type-option {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  width: 100%;
  margin: 0;
  padding: 0.7rem 0.8rem;
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
  background: #fff;
  cursor: pointer;
}

.factory-type-option:hover {
  border-color: #adb5bd;
}

.factory-type-option:focus-within {
  outline: 2px solid var(--lq-accent);
  outline-offset: 2px;
}

.factory-type-option:has(input:checked) {
  border-color: var(--lq-brand);
  background: #f4f8fb;
  box-shadow: inset 3px 0 0 var(--lq-brand);
}

.factory-type-option.is-disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.factory-type-option .form-check-input {
  position: static;
  float: none;
  flex: 0 0 auto;
  margin-top: 0.2rem;
  margin-left: 0;
}

.account-form-section .card-body > .form-group + .factory-type-fieldset {
  margin-top: 1.1rem;
}

.factory-type-option-body {
  min-width: 0;
}

.factory-type-option-title {
  display: block;
  font-weight: 600;
  color: #343a40;
  font-size: 0.875rem;
  line-height: 1.3;
}

.factory-type-option-hint {
  display: block;
  margin-top: 0.25rem;
  color: #6c757d;
  font-size: 0.75rem;
  line-height: 1.35;
}

.account-form-aside {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.account-form-facts {
  display: grid;
  gap: 0.7rem;
  margin: 0 0 1rem;
}

.account-form-facts > div {
  min-width: 0;
}

.account-form-facts dt {
  margin: 0 0 0.15rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #868e96;
}

.account-form-facts dd {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: #343a40;
  word-break: break-word;
}

.account-form-aside-sub {
  margin: 0 0 0.55rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--lq-brand);
}

.account-form-activity {
  list-style: none;
  margin: 0;
  padding: 0;
}

.account-form-activity li {
  padding: 0.5rem 0;
  border-top: 1px solid #eef2f5;
}

.account-form-activity li:first-child {
  padding-top: 0;
  border-top: 0;
}

.account-form-activity time {
  display: block;
  font-size: 0.75rem;
  color: #868e96;
  font-variant-numeric: tabular-nums;
}

.account-form-activity-action {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #343a40;
  word-break: break-word;
}

.account-form-activity-actor {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.75rem;
  color: #6c757d;
  word-break: break-word;
}

.account-form-activity-more {
  display: inline-block;
  margin-top: 0.65rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--lq-brand);
}

.account-form-activity-more:hover,
.account-form-activity-more:focus {
  color: var(--lq-brand-dark);
}

.account-form-aside .btn-block,
.account-form-aside .w-100 {
  width: 100%;
}

.factory-grant-col {
  width: 7rem;
  vertical-align: middle;
}

.factory-grant-master {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #6c757d;
  cursor: pointer;
}

.factory-grant-master input {
  margin: 0;
}

.factory-grant-matrix thead th {
  background: #f8f9fa;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #6c757d;
  border-bottom-color: #dee2e6;
}

.factory-grant-matrix td:first-child {
  font-weight: 500;
  color: #343a40;
}

.factory-grant-na {
  color: #adb5bd;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.account-form [hidden],
.account-form-aside [hidden],
.account-form-layout [hidden] {
  display: none !important;
}

/* Jobs and Works and Companies: user autocomplete sits in the shared filter row */
.jw-user-suggest .search-suggest-menu,
.companies-user-suggest .search-suggest-menu {
  min-width: 18rem;
}

.company-assignment-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.company-assignment-head .form-check {
  flex: 1 1 auto;
  margin-bottom: 0;
}

.company-card-menu {
  flex: 0 0 auto;
  padding: 0 0.35rem;
  line-height: 1.2;
  color: #6c757d;
}

.lq-list-actions {
  width: 3rem;
  text-align: right;
}

.user-company-list {
  max-height: 22rem;
  overflow: auto;
}

.user-company-choice {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid #eef1f4;
}

.user-company-choice .form-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  min-height: 0;
  padding-left: 0;
  margin-bottom: 0;
}

.user-company-choice .form-check-input {
  position: static;
  float: none;
  margin: 0.2rem 0 0;
  flex: 0 0 auto;
}

.user-company-types .form-check-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding-left: 0;
  margin-right: 0.75rem;
}

.user-company-types .form-check-input {
  margin-top: 0;
}

.user-company-choice:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.user-company-types {
  flex: 0 0 auto;
  padding-top: 0.15rem;
}

/* —— Jobs and Works page polish —— */
.jw-page .page-header-title h1 {
  color: #212529;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.jw-page .page-header-meta {
  margin-top: 0.25rem;
  font-size: 0.8125rem;
  color: #6c757d;
}

.jw-filters {
  border: 1px solid #e9ecef;
  box-shadow: none;
}

.jw-filters .form-group {
  margin-bottom: 0;
}

@media (min-width: 992px) {
  .jw-filters .form-row,
  .pl-filters .form-row,
  .lq-list-filters .form-row {
    flex-wrap: nowrap;
  }

  .jw-filters .form-row > .form-group,
  .pl-filters .form-row > .form-group,
  .lq-list-filters .form-row > .form-group {
    flex: 1 1 0%;
    width: auto;
    max-width: none;
    min-width: 0;
  }

  .jw-filters .form-control,
  .jw-filters .input-group,
  .pl-filters .form-control,
  .pl-filters .input-group,
  .lq-list-filters .form-control,
  .lq-list-filters .input-group {
    min-width: 0;
  }
}

.jw-filters label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #6c757d;
}

.jw-filters .form-control {
  height: calc(1.5em + 0.75rem + 2px);
  font-size: 0.875rem;
  color: #343a40;
  border-color: #ced4da;
}

.jw-filters .form-control:focus {
  border-color: var(--lq-brand);
  box-shadow: 0 0 0 0.15rem rgba(31, 78, 121, 0.15);
}

.jw-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #eef1f4;
}

.jw-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
  padding: 0.2rem 0.35rem 0.2rem 0.55rem;
  font-size: 0.8125rem;
  line-height: 1.3;
  color: #343a40;
  background: #eef3f8;
  border: 1px solid #d5e0ea;
  border-radius: 999px;
}

.jw-filter-chip-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6c757d;
}

.jw-filter-chip-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  color: #212529;
}

.jw-filter-chip-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  margin-left: 0.1rem;
  font-size: 1rem;
  line-height: 1;
  color: #6c757d;
  text-decoration: none;
  border-radius: 50%;
}

.jw-filter-chip-clear:hover,
.jw-filter-chip-clear:focus {
  color: #212529;
  background: rgba(0, 0, 0, 0.06);
  text-decoration: none;
}

.jw-tabs {
  border-bottom: 1px solid #dee2e6;
}

.jw-tabs .nav-link {
  margin-bottom: -1px;
  padding: 0.65rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #6c757d;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
}

.jw-tabs .nav-link:hover,
.jw-tabs .nav-link:focus {
  color: var(--lq-brand-dark);
  border-color: transparent;
  background: transparent;
}

.jw-tabs .nav-link.active {
  color: var(--lq-brand);
  font-weight: 600;
  border-bottom-color: var(--lq-brand);
  background: transparent;
}

.jw-tab-count {
  display: inline-block;
  min-width: 1.35rem;
  margin-left: 0.35rem;
  padding: 0.1rem 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.2;
  color: #495057;
  text-align: center;
  background: #e9ecef;
  border-radius: 999px;
}

.jw-tabs .nav-link.active .jw-tab-count {
  color: #fff;
  background: var(--lq-brand);
}

.jw-panel {
  border: 1px solid #e9ecef;
  box-shadow: none;
}

.jw-section-head {
  padding: 0.65rem 1rem;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
}

.jw-section-head .card-title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #6c757d;
}

.jw-table {
  margin-bottom: 0;
  font-size: 0.875rem;
  color: #343a40;
}

.jw-table thead th {
  padding: 0.55rem 0.85rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6c757d;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  border-top: 0;
  white-space: nowrap;
}

.jw-table tbody td {
  padding: 0.7rem 0.85rem;
  vertical-align: middle;
  border-top-color: #eef1f4;
}

.jw-table tbody tr:hover {
  background: #fafbfc;
}

.jw-col-primary {
  font-weight: 600;
  color: #212529;
}

.jw-col-primary a {
  color: #212529;
  text-decoration: none;
}

.jw-col-primary a:hover,
.jw-col-primary a:focus {
  color: var(--lq-brand);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.jw-col-secondary {
  font-size: 0.8125rem;
  color: #6c757d;
}

.jw-col-secondary a {
  color: #495057;
  text-decoration: none;
}

.jw-col-secondary a:hover,
.jw-col-secondary a:focus {
  color: var(--lq-brand);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.jw-col-date {
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  color: #6c757d;
  white-space: nowrap;
}

.jw-empty {
  padding: 2rem 1rem !important;
  font-size: 0.875rem;
  color: #6c757d;
  text-align: center;
}

.jw-status {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.01em;
  border-radius: 0.25rem;
  white-space: nowrap;
}

.jw-status.is-open {
  color: #343a40;
  background: #e9ecef;
}

.jw-status.is-progress {
  color: #0c5460;
  background: #d1ecf1;
}

.jw-status.is-done {
  color: #1f4e79;
  background: #d6e4f0;
}

.jw-status.is-review {
  color: #1a1a1a;
  background: #f9a825;
}

.jw-status.is-approved {
  color: #fff;
  background: #2e7d32;
}

.jw-status.is-danger {
  color: #fff;
  background: #c62828;
}

.jw-status.is-cancelled {
  color: #495057;
  background: #dee2e6;
}

/* —— Projects list page polish (mirrors Jobs and Works) —— */
/* Shared with admin Users, factory Users, End customers via .lq-list-* */
.pl-page .page-header-title h1,
.lq-list-page .page-header-title h1 {
  color: #212529;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.pl-page .page-header-meta,
.lq-list-page .page-header-meta {
  margin-top: 0.25rem;
  font-size: 0.8125rem;
  color: #6c757d;
}

.pl-filters,
.lq-list-filters {
  border: 1px solid #e9ecef;
  box-shadow: none;
}

.pl-filters .form-group,
.lq-list-filters .form-group {
  margin-bottom: 0;
}

.pl-filters label,
.lq-list-filters label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #6c757d;
}

.pl-filters .form-control,
.lq-list-filters .form-control {
  height: calc(1.5em + 0.75rem + 2px);
  font-size: 0.875rem;
  color: #343a40;
  border-color: #ced4da;
}

.pl-filters .form-control:focus,
.lq-list-filters .form-control:focus {
  border-color: var(--lq-brand);
  box-shadow: 0 0 0 0.15rem rgba(31, 78, 121, 0.15);
}

.pl-filters .btn-block,
.lq-list-filters .btn-block {
  height: calc(1.5em + 0.75rem + 2px);
}

.pl-panel,
.lq-list-panel {
  border: 1px solid #e9ecef;
  box-shadow: none;
}

.pl-table,
.lq-list-table {
  margin-bottom: 0;
  font-size: 0.875rem;
  color: #343a40;
}

.pl-table thead th,
.lq-list-table thead th {
  padding: 0.55rem 0.85rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6c757d;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  border-top: 0;
  white-space: nowrap;
}

.pl-table tbody td,
.lq-list-table tbody td {
  padding: 0.7rem 0.85rem;
  vertical-align: middle;
  border-top-color: #eef1f4;
}

.pl-table tbody tr:hover,
.lq-list-table tbody tr:hover {
  background: #fafbfc;
}

.pl-check-col {
  width: 2.25rem;
  text-align: center;
}

.pl-col-primary,
.lq-list-col-primary {
  font-weight: 600;
  color: #212529;
}

.pl-col-primary a,
.lq-list-col-primary a {
  color: #212529;
  text-decoration: none;
}

.pl-col-primary a:hover,
.pl-col-primary a:focus,
.lq-list-col-primary a:hover,
.lq-list-col-primary a:focus {
  color: var(--lq-brand);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.pl-col-secondary,
.lq-list-col-secondary {
  font-size: 0.8125rem;
  color: #6c757d;
}

.pl-col-code,
.lq-list-col-code {
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: #495057;
  white-space: nowrap;
}

.pl-customer-name {
  display: block;
  font-weight: 500;
  color: #343a40;
}

.pl-customer-factory {
  margin-top: 0.15rem;
  font-size: 0.75rem;
  color: #868e96;
}

.pl-classifications {
  max-width: 16rem;
}

.pl-empty,
.lq-list-empty {
  padding: 2rem 1rem !important;
  font-size: 0.875rem;
  color: #6c757d;
  text-align: center;
}

.pl-actions .btn,
.lq-list-actions .btn {
  margin-left: 0.25rem;
}

.pl-status,
.lq-list-status {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.01em;
  border-radius: 0.25rem;
  white-space: nowrap;
}

.pl-status.is-open,
.lq-list-status.is-open {
  color: #343a40;
  background: #e9ecef;
}

.pl-status.is-progress,
.lq-list-status.is-progress {
  color: #0c5460;
  background: #d1ecf1;
}

.pl-status.is-review,
.lq-list-status.is-review {
  color: #1a1a1a;
  background: #f9a825;
}

.pl-status.is-approved,
.lq-list-status.is-approved {
  color: #fff;
  background: #2e7d32;
}

.pl-status.is-cancelled,
.lq-list-status.is-cancelled {
  color: #495057;
  background: #dee2e6;
}

.lq-list-status.is-suspended,
.lq-list-status.is-inactive {
  color: #fff;
  background: #c62828;
}

.lq-list-status.is-active {
  color: #fff;
  background: #2e7d32;
}

.lq-list-hint {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.12rem 0.4rem;
  font-size: 0.65rem;
  font-weight: 600;
  line-height: 1.2;
  color: #1a1a1a;
  vertical-align: middle;
  background: #f9a825;
  border-radius: 0.25rem;
}

.data-removal-tree {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
  padding: 0.75rem 1rem;
}

.data-removal-tree li.data-removal-customer > label {
  font-weight: 600;
}

.data-removal-summary {
  max-height: 16rem;
  overflow: auto;
}

.data-removal-summary-title {
  font-weight: 600;
}

.customer-detail-pair > [class*="col-"] {
  align-items: stretch;
}

.customer-detail-pair > [class*="col-"] > .card {
  width: 100%;
}

.customer-state-switch {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem;
  background: #e9ecef;
  border-radius: 999px;
}

.customer-state-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.customer-state-switch label {
  margin: 0;
  padding: 0.35rem 0.95rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  color: #6c757d;
}

.customer-state-switch input:checked + label {
  background: var(--lq-brand);
  color: #fff;
}

.customer-state-switch input#customer-state-deactive:checked + label {
  background: #6c757d;
}

.customer-state-switch input:focus-visible + label {
  outline: 2px solid var(--lq-brand);
  outline-offset: 2px;
}

.customer-org-source {
  display: none !important;
}

.customer-org {
  overflow-x: auto;
  background: #f7f8fa;
  border: 1px solid #e6eaef;
  border-radius: 0.25rem;
  padding: 1.25rem 0.75rem 2rem;
}

.customer-org div.orgChart {
  position: relative;
  border: 0;
  background: transparent;
  margin: 0;
  padding: 0;
}

.customer-org svg.org-links {
  position: absolute;
  top: 0;
  left: 0;
  overflow: visible;
  pointer-events: none;
}

.customer-org svg.org-links path {
  fill: none;
  stroke: #b7c0ca;
  stroke-width: 1;
}

.customer-org div.orgChart h2 {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.35;
  color: inherit;
  text-align: left;
}

.customer-org div.orgChart table {
  margin: 0 auto;
}

.customer-org div.orgChart td {
  padding: 0 0.45rem;
}

.customer-org div.orgChart tr.lines td.line {
  height: 18px;
}

.customer-org div.orgChart tr.lines td.top {
  border-top: 1px solid #b7c0ca;
}

.customer-org div.orgChart tr.lines td.left {
  border-right: 1px solid #b7c0ca;
}

.customer-org div.orgChart tr.lines td.right {
  border-left: 1px solid #b7c0ca;
}

.customer-org div.orgChart div.node {
  width: auto;
  min-width: 9.5rem;
  max-width: 14rem;
  height: auto;
  padding: 0.5rem 0.7rem 0.45rem;
  background: #fff;
  border: 1px solid #d5dbe3;
  border-radius: 0.35rem;
  box-shadow: none;
  line-height: 1.35;
  text-align: left;
  cursor: default;
}

.customer-org div.orgChart div.node.hasChildren,
.customer-org div.orgChart.interactive div.hasChildren {
  background: #fff;
  cursor: default;
}

.customer-org div.orgChart div.node.hover {
  background: #fff;
  border-color: #d5dbe3;
}

.customer-org div.orgChart div.node.org-kind-customer {
  border-top: 3px solid #1f4e79;
}

.customer-org div.orgChart div.node.org-kind-owner {
  border-top: 3px solid #1d6b4f;
}

.customer-org div.orgChart div.node.org-kind-company,
.customer-org div.orgChart div.node.org-kind-company.hasChildren {
  border-top: 3px solid #8d5b12;
}

.customer-org div.orgChart div.node.org-kind-user {
  border-top: 3px solid #5c6770;
}

.customer-org div.orgChart div.node.is-suspended,
.customer-org div.orgChart div.node.is-stopped {
  opacity: 0.72;
}

.customer-org .org-kind {
  display: block;
  margin-bottom: 0.15rem;
  color: #6c757d;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.customer-org .org-name {
  display: block;
  color: #212529;
  font-size: 0.875rem;
  font-weight: 600;
  word-break: break-word;
}

.customer-org .org-name a {
  color: inherit;
}

.customer-org .org-meta {
  display: block;
  margin-top: 0.15rem;
  color: #6c757d;
  font-size: 0.75rem;
  font-weight: 400;
  word-break: break-word;
}

.data-removal-log {
  max-height: 18rem;
  overflow: auto;
  margin: 0;
  padding: 0.75rem 1.25rem 0.75rem 2rem;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
}

