/* Custom styles goes here */

/* Entry forms keep their loading explanation visible beside the progress spinner. */
form[data-auth-form] .btn.is-submitting {
  color: var(--bs-btn-color) !important;
  padding-inline-end: 44px;
}

form[data-auth-form] .btn.is-submitting::after {
  left: auto;
  right: 16px;
}

.app-brand-logo .store-brand-wordmark {
  width: 186px !important;
  max-width: 100%;
}

.store-brand-collapsed-icon {
  display: none;
  object-fit: contain;
}

@media (min-width: 1200px) {
  .layout-menu-collapsed:not(.layout-menu-hover) #layout-menu:not(:hover) .store-brand-wordmark {
    display: none;
  }

  .layout-menu-collapsed:not(.layout-menu-hover) #layout-menu:not(:hover) .store-brand-collapsed-icon {
    display: block;
  }
}

/* Shared brand states: filled controls and selected navigation use white text. */
.btn-outline-primary {
  --bs-btn-active-color: var(--bs-primary-contrast);
  --bs-btn-active-bg: var(--bs-primary);
  --bs-btn-active-border-color: var(--bs-primary);
}

.menu-item.active > .menu-link:not(.menu-toggle) {
  background: var(--bs-primary);
  color: var(--bs-primary-contrast);
}

.menu-item.active > .menu-link:not(.menu-toggle):hover,
.menu-item.active > .menu-link:not(.menu-toggle):focus,
.menu-item.active > .menu-link:not(.menu-toggle) .menu-icon {
  color: var(--bs-primary-contrast);
}

.brand-script {
  font-family: "Inter", sans-serif;
  font-weight: 400;
  letter-spacing: 0.5px;
  font-size: 1.35rem;
}

.app-brand-logo svg {
  width: 36px;
  height: 36px;
}

.navbar-user-identity {
  align-items: center;
  margin-right: 14px;
}

.navbar-user-summary {
  display: grid;
  justify-items: end;
  max-width: 190px;
  min-width: 0;
  color: inherit;
  line-height: 1.15;
  text-align: right;
  text-decoration: none;
}

.navbar-user-summary:hover,
.navbar-user-summary:focus {
  color: var(--bs-primary);
}

.navbar-user-name,
.navbar-user-role {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.navbar-user-name {
  color: var(--bs-heading-color, inherit);
  font-size: 0.9rem;
  font-weight: 700;
}

.navbar-user-role {
  color: var(--bs-secondary-color, #a8a3b9);
  font-size: 0.75rem;
  font-weight: 500;
}

.menu-header-strong {
  display: block;
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.6px;
}

.image-upload-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.image-tile {
  position: relative;
  width: 84px;
  height: 84px;
  flex: 0 0 auto;
}

.image-thumb {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  cursor: zoom-in;
  display: block;
}

.image-remove-check {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.image-remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: none;
  background: rgba(220, 53, 69, 0.9);
  color: #fff;
  font-size: 14px;
  line-height: 20px;
  text-align: center;
  cursor: pointer;
}

.image-tile.is-removed .image-thumb {
  opacity: 0.4;
  filter: grayscale(1);
}

.select2-container {
  width: 100% !important;
}

.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
  min-height: 40px;
  border: 1px solid var(--bs-border-color, #d9dee3);
  border-radius: 0.375rem;
  font-size: 0.95rem;
}

.select2-container--default .select2-selection--single {
  padding: 0.375rem 2rem 0.375rem 0.75rem;
  display: flex;
  align-items: center;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  padding: 0;
  line-height: 1.5;
  color: inherit;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 100%;
  right: 0.5rem;
}

.select2-container--default .select2-selection--multiple {
  padding: 0.25rem 0.5rem;
}

.select2-container--default .select2-selection--multiple .select2-selection__rendered {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
  margin: 0;
  border: 1px solid var(--bs-border-color, #d9dee3);
  background: #f5f7fb;
}

.select2-container--default .select2-search--inline .select2-search__field {
  height: 28px;
  margin: 2px 0 0 0;
}

.select2-dropdown {
  border-color: var(--bs-border-color, #d9dee3);
  border-radius: 0.375rem;
}

.quick-open.btn-outline-primary {
  border-color: transparent;
  box-shadow: none;
}

.quick-open.btn-outline-primary:hover,
.quick-open.btn-outline-primary:focus,
.quick-open.btn-outline-primary:active {
  border-color: transparent;
  box-shadow: none;
}

.input-validation-error {
  border-color: var(--bs-danger);
}

.field-validation-error,
.validation-summary-errors {
  color: var(--bs-danger);
}

.validation-summary-errors ul {
  margin-bottom: 0;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  width: 100%;
  max-width: 100%;
  overflow: visible;
}

.filter-bar > * {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.filter-date-range {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.filter-date-range .filter-input-group {
  min-width: 140px;
}

.filter-keyword {
  flex: 1 1 220px;
  min-width: 140px;
  max-width: 360px;
}

.filter-advanced {
  flex: 0 0 auto;
}

.filter-advanced .dropdown-menu {
  min-width: 380px;
  padding: 12px;
}

.filter-advanced .dropdown-menu .filter-advanced-grid {
  display: grid;
  gap: 8px;
  width: 100%;
  grid-template-columns: 1fr;
}

.filter-advanced .dropdown-menu .form-control,
.filter-advanced .dropdown-menu .form-select {
  width: 100%;
  min-width: 0;
  height: 34px;
  font-size: 0.875rem;
  padding-right: 2.1rem;
  line-height: 1.4;
  color: var(--bs-body-color, #2f2f2f);
  background-color: #fff;
}

.filter-advanced .dropdown-menu .form-select {
  background-position: right 0.65rem center;
  text-overflow: ellipsis;
}

.filter-advanced .dropdown-menu .form-select option {
  color: var(--bs-body-color, #2f2f2f);
}

.filter-advanced .dropdown-menu .form-label {
  font-size: 0.8rem;
  margin-bottom: 4px;
}

.action-buttons {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.action-buttons .btn {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.action-buttons .btn i {
  font-size: 16px;
}

.action-buttons form {
  margin: 0;
}

.action-buttons-compact .dropdown {
  display: inline-flex;
}

.action-buttons-compact .dropdown-menu {
  min-width: 128px;
}

.filter-actions .btn {
  min-width: 108px;
  white-space: nowrap;
}

.filter-actions .filter-advanced .btn {
  min-width: 96px;
}

.filter-control {
  height: 36px;
  min-height: 36px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.filter-control.form-control {
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

.filter-control.form-select {
  padding-top: 0.32rem;
  padding-bottom: 0.32rem;
}

.filter-input-group .input-group-text {
  height: 36px;
  font-size: 0.9rem;
}

.filter-input-group .form-control {
  height: 36px;
}

.filter-bar .btn {
  height: 36px;
  padding: 0 14px;
}

.filter-actions .btn {
  white-space: nowrap;
}

.filter-bar .segmented {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-bar .select2-container--default .select2-selection--single {
  min-height: 36px;
  padding: 0.25rem 2rem 0.25rem 0.6rem;
}

.filter-bar .select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 1.4;
}

.filter-bar .select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 36px;
}

.filter-input-group {
  min-width: 0;
}

.filter-compact {
  gap: 10px;
}

.filter-compact .btn {
  height: 34px;
  padding: 0 12px;
  font-size: 0.875rem;
}

.filter-compact .filter-actions {
  gap: 6px;
}

.filter-compact .filter-actions .btn {
  min-width: 96px;
  padding: 0 10px;
}

.filter-compact .filter-actions .filter-advanced .btn {
  min-width: 88px;
}

.filter-compact .filter-control,
.filter-compact .filter-input-group .input-group-text,
.filter-compact .filter-input-group .form-control {
  height: 34px;
  min-height: 34px;
  font-size: 0.875rem;
}

.filter-w-140 {
  flex: 0 1 140px !important;
  min-width: min(100%, 120px);
}

.filter-w-160 {
  flex: 0 1 160px !important;
  min-width: min(100%, 130px);
}

.filter-w-180 {
  flex: 0 1 180px !important;
  min-width: min(100%, 140px);
}

.filter-w-200 {
  flex: 0 1 200px !important;
  min-width: min(100%, 150px);
}

.filter-w-220 {
  flex: 0 1 220px !important;
  min-width: min(100%, 160px);
}

.filter-w-120 {
  flex: 0 1 120px !important;
  min-width: min(100%, 100px);
}

.filter-date-range.wide .filter-input-group {
  min-width: 170px;
}

.filter-stock .filter-date-range .filter-input-group {
  min-width: 120px;
}

.filter-stock .segmented .btn {
  padding: 0 10px;
  font-size: 0.82rem;
  border-color: var(--bs-primary);
  color: var(--bs-primary);
}

.filter-stock .segmented .btn:hover,
.filter-stock .segmented .btn:focus {
  border-color: var(--bs-primary);
  color: var(--bs-primary);
}

.filter-stock .filter-product {
  flex: 1 1 240px;
  min-width: 180px;
  max-width: 260px;
}

.filter-standard .filter-main-keyword {
  flex: 0 1 320px;
  min-width: 220px;
  max-width: 360px;
}

.filter-standard .filter-range-group {
  flex: 0 0 auto;
  width: auto;
  padding-top: 0;
}

.filter-sales .sales-keyword-filter {
  flex: 0 1 300px;
  min-width: 220px;
  max-width: 320px;
}

.filter-sales .sales-range-group {
  flex: 0 0 auto;
  width: auto;
  padding-top: 0;
}

.filter-customer-returns .customer-return-keyword-filter {
  flex: 0 1 360px;
  min-width: 240px;
  max-width: 420px;
}

.filter-customer-returns .customer-return-range-group {
  flex: 0 0 auto;
  width: auto;
  padding-top: 0;
}

@media (min-width: 1200px) {
  .filter-standard {
    flex-wrap: wrap;
  }

  .filter-standard .filter-actions {
    flex-wrap: nowrap;
  }

  .filter-sales {
    flex-wrap: wrap;
  }

  .filter-sales .filter-actions {
    flex-wrap: nowrap;
  }

  .filter-customer-returns {
    flex-wrap: wrap;
  }

  .filter-customer-returns .filter-actions {
    flex-wrap: nowrap;
  }
}

.filter-bar .filter-input-group {
  flex: 1 1 180px;
  max-width: 100%;
}

.filter-bar > .filter-actions {
  flex: 0 1 auto !important;
  max-width: 100%;
}

.filter-bar .form-control,
.filter-bar .form-select,
.filter-bar .select2-container {
  max-width: 100%;
}

.filter-bar.filter-standard .filter-main-keyword {
  flex: 0 1 320px;
  min-width: 220px;
  max-width: 360px;
}

.filter-bar.filter-standard .filter-range-group {
  flex: 0 0 auto;
  width: auto;
}

.filter-bar.filter-sales .sales-keyword-filter {
  flex: 0 1 370px;
  min-width: 280px;
  max-width: 390px;
}

.filter-bar.filter-sales .filter-actions {
  margin-left: 0;
  flex-wrap: nowrap;
  gap: 5px;
}

.filter-bar.filter-sales .report-filter-actions {
  margin-left: auto;
}

.filter-bar.filter-sales {
  column-gap: 12px;
  row-gap: 8px;
}

.filter-bar.filter-sales .sales-range-group {
  margin-right: 10px;
}

.filter-bar.filter-sales .sales-range-group .btn {
  padding: 0 10px;
}

.filter-bar.filter-sales .filter-actions .btn {
  min-width: 84px;
  padding: 0 9px;
  font-size: 0.85rem;
}

.filter-bar.filter-sales .filter-actions .filter-advanced .btn {
  min-width: 120px;
}

.filter-bar.filter-customer-returns .customer-return-keyword-filter {
  flex: 0 1 320px;
  min-width: 240px;
  max-width: 340px;
}

.sales-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--bs-border-color);
}

.sales-card-title {
  flex: 0 0 auto;
  min-width: 112px;
}

.sales-card-title h5 {
  font-size: 1.05rem;
  line-height: 1.2;
}

.sales-summary-strip {
  display: grid;
  grid-template-columns: 0.55fr 1.05fr 0.9fr 1.75fr;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.sales-summary-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  column-gap: 8px;
  min-width: 0;
  min-height: 44px;
  padding: 0.38rem 0.62rem;
  border-left: 0;
}

.sales-summary-item:first-child {
  border-left: 0;
}

.sales-summary-item span {
  color: var(--bs-secondary-color, #a8a3b9);
  font-size: 0.74rem;
  line-height: 1.15;
  white-space: nowrap;
}

.sales-summary-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 1.05rem;
}

.sales-summary-icon.text-primary {
  color: #0d6efd !important;
  background: rgba(13, 110, 253, 0.12);
  border-color: rgba(13, 110, 253, 0.18);
}

.sales-summary-icon.text-success {
  color: #008f45 !important;
  background: rgba(0, 143, 69, 0.12);
  border-color: rgba(0, 143, 69, 0.18);
}

.sales-summary-icon.text-info {
  color: #0aa2c0 !important;
  background: rgba(10, 162, 192, 0.12);
  border-color: rgba(10, 162, 192, 0.18);
}

.sales-summary-icon.text-warning {
  color: #b77900 !important;
  background: rgba(183, 121, 0, 0.14);
  border-color: rgba(183, 121, 0, 0.2);
}

.sales-summary-copy {
  min-width: 0;
}

.sales-summary-copy span,
.sales-summary-copy strong,
.sales-summary-copy small {
  display: block;
}

.sales-summary-item strong,
.sales-summary-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sales-summary-item strong {
  color: var(--bs-heading-color, inherit);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.25;
}

.sales-summary-item small {
  color: var(--bs-secondary-color, #a8a3b9);
  font-size: 0.78rem;
  line-height: 1.15;
}

.sales-summary-item-wide strong {
  font-size: 0.86rem;
}

.sales-summary-pair {
  display: flex;
  align-items: baseline;
  min-width: 0;
  gap: 10px;
}

.sales-summary-pair strong,
.sales-summary-pair small {
  min-width: 0;
}

.sales-summary-pair small {
  flex: 1 1 auto;
}

.sales-card-header .index-header-actions {
  flex: 0 0 auto;
  margin-left: 0;
}

.sales-card-header .index-header-actions .btn {
  height: 38px;
  display: inline-flex;
  align-items: center;
}

.sales-index-card .index-filter-body {
  padding-top: 1rem !important;
  padding-bottom: 0.85rem;
}

.report-index-card .sales-card-header {
  flex-wrap: wrap;
}

.report-index-card .index-header-actions {
  margin-left: auto;
}

.report-index-card .sales-summary-strip {
  order: 3;
  flex-basis: 100%;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.report-index-card .sales-summary-item {
  min-height: 48px;
}

.report-index-card .sales-summary-item strong {
  font-size: 0.9rem;
}

.report-index-card .sales-summary-pair {
  display: grid;
  align-items: start;
  gap: 1px;
}

@media (max-width: 1199.98px) {
  .sales-card-header {
    flex-wrap: wrap;
  }

  .sales-summary-strip {
    order: 3;
    flex-basis: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sales-summary-item:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--bs-border-color);
  }

  .sales-summary-item:nth-child(4) {
    border-top: 1px solid var(--bs-border-color);
  }
}

@media (min-width: 1200px) and (max-width: 1299.98px) {
  .sales-card-header {
    flex-wrap: wrap;
  }

  .sales-card-header .sales-summary-strip {
    order: 3;
    flex-basis: 100%;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .sales-card-header .sales-summary-pair {
    display: grid;
    align-items: start;
    gap: 1px;
  }
}

.index-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.index-card-title {
  flex: 1 1 220px;
  min-width: 180px;
}

.index-card-title h5 {
  line-height: 1.25;
}

.index-filter-body {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.active-filter-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.active-filter-label {
  color: var(--bs-secondary-color, #a8a3b9);
  font-size: 0.8rem;
  font-weight: 600;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid var(--bs-border-color, #d9dee3);
  border-radius: 999px;
  background: #fff;
  color: var(--bs-body-color, #2f2f2f);
  font-size: 0.8rem;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.filter-chip:hover,
.filter-chip:focus {
  border-color: var(--bs-primary);
  color: var(--bs-primary);
}

.filter-chip i {
  font-size: 0.95rem;
}

.filter-chip-clear {
  color: var(--bs-danger);
}

.index-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-left: auto;
}

.quick-range-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.quick-range-group .btn {
  height: 34px;
  padding: 0 12px;
  font-size: 0.875rem;
  white-space: nowrap;
}

.header-action-divider {
  width: 1px;
  height: 28px;
  background: var(--bs-border-color);
}

.index-kpi-row {
  --bs-gutter-x: 0.75rem;
  --bs-gutter-y: 0.75rem;
}

.index-kpi-row .card {
  border-radius: 0.5rem;
}

.index-kpi-row .card-body {
  min-height: 68px;
  padding: 0.65rem 0.9rem;
}

.index-kpi-icon {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 1.15rem;
}

.index-kpi-copy {
  min-width: 0;
}

.index-kpi-copy .text-body-secondary,
.index-kpi-copy h5 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.index-kpi-row .card-body > .d-flex.align-items-center.justify-content-between.mb-2 {
  margin-bottom: 0.25rem !important;
}

.index-kpi-row .text-body-secondary.small,
.index-kpi-row span.text-body-secondary {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.82rem;
}

.index-kpi-row h4,
.index-kpi-row h5,
.index-kpi-row h6 {
  line-height: 1.25;
}

.index-kpi-row h4 {
  font-size: 1.15rem;
}

.index-kpi-row h5 {
  font-size: 1.1rem;
}

.index-kpi-row h6 {
  font-size: 0.92rem;
}

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

.index-table > :not(caption) > * > * {
  padding-top: 0.58rem;
  padding-bottom: 0.58rem;
  vertical-align: middle;
}

.index-table thead th {
  white-space: nowrap;
  font-size: 0.78rem;
}

.index-table td {
  white-space: normal;
}

.table-responsive.text-nowrap .index-table td {
  white-space: normal !important;
}

.table-responsive.text-nowrap .index-table th,
.table-responsive.text-nowrap .index-table .cell-nowrap,
.table-responsive.text-nowrap .index-table .action-buttons {
  white-space: nowrap !important;
}

.index-table .cell-nowrap,
.index-table .action-buttons {
  white-space: nowrap;
}

.sales-table {
  min-width: 980px;
}

.sales-table > :not(caption) > * > * {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.sales-table .sales-col-stt {
  width: 58px;
}

.sales-table .sales-col-code {
  width: 84px;
}

.sales-table .sales-col-date {
  width: 118px;
}

.sales-table .sales-col-customer {
  width: 38%;
}

.sales-table .sales-col-payment {
  width: 240px;
}

.sales-table .sales-col-actions {
  width: 112px;
}

.sales-customer-cell {
  max-width: 420px;
}

.products-table {
  table-layout: fixed;
}

.products-table .product-name-cell {
  width: 30%;
  max-width: 320px;
}

.products-table .product-info-cell {
  width: 22%;
  max-width: 240px;
}

.products-table .table-money-stack {
  min-width: 108px;
}

.products-table .action-buttons-compact,
.stock-table .action-buttons-compact {
  justify-content: flex-end;
}

.stock-table {
  table-layout: fixed;
}

.stock-table .stock-imei-cell {
  width: 18%;
  max-width: 190px;
}

.stock-table .stock-product-cell {
  width: 28%;
  max-width: 300px;
}

.stock-table .stock-source-cell {
  width: 24%;
  max-width: 260px;
}

.cell-primary {
  font-weight: 600;
  color: var(--bs-heading-color, inherit);
}

.cell-muted {
  color: var(--bs-secondary-color, #a8a3b9);
  font-size: 0.82rem;
}

.table-money-stack {
  display: grid;
  gap: 2px;
  justify-items: end;
  min-width: 118px;
}

.table-money-stack .money-main {
  font-weight: 600;
  color: var(--bs-heading-color, inherit);
}

.table-money-stack .money-sub {
  color: var(--bs-secondary-color, #a8a3b9);
  font-size: 0.82rem;
  line-height: 1.25;
}

.table-money-compact {
  gap: 1px;
  min-width: 130px;
}

.table-money-compact .money-line {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  white-space: nowrap;
}

.table-money-compact .badge {
  font-size: 0.72rem;
  line-height: 1.1;
  padding: 0.28rem 0.45rem;
}

.return-items-cell {
  max-width: 280px;
}

.return-item-preview {
  max-width: 100%;
}

.table-money-return {
  gap: 1px;
  min-width: 170px;
}

.table-money-return .money-line {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}

.table-money-return .badge {
  font-size: 0.72rem;
  line-height: 1.1;
  padding: 0.28rem 0.45rem;
}

.table-money-return .money-sub {
  white-space: nowrap;
}

.return-table {
  min-width: 1000px;
  table-layout: fixed;
}

.return-table th,
.return-table td {
  overflow: hidden;
}

.return-table .return-col-stt {
  width: 46px;
}

.return-table .return-col-code {
  width: 54px;
}

.return-table .return-col-date {
  width: 96px;
}

.return-table .return-col-party {
  width: 160px;
}

.return-table .return-col-items {
  width: 220px;
}

.return-table .return-col-source {
  width: 82px;
}

.return-table .return-col-money {
  width: 180px;
}

.return-table .return-col-actions {
  width: 58px;
}

.return-party-cell,
.return-party-cell .cell-primary,
.return-party-cell .cell-muted {
  min-width: 0;
}

@media (min-width: 1200px) {
  .return-table {
    width: 100%;
    min-width: 0;
  }
}

.filter-payables {
  gap: 8px;
}

.filter-payables .filter-input-group {
  flex: 1 1 140px;
  min-width: 110px;
  max-width: 160px;
}

.filter-payables .filter-input-group .form-control {
  min-width: 0;
}

.filter-payables .filter-actions {
  margin-left: auto;
  gap: 6px;
}

.filter-payables .filter-actions .btn {
  min-width: 100px;
  padding: 0 10px;
  font-size: 0.85rem;
}

.filter-customers-details {
  gap: 8px;
}

.filter-customers-details .filter-input-group {
  flex: 0 0 170px;
  min-width: 160px;
  max-width: 170px;
}

.filter-customers-details .filter-actions {
  margin-left: auto;
  gap: 6px;
}

.filter-customers-details .filter-actions .btn {
  min-width: 100px;
  padding: 0 10px;
  font-size: 0.85rem;
}

@media (min-width: 992px) {
  .filter-control {
    min-width: 120px;
  }
}

@media (min-width: 1200px) {
  .filter-bar {
    flex-wrap: wrap;
  }

  .filter-bar > * {
    flex: 0 1 auto;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .filter-bar {
    gap: 10px;
  }

  .filter-bar > * {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
  }

  .filter-bar .filter-input-group {
    width: 100% !important;
  }

  .filter-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .filter-group {
    flex: 1 1 100%;
    justify-content: flex-end;
  }

  .filter-w-140 {
    flex: 1 1 calc(50% - 8px) !important;
  }

  .filter-w-160 {
    flex: 1 1 calc(50% - 8px) !important;
  }

  .filter-w-180 {
    flex: 1 1 calc(50% - 8px) !important;
  }

  .filter-w-200 {
    flex: 1 1 calc(50% - 8px) !important;
  }

  .filter-w-220 {
    flex: 1 1 calc(50% - 8px) !important;
  }
}

@media (max-width: 767.98px) {
  .document-line-tools {
    flex-wrap: wrap;
    width: 100%;
    margin-left: 0 !important;
  }

  .document-line-tools .input-group {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0 !important;
  }

  .filter-bar {
    gap: 8px;
  }

  .filter-bar > * {
    flex: 1 1 100%;
    width: 100%;
  }

  .filter-bar .filter-input-group {
    width: 100% !important;
  }

  .filter-actions {
    margin-left: 0;
    justify-content: flex-start;
  }

  .filter-actions .btn {
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
  }

  .index-header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .header-action-divider {
    display: none;
  }

  .sales-card-header {
    align-items: stretch;
  }

  .sales-card-title,
  .sales-card-header .index-header-actions {
    width: 100%;
  }

  .sales-summary-strip {
    grid-template-columns: 1fr;
  }

  .sales-summary-item {
    border-left: 0;
    border-top: 1px solid var(--bs-border-color);
  }

  .sales-summary-item:first-child {
    border-top: 0;
  }

  .filter-group {
    justify-content: flex-start;
  }
}

/* Treasury index ----------------------------------------------------------- */
.treasury-summary-strip {
  grid-template-columns: repeat(4, minmax(155px, 1fr));
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: thin;
}

.treasury-summary-strip .sales-summary-item {
  grid-template-columns: minmax(0, 1fr);
  min-height: 54px;
  padding-block: 0.45rem;
}

.treasury-summary-strip .sales-summary-copy {
  min-width: 155px;
}

.treasury-summary-strip .sales-summary-item strong,
.treasury-summary-strip .sales-summary-item small {
  overflow: visible;
  text-overflow: clip;
}

.filter-treasury {
  gap: 8px;
}

.filter-treasury .treasury-filter-keyword {
  min-width: 0;
  max-width: none;
}

.filter-treasury .treasury-filter-date,
.filter-treasury .treasury-filter-channel,
.filter-treasury .treasury-filter-direction {
  min-width: 0;
  width: 100%;
}

.filter-treasury .treasury-filter-actions {
  margin-left: 0;
  flex-wrap: nowrap;
  gap: 6px;
}

.filter-treasury .treasury-filter-actions .btn {
  min-width: 76px;
  padding-inline: 10px;
}

.treasury-business-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  color: var(--bs-secondary-color);
  font-size: 0.8125rem;
}

.treasury-category-row {
  grid-template-columns: minmax(220px, 1.6fr) 80px minmax(145px, 1fr) 90px 130px 42px;
  gap: 12px;
}

.justify-self-start { justify-self: start; }
.justify-self-end { justify-self: end; }

@media (min-width: 1200px) {
  .filter-bar.filter-treasury {
    display: grid;
    grid-template-columns: minmax(180px, 1fr)
      minmax(125px, 150px)
      minmax(125px, 150px)
      minmax(125px, 150px)
      minmax(110px, 130px)
      auto;
    align-items: center;
  }

  .filter-bar.filter-treasury > * {
    max-width: none;
  }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
  .filter-bar.filter-treasury {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-treasury .treasury-filter-keyword,
  .filter-treasury .treasury-filter-actions {
    grid-column: 1 / -1;
  }

  .filter-treasury .treasury-filter-actions {
    width: auto;
    justify-self: end;
  }

  .treasury-summary-strip {
    grid-template-columns: repeat(2, minmax(155px, 1fr));
  }
}

@media (max-width: 767.98px) {
  .treasury-summary-strip {
    grid-template-columns: minmax(155px, 1fr);
  }

  .filter-treasury .treasury-filter-actions {
    width: 100%;
  }

  .filter-treasury .treasury-filter-actions .btn {
    flex: 1 1 calc(50% - 3px);
  }

  .treasury-category-row {
    grid-template-columns: 1fr;
  }

  .treasury-category-row > * {
    justify-self: stretch;
  }
}

/* Desktop application shell ------------------------------------------------ */
.app-content-viewport {
  min-width: 0;
}

.app-pagination-bar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 0;
}

.app-pagination-size .form-select {
  width: 78px;
}

.app-pagination-pages {
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.app-pagination-pages .pagination {
  justify-content: flex-end;
  min-width: max-content;
}

.app-form-actions {
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 24px;
  border-top: 1px solid var(--bs-border-color);
  background: var(--bs-card-bg, var(--bs-body-bg));
}

.app-form-workspace {
  min-width: 0;
  min-height: 0;
}

.app-section-actions,
.app-detail-actions,
.app-detail-operation-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.app-section-actions {
  padding-top: 16px;
  border-top: 1px solid var(--bs-border-color);
}

.app-detail-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--bs-border-color);
  border-radius: 6px;
  background: var(--bs-card-bg, var(--bs-body-bg));
  box-shadow: 0 2px 8px rgba(var(--bs-body-color-rgb), 0.04);
}

.app-detail-action-label {
  flex: 0 0 auto;
  font-weight: 600;
}

.app-detail-operation-actions {
  padding-top: 12px;
  border-top: 1px solid var(--bs-border-color);
}

.app-profile-tabs {
  background: var(--bs-body-bg);
}

.app-profile-form-actions {
  margin: 0;
  padding: 10px 24px;
  border-top: 0;
  border-bottom: 1px solid var(--bs-border-color);
  background: var(--bs-card-bg, var(--bs-body-bg));
}

.password-requirements {
  padding: 16px;
  border-left: 3px solid var(--bs-primary);
  border-radius: 6px;
  background: rgba(var(--bs-primary-rgb), 0.04);
}

.password-requirements li {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--bs-secondary-color);
  transition: color 160ms ease;
}

.password-requirements li i {
  flex: 0 0 auto;
}

.password-requirements li.is-satisfied {
  color: var(--bs-success);
}

@media (min-width: 1200px) {
  html.app-shell,
  html.app-shell body {
    height: 100%;
    overflow: hidden;
  }

  html.app-shell .layout-wrapper,
  html.app-shell .layout-container,
  html.app-shell .layout-page {
    min-height: 0;
    height: 100dvh;
    max-height: 100dvh;
  }

  html.app-shell .layout-page,
  html.app-shell .content-wrapper {
    min-width: 0;
    min-height: 0;
    overflow: hidden;
  }

  html.app-shell .layout-navbar {
    position: relative;
    z-index: 1075;
    flex: 0 0 auto;
  }

  html.app-shell .app-content-container {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    width: 100%;
    max-width: none;
    min-height: 0;
    padding: 12px 16px 10px;
    overflow: hidden;
  }

  html.app-shell .app-system-alerts {
    flex: 0 0 auto;
  }

  html.app-shell .app-system-alerts:empty {
    display: none;
  }

  html.app-shell .app-system-alerts .alert {
    margin-bottom: 10px;
  }

  html.app-shell .app-content-viewport {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    scrollbar-gutter: stable;
  }

  html.app-shell .app-page-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
  }

  html.app-shell .app-page-list > .alert {
    flex: 0 0 auto;
    margin-bottom: 10px;
  }

  html.app-shell .app-page-list > .card {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    margin-bottom: 0 !important;
    overflow: visible;
  }

  html.app-shell .app-page-list > .card > .card-header,
  html.app-shell .app-page-list > .card > .index-filter-body {
    flex: 0 0 auto;
  }

  html.app-shell .app-page-list > .card > .table-responsive,
  html.app-shell .app-page-list > .card > .app-data-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    scrollbar-gutter: stable;
  }

  html.app-shell .app-page-list > .card > .table-responsive table,
  html.app-shell .app-page-list > .card > .app-data-scroll table {
    margin-bottom: 0;
  }

  html.app-shell .app-page-list > .card > .table-responsive thead th,
  html.app-shell .app-page-list > .card > .app-data-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 4;
    background: var(--bs-table-bg, var(--bs-body-bg));
    box-shadow: inset 0 -1px 0 var(--bs-border-color);
  }

  html.app-shell .app-page-list > .app-pagination-bar {
    flex: 0 0 auto;
  }

  html.app-shell .app-page-report {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
  }

  html.app-shell .app-page-report > .card {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    margin-bottom: 0 !important;
    overflow: visible;
  }

  html.app-shell .app-page-report > .card > .card-header,
  html.app-shell .app-page-report > .card > .index-filter-body {
    flex: 0 0 auto;
  }

  html.app-shell .app-page-report > .card > .table-responsive {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    scrollbar-gutter: stable;
  }

  html.app-shell .app-page-report > .card > .table-responsive table {
    margin-bottom: 0;
  }

  html.app-shell .app-page-report > .card > .table-responsive thead th {
    position: sticky;
    top: 0;
    z-index: 4;
    background: var(--bs-table-bg, var(--bs-body-bg));
    box-shadow: inset 0 -1px 0 var(--bs-border-color);
  }

  html.app-shell .app-page-form {
    overflow: hidden;
  }

  html.app-shell .app-page-form > .app-form-workspace {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  html.app-shell .app-form-workspace > .app-form-layout {
    flex: 1 1 auto;
    min-height: 0;
  }

  html.app-shell .app-page-form > .card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    margin-bottom: 0;
    overflow: hidden;
  }

  html.app-shell .app-page-form > .card > .card-header {
    position: relative;
    z-index: 5;
    flex: 0 0 auto;
    border-bottom: 1px solid var(--bs-border-color);
    background: var(--bs-card-bg, var(--bs-body-bg));
  }

  html.app-shell .app-form-layout {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    flex: 1 1 auto;
    min-height: 0;
  }

  html.app-shell .app-form-scroll {
    min-height: 0;
    overflow: auto;
    scrollbar-gutter: stable;
  }

  html.app-shell .app-form-scroll.row {
    width: auto;
    margin: 0;
  }

  html.app-shell .app-form-actions {
    position: relative;
    z-index: 6;
    flex-wrap: wrap;
    align-items: center;
    min-height: 60px;
    padding: 10px 24px;
    border-top: 1px solid var(--bs-border-color);
    background: var(--bs-card-bg, var(--bs-body-bg));
    box-shadow: 0 -4px 12px rgba(var(--bs-body-color-rgb), 0.04);
  }

  html.app-shell .app-page-details {
    overflow: auto;
    scrollbar-gutter: stable;
  }

  html.app-shell .app-page-details > .app-detail-action-bar,
  html.app-shell .app-page-details .app-profile-tabs {
    position: sticky;
    top: 0;
    z-index: 8;
  }

  html.app-shell .app-profile-page .tab-pane.active .app-profile-form-actions {
    position: sticky;
    top: 62px;
    z-index: 7;
  }

}

@media (max-width: 1199.98px) {
  .app-content-viewport {
    overflow: visible;
  }
}

@media (max-width: 767.98px) {
  .app-detail-action-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .app-detail-actions,
  .app-detail-operation-actions,
  .app-section-actions {
    justify-content: stretch;
  }

  .app-detail-actions > .btn,
  .app-detail-operation-actions > .btn,
  .app-section-actions > .btn {
    flex: 1 1 auto;
  }

  .app-pagination-bar {
    grid-template-columns: 1fr auto;
  }

  .app-pagination-pages {
    grid-column: 1 / -1;
  }

  .app-pagination-pages .pagination {
    justify-content: flex-start;
  }
}

@media (min-width: 1200px) and (max-height: 620px) {
  html.app-shell .app-page-list {
    display: block;
    overflow: auto;
  }

  html.app-shell .app-page-list > .card > .table-responsive,
  html.app-shell .app-page-list > .card > .app-data-scroll {
    max-height: none;
    overflow: auto;
  }
}

.authentication-wrapper .auth-theme-icon {
  filter: var(--auth-theme-filter, none);
}
