:root {
  --crm-purple-950: #21102f;
  --crm-purple-900: #301446;
  --crm-purple-800: #482064;
  --crm-purple-700: #67318a;
  --crm-purple-600: #7d42a2;
  --crm-purple-100: #f3ecf8;
  --crm-border: #e7e3ea;
  --crm-text: #2f2935;
  --crm-muted: #746d7b;
  --sidebar-width: 248px;
  --header-height: 62px;
}

#reconcile-workspace .list-group-item-action.active,
#reconcile-workspace .list-group-item-action.active .text-muted {
    color: #fff !important;
}

#reconcile-workspace .js-document-link,
#reconcile-workspace .js-document-link:visited {
    color: var(--bs-link-color);
}

#reconcile-workspace .list-group-item-action.active .js-document-link,
#reconcile-workspace .list-group-item-action.active .js-document-link:visited,
#reconcile-workspace .list-group-item-action.active .js-document-link:hover,
#reconcile-workspace .list-group-item-action.active .js-document-link:focus,
#reconcile-workspace .list-group-item-action.active .btn-link,
#reconcile-workspace .list-group-item-action.active .btn-link:hover,
#reconcile-workspace .list-group-item-action.active .btn-link:focus {
    color: #fff;
}

#reconcile-workspace .js-local-document.reconciliation-balanced:not(.active) {
    background-color: #d1e7dd;
}

#reconcile-workspace .js-local-document.reconciliation-variance:not(.active) {
    background-color: #f8d7da;
}

#reconcile-workspace .reconcile-document-card {
    min-height: 0;
    overflow: hidden;
}

#reconcile-workspace .reconcile-document-list {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

#reconcile-workspace .reconcile-preview-card {
    min-height: 0;
    overflow: hidden;
}

#reconcile-workspace .reconcile-preview-body {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

#reconcile-workspace .reconcile-action-card .card-header {
    padding: .5rem .75rem;
}

#reconcile-workspace .reconcile-action-card .card-body {
    padding: .625rem .75rem;
}

#reconcile-workspace .reconcile-action-card .form-label {
    margin-bottom: .2rem;
    font-size: .8rem;
}

#reconcile-workspace .reconcile-action-form,
#reconcile-workspace .reconcile-action-field {
    min-width: 0;
}

#reconcile-workspace .reconcile-action-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: .5rem;
}

#reconcile-workspace .reconcile-action-field {
    flex: 1 1 10rem;
}

#reconcile-workspace .reconcile-action-controls .btn {
    white-space: nowrap;
}

@media (min-width: 992px) {
    #reconcile-workspace .reconcile-classify-form {
        border-left: 1px solid var(--crm-border);
    }
}

@media (min-width: 992px) {
    #reconcile-workspace .reconcile-document-panels,
    #reconcile-workspace .reconcile-preview-panels {
        --bs-gutter-y: 0;
    }

    #reconcile-workspace .reconcile-document-panels {
        height: var(--reconcile-document-panels-height, auto);
        min-height: 190px;
        overflow: hidden;
    }

    #reconcile-workspace .reconcile-document-panels > [class*="col-"] {
        display: flex;
        height: 100%;
        min-height: 0;
    }

    #reconcile-workspace .reconcile-document-card {
        width: 100%;
        height: 100%;
        max-height: 100%;
    }

    #reconcile-workspace .reconcile-document-list {
        flex: 1 1 0;
        max-height: 100%;
    }

    #reconcile-workspace .reconcile-preview-panels {
        height: var(--reconcile-preview-panels-height, 180px);
        min-height: 180px;
        overflow: hidden;
    }

    #reconcile-workspace .reconcile-preview-panels > [class*="col-"] {
        display: flex;
        height: 100%;
        min-height: 0;
    }

    #reconcile-workspace .reconcile-preview-card {
        width: 100%;
        height: 100%;
    }

    #reconcile-workspace .reconcile-preview-body {
        flex: 1 1 0;
    }
}

.crm-tabs {
  gap: .25rem;
}

.crm-tabs .nav-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.crm-tab-content {
  padding-top: 1.5rem;
}

.crm-tab-count {
  min-width: 1.65rem;
  padding: .3em .55em;
  color: #fff;
  background-color: var(--crm-purple-700);
  font-size: .75em;
  font-variant-numeric: tabular-nums;
}

.crm-tabs .nav-link.active .crm-tab-count {
  background-color: var(--crm-purple-900);
}

.product-image-dropzone {
  display: grid;
  min-height: 120px;
  place-content: center;
  gap: .25rem;
  padding: 1.5rem;
  border: 2px dashed #cfc5d6;
  border-radius: .65rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}

.product-image-dropzone:hover,
.product-image-dropzone:focus-within,
.product-image-dropzone.is-drag-over {
  background: var(--crm-purple-100);
  border-color: var(--crm-purple-600);
}

.product-image-dropzone-title {
  color: var(--crm-purple-800);
  font-weight: 600;
}

.product-image-empty {
  margin-top: 1rem;
  padding: 1rem;
  color: var(--crm-muted);
  background: #f8f7f9;
  border-radius: .5rem;
  text-align: center;
}

.product-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 1rem;
}

.product-image-card {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--crm-border);
  border-radius: .65rem;
  box-shadow: 0 2px 8px rgba(38, 25, 49, .05);
}

.product-image-card[draggable="true"] {
  cursor: grab;
}

.product-image-card.is-dragging {
  opacity: .45;
}

.product-image-card.is-drag-target {
  outline: 2px solid var(--crm-purple-600);
  outline-offset: 2px;
}

.product-image-preview {
  aspect-ratio: 4 / 3;
  background: #f1eff3;
}

.product-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-image-info,
.product-image-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .65rem .75rem;
}

.product-image-info {
  align-items: flex-start;
  flex-direction: column;
  padding-bottom: .35rem;
}

.product-image-name {
  width: 100%;
  overflow: hidden;
  font-size: .82rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-image-size {
  color: var(--crm-muted);
  font-size: .72rem;
}

.product-image-actions {
  padding-top: .35rem;
}

.product-image-handle {
  color: var(--crm-muted);
  font-size: 1.1rem;
}

html {
  min-height: 100%;
  font-size: 14px;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--crm-text);
  background: #f6f5f8;
}

a {
  color: var(--crm-purple-700);
}

.app-shell {
  min-height: 100vh;
}

.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1040;
  width: var(--sidebar-width);
  overflow-x: hidden;
  overflow-y: auto;
  color: #fff;
  background: linear-gradient(180deg, var(--crm-purple-950) 0%, var(--crm-purple-800) 56%, var(--crm-purple-600) 100%);
  box-shadow: 4px 0 18px rgba(32, 15, 45, .18);
  transition: transform .22s ease;
}

.app-brand {
  display: flex;
  min-height: var(--header-height);
  align-items: center;
  gap: .75rem;
  padding: 0 1.15rem;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  text-decoration: none;
}

.app-brand:hover {
  color: #fff;
}

.brand-mark {
  display: inline-grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  color: var(--crm-purple-950);
  background: #fff;
  border-radius: 9px;
  font-size: .74rem;
  font-weight: 800;
}

.brand-text {
  white-space: nowrap;
  font-size: 1rem;
  letter-spacing: .01em;
}

.brand-text strong {
  color: #d9b9f0;
}

.sidebar-nav {
  padding: .85rem 0;
}

.sidebar-link {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  gap: .85rem;
  padding: .7rem 1.15rem;
  color: rgba(255, 255, 255, .82);
  background: transparent;
  border: 0 !important;
  border-left: 3px solid transparent;
  text-align: left;
  text-decoration: none;
  transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}

.sidebar-link:hover,
.sidebar-link:focus-visible,
.sidebar-link.is-active {
  color: #fff;
  background: rgba(255, 255, 255, .1);
  border-left-color: #c79be4;
  outline: none;
}

.sidebar-link.is-active {
  background: rgba(255, 255, 255, .16);
  font-weight: 600;
}

.sidebar-link svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: currentColor;
}

.sidebar-group-toggle[aria-expanded="true"] {
  color: #fff;
  background: rgba(255, 255, 255, .08);
}

.group-chevron {
  margin-left: auto;
  font-size: 1.35rem;
  line-height: 1;
  transform: rotate(90deg);
  transition: transform .15s ease;
}

.sidebar-group-toggle[aria-expanded="false"] .group-chevron {
  transform: rotate(0deg);
}

.sidebar-submenu {
  background: rgba(17, 6, 26, .2);
}

.sidebar-submenu .sidebar-link {
  padding-left: 3.35rem;
}

.submenu-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  background: #d5afea;
  border-radius: 50%;
}

.sidebar-section-label {
  padding: 1.3rem 1.3rem .45rem;
  color: rgba(255, 255, 255, .48);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.app-main {
  display: flex;
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  flex-direction: column;
  transition: margin-left .22s ease;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  display: flex;
  min-height: var(--header-height);
  align-items: center;
  justify-content: space-between;
  padding: 0 1.4rem;
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid var(--crm-border);
  box-shadow: 0 2px 10px rgba(38, 25, 49, .04);
}

.header-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: .85rem;
}

.header-title h1 {
  overflow: hidden;
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-toggle,
.user-menu {
  border: 0;
  background: transparent;
}

.menu-toggle {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--crm-muted);
  border-radius: 8px;
}

.menu-toggle:hover {
  color: var(--crm-purple-700);
  background: var(--crm-purple-100);
}

.menu-toggle svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .35rem .55rem;
  color: var(--crm-text);
  border-radius: 9px;
}

.user-menu:hover,
.user-menu[aria-expanded="true"] {
  background: var(--crm-purple-100);
}

.user-avatar {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #fff;
  background: var(--crm-purple-700);
  border-radius: 50%;
}

.user-avatar svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.user-name {
  max-width: 180px;
  overflow: hidden;
  font-size: .88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chevron {
  color: var(--crm-muted);
}

.office-status-item {
  display: flex;
  min-width: 230px;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-top: .65rem;
  padding-bottom: .65rem;
}

.office-status-item > span:first-child {
  display: flex;
  flex-direction: column;
}

.office-status-item strong {
  color: var(--crm-text);
  font-size: .86rem;
  font-weight: 600;
}

.office-status-item small {
  color: var(--crm-muted);
  font-size: .72rem;
}

.office-status-switch {
  position: relative;
  width: 34px;
  height: 19px;
  flex: 0 0 34px;
  background: #b9b3bd;
  border-radius: 999px;
  transition: background-color .15s ease;
}

.office-status-switch span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 13px;
  height: 13px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .15s ease;
}

.office-status-switch.is-active {
  background: var(--crm-purple-700);
}

.office-status-switch.is-active span {
  transform: translateX(15px);
}

.app-content {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 1.5rem;
  flex: 1;
}

.app-footer {
  padding: .8rem 1.5rem;
  color: var(--crm-muted);
  background: #fff;
  border-top: 1px solid var(--crm-border);
  font-size: .8rem;
  text-align: center;
}

.card {
  border-color: var(--crm-border);
  border-radius: 10px;
  box-shadow: 0 3px 14px rgba(38, 25, 49, .05);
}

.user-table thead th,
.product-table thead th,
.offer-table thead th,
.offer-history-table thead th {
  padding: .85rem 1rem;
  color: var(--crm-muted);
  background: #faf9fb;
  border-bottom-color: var(--crm-border);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.user-table tbody td,
.product-table tbody td,
.offer-table tbody td,
.offer-history-table tbody td {
  padding: .9rem 1rem;
  border-color: #eeeaf1;
}

.offer-expired td {
  color: var(--crm-muted);
  background: #faf9fb;
}

.product-offer-expired td {
  background: #fff1f1;
}

.product-offer-row {
  cursor: pointer;
}

.product-offer-row:hover td,
.product-offer-row:focus td {
  background: var(--crm-purple-100);
}

.product-offer-row:focus {
  outline: 2px solid var(--crm-purple-500);
  outline-offset: -2px;
}

.offer-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.offer-detail-grid > div {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--crm-border);
}

.offer-detail-grid dt {
  margin-bottom: .3rem;
  color: var(--crm-muted);
  font-size: .72rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.offer-detail-grid dd {
  margin: 0;
}

.offer-detail-notes {
  grid-column: 1 / -1;
  white-space: pre-wrap;
}

.offer-history-action {
  display: inline-flex;
  padding: .25rem .55rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
}

.offer-history-action-created {
  color: var(--crm-purple-800);
  background: var(--crm-purple-100);
}

.offer-history-action-confirmed {
  color: #18613c;
  background: #e4f5ec;
}

.offer-history-action-expired {
  color: #7a3030;
  background: #f9e7e7;
}

.autocomplete {
  position: relative;
}

.autocomplete-results {
  position: absolute;
  z-index: 1080;
  top: calc(100% + .25rem);
  right: 0;
  left: 0;
  max-height: 16rem;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--crm-border);
  border-radius: .375rem;
  box-shadow: 0 .5rem 1rem rgba(38, 25, 49, .15);
}

.autocomplete-option,
.autocomplete-empty {
  display: block;
  width: 100%;
  padding: .65rem .75rem;
  text-align: left;
  background: #fff;
  border: 0;
}

.autocomplete-option:hover,
.autocomplete-option.is-active {
  background: var(--crm-purple-100);
}

.autocomplete-empty {
  color: var(--crm-muted);
}

.department-badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  margin: .1rem .2rem .1rem 0;
  padding: .25rem .55rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
}

.department-badge {
  color: var(--crm-purple-800);
  background: var(--crm-purple-100);
}

.status-badge.is-active {
  color: #18613c;
  background: #e4f5ec;
}

.status-badge.is-disabled {
  color: #7a3030;
  background: #f9e7e7;
}

.product-filter-card {
  border-color: var(--crm-border);
}

.product-description {
  min-width: 18rem;
  max-width: 32rem;
}

.stock-count {
  font-weight: 600;
}

.stock-info-button {
  display: inline-grid;
  width: 1.35rem;
  height: 1.35rem;
  margin-left: .25rem;
  padding: 0;
  place-items: center;
  color: var(--crm-purple-700);
  background: transparent;
  border: 0;
  border-radius: 50%;
  vertical-align: middle;
}

.stock-info-button:hover,
.stock-info-button:focus-visible {
  color: #fff;
  background: var(--crm-purple-700);
  outline: none;
}

.stock-info-button:focus-visible {
  box-shadow: 0 0 0 .2rem rgba(125, 66, 162, .2);
}

.stock-info-button svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.stock-popover {
  --bs-popover-max-width: 24rem;
  --bs-popover-header-bg: var(--crm-purple-100);
  --bs-popover-header-color: var(--crm-purple-900);
  box-shadow: 0 8px 24px rgba(38, 25, 49, .14);
}

.stock-breakdown {
  min-width: 18rem;
}

.stock-breakdown-row {
  display: grid;
  grid-template-columns: minmax(7rem, 1fr) minmax(5rem, auto) 3rem;
  gap: .75rem;
  align-items: center;
  padding: .4rem .15rem;
  border-bottom: 1px solid var(--crm-border);
}

.stock-breakdown-row:last-child {
  border-bottom: 0;
}

.stock-breakdown-row > :last-child {
  text-align: right;
}

.stock-breakdown-header {
  padding-top: 0;
  color: var(--crm-muted);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

div.dt-button-collection {
  min-width: 14rem;
  padding: .5rem;
}

div.dt-button-collection .dt-button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 2.5rem;
  padding: .5rem .75rem;
  color: var(--crm-text);
  background: #fff;
  border: 0;
  border-radius: .35rem;
  line-height: 1.25;
  text-align: left;
  box-shadow: none !important;
}

div.dt-button-collection .dt-button:hover,
div.dt-button-collection .dt-button:focus {
  color: var(--crm-purple-900);
  background: var(--crm-purple-100);
  border: 0 !important;
}

div.dt-button-collection .dt-button span {
  display: block;
  min-height: 1.25rem;
}

[data-data-table-toolbar] .dt-length,
[data-data-table-toolbar] .dt-length label,
[data-inventory-table-toolbar] .dt-length,
[data-inventory-table-toolbar] .dt-length label {
  flex-wrap: nowrap;
  white-space: nowrap;
}

.data-table-measuring-filters thead tr[data-dt-order="disable"] input:not([type="checkbox"]),
.data-table-measuring-filters thead tr[data-dt-order="disable"] select,
.data-table-measuring-filters thead tr[data-dt-order="disable"] textarea,
.data-table-measuring-filters thead tr[data-dt-order="disable"] button,
.data-table-measuring-filters thead tr[data-dt-order="disable"] .dropdown {
  width: 1px !important;
  min-width: 0 !important;
  max-width: 1px !important;
  padding-right: 0 !important;
  padding-left: 0 !important;
  overflow: hidden;
}

[data-data-table-toolbar] .dt-buttons .data-table-columns-button,
[data-inventory-table-toolbar] .dt-buttons .data-table-columns-button,
[data-data-table-toolbar] .dt-buttons .data-table-columns-button:hover,
[data-inventory-table-toolbar] .dt-buttons .data-table-columns-button:hover,
[data-data-table-toolbar] .dt-buttons .data-table-columns-button:focus,
[data-inventory-table-toolbar] .dt-buttons .data-table-columns-button:focus,
[data-data-table-toolbar] .dt-buttons .data-table-columns-button:active,
[data-inventory-table-toolbar] .dt-buttons .data-table-columns-button:active,
[data-data-table-toolbar] .dt-buttons .data-table-columns-button.active,
[data-inventory-table-toolbar] .dt-buttons .data-table-columns-button.active {
  margin: 0;
  padding: .25rem .5rem;
  color: #6c757d !important;
  background: #fff !important;
  border: var(--bs-border-width) solid #6c757d !important;
  border-radius: var(--bs-border-radius-sm);
  box-shadow: none !important;
  font-size: .875rem;
  line-height: 1.5;
}

[data-data-table-toolbar] .dt-buttons .data-table-columns-button:hover,
[data-inventory-table-toolbar] .dt-buttons .data-table-columns-button:hover,
[data-data-table-toolbar] .dt-buttons .data-table-columns-button:focus,
[data-inventory-table-toolbar] .dt-buttons .data-table-columns-button:focus {
  color: #fff !important;
  background: #6c757d !important;
  border-color: #6c757d !important;
}

[data-data-table-toolbar] .dt-buttons .data-table-columns-button span,
[data-inventory-table-toolbar] .dt-buttons .data-table-columns-button span {
  color: inherit !important;
}

.inventory-data-table-search,
.data-table-search {
  flex: 1 1 19.2rem;
  min-width: min(100%, 12rem);
  max-width: 38.4rem;
}

.data-table-page-layout {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

.data-table-page-layout .app-content {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}

.data-table-page-layout .app-content > .mb-4 {
  flex: 0 0 auto;
  margin-bottom: 1rem !important;
}

.data-table-viewport-card {
  display: flex;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}

.data-table-viewport-body,
.data-table-viewport-region,
.data-table-viewport-card .dt-container {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.data-table-viewport-body,
.data-table-viewport-card .dt-layout-table,
.data-table-viewport-card .dt-layout-table > .dt-layout-cell,
.data-table-viewport-card .dt-scroll {
  overflow: hidden;
}

.data-table-viewport-card .dt-layout-table {
  min-height: 0;
  flex: 1;
}

.data-table-viewport-card .dt-layout-table > .dt-layout-cell,
.data-table-viewport-card .dt-scroll {
  display: flex;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.data-table-viewport-card .dt-scroll-body {
  height: auto !important;
  max-height: none !important;
  min-height: 0;
  flex: 1 1 0;
  overflow: auto !important;
  scrollbar-gutter: stable;
}

.data-table-viewport-card .dt-scroll-head {
  background: #fff;
}

.stock-location-data-tables {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  min-height: 0;
  flex: 1;
  align-items: stretch;
}

.stock-location-data-tables > .data-table-card {
  min-width: 0;
  min-height: 0;
}

.stock-location-data-tables .data-table-card .card-body,
.stock-location-data-tables .data-table-card .table-responsive,
.stock-location-data-tables .data-table-card .dt-container {
  min-width: 0;
}

.stock-location-data-tables .data-table-card .dt-scroll-body {
  overflow: auto !important;
}

@media (max-width: 991.98px) {
  .stock-location-data-tables {
    grid-template-columns: minmax(0, 1fr);
  }
}

.inventory-data-table-card {
  display: flex;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}

.app-main.inventory-page-layout {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

.inventory-page-layout .app-content {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}

.inventory-page-heading {
  flex: 0 0 auto;
  margin-bottom: 1rem;
}

.inventory-data-table-card .card-body,
.inventory-data-table-region,
.inventory-data-table-card .dt-container {
  min-width: 0;
}

.inventory-data-table-card .card-body {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}

.inventory-data-table-region {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.inventory-data-table-card .dt-container {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.inventory-data-table-card .dt-layout-table {
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.inventory-data-table-card .dt-layout-table > .dt-layout-cell,
.inventory-data-table-card .dt-scroll {
  min-height: 0;
}

.inventory-data-table-card .dt-layout-table > .dt-layout-cell {
  display: flex;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

.inventory-data-table-card .dt-scroll {
  display: flex;
  height: 100%;
  max-height: 100%;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}

.inventory-data-table-card .dt-scroll-body {
  height: auto !important;
  max-height: none !important;
  min-height: 0;
  flex: 1 1 0;
  overflow: auto !important;
  scrollbar-gutter: stable;
}

.inventory-data-table-card .dt-scroll-head {
  background: #fff;
}

.inventory-search-button {
  color: var(--bs-secondary-color);
  background: #fff;
  border: var(--bs-border-width) solid var(--bs-border-color);
}

.inventory-search-button:hover,
.inventory-search-button:focus {
  color: #fff;
  background: #6c757d;
  border-color: #6c757d;
}

.product-kind-badge {
  display: inline-flex;
  margin-left: .45rem;
  padding: .2rem .45rem;
  color: var(--crm-purple-800);
  background: var(--crm-purple-100);
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 700;
  vertical-align: middle;
}

.product-assembly-check {
  padding: .85rem .85rem .85rem 2.35rem;
  background: #faf9fb;
  border: 1px solid var(--crm-border);
  border-radius: 8px;
}

.product-details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.product-details-grid > div,
.product-audit-list > div {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--crm-border);
}

.product-details-grid dt,
.product-audit-list dt {
  margin-bottom: .3rem;
  color: var(--crm-muted);
  font-size: .72rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.product-details-grid dd,
.product-audit-list dd {
  margin: 0;
}

.product-audit-list {
  display: grid;
  gap: 1rem;
}

.product-audit-list > div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.product-tab-loading {
  display: flex;
  min-height: 12rem;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  color: var(--crm-muted);
}

.product-price-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--crm-border);
  border-radius: 10px;
  box-shadow: 0 3px 14px rgba(38, 25, 49, .05);
}

.product-price-summary > div {
  display: grid;
  gap: .3rem;
  padding: 1rem;
  border-right: 1px solid var(--crm-border);
}

.product-price-summary > div:last-child {
  border-right: 0;
}

.product-price-summary span {
  color: var(--crm-muted);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.product-price-summary strong {
  font-size: 1.05rem;
}

.product-insight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 21rem;
  gap: 1rem;
}

.product-insight-card {
  min-width: 0;
  height: 21rem;
  overflow: hidden;
}

.product-insight-current-stock {
  order: 1;
}

.product-insight-quote {
  order: 2;
}

.product-insight-sales {
  order: 3;
}

.product-insight-partner-stock {
  order: 4;
}

.product-insight-offer {
  order: 5;
}

.product-insight-purchase {
  order: 6;
}

.product-insight-card .card-header {
  flex: 0 0 auto;
}

.product-insight-scroll {
  min-height: 0;
  flex: 1;
  overflow: auto;
}

.product-insight-table {
  min-width: 100%;
  font-size: .78rem;
}

.product-insight-table thead th,
.product-inventory-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--crm-muted);
  background: #faf9fb;
  font-size: .68rem;
  letter-spacing: .03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.product-insight-empty {
  display: grid;
  min-height: 0;
  flex: 1;
  place-items: center;
  padding: 1.5rem;
  color: var(--crm-muted);
  background: #faf9fb;
  text-align: center;
}

.product-inventory-table-wrap {
  max-height: 65vh;
  overflow: auto;
}

.product-inventory-table {
  min-width: 70rem;
}

.user-detail-list {
  display: grid;
  gap: 1rem;
  margin: 0;
}

.user-detail-list > div {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--crm-border);
}

.user-detail-list > div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.user-detail-list dt {
  margin-bottom: .3rem;
  color: var(--crm-muted);
  font-size: .72rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.user-detail-list dd {
  margin: 0;
}

.user-detail-list code {
  color: var(--crm-purple-800);
  overflow-wrap: anywhere;
  user-select: all;
}

.department-options {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
}

.department-option {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .65rem .8rem;
  background: #faf9fb;
  border: 1px solid var(--crm-border);
  border-radius: 8px;
  cursor: pointer;
}

.department-option:has(input:checked) {
  color: var(--crm-purple-800);
  background: var(--crm-purple-100);
  border-color: #cba9df;
}

.btn-primary {
  background-color: var(--crm-purple-700);
  border-color: var(--crm-purple-700);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--crm-purple-800);
  border-color: var(--crm-purple-800);
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus,
.btn:focus-visible {
  border-color: #a874c8;
  box-shadow: 0 0 0 .2rem rgba(103, 49, 138, .18);
}

.tracking-page {
  display: grid;
  gap: 1.25rem;
}

.tracking-search-card,
.tracking-result-card {
  border: 1px solid var(--crm-border);
  box-shadow: 0 5px 18px rgba(38, 25, 49, .05);
}

.tracking-intro {
  margin-bottom: 1.25rem;
  color: var(--crm-muted);
}

.tracking-fallback {
  margin: 0;
}

.tracking-fallback a {
  font-weight: 600;
}

.tracking-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--crm-border);
}

.tracking-carrier {
  color: var(--crm-purple-700);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.tracking-summary h2 {
  margin: .25rem 0;
  font-size: 1.35rem;
}

.tracking-summary p {
  margin: 0;
  color: var(--crm-muted);
}

.tracking-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.25rem 0 0;
}

.tracking-meta dt {
  margin-bottom: .25rem;
  color: var(--crm-muted);
  font-size: .7rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.tracking-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 600;
}

.tracking-events-section {
  margin-top: 1.75rem;
}

.tracking-events-section h3 {
  margin-bottom: 1rem;
  font-size: 1rem;
}

.tracking-events {
  margin: 0;
  padding: 0;
  list-style: none;
}

.tracking-events li {
  position: relative;
  display: flex;
  gap: .9rem;
  padding: 0 0 1.25rem;
}

.tracking-events li:not(:last-child)::before {
  position: absolute;
  top: 11px;
  bottom: -1px;
  left: 5px;
  width: 2px;
  background: #ded2e6;
  content: "";
}

.tracking-event-marker {
  position: relative;
  z-index: 1;
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  margin-top: 4px;
  background: var(--crm-purple-600);
  border: 3px solid var(--crm-purple-100);
  border-radius: 50%;
}

.tracking-events strong,
.tracking-events span {
  display: block;
}

.tracking-events span {
  margin-top: .2rem;
  color: var(--crm-muted);
  font-size: .8rem;
}

.app-shell.sidebar-collapsed .app-sidebar {
  transform: translateX(calc(-1 * var(--sidebar-width)));
}

.app-shell.sidebar-collapsed .app-main {
  margin-left: 0;
}

.sidebar-backdrop {
  display: none;
}

@media (max-width: 767.98px) {
  .app-sidebar {
    transform: translateX(calc(-1 * var(--sidebar-width)));
  }

  .app-main {
    margin-left: 0;
  }

  .app-shell.sidebar-open .app-sidebar {
    transform: translateX(0);
  }

  .app-shell.sidebar-open .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1035;
    display: block;
    background: rgba(20, 11, 26, .45);
  }

  .app-header,
  .app-content {
    padding-right: 1rem;
    padding-left: 1rem;
  }

  .user-name,
  .user-chevron {
    display: none;
  }

  .tracking-summary {
    flex-direction: column;
  }

  .tracking-meta {
    grid-template-columns: 1fr;
  }

  .product-details-grid {
    grid-template-columns: 1fr;
  }

  .offer-detail-grid {
    grid-template-columns: 1fr;
  }

  .offer-detail-notes {
    grid-column: auto;
  }

  .product-price-summary,
  .product-insight-grid {
    grid-template-columns: 1fr;
  }

  .product-price-summary > div {
    border-right: 0;
    border-bottom: 1px solid var(--crm-border);
  }

  .product-price-summary > div:last-child {
    border-bottom: 0;
  }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
  .product-price-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .product-insight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.login-page {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 16%, rgba(211, 161, 239, .28), transparent 27%),
    radial-gradient(circle at 82% 82%, rgba(129, 72, 169, .38), transparent 30%),
    linear-gradient(145deg, #1d0d2a 0%, #4b1f68 48%, #7c3fa1 100%);
}

.login-pattern {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.swirl {
  position: absolute;
  display: block;
  width: 520px;
  height: 520px;
  border: 2px solid rgba(255, 255, 255, .1);
  border-radius: 45% 55% 48% 52%;
  box-shadow:
    0 0 0 38px rgba(255, 255, 255, .025),
    0 0 0 78px rgba(255, 255, 255, .02),
    inset 0 0 80px rgba(255, 255, 255, .025);
  transform: rotate(28deg);
}

.swirl-one {
  top: -270px;
  left: -150px;
}

.swirl-two {
  right: -230px;
  bottom: -250px;
  width: 650px;
  height: 650px;
  transform: rotate(-32deg);
}

.swirl-three {
  top: 28%;
  left: 58%;
  width: 230px;
  height: 230px;
  opacity: .35;
  transform: rotate(58deg);
}

.login-shell {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 100vh;
  padding: 2rem 1rem;
  place-items: center;
}

.login-card {
  width: min(100%, 430px);
  padding: 2.5rem;
  background: rgba(255, 255, 255, .98);
  border: 1px solid rgba(255, 255, 255, .65);
  border-radius: 18px;
  box-shadow: 0 28px 70px rgba(21, 8, 31, .36);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 2.2rem;
  color: var(--crm-purple-950);
  font-size: 1.05rem;
  font-weight: 600;
}

.login-brand .brand-mark {
  color: #fff;
  background: var(--crm-purple-700);
}

.login-brand strong {
  color: var(--crm-purple-700);
}

.login-card h1 {
  margin-bottom: .5rem;
  color: var(--crm-purple-950);
  font-size: 1.75rem;
  font-weight: 700;
}

.login-card > p {
  margin-bottom: 1.75rem;
  color: var(--crm-muted);
}

.microsoft-login-button {
  display: flex;
  width: 100%;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: .8rem;
  padding: .75rem 1rem;
  color: #fff;
  background: var(--crm-purple-700);
  border: 1px solid var(--crm-purple-700);
  border-radius: 9px;
  font-weight: 600;
  transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease;
}

.microsoft-login-button:hover {
  background: var(--crm-purple-800);
  box-shadow: 0 8px 20px rgba(74, 31, 101, .22);
  transform: translateY(-1px);
}

.microsoft-login-button:focus-visible {
  outline: 3px solid rgba(126, 68, 164, .3);
  outline-offset: 3px;
}

.microsoft-mark {
  display: grid;
  width: 18px;
  height: 18px;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
}

.microsoft-mark i:nth-child(1) { background: #f35325; }
.microsoft-mark i:nth-child(2) { background: #81bc06; }
.microsoft-mark i:nth-child(3) { background: #05a6f0; }
.microsoft-mark i:nth-child(4) { background: #ffba08; }

.login-security {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  margin-top: 1.4rem;
  color: var(--crm-muted);
  font-size: .78rem;
  line-height: 1.45;
}

.login-security svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  fill: var(--crm-purple-600);
}

.permission-card {
  width: min(100%, 560px);
}

.permission-icon {
  display: grid;
  width: 52px;
  height: 52px;
  margin-bottom: 1.25rem;
  place-items: center;
  color: var(--crm-purple-700);
  background: var(--crm-purple-100);
  border: 1px solid #dcc8e9;
  border-radius: 50%;
  font-size: 1.5rem;
  font-weight: 800;
}

.permission-instructions {
  margin-top: -.5rem;
  font-size: .9rem;
}

.identity-details {
  display: grid;
  gap: .8rem;
  margin: 1.5rem 0;
}

.identity-details > div {
  padding: .85rem 1rem;
  background: #f7f4f9;
  border: 1px solid var(--crm-border);
  border-radius: 9px;
}

.identity-details dt {
  margin-bottom: .35rem;
  color: var(--crm-muted);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.identity-details dd {
  margin: 0;
}

.identity-details code {
  color: var(--crm-purple-800);
  font-size: .84rem;
  overflow-wrap: anywhere;
  user-select: all;
}

.permission-logout-button {
  width: 100%;
  min-height: 46px;
  color: var(--crm-purple-700);
  background: #fff;
  border: 1px solid var(--crm-purple-700);
  border-radius: 9px;
  font-weight: 600;
}

.permission-logout-button:hover {
  color: #fff;
  background: var(--crm-purple-700);
}

@media (max-width: 479.98px) {
  .login-card {
    padding: 2rem 1.4rem;
  }
}
