:root {
  --sidebar-width: 272px;
  --sidebar-collapsed-width: 76px;
  --border: #d9dee7;
  --surface: #ffffff;
  --surface-muted: #f4f7fb;
  --text: #1f2937;
  --sidebar-bg: #111c3a;
  --sidebar-bg-strong: #0b1328;
  --sidebar-border: rgba(148, 163, 184, .22);
  --sidebar-link: #cbd5e1;
  --sidebar-link-muted: #94a3b8;
  --sidebar-link-active: #ecfdf5;
  --sidebar-link-active-bg: rgba(16, 185, 129, .18);
  --sidebar-link-hover-bg: rgba(99, 102, 241, .18);
}

[data-bs-theme="dark"] {
  --border: #334155;
  --surface: #111827;
  --surface-muted: #0f172a;
  --text: #e5e7eb;
}

body {
  background: var(--surface-muted);
  color: var(--text);
}

.app-frame {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--sidebar-bg), var(--sidebar-bg-strong));
  border-right: 1px solid var(--sidebar-border);
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1030;
  transition: transform .2s ease, width .2s ease;
  overflow-x: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  height: 64px;
  padding: 0 1rem;
  border-bottom: 1px solid var(--sidebar-border);
  color: #f8fafc;
  font-weight: 700;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #10b981;
  color: white;
  font-weight: 800;
}

.brand-logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
}

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

.sidebar-nav {
  padding: .75rem;
}

.sidebar-section-title {
  color: var(--sidebar-link-muted);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 1;
  margin: 1rem .8rem .45rem;
  text-transform: uppercase;
}

.sidebar-section-title:first-child {
  margin-top: .25rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: var(--sidebar-link);
  text-decoration: none;
  padding: .72rem .8rem;
  border-radius: 8px;
  margin-bottom: .15rem;
}

.sidebar-link.active,
.sidebar-link:hover {
  background: var(--sidebar-link-hover-bg);
  color: #ffffff;
}

.sidebar-link.active {
  background: var(--sidebar-link-active-bg);
  color: var(--sidebar-link-active);
}

.sidebar-link i {
  color: var(--sidebar-link-muted);
  flex: 0 0 1.25rem;
  text-align: center;
}

.sidebar-link.active i,
.sidebar-link:hover i {
  color: #34d399;
}

[data-bs-theme="dark"] .sidebar-link.active,
[data-bs-theme="dark"] .sidebar-link:hover {
  background: var(--sidebar-link-active-bg);
  color: var(--sidebar-link-active);
}

.app-main {
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  min-height: 100vh;
  transition: margin-left .2s ease, width .2s ease;
}

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

body.sidebar-collapsed .sidebar-brand {
  justify-content: center;
  padding-left: .5rem;
  padding-right: .5rem;
}

body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .sidebar-section-title,
body.sidebar-collapsed .sidebar-link span {
  display: none;
}

body.sidebar-collapsed .sidebar-link {
  justify-content: center;
  padding-left: .65rem;
  padding-right: .65rem;
}

body.sidebar-collapsed .app-main {
  margin-left: var(--sidebar-collapsed-width);
  width: calc(100% - var(--sidebar-collapsed-width));
}

.topbar {
  height: 64px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1020;
}

.btn-icon {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
}

.btn.is-loading {
  align-items: center;
  display: inline-flex;
  gap: .45rem;
  justify-content: center;
  pointer-events: none;
}

.btn-icon.is-loading {
  gap: 0;
}

.btn-icon.is-loading > :not(.btn-loading-spinner) {
  display: none;
}

.btn-loading-spinner {
  flex: 0 0 auto;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  border: 1px solid var(--border);
}

.avatar {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: #2f6f4e;
  color: white;
}

.notification-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d6336c;
  top: 9px;
  right: 9px;
}

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

.page-head h1 {
  font-size: 1.6rem;
  margin: 0;
}

.page-head p {
  color: #667085;
  margin: .25rem 0 0;
}

.panel,
.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 0;
  padding: 1rem;
}

.panel h2 {
  font-size: 1rem;
  margin-bottom: 1rem;
}

.user-guide-shell {
  overflow: hidden;
}

.user-guide-tabs {
  gap: .5rem;
}

.user-guide-tabs .nav-link {
  align-items: center;
  border: 1px solid var(--border);
  color: var(--text);
  display: inline-flex;
  font-weight: 700;
}

.user-guide-tabs .nav-link.active {
  background: #2454a6;
  border-color: #2454a6;
  color: #ffffff;
}

.user-guide-role-head {
  align-items: start;
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.user-guide-role-head h2 {
  font-size: 1.35rem;
  margin: .2rem 0 .35rem;
}

.user-guide-role-head p {
  color: #667085;
  margin: 0;
}

.user-guide-role-icon {
  background: #e9f2ff;
  border: 1px solid #bdd7ff;
  border-radius: 8px;
  color: #174ea6;
  display: grid;
  flex: 0 0 48px;
  font-size: 1.4rem;
  height: 48px;
  place-items: center;
}

.user-guide-focus {
  align-items: start;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  gap: .6rem;
  min-height: 74px;
  padding: .85rem;
}

.user-guide-focus i {
  color: #17613a;
  flex: 0 0 auto;
}

.user-guide-focus span {
  font-weight: 700;
  line-height: 1.35;
}

.user-guide-steps {
  display: grid;
  gap: 1rem;
}

.user-guide-step {
  align-items: start;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 1rem;
  grid-template-columns: auto 1fr;
  padding: 1rem;
}

.user-guide-step-number {
  background: #111c3a;
  border-radius: 8px;
  color: #ffffff;
  display: grid;
  font-weight: 800;
  height: 34px;
  place-items: center;
  width: 34px;
}

.user-guide-step-body h3 {
  font-size: 1rem;
  margin-bottom: .65rem;
}

.user-guide-step-body ol {
  margin-bottom: 0;
  padding-left: 1.2rem;
}

.user-guide-step-body li + li {
  margin-top: .35rem;
}

.user-guide-section-head {
  margin-bottom: 1rem;
}

.user-guide-section-head h2 {
  font-size: 1.25rem;
  margin: .2rem 0 .35rem;
}

.user-guide-section-head p {
  color: #667085;
  margin: 0;
}

.user-guide-operation-grid {
  display: grid;
  gap: 1rem;
}

.user-guide-operation {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
}

.user-guide-operation-head {
  align-items: center;
  display: flex;
  gap: .85rem;
  margin-bottom: 1rem;
}

.user-guide-operation-head h3 {
  font-size: 1.05rem;
  margin: 0 0 .2rem;
}

.user-guide-operation-head span {
  color: #667085;
  font-size: .9rem;
}

.user-guide-operation h4 {
  font-size: .9rem;
  margin-bottom: .7rem;
}

.user-guide-checklist {
  margin-bottom: 0;
  padding-left: 1.2rem;
}

.user-guide-checklist li + li {
  margin-top: .4rem;
}

.user-guide-rule-list {
  display: grid;
  gap: .5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.user-guide-rule-list li {
  align-items: start;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  gap: .55rem;
  padding: .65rem;
}

.user-guide-rule-list i {
  color: #8a4b00;
  flex: 0 0 auto;
}

.dashboard-chart-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-chart {
  box-shadow: 0 14px 34px rgba(15, 23, 42, .06);
  overflow: hidden;
  padding: 1.1rem;
}

.dashboard-chart-feature {
  min-height: 360px;
}

.dashboard-chart-head {
  align-items: start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.dashboard-chart-head span {
  color: #667085;
  display: block;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 1;
  margin-bottom: .45rem;
  text-transform: uppercase;
}

.dashboard-chart-head h2 {
  font-size: 1.05rem;
  line-height: 1.25;
  margin: 0;
}

.dashboard-chart-head strong {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: .95rem;
  line-height: 1;
  padding: .55rem .65rem;
  white-space: nowrap;
}

.dashboard-chart-body {
  height: 240px;
  min-width: 0;
  position: relative;
}

.dashboard-chart-feature .dashboard-chart-body {
  height: 285px;
}

.dashboard-chart canvas {
  display: block;
  max-width: 100%;
}

.asset-form,
.sectioned-form {
  display: grid;
  gap: 1rem;
}

.form-section {
  margin: 0;
}

.form-section h2 {
  font-size: .95rem;
  margin-bottom: .85rem;
  color: var(--text);
}

.product-detail-label {
  min-height: 2.35rem;
  white-space: pre-wrap;
}

.product-detail-label-multiline {
  min-height: 6rem;
}

.select2-lite {
  position: relative;
}

.select2-lite i {
  color: #667085;
  left: .75rem;
  pointer-events: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}

.select2-lite .form-control {
  padding-left: 2.15rem;
}

.choice-lite-native {
  border: 0 !important;
  height: 1px !important;
  opacity: 0 !important;
  padding: 0 !important;
  pointer-events: none;
  position: absolute !important;
  width: 1px !important;
}

.choice-lite {
  position: relative;
}

.choice-lite-control {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  min-height: 38px;
  overflow: hidden;
}

.choice-lite-sm .choice-lite-control {
  min-height: 31px;
}

.choice-lite-sm .choice-lite-search {
  font-size: .875rem;
  padding-bottom: .25rem;
  padding-top: .25rem;
}

.choice-lite-sm .choice-lite-toggle {
  flex-basis: 32px;
}

.choice-lite:focus-within .choice-lite-control {
  border-color: #86b7fe;
  box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .25);
}

.choice-lite.is-invalid .choice-lite-control {
  border-color: #dc3545;
}

.choice-lite-search {
  background: transparent;
  border: 0;
  color: var(--text);
  flex: 1 1 auto;
  min-width: 0;
  outline: 0;
  padding: .375rem .65rem;
}

.select2-lite .choice-lite-search {
  padding-left: 2.15rem;
}

.choice-lite-toggle {
  align-self: stretch;
  background: transparent;
  border: 0;
  border-left: 1px solid var(--border);
  color: #667085;
  display: grid;
  flex: 0 0 38px;
  place-items: center;
}

.choice-lite-menu {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, .14);
  display: none;
  max-height: 240px;
  overflow-y: auto;
  padding: .35rem;
  position: fixed;
  z-index: 2147483647;
}

.choice-lite-drop-up .choice-lite-menu {
  top: auto;
}

.choice-lite.is-open .choice-lite-menu {
  display: block;
}

.purchase-receipt-lines-wrap {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
}

.purchase-receipt-lines-wrap table,
.purchase-receipt-lines-wrap td,
.purchase-receipt-lines-wrap th {
  overflow: visible;
}

.purchase-receipt-lines-wrap .choice-lite-menu {
  z-index: 2147483647;
}

.purchase-receipt-lines-table {
  min-width: 100%;
  width: max-content;
}

.purchase-receipt-lines-table {
  --receipt-col-1-width: 180px;
  --receipt-col-2-left: 180px;
}

.purchase-receipt-lines-table > :is(thead, tbody) > tr > :nth-child(1) {
  min-width: var(--receipt-col-1-width);
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--surface);
}

.purchase-receipt-lines-table > :is(thead, tbody) > tr > :nth-child(2) {
  min-width: 220px;
  position: sticky;
  left: var(--receipt-col-2-left);
  z-index: 3;
  background: var(--surface);
}

.purchase-receipt-lines-table > thead > tr > :nth-child(1),
.purchase-receipt-lines-table > thead > tr > :nth-child(2) {
  z-index: 4;
}

.purchase-receipt-lines-table > :is(thead, tbody) > tr > :nth-child(2) {
  box-shadow: 2px 0 0 var(--border);
}

.payment-voucher-lines-wrap {
  overflow: visible;
}

.payment-voucher-lines-wrap table,
.payment-voucher-lines-wrap td,
.payment-voucher-lines-wrap th {
  overflow: visible;
}

.payment-voucher-lines-wrap .choice-lite-menu {
  z-index: 2147483647;
}

#paymentVoucherModal .modal-content,
#paymentVoucherModal .modal-body {
  overflow: visible;
}

#paymentVoucherModal .choice-lite-menu {
  z-index: 2147483647;
}

.purchase-receipt-lines-table [data-receipt-unit-price] {
  min-width: 150px;
}

.purchase-receipt-lines-table [data-receipt-qty] {
  min-width: 110px;
}

.receipt-grand-total {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-weight: 700;
  padding: .5rem .75rem;
}

.purchase-receipt-modal-dialog {
  max-width: min(1700px, 96vw);
}

.purchase-receipt-modal-dialog .modal-content {
  min-height: min(86vh, 980px);
}

.purchase-receipt-modal-dialog .modal-body {
  max-height: min(78vh, 860px);
}

#purchaseReceiptModal .modal-content,
#purchaseReceiptModal .modal-body {
  overflow: visible;
}

#purchaseReceiptModal .choice-lite-menu {
  z-index: 1300;
}

.choice-lite-option {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--text);
  display: block;
  padding: .45rem .55rem;
  text-align: left;
  width: 100%;
}

.choice-lite-option:hover,
.choice-lite-option.is-active {
  background: #e9f2ff;
  color: #174ea6;
}

.choice-lite-option[aria-selected="true"] {
  font-weight: 700;
}

.choice-lite-empty {
  color: #667085;
  padding: .55rem;
}

.asset-tag-preview {
  max-height: 120px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .75rem;
  background: var(--surface-muted);
  font-size: .9rem;
  word-break: break-word;
}

.asset-tags-preview-table {
  min-width: 1040px;
}

.asset-tags-table-wrap {
  overflow: visible;
}

.asset-tree-tag {
  align-items: center;
  display: inline-flex;
  gap: .5rem;
  min-height: 2.25rem;
  white-space: nowrap;
}

.asset-tree-toggle {
  border-radius: 6px;
  height: 2rem;
  width: 2rem;
}

.asset-tree-spacer {
  display: inline-block;
  flex: 0 0 2rem;
  height: 2rem;
}

.asset-tree-count {
  border: 1px solid var(--border);
  color: #475467;
  font-weight: 700;
}

.asset-tree-child td {
  background: var(--surface-muted);
  border-top-color: rgba(152, 162, 179, .22);
}

.asset-tree-child-row td {
  background: var(--surface-muted);
  padding: 0;
}

.asset-tree-child-panel {
  border-left: 3px solid #98a2b3;
  margin: .35rem 0 .35rem 1rem;
  padding-left: 1rem;
}

.asset-tree-child-table {
  min-width: 720px;
}

.asset-tree-child-table th {
  color: #667085;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.asset-tree-child-tag {
  padding-left: 2.5rem;
}

.asset-tree-branch {
  border-bottom: 1px solid #98a2b3;
  border-left: 1px solid #98a2b3;
  display: inline-block;
  flex: 0 0 1rem;
  height: 1.1rem;
  margin-top: -.55rem;
  width: 1rem;
}

[data-bs-theme="dark"] .asset-tree-count {
  background: #1f2937;
  color: #d1d5db;
}

.asset-tag-column-filters th {
  padding-top: 0;
}

.asset-tag-column-filters .form-control {
  min-width: 8rem;
}

.tag-condition-select {
  min-width: 8rem;
}

.asset-tag-deleted-row {
  opacity: .72;
}

.asset-tag-deleted-row td {
  background: var(--surface-muted);
}

.asset-tag-qr,
.asset-tag-qr canvas,
.asset-tag-qr img {
  width: 92px !important;
  height: 92px !important;
}

.asset-tag-detail-card .qr-box,
.asset-tag-detail-card .qr-box canvas,
.asset-tag-detail-card .qr-box img {
  width: 170px !important;
  height: 170px !important;
}

.tag-status-select {
  min-width: 9rem;
}

.tag-autosave-status {
  color: #667085;
  font-size: .8rem;
  min-width: 3.2rem;
  text-align: right;
}

.tag-autosave-status.is-saving {
  color: #2454a6;
}

.tag-autosave-status.is-saved {
  color: #17613a;
}

.tag-autosave-status.is-error {
  color: #842029;
}

.audit-items-table {
  min-width: 1040px;
}

.sortable-column {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.sortable-column::after {
  content: " \2195";
  color: #98a2b3;
  font-size: .75rem;
}

.sortable-column[data-sort-dir="asc"]::after {
  content: " \2191";
  color: #2454a6;
}

.sortable-column[data-sort-dir="desc"]::after {
  content: " \2193";
  color: #2454a6;
}

.datatable-column-filters th {
  padding-top: 0;
  vertical-align: middle;
}

.datatable-column-filters .datatable-check-filter {
  width: 100%;
}

.datatable-shell,
.datatable-shell .dt-container {
  max-width: 100%;
  min-width: 0;
  overflow: visible;
  width: 100%;
}

.dt-container,
.dt-container .dt-layout-row,
.dt-container .dt-scroll,
.dt-container .dt-scroll-head,
.dt-container .dt-scroll-headInner,
.dt-container table.dataTable {
  width: 100% !important;
}

.dt-container .dt-scroll,
.dt-container .dt-scroll-head,
.dt-container .dt-scroll-headInner {
  overflow: visible !important;
}

.dt-container .dt-scroll-head {
  position: relative;
  z-index: 20;
}

.dt-container .dt-scroll-body {
  width: 100% !important;
}

.datatable-shell .dt-layout-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  justify-content: space-between;
  margin: 0 0 .75rem;
}

.datatable-shell .dt-layout-cell {
  width: auto;
}

.datatable-shell .dt-length,
.datatable-shell .dt-length label {
  align-items: center;
  display: inline-flex;
  flex-wrap: nowrap;
  gap: .4rem;
  white-space: nowrap;
}

.datatable-shell .dt-layout-cell.dt-end {
  margin-left: auto;
}

.datatable-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: .75rem;
}

.datatable-filter-toolbar {
  justify-content: flex-start;
  overflow: visible;
}

.datatable-filter-toolbar .datatable-column-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  width: 100%;
}

.datatable-filter-toolbar .datatable-column-filters > div {
  min-width: 9rem;
  width: auto;
}

.datatable-global-search {
  align-items: center;
  display: inline-flex;
  gap: .5rem;
}

.datatable-global-search input {
  width: 280px;
}

.datatable-shell .dt-search {
  display: none;
}

.datatable-shell .dt-search input {
  max-width: min(100%, 280px);
}

.datatable-column-filters input[type="search"] {
  min-width: 8rem;
}

.datatable-check-filter {
  width: 100%;
}

.datatable-check-filter-button {
  min-height: 31px;
  overflow: hidden;
  padding-left: .45rem;
  padding-right: 1.35rem;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dt-container .datatable-align-center,
.dt-container .datatable-align-center .dt-column-title,
.dt-container .datatable-align-center .datatable-check-filter-button {
  text-align: center !important;
}

.dt-container td.datatable-align-center,
.dt-container th.datatable-align-center {
  text-align: center !important;
}

.datatable-check-filter-menu {
  max-height: 280px;
  min-width: 190px;
  width: 210px;
  overflow: visible;
  z-index: 1080;
}

.datatable-check-filter-actions {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
}

.datatable-check-filter-options {
  max-height: 175px;
  overflow-y: auto;
}

.datatable-check-filter-option {
  align-items: center;
  display: flex;
  gap: .25rem;
  max-width: 100%;
  white-space: normal;
}

.datatable-check-filter-option .form-check-input {
  flex: 0 0 1em;
  height: 1em;
  margin-top: 0;
  min-width: 1em;
  width: 1em;
}

.metric-card {
  min-height: 128px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric-card i {
  font-size: 1.4rem;
  color: #2454a6;
}

.metric-card span {
  color: #667085;
  font-size: .85rem;
}

.metric-card strong {
  font-size: 1.35rem;
}

.auth-body {
  min-height: 100vh;
  background: linear-gradient(135deg, #eef4ff, #f7faf8);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.login-card {
  width: min(100%, 430px);
  background: white;
  border: 1px solid #d9dee7;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 20px 50px rgba(31, 41, 55, .08);
}

.empty-state,
.empty-inline {
  text-align: center;
  color: #667085;
  padding: 3rem 1rem;
}

.empty-state i {
  font-size: 2.5rem;
  color: #2454a6;
}

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

.detail-grid span {
  display: block;
  color: #667085;
  font-size: .8rem;
}

.detail-grid strong {
  display: block;
  word-break: break-word;
}

.asset-preview-backdrop {
  background: rgba(15, 23, 42, .38);
  inset: 0;
  position: fixed;
  z-index: 1085;
}

.asset-preview-drawer {
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -18px 0 42px rgba(15, 23, 42, .16);
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 100%;
  position: fixed;
  right: 0;
  top: 0;
  transform: translateX(100%);
  transition: transform .2s ease;
  width: min(100%, 460px);
  z-index: 1090;
}

.asset-preview-drawer.is-open {
  transform: translateX(0);
}

.asset-preview-drawer-header {
  align-items: start;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 1rem;
}

.asset-preview-drawer-header h2 {
  font-size: 1.05rem;
  margin: 0 0 .25rem;
}

.asset-preview-drawer-body {
  overflow-y: auto;
  padding: 1rem;
}

.asset-preview-photo {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  height: 180px;
  margin-bottom: 1rem;
  object-fit: contain;
  width: 100%;
}

.asset-preview-section {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  margin-top: 1rem;
}

.asset-preview-section h3 {
  font-size: .9rem;
  margin-bottom: .75rem;
}

.asset-preview-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

.asset-photo-preview {
  max-width: min(100%, 420px);
  max-height: 280px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
}

.asset-photo-preview-sm {
  width: 180px;
  height: 120px;
}

.asset-linked-file {
  display: grid;
  justify-items: start;
}

.church-logo-preview {
  width: min(100%, 240px);
  max-height: 160px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: .5rem;
}

.asset-photo-thumb {
  width: 56px;
  height: 42px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-muted);
}

.asset-photo-button {
  display: inline-flex;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.asset-photo-button:focus-visible {
  outline: 3px solid rgba(36, 84, 166, .35);
  outline-offset: 3px;
  border-radius: 6px;
}

.asset-photo-preview-modal {
  display: grid;
  place-items: center;
  min-height: min(70vh, 720px);
  background: var(--surface-muted);
}

.asset-photo-preview-modal img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 8px;
}

.asset-status-badge {
  border: 1px solid transparent;
  font-weight: 700;
}

.asset-status-available {
  background: #dff5e8;
  border-color: #a8e0bd;
  color: #17613a;
}

.asset-status-borrowed {
  background: #e4efff;
  border-color: #b8d4ff;
  color: #174ea6;
}

.asset-status-reserved {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #075985;
}

.asset-status-maintenance {
  background: #fff3cd;
  border-color: #ffd86a;
  color: #7a4f01;
}

.asset-status-dispose {
  background: #ede9fe;
  border-color: #c4b5fd;
  color: #5b21b6;
}

.asset-status-lost {
  background: #f8d7da;
  border-color: #f1aeb5;
  color: #842029;
}

.asset-status-moved {
  background: #cff4fc;
  border-color: #9eeaf9;
  color: #055160;
}

.asset-status-damaged {
  background: #ffe5d0;
  border-color: #ffbe85;
  color: #8a3c00;
}

.asset-status-other {
  background: #e9ecef;
  border-color: #ced4da;
  color: #343a40;
}

[data-bs-theme="dark"] .asset-status-available {
  background: #123524;
  border-color: #1d6f45;
  color: #a7f3c8;
}

[data-bs-theme="dark"] .asset-status-borrowed {
  background: #132a4f;
  border-color: #2454a6;
  color: #bfdbfe;
}

[data-bs-theme="dark"] .asset-status-reserved {
  background: #0c3147;
  border-color: #0ea5e9;
  color: #bae6fd;
}

[data-bs-theme="dark"] .asset-status-maintenance {
  background: #3d2f06;
  border-color: #9a6b00;
  color: #fde68a;
}

[data-bs-theme="dark"] .asset-status-dispose {
  background: #2e1f57;
  border-color: #6d4dcc;
  color: #ddd6fe;
}

[data-bs-theme="dark"] .asset-status-lost {
  background: #4a1219;
  border-color: #9f2736;
  color: #fecdd3;
}

[data-bs-theme="dark"] .asset-status-moved {
  background: #06343d;
  border-color: #087386;
  color: #a5f3fc;
}

[data-bs-theme="dark"] .asset-status-damaged {
  background: #452107;
  border-color: #a14d0a;
  color: #fed7aa;
}

[data-bs-theme="dark"] .asset-status-other {
  background: #263241;
  border-color: #465568;
  color: #e5e7eb;
}

.qr-box,
.asset-label [data-qr] {
  width: 170px;
  height: 170px;
}

.scanner-panel #reader {
  width: min(100%, 640px);
  margin: 0 auto;
}

#qrScannerReader {
  width: min(100%, 640px);
  min-height: 320px;
  margin: 0 auto;
}

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

.asset-label {
  background: white;
  color: #111827;
  border: 1px dashed #111827;
  border-radius: 6px;
  padding: .75rem;
  min-height: 250px;
  display: grid;
  place-items: center;
  text-align: center;
}

.asset-label span {
  font-size: .85rem;
}

@media (max-width: 991.98px) {
  .dashboard-chart-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-chart-feature,
  .dashboard-chart {
    min-height: 0;
  }
  .dashboard-chart-body,
  .dashboard-chart-feature .dashboard-chart-body {
    height: 250px;
  }
  .dashboard-chart-head {
    align-items: stretch;
    flex-direction: column;
  }
  .dashboard-chart-head strong {
    width: fit-content;
  }
  body.sidebar-collapsed .sidebar {
    width: var(--sidebar-width);
  }
  body.sidebar-collapsed .brand-text,
  body.sidebar-collapsed .sidebar-link span {
    display: inline;
  }
  body.sidebar-collapsed .sidebar-section-title {
    display: block;
  }
  body.sidebar-collapsed .sidebar-link {
    justify-content: flex-start;
    padding: .72rem .8rem;
  }
  .sidebar {
    transform: translateX(-100%);
  }
  body.sidebar-open .sidebar {
    transform: translateX(0);
  }
  .app-main {
    margin-left: 0;
    width: 100%;
  }
  body.sidebar-collapsed .app-main {
    margin-left: 0;
    width: 100%;
  }
  .page-head {
    flex-direction: column;
  }
}

@media (max-width: 575.98px) {
  .page-head > *,
  .datatable-shell,
  .datatable-shell .dt-container,
  .datatable-shell .dt-layout-row,
  .datatable-shell .dt-layout-cell {
    max-width: 100%;
    min-width: 0;
  }

  .datatable-shell {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .datatable-shell .dt-layout-cell {
    width: 100%;
  }

  .datatable-global-search {
    width: 100%;
  }

  .datatable-global-search input {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
  }

  .dt-container .dt-scroll,
  .dt-container .dt-scroll-head,
  .dt-container .dt-scroll-headInner {
    max-width: 100%;
    overflow: hidden !important;
  }

  .dt-container .dt-scroll-body {
    overflow-x: auto !important;
  }
}

@media print {
  .sidebar,
  .topbar,
  .footer,
  .page-head .btn {
    display: none !important;
  }
  .app-main {
    margin: 0;
    width: 100%;
  }
  .panel {
    border: 0;
  }
  [data-tag-selection-form] .d-flex:has([data-selected-tags-link]),
  [data-tag-pagination-controls],
  [data-select-all-tags],
  [data-tag-select],
  [data-select-visible-tags] {
    display: none !important;
  }
  .asset-tags-preview-table tr.d-none {
    display: table-row !important;
  }
  .asset-tags-preview-table {
    min-width: 0;
  }
}
