:root {
  --sx-primary: #2563eb;
  --sx-primary-dark: #1d4ed8;
  --sx-success: #16a34a;
  --sx-warning: #f59e0b;
  --sx-danger: #dc2626;
  --sx-info: #0284c7;
  --sx-bg: #f8fafc;
  --sx-surface: #ffffff;
  --sx-text: #0f172a;
  --sx-muted: #64748b;
  --sx-border: #e2e8f0;
  --sx-radius: 12px;
  --sx-radius-sm: 10px;
  --sx-shadow: 0 12px 30px rgba(15, 23, 42, 0.07);
  --sx-shadow-sm: 0 6px 18px rgba(15, 23, 42, 0.06);
  --sx-sidebar-width: 250px;
}

html.sidebar-collapsed {
  --sx-sidebar-width: 76px;
}

* {
  letter-spacing: 0;
}

body {
  background: var(--sx-bg);
  color: var(--sx-text);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.94rem;
}

.pursuit-information-card { background: var(--sx-surface-muted); border-color: var(--sx-primary); }
.project-contact-card { height: 100%; padding: .75rem; background: var(--sx-surface-muted); border: 1px solid var(--sx-border); border-radius: var(--sx-radius-sm); }
.create-action-divider { min-height: 0; margin: 0 .75rem; padding: 0; border-top: 1px solid var(--sx-border); }
.create-action-group-label { padding-bottom: .35rem; color: var(--sx-muted); font-size: .75rem; font-weight: 700; text-transform: uppercase; }
[data-report-row-url] { cursor: pointer; }
[data-report-row-url]:hover > * { background-color: var(--sx-surface-muted); }
[data-bs-toggle="collapse"] .bi-chevron-up { transition: transform .15s ease; }
[data-bs-toggle="collapse"][aria-expanded="false"] .bi-chevron-up { transform: rotate(180deg); }

a {
  color: var(--sx-primary);
  text-decoration: none;
}

a:hover {
  color: var(--sx-primary-dark);
}

.app-shell {
  display: flex;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sx-sidebar-width);
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.25rem;
  background: var(--sx-surface);
  border-right: 1px solid var(--sx-border);
  overflow-x: hidden;
  overflow-y: auto;
  z-index: 1020;
  transition: width 220ms cubic-bezier(0.4, 0, 0.2, 1), padding 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

.app-content {
  min-width: 0;
  width: 100%;
}

@media (min-width: 992px) {
  .app-content {
    margin-left: var(--sx-sidebar-width);
    transition: margin-left 220ms cubic-bezier(0.4, 0, 0.2, 1);
  }
}

.sidebar-toggle {
  position: fixed;
  top: 50%;
  left: calc(var(--sx-sidebar-width) - 17px);
  z-index: 1030;
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  color: var(--sx-text);
  background: var(--sx-surface);
  border: 1px solid var(--sx-border);
  border-radius: 50%;
  box-shadow: var(--sx-shadow-sm);
  transform: translateY(-50%);
  transition: left 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-toggle:hover {
  color: var(--sx-primary);
  border-color: #bfdbfe;
}

.sidebar-toggle:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
}

@media (max-width: 991.98px) {
  .sidebar-toggle {
    display: none;
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.brand > :last-child {
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--sx-radius-sm);
  background: linear-gradient(135deg, var(--sx-primary), #38bdf8);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.22);
}

.brand-title {
  font-weight: 800;
  line-height: 1.1;
}

.brand-subtitle,
.page-eyebrow {
  color: var(--sx-muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.brand-subtitle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-section {
  margin: 1.25rem 0 0.35rem;
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-nav-group {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.sidebar-nav-child {
  margin-left: 0.8rem;
  padding-left: 0.75rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 44px;
  color: #334155;
  border-radius: var(--sx-radius-sm);
  padding: 0.72rem 0.85rem;
  font-weight: 600;
  transition: background-color 200ms ease, color 200ms ease, box-shadow 200ms ease;
}

.sidebar .nav-link span {
  flex: 1 1 auto;
  min-width: 0;
  white-space: normal;
}

.nav-link i {
  color: #64748b;
  font-size: 1.05rem;
}

html.sidebar-collapsed .sidebar {
  padding-right: 1rem;
  padding-left: 1rem;
}

html.sidebar-collapsed .sidebar .brand,
html.sidebar-collapsed .sidebar .nav-link {
  justify-content: center;
}

html.sidebar-collapsed .sidebar .brand-title,
html.sidebar-collapsed .sidebar .brand-subtitle,
html.sidebar-collapsed .sidebar .nav-link span {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html.sidebar-collapsed .sidebar .module-switch-section,
html.sidebar-collapsed .sidebar .sidebar-action-group,
html.sidebar-collapsed .sidebar .mt-auto {
  width: 100%;
}

html.sidebar-collapsed .sidebar-watermark {
  display: none;
}

.report-save-overlay { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 1rem; background: rgb(15 23 42 / .6); }
.report-save-overlay[hidden] { display: none; }
.report-save-overlay__panel { width: min(100%, 28rem); padding: 1.5rem; text-align: center; border-radius: var(--sx-radius, .75rem); background: #fff; box-shadow: 0 1rem 3rem rgb(0 0 0 / .25); }
.report-save-locked { pointer-events: none; }
.report-save-locked .report-save-overlay { pointer-events: auto; }
@media (prefers-reduced-motion: reduce) { .report-save-overlay *, .report-save-overlay { transition: none !important; animation: none !important; } }

.nav-link:hover,
.nav-link.active {
  background: #eff6ff;
  color: var(--sx-primary);
}

.module-switch-section {
  margin: 0 0 1rem;
  padding: 0 0 1rem;
  border-bottom: 1px solid var(--sx-border);
}

.module-switch-link {
  min-height: 44px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  box-shadow: 0 4px 12px rgba(37, 99, 235, .08);
}

.module-switch-link:focus-visible { outline: 3px solid rgba(37, 99, 235, .35); outline-offset: 2px; }

[data-module-card] { position: relative; }
.module-card-link { display: block; height: 100%; }
.module-card-navigation-trigger { position: absolute; top: .75rem; right: .75rem; z-index: 1; }

.display-image-preview {
  width: 128px;
  aspect-ratio: 1 / 1;
  display: block;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--sx-border);
  background: #f8fafc;
}

.display-image-preview-circle {
  align-items: center;
  aspect-ratio: 1;
  background: #eef2f7;
  border: 1px solid #dbe4ee;
  border-radius: 50%;
  color: var(--sx-muted);
  display: flex;
  height: 128px;
  justify-content: center;
  overflow: hidden;
  width: 128px;
}

.display-image-preview-circle img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

[data-new-preview]:not([src]) { display: none; }
.display-crop-canvas { width: min(100%, 420px); aspect-ratio: 1; border-radius: 50%; cursor: grab; background: #111827; touch-action: none; }
.media-viewer-dialog { height: auto; margin: 6vh auto; max-width: min(92vw, 1500px); }
.media-viewer-panel { height: min(88dvh, 1000px); }
.media-viewer-panel .modal-body { min-height: 0; padding: 1rem; }
.media-viewer-media { max-width: 100%; max-height: 100%; object-fit: contain; transition: transform .08s linear; transform-origin: center; user-select: none; }
.media-viewer-frame { border: 0; height: 100%; width: 100%; }
.media-viewer-close, .media-viewer-panel .btn { min-height: 44px; }
@media (max-width: 575.98px) { .media-viewer-dialog { margin: 1dvh auto; max-width: calc(100vw - 1rem); } .media-viewer-panel { height: 96dvh; } }

.nav-link.active {
  box-shadow: inset 3px 0 0 var(--sx-primary);
}

.nav-link:hover i,
.nav-link.active i {
  color: var(--sx-primary);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 1010;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 76px;
  padding: 1rem 1.5rem;
  background: rgba(248, 250, 252, 0.88);
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  backdrop-filter: blur(12px);
}

.page-title {
  font-size: 1.35rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.main-content {
  padding: 1.5rem;
}

.auth-shell {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 34rem),
    var(--sx-bg);
}

.auth-shell > .w-100 {
  position: relative;
  z-index: 1;
}

.login-page {
  position: relative;
}

.login-background {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: #0f172a;
}

.login-background::after {
  position: absolute;
  inset: 0;
  content: "";
  background: rgb(15 23 42 / 0.45);
}

.login-background video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.login-brand img {
  display: block;
  width: min(100%, 120px);
  height: auto;
  margin: 0 auto;
}

.login-credit {
  color: #f8fafc;
  font-size: 0.8125rem;
  text-shadow: 0 1px 3px rgb(15 23 42 / .8);
}

.login-credit-slayer {
  position: relative;
  display: inline-block;
  isolation: isolate;
}

.login-credit-slayer img {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 0;
  width: 34px;
  height: 34px;
  max-width: none;
  opacity: 0.75;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.login-credit-slayer-text {
  position: relative;
  z-index: 1;
}

.card,
.table-card,
.filter-card,
.form-card,
.chart-card,
.stat-card {
  background: var(--sx-surface);
  border: 1px solid var(--sx-border);
  border-radius: var(--sx-radius);
  box-shadow: var(--sx-shadow-sm);
}

.card {
  overflow: hidden;
}

.card-header {
  background: transparent;
  border-bottom-color: var(--sx-border);
}

.filter-card {
  padding: 1rem;
}

.form-card {
  padding: 1.25rem;
}

.table-card {
  overflow: hidden;
}

.table {
  margin-bottom: 0;
}

.table > :not(caption) > * > * {
  padding: 0.85rem 1rem;
  border-bottom-color: var(--sx-border);
}

.table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--sx-surface-muted);
  color: var(--sx-muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.table-hover tbody tr {
  transition: background-color 150ms ease;
}

.table-hover tbody tr:hover {
  background-color: var(--sx-surface-muted);
}

.btn {
  min-height: 38px;
  border-radius: 9px;
  font-weight: 700;
  transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}

.document-share-button:hover,
.document-share-button:focus-visible {
  box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.16);
}

.document-principal-results {
  position: absolute;
  z-index: 10;
  width: 100%;
  max-height: 250px;
  overflow-y: auto;
  margin-top: 0.25rem;
  border: 1px solid var(--sx-border);
  border-radius: 9px;
  box-shadow: var(--sx-shadow);
}

.document-selected-principal {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 100%;
  padding: 0.4rem 0.6rem;
  color: #1e3a8a;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  font-size: 0.86rem;
}

.document-selected-principal span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-selected-principal .btn-close { width: 0.55rem; height: 0.55rem; }

.document-permission-presets { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.document-permission-presets .btn { min-height: 34px; font-size: 0.82rem; }
.document-permission-presets .btn.active { color: #fff; background: var(--sx-primary); border-color: var(--sx-primary); }

.document-permission-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 42px;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--sx-border);
  border-radius: 9px;
  cursor: pointer;
}

.document-permission-check:hover { background: #f8fafc; }
.document-permissions-table th:not(:first-child) { white-space: nowrap; }

.custom-select-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.custom-select {
  position: relative;
}

.custom-select-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 42px;
  padding: 0.5rem 0.75rem;
  color: var(--sx-text);
  background: #fff;
  border: 1px solid var(--sx-border);
  border-radius: 9px;
  font-weight: 600;
  text-align: left;
}

.custom-select-toggle::after {
  content: "⌄";
  color: var(--sx-muted);
  margin-left: 0.75rem;
}

.custom-select.disabled .custom-select-toggle {
  background: #e9ecef;
  color: #64748b;
}

.custom-select-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  z-index: 1040;
  display: none;
  max-height: 260px;
  overflow: auto;
  padding: 0.35rem;
  background: #fff;
  border: 1px solid var(--sx-border);
  border-radius: var(--sx-radius-sm);
  box-shadow: var(--sx-shadow);
}

.custom-select.open .custom-select-menu {
  display: grid;
  gap: 0.25rem;
}

.custom-select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 40px;
  padding: 0.5rem 0.6rem;
  color: var(--sx-text);
  background: transparent;
  border: 0;
  border-radius: 8px;
  text-align: left;
}

.custom-select-option:hover,
.custom-select-option.active {
  background: #eff6ff;
  color: var(--sx-primary);
}

.custom-select-option:focus-visible,
.custom-select-toggle:focus-visible {
  outline: 3px solid rgb(59 130 246 / .35);
  outline-offset: 2px;
}

.custom-select-check { visibility: hidden; font-weight: 800; }
.custom-select-option.active .custom-select-check { visibility: visible; }

.custom-select-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.status-icon-chip,
.status-dot {
  display: inline-grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

.status-svg { width: 1.2rem; height: 1.2rem; display: block; fill: currentColor; }

.status-dot-good {
  background: #dcfce7;
}

.status-dot-info { background: #dbeafe; color: #1d4ed8; }
.status-dot-processing { background: #e0e7ff; color: #4338ca; }
.status-dot-attention { background: #fef3c7; color: #a16207; }
.status-dot-critical { background: #fee2e2; color: #b91c1c; }
.status-dot-info,
.status-dot-updated {
  background: #dbeafe;
}

.upload-dropzone {
  display: grid;
  place-items: center;
  gap: 0.2rem;
  min-height: 112px;
  padding: 1rem;
  cursor: pointer;
  background: #f8fafc;
  border: 1px dashed #93c5fd;
  border-radius: var(--sx-radius);
  text-align: center;
  transition: background-color 200ms ease, border-color 200ms ease;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
  background: #eff6ff;
  border-color: var(--sx-primary);
}

.upload-dropzone.disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.project-document-upload-queue-item {
  min-width: 0;
}

.project-document-upload-queue-name {
  overflow-wrap: anywhere;
}

.company-media-upload-limits {
  border: 1px solid var(--sx-border);
  border-radius: var(--sx-radius-sm);
  padding: .75rem;
  background: var(--sx-surface-muted);
}

.company-media-upload-limits.is-near-limit {
  border-color: #d97706;
}

.company-media-upload-limits.is-exceeded {
  border-color: #b91c1c;
}

.company-media-upload-limit-list {
  columns: 2;
}

.company-media-upload-queue .company-media-upload-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.company-media-upload-queue .btn {
  min-height: 38px;
}

@media (max-width: 575.98px) {
  .company-media-upload-limit-list { columns: 1; }
  .company-media-upload-queue .list-group-item { align-items: flex-start !important; }
  .company-media-upload-queue .btn { flex: 0 0 auto; }
  [data-company-media-upload-overlay] .modal-dialog { margin: .5rem; max-width: calc(100vw - 1rem); }
  [data-company-media-upload] [data-company-media-choose-files],
  [data-company-media-upload] [data-company-media-start-upload] { flex: 1 1 100%; }
}

.document-thumbnail-placeholder,
.document-file-icon {
  align-items: center;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  color: var(--sx-muted);
  display: flex;
  flex: 0 0 112px;
  height: 84px;
  justify-content: center;
  overflow: hidden;
  padding: 0;
}

.document-thumbnail-placeholder {
  cursor: pointer;
}

.document-thumbnail-image {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.preview-placeholder-text {
  font-size: 0.75rem;
  padding: 0.5rem;
  text-align: center;
}

.document-file-icon {
  font-size: 1.75rem;
}

.document-preview-image {
  max-height: 70vh;
  object-fit: contain;
}

.document-toolbar,
.document-filter-form {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.document-listing-toolbar,
.document-status-filter {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.document-status-filter {
  flex: 0 0 auto;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.document-status-filter .form-select {
  flex: 0 1 15rem;
  min-width: 0;
  width: auto;
}

.document-listing-toolbar .document-filter-form {
  flex: 0 1 36rem;
  max-width: 100%;
}

.document-toolbar .document-listing-toolbar {
  flex: 1 1 44rem;
  min-width: 0;
}

.document-listing-toolbar .document-filter-form .form-control,
.document-toolbar .document-filter-form .form-control {
  flex: 1 1 16rem;
  min-width: 0;
}

.document-toolbar .document-filter-form {
  flex: 0 1 32rem;
  max-width: 100%;
}

.document-toolbar {
  justify-content: space-between;
}

.document-folder-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.document-file-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.document-folder-card {
  background: var(--sx-surface);
  border: 1px solid var(--sx-border);
  border-radius: var(--sx-radius);
  min-height: 104px;
  min-width: 0;
  position: relative;
}

.document-folder-open {
  align-items: flex-start;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 104px;
  padding: 0.75rem 2.75rem 0.75rem 0.75rem;
  text-decoration: none;
}

.document-folder-card:hover,
.document-folder-open:hover {
  border-color: var(--sx-primary);
  color: inherit;
}

.document-folder-open > i {
  color: #f59e0b;
  font-size: 1.5rem;
}

.document-folder-name {
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  display: -webkit-box;
  line-clamp: 2;
  min-width: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  text-overflow: ellipsis;
}

.document-folder-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  min-width: 0;
}

.document-folder-menu {
  position: absolute;
  right: 0.25rem;
  top: 0.5rem;
}

.document-file-card {
  background: var(--sx-surface);
  border: 1px solid var(--sx-border);
  border-radius: var(--sx-radius);
  min-width: 0;
  padding: 0.5rem;
  position: relative;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.document-file-card:hover {
  border-color: #94a3b8;
  box-shadow: 0 0.2rem 0.65rem rgb(15 23 42 / 10%);
}

.document-file-card.is-archived {
  background: #fffbeb;
  opacity: 0.8;
}

.document-file-card.is-selected {
  background: #eff6ff;
  border-color: #3b82f6;
  box-shadow: 0 0.2rem 0.65rem rgb(59 130 246 / 18%);
}

.document-file-select,
.document-file-menu {
  position: absolute;
  top: 0.5rem;
  z-index: 2;
}

.document-file-select { left: 0.5rem; }
.document-file-menu { right: 0.25rem; }
.document-file-select input { height: 1.1rem; width: 1.1rem; }
.document-file-card:has(.document-file-menu .dropdown-menu.show) { z-index: 3; }
.document-file-menu .dropdown-menu.show { z-index: 3; }

.document-select-all {
  align-items: center;
  display: inline-flex;
  gap: 0.35rem;
  font-size: 0.875rem;
}

.document-select-all .form-check-input { margin: 0; }

.document-card-preview,
.document-card-icon {
  align-items: center;
  aspect-ratio: 4 / 3;
  background: #f1f5f9;
  border: 0;
  border-radius: calc(var(--sx-radius-sm) + 2px);
  color: var(--sx-muted);
  display: flex;
  justify-content: center;
  overflow: hidden;
  padding: 0;
  width: 100%;
}

.document-card-preview { cursor: pointer; }
.document-card-preview:hover { background: #e2e8f0; }
.document-card-icon { font-size: 3rem; }

.document-card-preview .document-thumbnail-image {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.document-card-name {
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  display: -webkit-box;
  line-clamp: 2;
  margin-top: 0.65rem;
  min-height: 2.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

.document-card-status {
  display: block;
  font-size: 0.75rem;
  margin-top: 0.2rem;
}

.document-bulk-bar {
  align-items: center;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--sx-radius-sm);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding: 0.6rem 0.75rem;
}

.document-preview-video { max-height: 70vh; }
.document-preview-pdf { height: min(70vh, 760px); }

@media (max-width: 575.98px) {
  .document-file-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem; }
  .document-folder-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem; }
  .document-filter-form,
  .document-status-filter { flex-wrap: nowrap; width: 100%; }
  .document-filter-form .form-control,
  .document-status-filter .form-select { flex: 1 1 auto; min-width: 0; }
}

.upload-title {
  color: var(--sx-primary);
  font-weight: 800;
}

.upload-help {
  color: var(--sx-muted);
  font-size: 0.86rem;
}

.upload-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
}

.upload-preview-item {
  position: relative;
  min-width: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--sx-border);
  border-radius: var(--sx-radius-sm);
}

.upload-preview-media {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f1f5f9;
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

.upload-preview-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-preview-media i {
  color: #94a3b8;
  font-size: 2rem;
}

.upload-preview-name {
  margin-top: 0.4rem;
  color: #475569;
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-preview-item .btn {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  min-height: 32px;
  width: 32px;
  padding: 0;
}

.upload-preview-item .report-thumb { width: 100%; height: 100%; border: 0; border-radius: inherit; }
.image-gallery { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.image-gallery .attachment-card { min-width: 0; aspect-ratio: 4 / 3; overflow: hidden; padding: 0; }
.image-gallery .report-thumb { width: 100%; height: 100%; border: 0; border-radius: 0; }

.icon-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
}

.icon-choice {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.55rem 0.7rem;
  background: #fff;
  border: 1px solid var(--sx-border);
  border-radius: 10px;
  text-align: left;
}

.icon-choice:hover,
.icon-choice.active {
  border-color: #93c5fd;
  background: #eff6ff;
}

.icon-choice-symbol {
  font-size: 1.2rem;
}

.icon-choice-label {
  font-size: 0.82rem;
  font-weight: 700;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--sx-primary);
  border-color: var(--sx-primary);
}

.btn-primary:hover {
  background: var(--sx-primary-dark);
  border-color: var(--sx-primary-dark);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  color: #475569;
  background: #fff;
  border: 1px solid var(--sx-border);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.25rem 0.5rem 0.25rem 0.25rem;
  border: 1px solid var(--sx-border);
  border-radius: 999px;
  background: #fff;
}

.mobile-account-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.85rem;
  background: #f8fafc;
  border: 1px solid var(--sx-border);
  border-radius: var(--sx-radius);
}

.mobile-account-info-button {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
}

.mobile-logout-form {
  margin: 0;
}

.mobile-logout-button {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
}

.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #dbeafe;
  color: var(--sx-primary);
  font-size: 0.8rem;
  font-weight: 800;
}

.avatar-c0 { background: #dbeafe; color: #1e3a8a; }
.avatar-c1 { background: #dcfce7; color: #166534; }
.avatar-c2 { background: #fef3c7; color: #92400e; }
.avatar-c3 { background: #fce7f3; color: #9d174d; }
.avatar-c4 { background: #ede9fe; color: #5b21b6; }
.avatar-c5 { background: #cffafe; color: #155e75; }

.account-modal-avatar {
  width: 46px;
  height: 46px;
  font-size: 1rem;
}

.account-info-list {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 0.5rem 1rem;
}

.account-info-list dt {
  color: var(--sx-muted);
  font-weight: 800;
}

.account-info-list dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.mobile-card-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  justify-content: flex-end;
}

.btn-action-mobile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.form-label {
  color: #475569;
  font-size: 0.82rem;
  font-weight: 700;
}

.form-control,
.form-select {
  border-color: var(--sx-border);
  border-radius: 9px;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 0.22rem rgba(37, 99, 235, 0.14);
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  height: 100%;
  padding: 1rem;
}

.stat-card-link { color: inherit; text-decoration: none; transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.stat-card-link:hover, .stat-card-link:focus-visible { color: inherit; border-color: var(--sx-primary); box-shadow: 0 0 0 .2rem rgb(37 99 235 / .14); transform: translateY(-1px); }

.dashboard-type-card { display: block; min-height: 132px; padding: 1rem; border: 1px solid var(--sx-border); border-radius: .75rem; background: var(--sx-surface); color: inherit; text-decoration: none; transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.dashboard-type-card i { display: inline-block; margin-bottom: .6rem; font-size: 1.4rem; color: var(--sx-primary); }
.dashboard-type-card:hover, .dashboard-type-card:focus-visible, .dashboard-type-card.active { color: inherit; border-color: var(--sx-primary); box-shadow: 0 0 0 .2rem rgb(37 99 235 / .14); transform: translateY(-1px); }
.dashboard-type-card.disabled { opacity: .64; cursor: not-allowed; }
.dashboard-resource-selector { max-width: 38rem; }
.workspace-card { display: block; min-height: 175px; padding: 1.25rem; border: 1px solid var(--sx-border); border-radius: .75rem; background: var(--sx-surface); color: inherit; text-decoration: none; }
.workspace-card:hover, .workspace-card:focus-visible { color: inherit; border-color: var(--sx-primary); box-shadow: 0 0 0 .2rem rgb(37 99 235 / .14); }
.workspace-card .workspace-card-icon { color: var(--sx-primary); font-size: 1.5rem; }
@media (prefers-reduced-motion: reduce) { .dashboard-type-card, .workspace-card { transition: none; } }

.system-analytics-tab,
.system-analytics-grid,
.system-analytics-grid > [class*="col-"] {
  min-width: 0;
}

.system-analytics-card .card-header {
  font-weight: 700;
}

.system-analytics-card .card-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
}

.system-analytics-chart-wrap {
  height: 340px;
  max-height: 340px;
  min-width: 0;
  position: relative;
}

.system-analytics-canvas {
  display: block;
  height: 100% !important;
  max-width: 100% !important;
  width: 100% !important;
}

@media (max-width: 991.98px) {
  .system-analytics-chart-wrap {
    height: 280px;
    max-height: 280px;
  }
}

@media (max-width: 575.98px) {
  .system-analytics-card .card-body {
    padding: 1rem;
  }

  .system-analytics-chart-wrap {
    height: 230px;
    max-height: 230px;
  }
}

.stat-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #eff6ff;
  color: var(--sx-primary);
  font-size: 1.25rem;
}

/* Aggregate cards stay neutral so they do not read as a report status colour. */
.stat-icon.stat-icon-total { background: var(--sx-surface-muted); color: var(--sx-text); }

.stat-label {
  color: var(--sx-muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.stat-value {
  font-size: 1.45rem;
  font-weight: 800;
}

.dashboard-kpi-row .stat-card { justify-content: center; text-align: center; }
.dashboard-kpi-row .stat-card.stat-card-divided { padding: 0; gap: 0; overflow: hidden; }
.dashboard-kpi-half { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1rem; text-decoration: none; color: inherit; }
.dashboard-kpi-half:hover, .dashboard-kpi-half:focus-visible { background-color: var(--sx-surface-muted); color: inherit; }
.dashboard-kpi-half + .dashboard-kpi-half { border-left: 1px solid var(--sx-border); }

.inventory-warehouse-card { border: 1px solid var(--sx-border); }
.inventory-warehouse-card-link { transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease; }
.inventory-warehouse-card-link:hover { border-color: var(--sx-primary); box-shadow: 0 .3rem .85rem rgb(15 23 42 / .12); transform: translateY(-1px); }
.inventory-warehouse-card-link:focus-visible { outline: 3px solid var(--sx-primary); outline-offset: 3px; }
.inventory-warehouse-card .inventory-warehouse-metric { min-width: 5.5rem; }

.chart-card {
  padding: 1rem;
}

.chart-card canvas {
  width: 100% !important;
  height: 320px !important;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border-radius: 999px;
  padding: 0.42em 0.7em;
  font-weight: 800;
}

.status-badge .status-svg { width: 1em; height: 1em; }

.status-good,
.severity-low {
  background: #dcfce7;
  color: #166534;
}

.status-processing,
.severity-medium {
  background: #e0e7ff;
  color: #4338ca;
}

.status-attention,
.severity-high {
  background: #fef3c7;
  color: #92400e;
}

.status-critical,
.severity-critical {
  background: #fee2e2;
  color: #991b1b;
}

.status-updated,
.status-info {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-color-info { color: #1d4ed8; }
.status-color-good { color: #166534; }
.status-color-processing { color: #4338ca; }
.status-color-attention { color: #a16207; }
.status-color-critical { color: #b91c1c; }
.status-bg-info { background: #dbeafe; }
.status-bg-good { background: #dcfce7; }
.status-bg-processing { background: #e0e7ff; }
.status-bg-attention { background: #fef3c7; }
.status-bg-critical { background: #fee2e2; }

.report-section.status-section-info { border-left: 3px solid #93c5fd; }
.report-section.status-section-good { border-left: 3px solid #86efac; }
.report-section.status-section-processing { border-left: 3px solid #a5b4fc; }
.report-section.status-section-attention { border-left: 3px solid #fcd34d; }
.report-section.status-section-critical { border-left: 3px solid #fca5a5; }

.status-open {
  background: #fef3c7;
  color: #92400e;
}

.status-resolved,
.status-closed {
  background: #dcfce7;
  color: #166534;
}

.pursuit-difficulty-status-open {
  background: #fee2e2;
  color: #991b1b;
}

.pursuit-difficulty-status-handling {
  background: #fef3c7;
  color: #92400e;
}

.pursuit-difficulty-status-resolved {
  background: #dcfce7;
  color: #166534;
}

.pursuit-timeline {
  position: relative;
  margin-left: .6rem;
  padding-left: 1.75rem;
}

.pursuit-timeline::before {
  position: absolute;
  top: .6rem;
  bottom: .6rem;
  left: 0;
  width: 2px;
  background: var(--sx-border);
  content: "";
}

.pursuit-timeline-item {
  position: relative;
  padding-bottom: 1rem;
}

.pursuit-timeline-marker {
  position: absolute;
  z-index: 1;
  top: 1.25rem;
  left: -2.08rem;
  width: .7rem;
  height: .7rem;
  border: 2px solid var(--sx-surface);
  border-radius: 50%;
  background: var(--sx-primary);
  box-shadow: 0 0 0 1px var(--sx-border);
}

.pursuit-action:hover,
.pursuit-action:focus-visible {
  color: var(--sx-primary) !important;
}

.pursuit-timeline-item .card {
  transition: box-shadow 180ms ease, transform 180ms ease;
}

.pursuit-timeline-item .card:hover {
  box-shadow: var(--sx-shadow);
  transform: translateY(-1px);
}

.status-muted {
  background: #f1f5f9;
  color: #475569;
}

.empty-state {
  padding: 2.5rem 1rem;
  color: var(--sx-muted);
  font-size: 0.925rem;
  text-align: center;
}

.empty-state i {
  display: grid;
  width: 3rem;
  height: 3rem;
  margin: 0 auto 0.75rem;
  place-items: center;
  border-radius: 50%;
  background: var(--sx-surface-muted);
  color: var(--sx-muted);
  font-size: 1.4rem;
}

.group-head { margin: 0 0 .75rem; color: var(--sx-muted); font-size: .8rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.personal-note-card { position: relative; height: 100%; padding: 1rem; border: 0; border-radius: var(--sx-radius-sm); background: var(--sx-surface-muted); box-shadow: 0 .5rem 1.25rem color-mix(in srgb, var(--sx-text) 12%, transparent); transition: box-shadow .15s ease, transform .15s ease; }
.personal-note-card:hover { box-shadow: 0 .8rem 1.6rem color-mix(in srgb, var(--sx-text) 16%, transparent); transform: translateY(-2px); }
.personal-note-card.is-pinned { transform: rotate(-1.25deg); }.personal-note-card.is-pinned:hover { transform: rotate(-1.25deg) translateY(-2px); }.personal-note-card__pin { position: absolute; top: -.45rem; right: .7rem; color: var(--sx-danger); font-size: 1.1rem; transform: rotate(20deg); text-shadow: 0 1px 1px color-mix(in srgb, var(--sx-text) 24%, transparent); }
.personal-note-card__body { display: -webkit-box; overflow: hidden; color: var(--sx-text-subtle, var(--sx-muted)); line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 5; }
.personal-note-card__body ul { margin: .5rem 0; padding-left: 1.25rem; }
.note-color--yellow { background: color-mix(in srgb, #facc15 24%, var(--sx-surface)); }.note-color--green { background: color-mix(in srgb, #22c55e 18%, var(--sx-surface)); }.note-color--blue { background: color-mix(in srgb, #3b82f6 16%, var(--sx-surface)); }.note-color--purple { background: color-mix(in srgb, #a855f7 14%, var(--sx-surface)); }.note-color--pink { background: color-mix(in srgb, #ec4899 14%, var(--sx-surface)); }.note-color--orange { background: color-mix(in srgb, #f97316 18%, var(--sx-surface)); }
.personal-note-filter { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .65rem; border: 1px solid var(--sx-border); border-radius: var(--sx-radius); background: var(--sx-surface); box-shadow: var(--sx-shadow-sm); }
.personal-note-filter .form-control { flex: 1 1 16rem; min-width: 12rem; }.personal-note-filter__tag { text-decoration: none; }.personal-note-filter__tag.is-selected { background: var(--sx-primary); border-color: var(--sx-primary); color: #fff; }.personal-tag-rename { padding: .65rem .75rem; border: 1px solid var(--sx-border); border-radius: var(--sx-radius-sm); background: var(--sx-surface); }.personal-tag-rename summary { cursor: pointer; color: var(--sx-muted); font-size: .875rem; }.personal-tag-rename .form-control { width: min(20rem, 100%); }
.personal-tag { border: 1px solid var(--personal-tag-border); background: var(--personal-tag-bg); color: var(--personal-tag-text); }.personal-tag--0 { --personal-tag-bg: var(--sx-tag-0-bg); --personal-tag-text: var(--sx-tag-0-text); --personal-tag-border: var(--sx-tag-0-border); }.personal-tag--1 { --personal-tag-bg: var(--sx-tag-1-bg); --personal-tag-text: var(--sx-tag-1-text); --personal-tag-border: var(--sx-tag-1-border); }.personal-tag--2 { --personal-tag-bg: var(--sx-tag-2-bg); --personal-tag-text: var(--sx-tag-2-text); --personal-tag-border: var(--sx-tag-2-border); }.personal-tag--3 { --personal-tag-bg: var(--sx-tag-3-bg); --personal-tag-text: var(--sx-tag-3-text); --personal-tag-border: var(--sx-tag-3-border); }.personal-tag--4 { --personal-tag-bg: var(--sx-tag-4-bg); --personal-tag-text: var(--sx-tag-4-text); --personal-tag-border: var(--sx-tag-4-border); }.personal-tag--5 { --personal-tag-bg: var(--sx-tag-5-bg); --personal-tag-text: var(--sx-tag-5-text); --personal-tag-border: var(--sx-tag-5-border); }.personal-tag--6 { --personal-tag-bg: var(--sx-tag-6-bg); --personal-tag-text: var(--sx-tag-6-text); --personal-tag-border: var(--sx-tag-6-border); }.personal-tag--7 { --personal-tag-bg: var(--sx-tag-7-bg); --personal-tag-text: var(--sx-tag-7-text); --personal-tag-border: var(--sx-tag-7-border); }.personal-tag.is-duplicate { animation: personal-tag-duplicate .45s ease-in-out; }@keyframes personal-tag-duplicate { 50% { filter: brightness(.78); transform: translateX(2px); } }
.personal-tag-picker { position: relative; }.personal-tag-picker summary { list-style: none; }.personal-tag-picker summary::-webkit-details-marker { display: none; }.personal-tag-picker__panel { position: absolute; z-index: 5; right: 0; width: min(22rem, calc(100vw - 3rem)); margin-top: .35rem; padding: .75rem; background: var(--sx-surface); border: 1px solid var(--sx-border); border-radius: var(--sx-radius-sm); box-shadow: var(--sx-shadow); }.personal-tag-picker__options { display: grid; gap: .45rem; max-height: 15rem; overflow-y: auto; }.personal-tag-picker__option { display: flex; align-items: center; gap: .4rem; cursor: pointer; }
.personal-note-tags { display: flex; flex-wrap: wrap; gap: .4rem; min-height: 1.75rem; }.personal-note-tags .btn-close { width: .5rem; height: .5rem; }
.note-color-choice { display: inline-block; width: 2rem; height: 2rem; border: 2px solid transparent; border-radius: 50%; cursor: pointer; }.btn-check:focus + .note-color-choice { outline: 2px solid var(--sx-primary); outline-offset: 2px; }.btn-check:checked + .note-color-choice { border-color: var(--sx-text); box-shadow: 0 0 0 2px var(--sx-surface), 0 0 0 4px var(--sx-primary); }
.note-color-choice--yellow { background: #facc15; }.note-color-choice--green { background: #22c55e; }.note-color-choice--blue { background: #3b82f6; }.note-color-choice--purple { background: #a855f7; }.note-color-choice--pink { background: #ec4899; }.note-color-choice--orange { background: #f97316; }
.personal-task-list { border: 1px solid var(--sx-border); border-radius: var(--sx-radius); overflow: hidden; background: var(--sx-surface); }
.personal-task-row { display: flex; align-items: center; gap: .65rem; min-height: 3.5rem; padding: .6rem .75rem; border-bottom: 1px solid var(--sx-border); }.personal-task-row:last-child { border-bottom: 0; }.personal-task-row form { margin: 0; }.personal-task-content { flex: 1 1 auto; min-width: 0; }.personal-task-title { display: block; color: var(--sx-text); text-decoration: none; overflow-wrap: anywhere; }.personal-task-title:hover { color: var(--sx-primary); }.personal-task-meta { display: flex; flex-wrap: wrap; gap: .25rem .6rem; margin-top: .2rem; color: var(--sx-muted); font-size: .8125rem; }.personal-task-meta > span + span::before { margin-right: .6rem; content: '·'; }.personal-task-meta .status-badge + span::before { content: none; }.personal-task-row.is-completed .personal-task-title { color: var(--sx-muted); text-decoration: line-through; }.personal-task-check { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 1.55rem; height: 1.55rem; min-height: 0; padding: 0; aspect-ratio: 1; color: var(--sx-muted); background: transparent; border: 1px solid var(--sx-border); border-radius: 50%; }.personal-task-check:hover { border-color: var(--sx-primary); color: var(--sx-primary); }.personal-task-row.is-completed .personal-task-check, .personal-task-step.is-completed .personal-task-check { border-color: var(--sx-primary); background: var(--sx-primary); color: #fff; }.personal-task-star { padding-inline: .25rem; }.personal-add-to-day { white-space: nowrap; }.personal-task-step { display: flex; align-items: center; gap: .5rem; padding: .45rem .25rem; border-bottom: 1px solid var(--sx-border); }.personal-task-step:last-child { border-bottom: 0; }.personal-task-step__title { border-color: transparent; background: transparent; box-shadow: none !important; }.personal-task-step__title:focus { border-color: var(--sx-border); background: var(--sx-surface); }.personal-task-step__delete { opacity: 0; transition: opacity .15s ease-in-out; }.personal-task-step:hover .personal-task-step__delete, .personal-task-step__delete:focus-within { opacity: 1; }.personal-completed-group summary { cursor: pointer; }.personal-note-panel { padding: 1rem; border-radius: var(--sx-radius-sm); }.personal-note-panel__body { line-height: 1.65; }.personal-note-panel__body ul { margin: .75rem 0; padding-left: 1.25rem; }.personal-panel-steps { padding-top: .5rem; }

.report-section {
  background: #fff;
  border: 1px solid var(--sx-border) !important;
  border-radius: var(--sx-radius);
  box-shadow: var(--sx-shadow-sm);
}

.report-user-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; }
.report-summary-card { padding: 1rem; background: #fff; border: 1px solid var(--sx-border); border-radius: var(--sx-radius); box-shadow: var(--sx-shadow-sm); }
.report-highlight-block, .report-note-block { height: 100%; padding: 1rem; border-radius: var(--sx-radius-sm); }
.report-highlight-block { background: #fffbeb; border-left: 4px solid #f59e0b; }
.report-note-block { background: #f8fafc; border-left: 4px solid #94a3b8; }
.report-detail-section { border-left: 4px solid #94a3b8; }
.report-detail-section.status-good { border-left-color: #22c55e; }
.report-detail-section.status-processing { border-left-color: #0ea5e9; }
.report-detail-section.status-attention { border-left-color: #f59e0b; }
.report-detail-section.status-critical { border-left-color: #ef4444; }
.report-detail-section.status-info { border-left-color: #6366f1; }

.report-thumb {
  width: 120px;
  height: 90px;
  object-fit: cover;
  border-radius: 9px;
  border: 1px solid var(--sx-border);
}

.image-gallery .report-thumb {
  width: 160px;
  height: 120px;
}

.category-emoji {
  display: inline-block;
  min-width: 1.1em;
}

.attachment-card {
  border: 1px solid var(--sx-border);
  border-radius: var(--sx-radius-sm);
  padding: 0.5rem;
  background: #f8fafc;
}

.attachment-kebab { min-height: 40px; min-width: 40px; }

.list-group-item {
  background: var(--sx-surface);
  color: var(--sx-text);
  border-color: var(--sx-border);
}

@media (max-width: 768px) {
  .btn,
  .form-control,
  .form-select,
  .custom-select-toggle {
    min-height: 44px;
  }

  .mobile-hide,
  .topbar-actions {
    display: none !important;
  }

  .topbar {
    align-items: center;
    flex-direction: row;
    min-height: 56px;
    padding: 0.5rem 1rem;
  }

  .main-content {
    padding: 1rem;
    padding-bottom: 5rem;
  }

  .page-eyebrow {
    display: none;
  }

  .page-title {
    font-size: 1rem;
    line-height: 1.2;
  }

  .icon-btn {
    width: 40px;
    height: 40px;
    min-height: 40px;
  }

  .filter-card > [class*="col-"],
  .form-card > [class*="col-"] {
    width: 100%;
  }

  .card-body.d-flex,
  .d-flex.flex-wrap {
    align-items: stretch !important;
  }

  .card-body.d-flex .btn,
  .d-flex.flex-wrap .btn {
    flex: 1 1 150px;
  }

  .issue-create-button,
  .report-create-entry {
    flex: 0 0 auto !important;
    white-space: nowrap;
  }

  .btn-action-mobile {
    width: 44px;
    height: 44px;
    min-width: 44px;
    padding: 0;
    border-radius: 12px;
    gap: 0;
  }

  .btn-action-mobile .action-label {
    display: none !important;
  }

  .btn-action-mobile i {
    margin: 0 !important;
  }

  .mobile-card-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    justify-content: flex-start;
  }

  .upload-preview-grid,
  .image-gallery {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .image-gallery .report-thumb,
  .report-thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .table-card.mobile-cards {
    overflow: visible;
  }

  .mobile-cards table,
  .mobile-cards thead,
  .mobile-cards tbody,
  .mobile-cards tr,
  .mobile-cards th,
  .mobile-cards td {
    display: block;
    width: 100%;
  }

  .mobile-cards thead {
    display: none;
  }

  .mobile-cards tr {
    margin-bottom: 0.85rem;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--sx-border);
    border-radius: var(--sx-radius);
    box-shadow: var(--sx-shadow-sm);
  }

  .mobile-cards td {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.75rem 0.9rem;
    text-align: left !important;
  }

  .mobile-cards td::before {
    content: attr(data-label);
    color: var(--sx-muted);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
  }

  .mobile-cards td .d-inline-flex {
    justify-content: flex-start !important;
  }

  .mobile-cards td .btn,
  .mobile-cards td form,
  .mobile-cards td form .btn {
    width: 100%;
  }

  .mobile-cards td .mobile-card-actions {
    grid-column: 2;
  }

  .mobile-cards td .mobile-card-actions .btn-action-mobile,
  .mobile-cards td .mobile-card-actions form .btn-action-mobile {
    width: 44px;
  }

  .mobile-cards td .mobile-card-actions form {
    width: auto;
    margin: 0;
  }
}
.text-pre-line {
  white-space: pre-line;
}

.relationship-tree {
  min-width: 760px;
  padding: 1rem;
}

.tree-node,
.department-node,
.partner-node {
  border: 1px solid var(--sx-border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--sx-shadow-sm);
}

.tree-node {
  max-width: 360px;
  margin: 0 auto;
  padding: 0.9rem 1rem;
  text-align: center;
  font-weight: 800;
}

.company-node {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.tree-connector {
  width: 2px;
  height: 28px;
  margin: 0 auto;
  background: var(--sx-border);
}

.tree-arrow {
  color: var(--sx-muted);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
  margin: 0.4rem 0;
  text-align: center;
}

.department-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.department-node {
  padding: 0.9rem;
  background: #f8fafc;
}

.department-title {
  margin-bottom: 0.75rem;
  font-weight: 800;
}

.partner-node {
  margin-top: 0.6rem;
  padding: 0.75rem;
}

.partner-manager {
  border-color: #86efac;
  background: #f0fdf4;
}

.org-tree-list,
.org-tree-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.org-tree-list ul {
  margin-left: 1.25rem;
  padding-left: 1rem;
}

.org-tree-list ul::before {
  background: var(--sx-border);
  bottom: 0.75rem;
  content: "";
  left: 0;
  position: absolute;
  top: 0;
  width: 2px;
}

.org-tree-list li {
  margin: 0.7rem 0;
  position: relative;
}

.org-tree-list ul li::before {
  background: var(--sx-border);
  content: "";
  height: 2px;
  left: -1rem;
  position: absolute;
  top: 1.6rem;
  width: 1rem;
}

.org-chart-scroll {
  overflow-x: auto;
  padding: 1rem 0 1.5rem;
}

.org-chart {
  min-width: 860px;
  padding: 1rem;
  text-align: center;
}

.org-company-node,
.org-department-node {
  border: 1px solid var(--sx-border);
  border-radius: 8px;
  box-shadow: var(--sx-shadow-sm);
}

.org-company-node {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e3a8a;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  margin: 0 auto;
  min-width: 280px;
  padding: 0.9rem 1.2rem;
}

.org-chart-list,
.org-chart-list ul {
  display: flex;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.org-chart-root {
  margin-top: 2.2rem;
}

.org-chart-list ul {
  margin-top: 2rem;
}

.org-chart-item {
  padding: 0 0.8rem;
  position: relative;
}

.org-chart-root::before,
.org-chart-list ul::before {
  background: var(--sx-border);
  content: "";
  height: 1.2rem;
  left: 50%;
  position: absolute;
  top: -1.2rem;
  width: 2px;
}

.org-chart-item::before,
.org-chart-item::after {
  border-top: 2px solid var(--sx-border);
  content: "";
  height: 1.2rem;
  position: absolute;
  top: -1.2rem;
  width: 50%;
}

.org-chart-item::before {
  left: 0;
}

.org-chart-item::after {
  right: 0;
}

.org-chart-item:first-child::before,
.org-chart-item:last-child::after {
  border-top: 0;
}

.org-chart-item:only-child::before,
.org-chart-item:only-child::after {
  display: none;
}

.org-department-node {
  background: #fff;
  color: var(--sx-text);
  display: inline-flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 92px;
  min-width: 220px;
  max-width: 280px;
  padding: 0.85rem 1rem;
  text-align: left;
}

.org-department-node:hover,
.org-department-node:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 0.2rem rgba(96, 165, 250, 0.16);
  outline: 0;
}

.org-department-special {
  background: #f0f9ff;
  border-color: #7dd3fc;
}

.org-node-title {
  font-weight: 800;
}

.org-node-head,
.org-node-type,
.org-special-member {
  color: var(--sx-muted);
  display: block;
  font-size: 0.82rem;
}

.org-special-members {
  display: grid;
  gap: 0.2rem;
}

.partner-position-badge {
  align-items: center;
  background: #eef4ff;
  border-radius: 999px;
  color: #2563eb;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  max-width: 100%;
  padding: 0.22rem 0.55rem;
  white-space: normal;
}

.sidebar-watermark {
  color: #94a3b8;
  font-size: 0.75rem;
  margin-top: auto;
  padding: 1rem;
  text-align: center;
}

.sidebar-watermark-slayer {
  position: relative;
  display: inline-block;
  isolation: isolate;
}

.sidebar-watermark-slayer img {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 0;
  width: 28px;
  height: 28px;
  max-width: none;
  opacity: 0.55;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.sidebar-watermark-slayer-text {
  position: relative;
  z-index: 1;
}

.org-chart-match > .org-department-node {
  border-color: #f59e0b;
  box-shadow: 0 0 0 0.2rem rgba(245, 158, 11, 0.12);
}

.department-summary .list-group-item {
  border-color: var(--sx-border);
}

@media (max-width: 768px) {
  .relationship-tree {
    min-width: 680px;
    padding: 0.75rem;
  }

  .org-chart-scroll {
    margin-left: -0.75rem;
    margin-right: -0.75rem;
    padding-left: 0.75rem;
  }

  .org-chart {
    min-width: 760px;
    padding: 0.75rem;
  }

  .org-department-node {
    min-height: 96px;
    min-width: 210px;
  }

  .partner-position-badge {
    font-size: 0.74rem;
  }

  .relation-form-grid > [class*="col-"] {
    width: 100%;
  }

  .relationship-tree .partner-node {
    min-width: 190px;
  }
}
.modal-body[data-preview-modal-body] {
  min-height: 18rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
}

.modal-body[data-preview-modal-body] .document-preview-image,
.modal-body[data-preview-modal-body] .document-preview-video {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  width: auto;
  height: auto;
  margin: auto;
  object-fit: contain;
}

.modal-body[data-preview-modal-body] .document-preview-video { background: #111827; }

/* Personal appearance: semantic tokens are the single source for app and Bootstrap surfaces. */
:root {
  color-scheme: light;
  --sx-bg: #f8fafc;
  --sx-surface: #ffffff;
  --sx-surface-muted: #f1f5f9;
  --sx-surface-emphasis: #e2e8f0;
  --sx-text: #0f172a;
  --sx-text-subtle: #475569;
  --sx-muted: #64748b;
  --sx-border: #dbe4ee;
  --sx-focus-ring: rgb(37 99 235 / .35);
  --sx-overlay: rgb(15 23 42 / .6);
  --sx-primary: #2563eb;
  --sx-primary-dark: #1d4ed8;
  --sx-primary-soft: #eff6ff;
  --sx-primary-border: #bfdbfe;
  --sx-chart-text: #334155;
  --sx-chart-grid: #dbe4ee;
  --sx-chart-neutral: #64748b;
  --sx-chart-info: #0284c7;
  --sx-chart-good: #16a34a;
  --sx-chart-processing: #6366f1;
  --sx-chart-attention: #d97706;
  --sx-chart-critical: #dc2626;
  --sx-chart-purple: #7e22ce;
  --sx-chart-orange: #c2410c;
  --sx-chart-teal: #0f766e;
  --sx-status-info-bg: #dbeafe;
  --sx-status-info-text: #1d4ed8;
  --sx-status-good-bg: #dcfce7;
  --sx-status-good-text: #166534;
  --sx-status-processing-bg: #e0e7ff;
  --sx-status-processing-text: #4338ca;
  --sx-status-attention-bg: #fef3c7;
  --sx-status-attention-text: #92400e;
  --sx-status-critical-bg: #fee2e2;
  --sx-status-critical-text: #991b1b;
  --sx-tag-0-bg: #dbeafe; --sx-tag-0-text: #1e40af; --sx-tag-0-border: #60a5fa;
  --sx-tag-1-bg: #dcfce7; --sx-tag-1-text: #166534; --sx-tag-1-border: #4ade80;
  --sx-tag-2-bg: #f3e8ff; --sx-tag-2-text: #6b21a8; --sx-tag-2-border: #c084fc;
  --sx-tag-3-bg: #ffedd5; --sx-tag-3-text: #9a3412; --sx-tag-3-border: #fb923c;
  --sx-tag-4-bg: #fce7f3; --sx-tag-4-text: #9d174d; --sx-tag-4-border: #f472b6;
  --sx-tag-5-bg: #ccfbf1; --sx-tag-5-text: #115e59; --sx-tag-5-border: #2dd4bf;
  --sx-tag-6-bg: #fef3c7; --sx-tag-6-text: #92400e; --sx-tag-6-border: #fbbf24;
  --sx-tag-7-bg: #e0e7ff; --sx-tag-7-text: #3730a3; --sx-tag-7-border: #818cf8;
}

html[data-accent="green"] { --sx-primary: #15803d; --sx-primary-dark: #166534; --sx-primary-soft: #ecfdf3; --sx-primary-border: #86efac; --sx-focus-ring: rgb(21 128 61 / .35); }
html[data-accent="purple"] { --sx-primary: #7e22ce; --sx-primary-dark: #6b21a8; --sx-primary-soft: #faf5ff; --sx-primary-border: #d8b4fe; --sx-focus-ring: rgb(126 34 206 / .35); }
html[data-accent="orange"] { --sx-primary: #c2410c; --sx-primary-dark: #9a3412; --sx-primary-soft: #fff7ed; --sx-primary-border: #fdba74; --sx-focus-ring: rgb(194 65 12 / .35); }

html[data-resolved-theme="dark"] {
  color-scheme: dark;
  --sx-bg: #111827;
  --sx-surface: #1f2937;
  --sx-surface-muted: #263244;
  --sx-surface-emphasis: #334155;
  --sx-text: #f8fafc;
  --sx-text-subtle: #cbd5e1;
  --sx-muted: #a8b6ca;
  --sx-border: #475569;
  --sx-focus-ring: rgb(96 165 250 / .6);
  --sx-overlay: rgb(2 6 23 / .72);
  --sx-primary: #60a5fa;
  --sx-primary-dark: #93c5fd;
  --sx-primary-soft: #172554;
  --sx-primary-border: #315a96;
  --sx-chart-text: #dbeafe;
  --sx-chart-grid: #475569;
  --sx-chart-neutral: #94a3b8;
  --sx-chart-info: #38bdf8;
  --sx-chart-good: #4ade80;
  --sx-chart-processing: #a5b4fc;
  --sx-chart-attention: #fbbf24;
  --sx-chart-critical: #f87171;
  --sx-chart-purple: #c084fc;
  --sx-chart-orange: #fb923c;
  --sx-chart-teal: #2dd4bf;
  --sx-status-info-bg: #172554;
  --sx-status-info-text: #93c5fd;
  --sx-status-good-bg: #143321;
  --sx-status-good-text: #86efac;
  --sx-status-processing-bg: #2e1065;
  --sx-status-processing-text: #c4b5fd;
  --sx-status-attention-bg: #422006;
  --sx-status-attention-text: #fcd34d;
  --sx-status-critical-bg: #450a0a;
  --sx-status-critical-text: #fca5a5;
  --sx-tag-0-bg: #172554; --sx-tag-0-text: #93c5fd; --sx-tag-0-border: #3b82f6;
  --sx-tag-1-bg: #143321; --sx-tag-1-text: #86efac; --sx-tag-1-border: #22c55e;
  --sx-tag-2-bg: #2e1065; --sx-tag-2-text: #d8b4fe; --sx-tag-2-border: #a855f7;
  --sx-tag-3-bg: #431407; --sx-tag-3-text: #fdba74; --sx-tag-3-border: #f97316;
  --sx-tag-4-bg: #500724; --sx-tag-4-text: #f9a8d4; --sx-tag-4-border: #ec4899;
  --sx-tag-5-bg: #042f2e; --sx-tag-5-text: #99f6e4; --sx-tag-5-border: #14b8a6;
  --sx-tag-6-bg: #422006; --sx-tag-6-text: #fcd34d; --sx-tag-6-border: #f59e0b;
  --sx-tag-7-bg: #1e1b4b; --sx-tag-7-text: #c7d2fe; --sx-tag-7-border: #6366f1;
}

html[data-resolved-theme="dark"][data-accent="green"] { --sx-primary: #4ade80; --sx-primary-dark: #86efac; --sx-primary-soft: #143321; --sx-primary-border: #267447; }
html[data-resolved-theme="dark"][data-accent="purple"] { --sx-primary: #c084fc; --sx-primary-dark: #d8b4fe; --sx-primary-soft: #2e1065; --sx-primary-border: #7e22ce; }
html[data-resolved-theme="dark"][data-accent="orange"] { --sx-primary: #fb923c; --sx-primary-dark: #fdba74; --sx-primary-soft: #431407; --sx-primary-border: #c2410c; }

html {
  --bs-body-bg: var(--sx-bg);
  --bs-body-color: var(--sx-text);
  --bs-secondary-color: var(--sx-muted);
  --bs-secondary-bg: var(--sx-surface-muted);
  --bs-tertiary-bg: var(--sx-surface-muted);
  --bs-border-color: var(--sx-border);
  --bs-emphasis-color: var(--sx-text);
  --bs-primary: var(--sx-primary);
  --bs-primary-rgb: 37, 99, 235;
  --bs-link-color: var(--sx-primary);
  --bs-link-hover-color: var(--sx-primary-dark);
  --bs-card-bg: var(--sx-surface);
  --bs-card-border-color: var(--sx-border);
  --bs-table-bg: var(--sx-surface);
  --bs-table-color: var(--sx-text);
  --bs-table-border-color: var(--sx-border);
  --bs-table-striped-bg: var(--sx-surface-muted);
  --bs-table-hover-bg: var(--sx-surface-muted);
  --bs-dropdown-bg: var(--sx-surface);
  --bs-dropdown-color: var(--sx-text);
  --bs-dropdown-link-color: var(--sx-text);
  --bs-dropdown-link-hover-bg: var(--sx-primary-soft);
  --bs-modal-bg: var(--sx-surface);
  --bs-modal-color: var(--sx-text);
  --bs-toast-bg: var(--sx-surface);
  --bs-toast-color: var(--sx-text);
  --bs-pagination-bg: var(--sx-surface);
  --bs-pagination-color: var(--sx-primary);
  --bs-pagination-border-color: var(--sx-border);
  --bs-pagination-hover-bg: var(--sx-primary-soft);
  --bs-pagination-hover-color: var(--sx-primary-dark);
  --bs-form-control-bg: var(--sx-surface);
  --bs-form-control-color: var(--sx-text);
  --bs-form-control-border-color: var(--sx-border);
  --bs-form-select-bg: var(--sx-surface);
  --bs-form-select-color: var(--sx-text);
}

body, .offcanvas, .sidebar, .topbar, .card, .table-card, .filter-card, .form-card, .chart-card, .stat-card,
.modal-content, .dropdown-menu, .toast, .upload-dropzone, .document-thumbnail-placeholder, .report-summary-card,
.document-principal-results, .custom-select-menu, .custom-select-options, .auth-shell {
  background-color: var(--sx-surface);
  color: var(--sx-text);
  border-color: var(--sx-border);
}
.inventory-warehouse-card--normal { border-color: var(--sx-border); }
.inventory-warehouse-card--attention { border-color: var(--sx-warning); border-left-width: 3px; }
.inventory-warehouse-card--overdue { border-color: var(--sx-warning); border-left-width: 4px; box-shadow: 0 .45rem 1.25rem color-mix(in srgb, var(--sx-warning) 42%, transparent); }
body, .auth-shell { background-color: var(--sx-bg); }
.topbar { background: color-mix(in srgb, var(--sx-bg) 88%, transparent); border-bottom-color: var(--sx-border); }
.nav-link, .nav-link i, .table thead th, .text-muted, .form-text, .placeholder, ::placeholder { color: var(--sx-muted) !important; }
.nav-link:hover, .nav-link.active, .module-switch-link, .document-permission-check:hover, .table-hover tbody tr:hover { background-color: var(--sx-primary-soft); color: var(--sx-primary) !important; }
.module-switch-link, .document-selected-principal { border-color: var(--sx-primary-border); }
.form-control, .form-select, .form-control:disabled, .form-select:disabled, .input-group-text { background-color: var(--sx-surface); color: var(--sx-text); border-color: var(--sx-border); }
.form-control:focus, .form-select:focus, .btn:focus-visible, .theme-choice-card:focus-within, .accent-choice:focus-within { border-color: var(--sx-primary); box-shadow: 0 0 0 .25rem var(--sx-focus-ring); }
.btn-primary { --bs-btn-bg: var(--sx-primary); --bs-btn-border-color: var(--sx-primary); --bs-btn-hover-bg: var(--sx-primary-dark); --bs-btn-hover-border-color: var(--sx-primary-dark); --bs-btn-active-bg: var(--sx-primary-dark); --bs-btn-active-border-color: var(--sx-primary-dark); }
.btn-outline-primary { --bs-btn-color: var(--sx-primary); --bs-btn-border-color: var(--sx-primary); --bs-btn-hover-bg: var(--sx-primary); --bs-btn-hover-border-color: var(--sx-primary); }
.upload-dropzone, .document-permission-check { background: var(--sx-surface-muted); border-color: var(--sx-border); }
.report-save-overlay { background: var(--sx-overlay); }
.report-save-overlay__panel, .report-highlight-block, .report-note-block { background: var(--sx-surface); color: var(--sx-text); }
.status-good, .status-dot-good { background: var(--sx-status-good-bg); color: var(--sx-status-good-text); }
.status-info, .status-updated, .status-dot-info, .status-dot-updated { background: var(--sx-status-info-bg); color: var(--sx-status-info-text); }
.status-processing, .status-dot-processing { background: var(--sx-status-processing-bg); color: var(--sx-status-processing-text); }
.status-attention, .status-dot-attention { background: var(--sx-status-attention-bg); color: var(--sx-status-attention-text); }
.status-critical, .status-dot-critical { background: var(--sx-status-critical-bg); color: var(--sx-status-critical-text); }
.status-color-info { color: var(--sx-status-info-text); }.status-color-good { color: var(--sx-status-good-text); }.status-color-processing { color: var(--sx-status-processing-text); }.status-color-attention { color: var(--sx-status-attention-text); }.status-color-critical { color: var(--sx-status-critical-text); }
.status-bg-info { background: var(--sx-status-info-bg); }.status-bg-good { background: var(--sx-status-good-bg); }.status-bg-processing { background: var(--sx-status-processing-bg); }.status-bg-attention { background: var(--sx-status-attention-bg); }.status-bg-critical { background: var(--sx-status-critical-bg); }

/* These share the same five-colour status vocabulary as .status-good/.status-info/etc.
   above but were defined with their own hardcoded hex before dark mode existed, so they
   never picked up the --sx-status-* tokens and render unreadable in dark mode. */
.severity-low, .status-resolved, .status-closed, .pursuit-difficulty-status-resolved { background: var(--sx-status-good-bg); color: var(--sx-status-good-text); }
.severity-medium { background: var(--sx-status-processing-bg); color: var(--sx-status-processing-text); }
.severity-high, .status-open, .pursuit-difficulty-status-handling { background: var(--sx-status-attention-bg); color: var(--sx-status-attention-text); }
.severity-critical, .pursuit-difficulty-status-open { background: var(--sx-status-critical-bg); color: var(--sx-status-critical-text); }
.status-muted { background: var(--sx-surface-muted); color: var(--sx-text-subtle); }

.theme-choice-input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; }

/* Task module: explicit active colours keep Bootstrap pill labels readable in
   both light and dark themes, despite the global sidebar nav overrides. */
.task-view-toggle .nav-link.active,
.task-view-toggle .nav-link.active:hover {
  background-color: var(--sx-primary);
  color: #fff !important;
  box-shadow: none;
}

.task-view-toggle .nav-link.active i { color: #fff !important; }

/* Project status tabs (projects/index.html) and the per-project section tab bar
   (_project_tabs.html) both use this: a segmented control instead of Bootstrap's
   default underline tabs, so the active item is legible in both themes without
   relying on the global .nav-link.active !important rule above. */
.project-tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.3rem;
  background: var(--sx-surface-muted);
  border: 0;
  border-radius: var(--sx-radius);
}

.project-tab-bar .nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0.45rem 0.9rem;
  border: 0;
  border-radius: calc(var(--sx-radius) - 4px);
  color: var(--sx-muted);
  font-size: 0.875rem;
  font-weight: 700;
  white-space: nowrap;
  transition: background-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.project-tab-bar .nav-link:hover {
  background-color: color-mix(in srgb, var(--sx-primary) 12%, transparent);
  color: var(--sx-primary);
}

.project-tab-bar .nav-link.active {
  background-color: var(--sx-surface);
  color: var(--sx-primary);
  box-shadow: var(--sx-shadow-sm);
}

.project-tab-bar .nav-link.opacity-50 {
  cursor: not-allowed;
}

.project-tab-bar .nav-link.opacity-50:hover {
  background-color: transparent;
  color: var(--sx-muted);
}

.project-tab-bar .nav-link .badge {
  font-size: 0.7rem;
  font-weight: 700;
}

.task-filter-bar {
  align-items: center;
  background: var(--sx-surface);
  border: 1px solid var(--sx-border);
  border-radius: var(--sx-radius);
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  padding: .75rem;
}

.task-filter-bar .form-select { flex: 0 1 15rem; min-width: 12rem; }
.task-filter-overdue { margin: 0; white-space: nowrap; }
.task-filter-bar .form-select,
.task-filter-bar .btn,
.task-module-actions .btn,
.task-form-control-button { min-height: 31px; }
.task-kanban-card[data-task-draggable] { cursor: grab; }
.task-kanban-card[data-task-draggable]:active { cursor: grabbing; }
.task-kanban-card { position: relative; }
.task-priority-badge { color: #111827; font-weight: 600; }
.task-priority-cao { background: #f8d7da; color: #842029; }
.task-priority-trung_binh { background: #fff3cd; color: #664d03; }
.task-priority-thap { background: #cff4fc; color: #055160; }
.task-priority-choice { display: inline-block; width: auto; }
/* Fixed width so the control does not resize when the label length changes. */
.task-priority-choice .task-priority-toggle {
  width: 11.5rem;
  min-height: calc(1.5em + .75rem + 2px);
  padding: .25rem .5rem;
  text-align: left;
  white-space: nowrap;
  background: var(--sx-surface);
  border: 1px solid var(--sx-border);
  border-radius: var(--sx-radius);
  transition: border-color .15s ease-in-out;
}
.task-priority-choice .task-priority-toggle:hover,
.task-priority-choice .task-priority-toggle.show {
  background: var(--sx-surface);
  border-color: var(--sx-muted);
}
.task-priority-choice .task-priority-toggle::after { margin-left: .5rem; color: var(--sx-muted); }
.task-priority-choice .dropdown-menu {
  min-width: 11.5rem;
  width: 11.5rem;
  padding: .25rem;
  border-radius: var(--sx-radius);
  border-color: var(--sx-border);
}
.task-priority-choice .dropdown-item { border-radius: 8px; padding: .3rem .45rem; }
.task-priority-choice .dropdown-item:active { background: var(--sx-border); color: inherit; }
.task-user-picker { min-height: calc(1.5em + .75rem + 2px); }
.task-user-picker .list-group { z-index: 1060; }
.task-user-picker-chip { max-width: 100%; }
.task-user-picker-chip > span:last-of-type { overflow: hidden; text-overflow: ellipsis; }
.task-status-badge { font-weight: 600; white-space: nowrap; }
.task-status-done { background: #d1e7dd; color: #0f5132; }
.task-status-doing { background: #fff3cd; color: #664d03; }
.task-status-waiting { background: #ffe5d0; color: #8a3d00; }
.task-status-todo { background: #e2e3e5; color: #41464b; }
.task-status-da_huy { background: #f8d7da; color: #842029; }
.task-user { align-items: center; display: inline-flex; gap: .35rem; vertical-align: middle; }
.task-user .avatar { align-items: center; display: inline-flex; flex: 0 0 auto; height: 1.75rem; justify-content: center; width: 1.75rem; }
.task-user-sm { font-size: inherit; }
.task-overdue-badge { background: #842029; color: #fff; position: absolute; right: .5rem; top: .5rem; z-index: 1; }
.task-overdue-badge-list { background: #842029; color: #fff; font-size: .72rem; }
.task-group-card { min-width: 0; }
.task-group-metrics { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr)); }
.task-group-metrics span { background: var(--sx-surface-muted); border-radius: .4rem; display: flex; flex-direction: column; padding: .45rem .55rem; }
.task-group-metrics small { color: var(--sx-muted); line-height: 1.2; }
.task-group-metrics strong { font-size: 1.1rem; line-height: 1.2; }
.task-group-metric-overdue strong { color: #b42318; }
.task-document-tree-node { border-bottom: 1px solid var(--sx-border); }
.task-document-tree-node:last-child { border-bottom: 0; }
.task-document-tree-row { align-items: center; display: flex; gap: .5rem; min-height: 2.4rem; }
.task-document-tree-toggle, .task-document-tree-toggle-spacer { flex: 0 0 1.75rem; height: 1.75rem; width: 1.75rem; }
.task-document-tree-toggle { background: transparent; border: 1px solid transparent; border-radius: .25rem; color: var(--sx-text); font-size: 1.3rem; line-height: 1; }
.task-document-tree-toggle:hover { background: var(--sx-surface-muted); border-color: var(--sx-border); }
.task-document-tree-toggle:focus-visible { outline: 2px solid var(--sx-primary); outline-offset: 1px; }
.task-document-tree-name { cursor: pointer; flex: 1; margin: 0; min-width: 0; overflow-wrap: anywhere; }
.task-document-tree-children { border-left: 1px solid var(--sx-border); margin-left: .85rem; padding-left: .85rem; }
.task-document-tree-file { padding-left: 0; }

@media (max-width: 767.98px) {
  .task-filter-bar .form-select,
  .task-filter-bar .btn { flex: 1 1 100%; }
}

/* Collapsible inventory headings are buttons, not sidebar links.  The explicit
   colours restore contrast against the global .nav-link.active !important rule. */
.sidebar-group-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  color: #94a3b8 !important;
  display: flex;
  padding: 0;
  text-align: left;
  width: 100%;
}
.sidebar-group-toggle:hover { color: var(--sx-primary) !important; }
.sidebar-group-toggle:focus-visible { outline: 2px solid var(--sx-primary); outline-offset: 3px; }
.sidebar-group-toggle .sidebar-group-chevron { font-size: .8rem; margin-left: auto; transition: transform 160ms ease; }
.sidebar-group-toggle[aria-expanded="false"] .sidebar-group-chevron { transform: rotate(-90deg); }
.sidebar-search-trigger { align-items: center; background: var(--sx-surface-muted); border: 1px solid var(--sx-border); border-radius: var(--sx-radius-sm); color: var(--sx-text) !important; container-type: inline-size; display: flex; font-size: .8rem; font-weight: 600; gap: .5rem; justify-content: center; min-height: 38px; padding: .45rem .75rem; text-decoration: none; width: 100%; }
.sidebar-search-trigger i { color: var(--sx-primary) !important; flex: 0 0 auto; font-size: 1rem; }
.sidebar-search-label { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-search-trigger:hover { background: var(--sx-primary-soft); border-color: var(--sx-primary-border); color: var(--sx-primary) !important; }
.sidebar-search-trigger:focus-visible { outline: 2px solid var(--sx-primary); outline-offset: 2px; }
.sidebar-action-group { display: flex; flex-direction: column; gap: .25rem; }
.sidebar-action-divider { border-top: 1px solid var(--sx-border); margin: .75rem 0; }
.sidebar-action-link { align-items: center; background: var(--sx-primary); border: 1px solid var(--sx-primary); border-radius: var(--sx-radius-sm); color: #fff; display: flex; font-size: .8rem; font-weight: 600; gap: .4rem; justify-content: center; min-height: 38px; padding: .45rem .75rem; text-decoration: none; white-space: nowrap; width: 100%; }
.sidebar-action-link i { color: currentColor; font-size: 1rem; }
.sidebar-action-link:hover { background: var(--sx-primary-dark); border-color: var(--sx-primary-dark); color: #fff; }
.sidebar-action-link:visited { color: #fff; }
html[data-resolved-theme="dark"] .sidebar-action-link,
html[data-resolved-theme="dark"] .sidebar-action-link:hover,
html[data-resolved-theme="dark"] .sidebar-action-link:visited { color: var(--sx-bg); }
.sidebar-action-link:focus-visible { outline: 2px solid var(--sx-primary); outline-offset: 2px; }
html.sidebar-collapsed .sidebar .sidebar-action-link { justify-content: center; padding-left: .2rem; padding-right: .2rem; }
html.sidebar-collapsed .sidebar .sidebar-action-link span { border: 0; clip: rect(0, 0, 0, 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; white-space: nowrap; width: 1px; }
html.sidebar-collapsed .sidebar .sidebar-search-trigger { justify-content: center; padding-left: .2rem; padding-right: .2rem; }
html.sidebar-collapsed .sidebar .sidebar-search-label { border: 0; clip: rect(0, 0, 0, 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; white-space: nowrap; width: 1px; }
html[data-js-enabled="true"] .material-select-fallback { display: none; }
.material-suggestions { background: var(--sx-surface); border: 1px solid var(--sx-border); border-radius: var(--sx-radius-sm); margin-top: .25rem; max-height: 13rem; overflow-y: auto; }
.material-suggestion { background: transparent; border: 0; display: block; padding: .45rem .65rem; text-align: left; width: 100%; }
.material-suggestion[data-active="true"], .material-suggestion:hover { background: var(--sx-primary-soft); }
.inventory-search-overlay { align-items: center; display: flex; inset: 0; justify-content: center; padding: 1rem; position: fixed; z-index: 1080; }
.inventory-search-overlay__backdrop { background: var(--sx-overlay); inset: 0; position: absolute; }
.inventory-search-overlay__dialog { background: var(--sx-surface); border: 1px solid var(--sx-border); border-radius: var(--sx-radius); box-shadow: var(--sx-shadow); max-width: 42rem; padding: 1.25rem; position: relative; width: 100%; }
.inventory-warehouse-filter { position: relative; }
.inventory-warehouse-filter__toggle { align-items: center; background-image: none; display: none; justify-content: space-between; padding-right: .75rem; text-align: left; width: 100%; }
html[data-js-enabled="true"] .inventory-warehouse-filter__toggle { display: flex; }
.inventory-warehouse-filter__menu { background: var(--sx-surface); border: 1px solid var(--sx-border); border-radius: var(--sx-radius-sm); box-shadow: var(--sx-shadow); left: 0; margin-top: .25rem; max-height: 18rem; overflow-y: auto; padding: .5rem; position: absolute; top: 100%; width: 100%; z-index: 10; }
.inventory-warehouse-filter__clear { background: transparent; border: 0; border-bottom: 1px solid var(--sx-border); color: var(--sx-primary); font-weight: 600; padding: .35rem .45rem .55rem; text-align: left; width: 100%; }
.inventory-warehouse-filter__option { align-items: center; cursor: pointer; display: flex; gap: .45rem; margin: 0; padding: .4rem .45rem; }
.inventory-warehouse-filter__option:hover { background: var(--sx-surface-muted); }
.inventory-warehouse-filter__option input { flex: 0 0 auto; }
.inventory-warehouse-filter__toggle:focus-visible, .inventory-warehouse-filter__clear:focus-visible, .inventory-warehouse-filter__option input:focus-visible { outline: 2px solid var(--sx-primary); outline-offset: 2px; }
html[data-js-enabled="true"] .inventory-warehouse-filter__fallback { display: none; }
.theme-choice-card, .accent-choice { display: block; min-height: 76px; padding: .9rem 1rem; color: var(--sx-text); background: var(--sx-surface-muted); border: 1px solid var(--sx-border); border-radius: var(--sx-radius-sm); cursor: pointer; }
.theme-choice-input:checked + .theme-choice-card, .theme-choice-input:checked + .accent-choice { color: var(--sx-text); background: var(--sx-primary-soft); border-color: var(--sx-primary); box-shadow: inset 0 0 0 1px var(--sx-primary); }
.accent-choice { display: inline-flex; align-items: center; gap: .5rem; min-height: 42px; padding: .55rem .75rem; }
.accent-swatch { width: 1rem; height: 1rem; border-radius: 50%; background: var(--sx-primary); }.accent-choice-green .accent-swatch { background: #15803d; }.accent-choice-purple .accent-swatch { background: #7e22ce; }.accent-choice-orange .accent-swatch { background: #c2410c; }
.theme-preview { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; padding: 1rem; background: var(--sx-surface-muted); border: 1px solid var(--sx-border); border-radius: var(--sx-radius-sm); }.theme-preview-title { font-weight: 700; color: var(--sx-text); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* ---------- Dashboard Giao việc ---------- */
.task-dashboard-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem; }
.task-dashboard-toolbar .form-label { font-size: 0.76rem; font-weight: 600; color: var(--sx-muted); margin-bottom: 0.3rem; }
.task-dashboard-toolbar .form-select { min-width: 11rem; }

.task-lens { display: inline-flex; gap: 3px; padding: 3px; background: var(--sx-bg);
  border: 1px solid var(--sx-border); border-radius: var(--sx-radius-sm); }
.task-lens a { padding: 0.45rem 0.95rem; border-radius: 8px; font-size: 0.86rem;
  font-weight: 500; color: var(--sx-muted); white-space: nowrap; }
.task-lens a:hover { color: var(--sx-primary); }
.task-lens a.active { background: var(--sx-surface); color: var(--sx-primary);
  font-weight: 600; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08); }

.task-dashboard-metrics .stat-card { flex-direction: column; align-items: flex-start; gap: 0.2rem; }
.task-dashboard-metrics .stat-card.is-danger {
  border-color: color-mix(in srgb, var(--sx-danger) 40%, var(--sx-border));
  background: color-mix(in srgb, var(--sx-danger) 6%, var(--sx-surface)); }
.task-dashboard-metrics .stat-detail { font-size: 0.74rem; color: var(--sx-muted); }

.task-rate { display: flex; align-items: center; gap: 0.55rem; min-width: 7.5rem; }
.task-rate-track { flex: 1; height: 6px; border-radius: 3px; background: var(--sx-bg); overflow: hidden; }
.task-rate-track span { display: block; height: 100%; }

.task-donut { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.task-donut-canvas { position: relative; width: 152px; height: 152px; flex: none; }
.task-donut canvas { width: 152px !important; height: 152px !important; }
.task-donut-legend { flex: 1; min-width: 9rem; display: flex; flex-direction: column;
  gap: 0.55rem; font-size: 0.86rem; }
.task-donut-legend > div { display: flex; align-items: center; gap: 0.5rem; }
.task-donut-legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.task-donut-legend strong { margin-left: auto; font-variant-numeric: tabular-nums; }
.task-donut-legend .is-cancelled { color: var(--sx-muted); padding-top: 0.5rem;
  border-top: 1px solid var(--sx-border); }

.task-dashboard-weekly { height: 220px; }
.task-dashboard-weekly canvas { max-height: 220px; }

.project-dashboard-chart-box { height: 240px; }
.project-dashboard-chart-box canvas { max-height: 240px; }

.task-num { font-variant-numeric: tabular-nums; }

/* The global .nav-link colours near the top of this file are written for the
   sidebar, where a link sits on the page background and takes the accent as
   its own colour.  Bootstrap paints an active pill with a solid accent fill,
   so inheriting that accent as the text colour leaves the label invisible.
   Every .nav-pills group needs its contrast restored explicitly, and these
   rules must carry !important because the sidebar rules do. */
.nav-pills .nav-link { color: var(--sx-text) !important; }
.nav-pills .nav-link:hover { background-color: var(--sx-primary-soft); color: var(--sx-primary) !important; }
.nav-pills .nav-link.active,
.nav-pills .show > .nav-link { background-color: var(--sx-primary); color: #fff !important; }
.nav-pills .nav-link.active i { color: #fff !important; }

/* This is intentionally more specific than the global sidebar .nav-link
   overrides: these pills live in the bell panel, not in navigation. */
.notification-dropdown-menu { max-width: calc(100vw - 1rem); min-width: 22.5rem; padding: .75rem !important; }
.notification-panel { min-width: 0; }
.notification-panel-header { display: grid; gap: .45rem; margin-bottom: .6rem; }
.notification-panel-header-row { align-items: center; display: flex; gap: .75rem; justify-content: space-between; min-width: 0; }
.notification-panel-header-row > strong { color: var(--sx-text); font-size: .92rem; }
.notification-tabs { flex-wrap: nowrap; gap: .15rem; justify-self: start; padding: .15rem; width: fit-content; background: var(--sx-surface-muted); border-radius: .45rem; }
.notification-tabs .nav-link { background: transparent; border-radius: .32rem; color: var(--sx-muted) !important; font-size: .8125rem; line-height: 1.15; padding: .28rem .55rem; }
.notification-tabs .nav-link:hover { background: color-mix(in srgb, var(--sx-primary-soft) 78%, transparent); color: var(--sx-primary) !important; }
.notification-tabs .nav-link.active,
.notification-tabs .nav-link.active:hover { background: var(--sx-primary); color: #fff !important; }
.notification-tabs .nav-link:focus-visible, .notification-read-all:focus-visible { outline: 2px solid var(--sx-primary); outline-offset: 2px; }
.notification-read-all { font-size: .7rem; line-height: 1.15; text-align: right; white-space: nowrap; }
.notification-list { max-height: calc(70vh - 5rem); overflow-y: auto; }
.notification-list-state { color: var(--sx-muted); font-size: .875rem; margin: 0; padding: 1.25rem .5rem; text-align: center; }
.notification-item { align-items: flex-start; background: transparent; border: 0; border-bottom: 1px solid var(--sx-border); color: var(--sx-text); cursor: pointer; display: flex; gap: .65rem; padding: .75rem .45rem; text-align: left; transition: background-color .15s ease; width: 100%; }
.notification-item.is-unread { background: color-mix(in srgb, var(--sx-primary-soft) 55%, transparent); }
.notification-item:hover { background: var(--sx-surface-muted); }
.notification-item:focus-visible { outline: 2px solid var(--sx-primary); outline-offset: -2px; position: relative; z-index: 1; }
.notification-item:last-child { border-bottom: 0; }
.notification-actor-avatar, .notification-system-icon { align-items: center; background: var(--sx-primary-soft); border-radius: 50%; color: var(--sx-primary); display: inline-flex; flex: 0 0 2.25rem; font-size: .78rem; font-weight: 700; height: 2.25rem; justify-content: center; object-fit: cover; width: 2.25rem; }
.notification-system-icon { font-size: 1rem; }
.notification-item-copy { flex: 1; min-width: 0; padding-right: .25rem; }
.notification-item-title { color: var(--sx-text); display: block; font-size: .86rem; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.notification-item-subtitle, .notification-item-time { color: var(--sx-muted); display: block; font-size: .75rem; line-height: 1.35; margin-top: .16rem; overflow-wrap: anywhere; }
.notification-item-time { margin-top: .28rem; }
.notification-unread-dot { background: var(--sx-primary); border-radius: 50%; flex: 0 0 .5rem; height: .5rem; margin-top: .48rem; width: .5rem; }
.notification-badge { background: var(--sx-danger); border: 2px solid var(--sx-surface); border-radius: 999px; color: #fff; font-size: .65rem; font-variant-numeric: tabular-nums; font-weight: 700; line-height: 1; min-width: 1.15rem; padding: .15rem .25rem; position: absolute; right: -.35rem; text-align: center; top: -.35rem; }
.notification-mobile-toggle { align-items: center; display: flex; gap: .5rem; text-align: left; width: 100%; }
.notification-mobile-toggle .notification-badge { margin-left: auto; position: static; }
.notification-panel-mobile { border: 1px solid var(--sx-border); border-radius: var(--sx-radius-sm); margin: .25rem 0 .5rem; padding: .75rem; }
.notification-see-all { border-top: 1px solid var(--sx-border); margin-top: .25rem; padding-top: .6rem; text-align: center; }
.notification-page-list { overflow: hidden; }
.notification-page-list .notification-item { padding: .9rem 1rem; }

@media (max-width: 767.98px) {
  .notification-dropdown-menu { min-width: min(22.5rem, calc(100vw - 1rem)); }
  .notification-panel-header { gap: .4rem; }
  .notification-panel-header-row { gap: .5rem; }
  .notification-panel-header-row > strong { font-size: .82rem; }
  .notification-tabs { gap: .1rem; padding: .1rem; }
  .notification-tabs .nav-link { font-size: .75rem; padding: .25rem .45rem; }
  .notification-read-all { flex: 0 0 auto; font-size: .63rem; white-space: nowrap; }
  .notification-list { max-height: calc(70vh - 5rem); }
}

/* Phase 24: the sidebar reads as three zones — navigate, work, configure.
   Spacing alone did not separate them at a glance. */
.sidebar-divider { height: 1px; background: var(--sx-border); margin: .6rem .35rem; border: 0; }
