/* System-wide readable text size - applied across entire application */
html {
  font-size: 16px;
}

body,
.main-content,
.page-content {
  font-size: 1rem;
}

.card-body,
.card-header,
.alert,
.form-label,
.form-control,
.form-select,
.form-check-label,
.table,
.table th,
.table td,
.btn,
.text-muted,
small,
.small {
  font-size: 1rem !important;
}

h5 {
  font-size: 1.2rem !important;
}

h6 {
  font-size: 1.1rem !important;
}

/* Row spacing – match product list table (0.9rem); product body cells keep py-0 for avatars */
.table thead>tr>th {
  padding-top: 0.9rem !important;
  padding-bottom: 0.9rem !important;
}

.table tbody>tr>td {
  padding-top: 0.3rem !important;
  padding-bottom: 0.3rem !important;
}

/* #productTable tbody > tr > td {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
} */
/* table-sm and utility padding – same as product table in scroll areas */
.table-scroll-wrapper .table-sm> :not(caption)>*>*,
.table-scroll-wrapper .table tbody>tr>td[class*="py-"],
.table-scroll-wrapper .table thead>tr>th[class*="py-"] {
  padding-top: 0.9rem !important;
  padding-bottom: 0.9rem !important;
}

.table-scroll-wrapper #productTable tbody>tr>td {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* Product table – sort chevrons sit on the right; keep labels from covering them */
#productTable thead th.sort {
  padding-right: 1.65rem;
  white-space: nowrap;
}

#productTable thead th.sort > a {
  display: block;
  width: 100%;
  padding-right: 1.25rem;
  box-sizing: border-box;
}

#productTable thead th.sort.text-center > a {
  text-align: center;
}

#productTable thead th.sort::before,
#productTable thead th.sort::after {
  z-index: 1;
  pointer-events: none;
}

/* Scrollable table areas – room above horizontal scrollbar */
.table-responsive {
  padding-bottom: 1.5rem;
}

/* PharmX toast notifications – semantic colors (success / failure / warning / info) */
#pharmx-toast-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

#pharmx-toast-container .toast {
  pointer-events: auto;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  border-radius: 0.5rem;
  border: none;
  min-width: 280px;
  max-width: min(420px, calc(100vw - 2rem));
}

#pharmx-toast-container .toast .toast-body {
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Success – green/teal, white text */
#pharmx-toast-container .pharmx-toast-success {
  background-color: var(--vz-success, #0ab39c);
  color: #fff;
}

#pharmx-toast-container .pharmx-toast-success .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

/* Failure / Error – red, white text */
#pharmx-toast-container .pharmx-toast-danger {
  background-color: var(--vz-danger, #dc3545);
  color: #fff;
}

#pharmx-toast-container .pharmx-toast-danger .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

/* Warning – amber, dark text for readability */
#pharmx-toast-container .pharmx-toast-warning {
  background-color: var(--vz-warning, #ffc107);
  color: #212529;
}

#pharmx-toast-container .pharmx-toast-warning .btn-close {
  filter: none;
}

/* Info – blue, white text */
#pharmx-toast-container .pharmx-toast-info {
  background-color: var(--vz-info, #299cdb);
  color: #fff;
}

#pharmx-toast-container .pharmx-toast-info .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

#pharmx-toast-container .pharmx-toast-icon {
  font-size: 1.25rem;
}

/* Import loading – animated bar moving left to right; show when used as HTMX indicator */
#import-loading-bar.htmx-request,
.import-loading-bar.htmx-request {
  display: block !important;
}

.import-loading-bar {
  height: 4px;
  background: linear-gradient(90deg,
      transparent 0%,
      var(--vz-primary, #405189) 25%,
      var(--vz-success, #0ab39c) 50%,
      var(--vz-primary, #405189) 75%,
      transparent 100%);
  background-size: 200% 100%;
  animation: import-loading-slide 1.2s ease-in-out infinite;
  border-radius: 2px;
}

@keyframes import-loading-slide {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* When trial-ended banner is shown, reduce gap between banner and main content */
.main-content.has-trial-banner .page-content {
  padding-top: 1rem;
}

/* Hide vertical scrollbar on select[multiple] (e.g. OrgRoleForm permissions/users) */
.select-no-scrollbar::-webkit-scrollbar {
  display: none;
}

/* Roles & permissions – modern UI */
.role-permissions-modern .permission-check-item:hover,
.role-staff-modern .staff-check-item:hover {
  background-color: rgba(0, 0, 0, 0.03);
}

[data-layout-mode="dark"] .role-permissions-modern .permission-check-item:hover,
[data-layout-mode="dark"] .role-staff-modern .staff-check-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

/* Notification bell dropdown */
.notification-dropdown-body .notification-item {
  white-space: normal;
  overflow-wrap: break-word;
  min-width: 0;
}

.notification-dropdown-body .notification-item .flex-grow-1 {
  min-width: 0;
}

.notification-dropdown-body .channel-badge {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.notification-dropdown-body .channel-fcm {
  background: rgba(41, 156, 219, 0.15);
  color: var(--vz-info, #299cdb);
}

.notification-dropdown-body .channel-sms {
  background: rgba(15, 179, 156, 0.15);
  color: var(--vz-success, #0ab39c);
}

.notification-dropdown-body .channel-whatsapp {
  background: rgba(37, 211, 102, 0.2);
  color: #25d366;
}

/* Notification list page – prevent overflow */
.notification-list-item .flex-grow-1 {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Product list – sticky toolbar (search + tabs) when page scrolls */
.product-list-sticky-header {
  position: sticky;
  top: 0;
  z-index: 102;
  background: var(--vz-body-bg, #fff);
  border-radius: inherit;
  overflow: visible;
}

.product-list-toolbar .dropdown {
  position: relative;
  z-index: 103;
}

.product-list-toolbar .dropdown-menu {
  z-index: 104;
}

.product-list-toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  gap: 0.375rem;
}

.product-list-toolbar > * {
  flex: 1 1 0;
  min-width: 0;
}

.product-list-toolbar .btn,
.product-list-toolbar .dropdown,
.product-list-toolbar .dropdown .btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 768px) {
  .product-list-toolbar {
    flex-wrap: nowrap;
    width: auto;
    max-width: none;
    gap: 0.5rem;
  }

  .product-list-toolbar > * {
    flex: 0 0 auto;
  }

  .product-list-toolbar .btn,
  .product-list-toolbar .dropdown,
  .product-list-toolbar .dropdown .btn {
    width: auto;
    justify-content: center;
  }
}

.product-list-sticky-header .card-header:last-child {
  border-bottom: 0;
}

[data-layout-mode="dark"] .product-list-sticky-header {
  background: var(--vz-body-bg, #292e40);
}

/* Scrollable table area – max height + sticky header (wrap .table-responsive + table) */
.table-scroll-wrapper {
  max-height: calc(100vh - 340px);
  overflow-y: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-scroll-wrapper--55vh {
  max-height: 55vh;
}

.table-scroll-wrapper--60vh {
  max-height: 60vh;
}

.table-scroll-wrapper--70vh {
  max-height: 70vh;
}

.table-scroll-wrapper--72vh {
  max-height: 72vh;
}

.table-scroll-wrapper--300 {
  max-height: 300px;
}

.table-scroll-wrapper--320 {
  max-height: 320px;
}

.table-scroll-wrapper .table-sticky-header thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #f3f6f9 !important;
  box-shadow: 0 1px 0 0 var(--vz-border-color, #eceef1);
}

[data-layout-mode="dark"] .table-scroll-wrapper .table-sticky-header thead th {
  background: var(--vz-secondary-bg, #32394e) !important;
  box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.08);
}

/* User detail – profile hero & layout */
.user-detail-hero {
  position: relative;
  overflow: hidden;
  border: 0;
  border-radius: 0;
}

.user-detail-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.user-detail-hero .card-body {
  position: relative;
  z-index: 1;
}

.user-detail-avatar {
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 700;
  background: var(--vz-primary-bg-subtle, rgba(64, 81, 137, 0.257));
  flex-shrink: 0;
}

.user-detail-hero .user-detail-meta {
  opacity: 0.92;
}

.user-detail-hero .btn-light {
  border: 0;
  font-weight: 500;
}

.user-detail-hero .btn-outline-light {
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}

.user-detail-hero .btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.user-detail-stat {
  border: 0;
  border-radius: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.user-detail-stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1.25rem rgba(64, 81, 137, 0.12);
}

.user-detail-stat .stat-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

.user-detail-info-item {
  display: flex;
  gap: 0.85rem;
  padding: 0.85rem 0;
  border-bottom: 1px dashed var(--vz-border-color, #e9ebec);
}

.user-detail-info-item:last-child {
  border-bottom: 0;
}

.user-detail-info-item .info-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.1rem;
}

.user-detail-tabs .nav-link {
  font-weight: 500;
  border: 0;
  color: var(--vz-secondary-color);
  padding: 0.65rem 1.1rem;
  border-radius: 0.5rem;
}

.user-detail-tabs .nav-link.active {
  background: var(--vz-primary-bg-subtle, rgba(64, 81, 137, 0.1));
  color: var(--vz-primary);
}

/* User additional-permissions modal: scroll body, keep footer visible */
#userPermissionsModal .user-permissions-modal-dialog {
  max-height: calc(100vh - 2rem);
  margin: 1rem auto;
}

#userPermissionsModal .modal-content {
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#userPermissionsModal .user-permissions-form {
  min-height: 0;
}

#userPermissionsModal .user-permissions-modal-body {
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

#userPermissionsModal .user-permissions-loading {
  min-height: 280px;
  flex: 1 1 auto;
}

.user-detail-perm-pill.d-none,
.user-perm-group-col.d-none {
  display: none !important;
}

.user-perm-groups-panel {
  border-radius: 0.5rem;
  overflow: hidden;
}

.user-perm-groups-scroll {
  max-height: 360px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.user-perm-groups-panel .list-group-item {
  border-left: 0;
  border-right: 0;
}

.user-perm-groups-panel .list-group-item:first-child {
  border-top: 0;
}

.user-perm-group-row {
  transition: background 0.15s ease;
}

.user-perm-group-row:hover {
  background: var(--vz-primary-bg-subtle, rgba(64, 81, 137, 0.04));
}

.user-perm-group-icon {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  background: var(--vz-primary-bg-subtle, rgba(64, 81, 137, 0.1));
  color: var(--vz-primary);
}

.user-perm-group-title {
  display: inline-block;
  line-height: 1.25;
  white-space: nowrap;
}

.user-perm-count-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15em 0.45em;
  line-height: 1.2;
}

.user-perm-group-label {
  max-width: 100%;
}

@media (min-width: 768px) {
  .user-perm-group-label {
    max-width: 14rem;
  }

  .user-perm-group-actions {
    justify-content: flex-end;
  }
}

.user-perm-action {
  display: inline-flex;
  align-items: center;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  cursor: default;
  line-height: 1.3;
}

.user-perm-action--view {
  background: rgba(41, 156, 219, 0.12);
  color: #299cdb;
  border-color: rgba(41, 156, 219, 0.2);
}

.user-perm-action--add {
  background: rgba(10, 179, 156, 0.12);
  color: #0ab39c;
  border-color: rgba(10, 179, 156, 0.2);
}

.user-perm-action--change {
  background: rgba(247, 184, 75, 0.15);
  color: #c98a0a;
  border-color: rgba(247, 184, 75, 0.25);
}

.user-perm-action--delete {
  background: rgba(240, 101, 72, 0.12);
  color: #f06548;
  border-color: rgba(240, 101, 72, 0.2);
}

.user-detail-perm-pill--extra {
  box-shadow: inset 0 0 0 1px rgba(var(--vz-warning-rgb), 0.45);
}

.user-perm-action--other {
  background: var(--vz-light, #f3f6f9);
  color: var(--vz-body-color);
  border-color: var(--vz-border-color);
}

.user-detail-shop-pill {
  border: 1px solid var(--vz-border-color);
  border-radius: 0.65rem;
  padding: 0.75rem 1rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.user-detail-shop-pill:hover {
  border-color: var(--vz-primary);
  background: var(--vz-primary-bg-subtle, rgba(64, 81, 137, 0.06));
}

.user-list-filters-card {
  border-radius: 0.65rem;
  box-shadow: none;
}

.user-list-filter-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--vz-secondary-color);
  margin-bottom: 0.35rem;
}

.user-list-filter-chip {
  display: inline-flex;
  align-items: center;
  font-weight: 500;
  padding: 0.35em 0.55em;
}

.user-list-filter-chip .btn-close {
  font-size: 0.55rem;
}

.user-list-results-bar {
  padding-bottom: 0.25rem;
  border-bottom: 1px dashed var(--vz-border-color, #e9ebec);
}

/* Cart items – comfortable cards vs compact table */
#cart-items-container.cart-view-comfortable .cart-items-compact {
  display: none !important;
}

#cart-items-container.cart-view-compact .cart-items-comfortable {
  display: none !important;
}

#cart-items-container.cart-view-compact .card.product {
  display: none !important;
}

.cart-view-toggle .btn.active {
  background-color: var(--vz-primary);
  color: #fff;
  border-color: var(--vz-primary);
}

/* Compact cart – scrollable table */
.cart-items-compact {
  overflow: visible;
}

.cart-compact-scroll {
  width: 100%;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.cart-compact-table {
  min-width: 42rem;
  margin-bottom: 0;
  white-space: nowrap;
}

.cart-compact-table--checkout {
  min-width: 62rem;
}

.cart-compact-table thead th {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--vz-secondary-color);
  white-space: nowrap;
  background: var(--vz-light, #f3f6f9);
  border-bottom: 1px solid var(--vz-border-color, #e9ebec);
  vertical-align: middle;
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
}

[data-layout-mode="dark"] .cart-compact-table thead th {
  background: rgba(255, 255, 255, 0.04);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.cart-compact-th-thumb,
.cart-compact-td-thumb {
  width: 2.75rem;
  padding-left: 1rem;
}

.cart-compact-th-product,
.cart-compact-td-product {
  min-width: 14rem;
  max-width: 22rem;
  white-space: normal;
}

.cart-compact-th-qty,
.cart-compact-td-qty {
  min-width: 8.5rem;
}

.cart-compact-th-unit,
.cart-compact-td-unit {
  min-width: 7.5rem;
}

.cart-compact-th-disc,
.cart-compact-td-disc {
  min-width: 10.5rem;
}

.cart-compact-th-total,
.cart-compact-td-total {
  min-width: 7.5rem;
}

.cart-compact-th-actions,
.cart-compact-td-actions {
  min-width: 5.5rem;
  padding-right: 1rem;
}

.cart-compact-table tbody td {
  vertical-align: middle;
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}

.cart-compact-product-name {
  font-weight: 500;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cart-compact-product-meta {
  font-size: 0.8rem !important;
  color: var(--vz-secondary-color);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cart-compact-td-qty .input-step-sm {
  margin-left: auto;
  margin-right: auto;
}

.cart-compact-td-disc .cart-discount-form {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: max-content;
  margin: 0 auto;
}

.cart-compact-thumb {
  width: 2.25rem;
  height: 2.25rem;
  object-fit: cover;
  border-radius: 0.35rem;
  display: block;
}

.cart-compact-thumb--letter {
  width: 2.25rem;
  height: 2.25rem;
  background: var(--vz-light, #f3f6f9);
  border-radius: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

[data-layout-mode="dark"] .cart-compact-thumb--letter {
  background: rgba(255, 255, 255, 0.08);
}

.cart-compact-discount .cart-discount-input,
.cart-compact-td-disc .cart-discount-input,
.cart-item-discount-input {
  background-color: var(--vz-input-bg, #fff) !important;
  border: 1px solid var(--vz-input-border-custom, var(--vz-input-border, #ced4da)) !important;
  color: var(--vz-body-color) !important;
}

[data-layout-mode="dark"] .cart-compact-discount .cart-discount-input,
[data-layout-mode="dark"] .cart-compact-td-disc .cart-discount-input {
  background-color: var(--vz-input-bg, #2a3042) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

.cart-compact-discount .cart-discount-input,
.cart-compact-td-disc .cart-discount-input {
  flex: 1 1 auto;
  min-width: 3.75rem;
  width: 4.25rem !important;
  max-width: none !important;
  text-align: center;
  -moz-appearance: textfield;
}

.cart-compact-discount .cart-discount-input::-webkit-outer-spin-button,
.cart-compact-discount .cart-discount-input::-webkit-inner-spin-button,
.cart-compact-td-disc .cart-discount-input::-webkit-outer-spin-button,
.cart-compact-td-disc .cart-discount-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.cart-item-discount-input {
  width: 5.5rem !important;
  min-width: 5.5rem !important;
  flex-shrink: 0;
}

#cart-items-list .input-step-sm,
.cart-compact-td-qty .input-step-sm {
  width: 8rem;
  min-width: 8rem;
  max-width: none;
  height: 2rem;
  padding: 2px;
  background: var(--vz-input-bg, #fff);
  border: 1px solid var(--vz-input-border, #ced4da);
}

[data-layout-mode="dark"] #cart-items-list .input-step-sm,
[data-layout-mode="dark"] .cart-compact-td-qty .input-step-sm {
  background: var(--vz-input-bg, #2a3042);
  border-color: rgba(255, 255, 255, 0.12);
}

#cart-items-list .input-step-sm .product-quantity,
.cart-compact-td-qty .input-step-sm .product-quantity {
  width: 2.75rem;
  min-width: 2.75rem;
  padding: 0.1rem 0.2rem;
  font-size: 0.875rem !important;
  background: transparent !important;
}

#cart-items-list .input-step-sm button,
.cart-compact-td-qty .input-step-sm button {
  width: 1.65rem;
  height: 1.65rem;
  font-size: 0.85rem;
  line-height: 1;
}

/* Cart page – empty state height aligned with sidebar summary */
#cart-items-container:has(.cart-empty-panel) {
  align-items: stretch;
}

#cart-items-container:has(.cart-empty-panel)>.cart-main-col,
#cart-items-container:has(.cart-empty-panel)>.cart-sidebar-col {
  align-self: stretch;
}

#cart-items-container .cart-main-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  max-width: 100%;
}

#cart-items-container .cart-main-col--scroll {
  max-height: 75vh;
  overflow-y: auto;
}

#cart-items-container .cart-items-list--empty {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

#cart-items-container .cart-empty-panel {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

#cart-items-container .cart-sidebar-col {
  display: flex;
  flex-direction: column;
}

#cart-items-container .cart-sidebar-stack {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

@media (max-width: 991.98px) {
  #cart-items-container {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
  }

  #cart-items-container .cart-sidebar-col,
  #cart-items-container .cart-sidebar-stack {
    display: contents;
  }

  #cart-items-container .cart-panel-customer {
    order: 1;
    flex: 0 0 100%;
    max-width: 100%;
    width: 100%;
    margin-bottom: 0.75rem;
  }

  #cart-items-container .cart-main-col {
    order: 2;
    flex: 0 0 100%;
    max-width: 100%;
    margin-bottom: 0.75rem;
  }

  #cart-items-container .cart-main-col--scroll {
    max-height: none;
    overflow-y: visible;
  }

  #cart-items-container .cart-panel-summary {
    order: 3;
    flex: 0 0 100%;
    max-width: 100%;
    width: 100%;
  }

  #cart-items-container .cart-mobile-bar {
    order: 4;
    flex: 0 0 100%;
    max-width: 100%;
  }

  .page-content:has(#cart-items-container) {
    padding-bottom: 5.5rem;
  }
}

/* Cart toolbar */
.cart-toolbar__primary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.cart-toolbar__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.cart-toolbar__count {
  font-size: 0.7rem;
  font-weight: 600;
}

.cart-toolbar__controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.cart-toolbar__secondary {
  margin-top: 0.65rem;
}

@media (min-width: 576px) {
  .cart-toolbar__secondary.collapse:not(.show) {
    display: block;
    height: auto !important;
    visibility: visible;
  }
}

@media (max-width: 575.98px) {
  .cart-toolbar-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .cart-toolbar-actions .btn {
    justify-content: center;
    font-size: 0.78rem;
    padding: 0.35rem 0.5rem;
  }
}

/* Cart item card – unified layout */
.cart-item-layout {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.cart-item-media {
  flex-shrink: 0;
}

.cart-item-thumb,
.cart-item-thumb-letter {
  width: 2.75rem;
  height: 2.75rem;
}

.cart-item-thumb-letter {
  font-size: 1rem;
  font-weight: 600;
}

.cart-item-main {
  flex: 1 1 auto;
  min-width: 0;
}

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

.cart-item-name {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
  word-break: break-word;
}

.cart-item-meta {
  font-size: 0.75rem;
  line-height: 1.3;
}

.cart-item-line-total {
  text-align: right;
  flex-shrink: 0;
}

.cart-item-line-total__label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.cart-item-line-total__value {
  font-size: 0.9rem;
  white-space: nowrap;
}

.cart-item-foot {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 0.75rem;
  align-items: center;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--vz-border-color, #e9ebec);
}

.cart-item-foot__label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
}

.cart-item-qty-wrap {
  display: contents;
}

.cart-item-qty-wrap .cart-item-foot__label {
  grid-column: 1;
}

.cart-item-qty-wrap .cart-item-qty {
  grid-column: 2;
}

.cart-item-unit-wrap {
  display: contents;
}

.cart-item-unit-wrap .cart-item-foot__label {
  grid-column: 1;
}

.cart-item-unit-wrap .cart-item-unit {
  grid-column: 2;
  font-size: 0.85rem;
}

.cart-item-discount-wrap {
  display: contents;
}

.cart-item-discount-wrap .cart-item-foot__label {
  grid-column: 1;
}

.cart-item-discount-form {
  grid-column: 2;
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.cart-item-actions-wrap {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 0.35rem;
  padding-top: 0.25rem;
}

@media (min-width: 576px) {
  .cart-item-foot {
    grid-template-columns: auto auto 1fr auto;
    align-items: center;
  }

  .cart-item-qty-wrap,
  .cart-item-unit-wrap,
  .cart-item-discount-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .cart-item-qty-wrap .cart-item-qty,
  .cart-item-unit-wrap .cart-item-unit,
  .cart-item-discount-form {
    grid-column: auto;
  }

  .cart-item-actions-wrap {
    grid-column: auto;
    padding-top: 0;
    margin-left: auto;
  }
}

@media (min-width: 768px) {
  .cart-item-foot {
    grid-template-columns: auto auto auto 1fr auto;
  }
}

/* Customer type pills on mobile */
.cart-customer-type {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.cart-customer-type .form-check {
  margin: 0;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--vz-border-color, #e9ebec);
  border-radius: 0.375rem;
  text-align: center;
}

.cart-customer-type .form-check-input {
  display: none;
}

.cart-customer-type .form-check-input:checked+.form-check-label {
  color: var(--vz-primary);
  font-weight: 600;
}

.cart-customer-type .form-check:has(.form-check-input:checked) {
  border-color: var(--vz-primary);
  background: rgba(var(--vz-primary-rgb, 64, 81, 137), 0.08);
}

@media (min-width: 1200px) {
  .cart-customer-type {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .cart-customer-type .form-check {
    border: none;
    text-align: left;
    background: transparent !important;
  }

  .cart-customer-type .form-check-input {
    display: inline-block;
  }
}

/* Collapsible panel chevron */
.cart-panel-toggle[aria-expanded="true"] .cart-panel-chevron {
  transform: rotate(180deg);
}

.cart-panel-chevron {
  transition: transform 0.2s ease;
}

/* Order totals */
.cart-totals__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.35rem 0;
  font-size: 0.875rem;
}

.cart-totals__row--total {
  margin-top: 0.35rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--vz-border-color, #e9ebec);
}

/* Discount / shipping forms */
.cart-summary-form {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.cart-summary-form .form-control {
  flex: 1 1 auto;
  min-width: 0;
}

.cart-summary-form .btn {
  flex-shrink: 0;
}

.cart-adjustment-block+.cart-adjustment-block {
  margin-top: 0.85rem;
}

.cart-adjustments-toggle[aria-expanded="true"] .ri-arrow-down-s-line {
  transform: rotate(180deg);
}

.cart-adjustments-toggle .ri-arrow-down-s-line {
  display: inline-block;
  transition: transform 0.2s ease;
}

/* Actions bar (desktop checkout) */
.cart-actions-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

/* Sticky mobile checkout bar */
.cart-mobile-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1040;
  padding: 0.65rem 0.85rem calc(0.65rem + env(safe-area-inset-bottom, 0px));
  background: var(--vz-card-bg, #fff);
  border-top: 1px solid var(--vz-border-color, #e9ebec);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

[data-layout-mode="dark"] .cart-mobile-bar {
  background: var(--vz-card-bg, #212529);
  border-top-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.35);
}

.cart-mobile-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  max-width: 100%;
}

.cart-mobile-bar__checkout {
  flex: 1 1 auto;
  max-width: 11rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
}

.cart-mobile-bar__total {
  min-width: 0;
}

.cart-item-discount-input {
  width: 4.5rem !important;
  min-width: 4.5rem !important;
  flex-shrink: 0;
  text-align: center;
}

@media (max-width: 575.98px) {
  .cart-item-card .card-body {
    padding: 0.85rem;
  }

  .cart-summary-form {
    flex-direction: column;
  }

  .cart-summary-form .btn {
    width: 100%;
  }

  .cart-panel-customer .card-body,
  .cart-panel-summary .card-body {
    padding: 0.85rem 1rem;
  }
}

.cart-item-thumb {
  flex-shrink: 0;
}

/* Checkout modal – mobile */
@media (max-width: 991.98px) {
  #checkoutModal .modal-body .row.g-4>[class*="col-lg-"] {
    margin-bottom: 0.5rem;
  }
}

/* Saved proformas – mobile */
@media (max-width: 575.98px) {
  .cart-proforma-actions .btn {
    flex: 1 1 auto;
  }
}

/* Product search results – mobile */
.cart-product-search-results .product-search-result {
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

/* Purchase form – scrollable items table */
.purchase-form-card {
  overflow: visible;
}

.purchase-form-card .card-body {
  min-width: 0;
}

.purchase-items-table-wrap,
.purchase-readonly-table-wrap {
  width: 100%;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.purchase-items-table {
  min-width: 72rem;
}

.purchase-readonly-table {
  min-width: 48rem;
}

.purchase-items-table thead th {
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  vertical-align: middle;
}

.purchase-items-table th:nth-child(1),
.purchase-items-table td:nth-child(1) {
  min-width: 14rem;
}

.purchase-items-table th:nth-child(2),
.purchase-items-table td:nth-child(2) {
  min-width: 9rem;
}

.purchase-items-table th:nth-child(3),
.purchase-items-table td:nth-child(3) {
  min-width: 5.5rem;
}

.purchase-items-table th:nth-child(4),
.purchase-items-table td:nth-child(4),
.purchase-items-table th:nth-child(5),
.purchase-items-table td:nth-child(5) {
  min-width: 7.5rem;
}

.purchase-items-table th:nth-child(6),
.purchase-items-table td:nth-child(6) {
  min-width: 6.5rem;
}

.purchase-items-table th:nth-child(7),
.purchase-items-table td:nth-child(7) {
  min-width: 9rem;
}

.purchase-items-table th:nth-child(8),
.purchase-items-table td:nth-child(8) {
  min-width: 10.5rem;
}

.purchase-items-table th:nth-child(9),
.purchase-items-table td:nth-child(9) {
  min-width: 5rem;
}

.purchase-items-table tbody td {
  vertical-align: middle;
}

.purchase-items-table .product-search-cell,
.purchase-items-table .uom-typeahead-cell {
  min-width: 0;
  width: 100%;
}

.purchase-items-table .product-search-input {
  width: 100%;
  min-width: 12rem;
}

.purchase-items-table .uom-typeahead-input {
  width: 100%;
  min-width: 8rem;
}

.purchase-items-table td:nth-child(3) .form-control,
.purchase-items-table td:nth-child(4) .form-control,
.purchase-items-table td:nth-child(5) .form-control {
  width: 100%;
  min-width: 6.5rem;
}

.purchase-items-table td:nth-child(7) .form-control {
  width: 100%;
  min-width: 8rem;
}

.purchase-items-table td:nth-child(8) .form-control,
.purchase-items-table td:nth-child(8) input[type="date"] {
  width: 100%;
  min-width: 9.5rem;
}

.purchase-items-table .row-buy-total {
  min-width: 5.5rem;
}

.purchase-items-toolbar-left {
  min-width: 0;
}

.purchase-expiry-inline input[type="date"] {
  min-width: 10rem;
}

.purchase-total-box {
  width: 100%;
  max-width: 24rem;
}

.purchase-form-actions .btn {
  min-width: 8rem;
}

@media (max-width: 991.98px) {
  .purchase-items-toolbar {
    flex-direction: column;
    align-items: stretch !important;
  }

  .purchase-items-toolbar-left {
    flex-wrap: wrap;
    align-items: stretch !important;
    gap: 0.5rem !important;
  }

  .purchase-items-toolbar-left .text-muted.small {
    display: none;
  }

  .purchase-expiry-inline {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .purchase-expiry-inline input[type="date"] {
    width: 100%;
    min-width: 0;
  }

  #apply-expiry-btn,
  #apply-batch-btn {
    width: 100%;
  }

  .purchase-items-toolbar>.btn {
    width: 100%;
  }

  .purchase-add-row-wrap,
  .purchase-total-wrap {
    justify-content: stretch !important;
  }

  .purchase-total-box {
    max-width: none;
  }

  .purchase-form-actions .btn {
    flex: 1 1 100%;
  }
}

@media (max-width: 575.98px) {
  .purchase-meta-row>[class*="col-"] {
    margin-bottom: 0;
  }

  .purchase-notes-block {
    margin-bottom: 1rem !important;
  }
}

/* Expenses responsive layout */
.expense-table-wrap {
  width: 100%;
}

@media (max-width: 991.98px) {
  .expense-filters-form {
    margin-bottom: 0 !important;
  }

  .expense-filters-actions {
    width: 100%;
    min-width: 0 !important;
    margin-top: 0.75rem !important;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--vz-border-color, #e9ebec);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  [data-layout-mode="dark"] .expense-filters-actions {
    border-top-color: rgba(255, 255, 255, 0.12);
  }

  .expense-filters-actions .btn {
    width: 100%;
    margin-bottom: 0 !important;
  }

  .expense-form-actions .btn {
    flex: 1 1 100%;
  }

  .expense-modal-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    width: 100%;
    flex-direction: column;
  }

  .expense-modal-actions .btn {
    width: 100%;
  }
}

@media (max-width: 575.98px) {
  #expenseModal .modal-content {
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  #expenseModal #expenseForm {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1 1 auto;
  }

  #expenseModal #expenseForm .modal-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
    min-height: 0;
  }

  #expenseModal #expenseForm .modal-footer {
    position: sticky;
    bottom: 0;
    z-index: 2;
    flex-shrink: 0;
    background: var(--vz-card-bg, #fff);
    border-top: 1px solid var(--vz-border-color, #e9ebec);
  }

  [data-layout-mode="dark"] #expenseModal #expenseForm .modal-footer {
    background: var(--vz-card-bg, #2a3042);
    border-top-color: rgba(255, 255, 255, 0.12);
  }
}

@media (max-width: 767.98px) {
  .expense-table {
    min-width: 0;
    width: 100%;
  }

  .expense-table-card-body {
    padding-top: 0.5rem;
  }

  .expense-table thead {
    display: none;
  }

  .expense-table tbody,
  .expense-table tr {
    display: block;
    width: 100%;
  }

  .expense-table tbody tr {
    border: 1px solid var(--vz-border-color, #e9ebec);
    border-radius: 0.625rem;
    background: var(--vz-card-bg, #fff);
    padding: 0;
    margin-bottom: 0.75rem;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  }

  [data-layout-mode="dark"] .expense-table tbody tr {
    background: var(--vz-card-bg, #2a3042);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: none;
  }

  .expense-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border: 0;
    padding: 0.45rem 0.85rem;
    width: 100%;
    font-size: 0.875rem;
    line-height: 1.45;
  }

  .expense-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--vz-secondary-color);
    font-size: 0.75rem;
    flex: 0 0 5rem;
  }

  .expense-table td.text-end {
    justify-content: space-between;
    text-align: left !important;
  }

  .expense-table tfoot {
    display: block;
    border: 1px solid var(--vz-border-color, #e9ebec);
    border-radius: 0.625rem;
    background: var(--vz-light, #f3f6f9);
    margin-top: 0.25rem;
    padding: 0.65rem 0.85rem;
  }

  [data-layout-mode="dark"] .expense-table tfoot {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
  }

  .expense-table tfoot tr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
  }

  .expense-table tfoot th {
    display: inline-block;
    width: auto;
    border: 0;
    padding: 0;
    margin: 0;
    font-size: 0.875rem;
  }

  .expense-table tfoot th:first-child {
    flex: 1 1 auto;
    text-align: left !important;
  }

  .expense-table tfoot th:last-child {
    font-size: 0.9375rem;
    font-weight: 700;
  }
}

@media (max-width: 767.98px) {
  .documents-filters-wrap {
    width: 100%;
    gap: 0.65rem !important;
  }

  .documents-filters-wrap .ms-2 {
    margin-left: 0 !important;
  }

  .documents-filter-item {
    width: 100%;
    min-width: 0 !important;
    flex: 1 1 100%;
  }

  .documents-filter-item--search {
    width: 100%;
  }

  .documents-filter-item--search .form-control {
    width: 100% !important;
  }

  .documents-filter-item .form-control,
  .documents-filter-item .form-select {
    width: 100% !important;
  }

  .documents-filter-item--custom-range .d-flex {
    flex-direction: column;
    gap: 0.5rem !important;
  }

  .documents-filter-item--custom-range .align-self-center {
    align-self: flex-start !important;
  }

  .documents-filters-row .project-card .card {
    border-radius: 0.625rem;
  }

  .documents-filters-row .project-card .card-body {
    padding: 1rem;
  }
}

/* Mobile data cards — shared table-to-card layout */
@media (max-width: 767.98px) {

  .table-scroll-wrapper,
  .table-scroll-wrapper--55vh,
  .table-scroll-wrapper--60vh,
  .table-scroll-wrapper--70vh,
  .table-scroll-wrapper--72vh {
    max-height: none !important;
    overflow: visible !important;
  }

  .mobile-card-skip-md {
    display: none !important;
  }

  .mobile-card-title {
    display: block !important;
    padding: 0.75rem 0.85rem !important;
    border-bottom: 1px solid var(--vz-border-color, #e9ebec);
    background: rgba(var(--vz-light-rgb, 243, 246, 249), 0.65);
  }

  [data-layout-mode="dark"] .mobile-card-title {
    background: rgba(255, 255, 255, 0.04);
    border-bottom-color: rgba(255, 255, 255, 0.1);
  }

  .mobile-card-title::before {
    display: none !important;
  }

  .mobile-card-title__main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.65rem;
  }

  .mobile-card-title__text {
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--vz-body-color);
    word-break: break-word;
  }

  .mobile-card-title__amount {
    font-size: 0.875rem;
    color: var(--vz-primary);
    white-space: nowrap;
    flex-shrink: 0;
  }

  [data-layout-mode="dark"] .mobile-card-title__amount {
    color: var(--vz-primary-text-emphasis, #6ea8fe);
  }

  .mobile-card-title__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.35rem;
    font-size: 0.75rem;
    line-height: 1.35;
  }

  .mobile-card-title__badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.35rem;
  }

  .mobile-card-title__badges .badge {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0.3em 0.55em;
  }

  .mobile-card-actions {
    display: block !important;
    padding: 0.65rem 0.85rem !important;
    border-top: 1px solid var(--vz-border-color, #e9ebec);
    background: rgba(var(--vz-light-rgb, 243, 246, 249), 0.35);
  }

  [data-layout-mode="dark"] .mobile-card-actions {
    background: rgba(255, 255, 255, 0.02);
    border-top-color: rgba(255, 255, 255, 0.1);
  }

  .mobile-card-actions::before {
    display: none !important;
  }

  .mobile-card-actions__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
    width: 100%;
    justify-items: stretch;
  }

  .mobile-card-actions__grid .btn,
  .mobile-card-actions__grid form,
  .mobile-card-actions__grid>a {
    width: 100%;
    margin: 0 !important;
  }

  .mobile-card-actions__grid .btn,
  .mobile-card-actions__grid>a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
  }

  .mobile-card-actions__grid>a {
    border: none;
    border-radius: 0.5rem;
    background: transparent;
    padding: 0.55rem;
    font-size: 1.125rem;
    line-height: 1;
    text-decoration: none;
    transition: background-color 0.15s ease, transform 0.1s ease;
  }

  .mobile-card-actions__grid>a:active {
    transform: scale(0.97);
  }

  .mobile-card-actions__grid>a.text-info {
    color: var(--vz-info) !important;
    background: rgba(var(--vz-info-rgb, 41, 156, 219), 0.12);
  }

  .mobile-card-actions__grid>a.text-primary {
    color: var(--vz-primary) !important;
    background: rgba(var(--vz-primary-rgb, 64, 81, 137), 0.12);
  }

  .mobile-card-actions__grid>a.text-danger {
    color: var(--vz-danger) !important;
    background: rgba(var(--vz-danger-rgb, 240, 101, 72), 0.12);
  }

  .mobile-card-actions__grid>a.text-success {
    color: var(--vz-success) !important;
    background: rgba(var(--vz-success-rgb, 10, 179, 156), 0.12);
  }

  [data-layout-mode="dark"] .mobile-card-actions__grid>a.text-info {
    background: rgba(var(--vz-info-rgb, 41, 156, 219), 0.2);
  }

  [data-layout-mode="dark"] .mobile-card-actions__grid>a.text-primary {
    background: rgba(var(--vz-primary-rgb, 64, 81, 137), 0.22);
  }

  [data-layout-mode="dark"] .mobile-card-actions__grid>a.text-danger {
    background: rgba(var(--vz-danger-rgb, 240, 101, 72), 0.2);
  }

  [data-layout-mode="dark"] .mobile-card-actions__grid>a.text-success {
    background: rgba(var(--vz-success-rgb, 10, 179, 156), 0.2);
  }

  .customer-table .mobile-card-actions {
    padding: 0.75rem 0.85rem 0.85rem !important;
    background: transparent;
    border-top: 1px solid var(--vz-border-color, #e9ebec);
  }

  [data-layout-mode="dark"] .customer-table .mobile-card-actions {
    background: transparent;
    border-top-color: rgba(255, 255, 255, 0.1);
  }

  .customer-table .mobile-card-actions__grid {
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(2.75rem, 1fr));
  }

  .shops-page-header,
  .shop-staff-page-header {
    flex-direction: column;
    align-items: stretch !important;
    gap: 0.75rem;
  }
}

@media (max-width: 575.98px) {
  .mobile-card-skip-sm {
    display: none !important;
  }

  .expense-filters-actions {
    grid-template-columns: 1fr;
  }

  .shop-staff-page-actions {
    grid-template-columns: 1fr;
  }

  .shop-staff-pagination {
    flex-direction: column;
    align-items: stretch !important;
    gap: 0.65rem;
    text-align: center;
  }
}

/* Shops & shop staff responsive */
@media (max-width: 767.98px) {

  .shops-table,
  .shop-staff-table {
    min-width: 0;
    width: 100%;
  }

  .shops-table thead,
  .shop-staff-table thead {
    display: none;
  }

  .shops-table tbody,
  .shops-table tr,
  .shop-staff-table tbody,
  .shop-staff-table tr {
    display: block;
    width: 100%;
  }

  .shops-table tbody tr,
  .shop-staff-table tbody tr {
    border: 1px solid var(--vz-border-color, #e9ebec);
    border-radius: 0.625rem;
    background: var(--vz-card-bg, #fff);
    padding: 0;
    margin-bottom: 0.75rem;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  }

  [data-layout-mode="dark"] .shops-table tbody tr,
  [data-layout-mode="dark"] .shop-staff-table tbody tr {
    background: var(--vz-card-bg, #2a3042);
    border-color: rgba(255, 255, 255, 0.1);
  }

  .shops-table td,
  .shop-staff-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    border: 0;
    padding: 0.45rem 0.85rem;
    font-size: 0.875rem;
    line-height: 1.45;
  }

  .shops-table td::before,
  .shop-staff-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--vz-secondary-color);
    font-size: 0.75rem;
    flex: 0 0 5rem;
  }

  .shops-table td.text-end,
  .shop-staff-table td.text-center {
    text-align: left !important;
  }

  .shops-table td[data-label="Actions"],
  .shop-staff-table td[data-label="Actions"] {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .shops-table td[data-label="Actions"]::before,
  .shop-staff-table td[data-label="Actions"]::before {
    display: none;
  }

  .shop-staff-pagination .pagination {
    justify-content: center;
    width: 100%;
  }

  .shop-staff-page-actions,
  .shops-page-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    width: 100%;
  }

  .shop-staff-page-actions .btn:last-child,
  .shops-page-actions .btn:only-child {
    grid-column: 1 / -1;
  }

  .shop-staff-page-actions .btn,
  .shops-page-actions .btn {
    width: 100%;
    margin: 0 !important;
  }
}

/* Shop staff modals — mobile only */
@media (max-width: 575.98px) {

  #addStaffModal .modal-content,
  #editStaffModal .modal-content,
  #setPasswordStaffModal .modal-content,
  #removeStaffModal .modal-content {
    display: flex;
    flex-direction: column;
    max-height: 100dvh;
    overflow: hidden;
  }

  #addStaffModal .modal-content>form,
  #editStaffModal .modal-content>form,
  #setPasswordStaffModal .modal-content>form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
  }

  #addStaffModal form .modal-body,
  #editStaffModal form .modal-body,
  #setPasswordStaffModal form .modal-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
    min-height: 0;
  }

  #addStaffModal .modal-footer,
  #editStaffModal .modal-footer,
  #setPasswordStaffModal .modal-footer {
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 2;
    background: var(--vz-card-bg, #fff);
    border-top: 1px solid var(--vz-border-color, #e9ebec);
  }

  [data-layout-mode="dark"] #addStaffModal .modal-footer,
  [data-layout-mode="dark"] #editStaffModal .modal-footer,
  [data-layout-mode="dark"] #setPasswordStaffModal .modal-footer {
    background: var(--vz-card-bg, #2a3042);
    border-top-color: rgba(255, 255, 255, 0.12);
  }

  #addStaffModal .modal-footer .hstack,
  #editStaffModal .modal-footer .hstack,
  #setPasswordStaffModal .modal-footer .hstack,
  #removeStaffModal .hstack {
    flex-direction: column;
    width: 100%;
    gap: 0.5rem !important;
  }

  #addStaffModal .modal-footer .btn,
  #editStaffModal .modal-footer .btn,
  #setPasswordStaffModal .modal-footer .btn,
  #removeStaffModal .btn,
  #removeStaffModal form {
    width: 100%;
    margin: 0 !important;
  }

  .shops-form-page .text-end {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .shops-form-page .text-end .btn {
    width: 100%;
    margin: 0 !important;
  }

  #showModal .modal-content,
  #editCustomerModal .modal-content {
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  #showModal .modal-content>form,
  #showModal .modal-content>.modal-content,
  #editCustomerModal .modal-content>form,
  #editCustomerModal .modal-content>.modal-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
  }

  #showModal form .modal-body,
  #showModal .modal-body,
  #editCustomerModal form .modal-body,
  #editCustomerModal .modal-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
    min-height: 0;
  }

  #showModal .modal-footer .hstack,
  #editCustomerModal .modal-footer .hstack {
    flex-direction: column;
    width: 100%;
    gap: 0.5rem !important;
  }

  #showModal .modal-footer .btn,
  #editCustomerModal .modal-footer .btn {
    width: 100%;
    margin: 0 !important;
  }
}

/* Customer & supplier list tables */
@media (max-width: 767.98px) {

  .customer-table,
  .supplier-table,
  .customer-orders-table,
  .supplier-purchases-table {
    min-width: 0;
    width: 100%;
  }

  .customer-table thead,
  .supplier-table thead,
  .customer-orders-table thead,
  .supplier-purchases-table thead {
    display: none;
  }

  .customer-table tbody,
  .customer-table tr,
  .supplier-table tbody,
  .supplier-table tr,
  .customer-orders-table tbody,
  .customer-orders-table tr,
  .supplier-purchases-table tbody,
  .supplier-purchases-table tr {
    display: block;
    width: 100%;
  }

  .customer-table tbody tr,
  .supplier-table tbody tr,
  .customer-orders-table tbody tr {
    border: 1px solid var(--vz-border-color, #e9ebec);
    border-radius: 0.625rem;
    background: var(--vz-card-bg, #fff);
    padding: 0;
    margin-bottom: 0.75rem;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  }

  .supplier-purchases-table tbody tr {
    border: 1px solid var(--vz-border-color, #e9ebec);
    border-radius: var(--vz-border-radius, 0.375rem);
    background: var(--vz-card-bg, #fff);
    padding: 0;
    margin-bottom: 0.5rem;
    overflow: hidden;
    box-shadow: none;
  }

  [data-layout-mode="dark"] .customer-table tbody tr,
  [data-layout-mode="dark"] .supplier-table tbody tr,
  [data-layout-mode="dark"] .customer-orders-table tbody tr {
    background: var(--vz-card-bg, #2a3042);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: none;
  }

  [data-layout-mode="dark"] .supplier-purchases-table tbody tr {
    background: var(--vz-card-bg, #2a3042);
    border-color: rgba(255, 255, 255, 0.1);
  }

  .customer-table td,
  .customer-table th,
  .supplier-table td,
  .customer-orders-table td,
  .supplier-purchases-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    border: 0;
    padding: 0.45rem 0.85rem;
    font-size: 0.875rem;
    line-height: 1.45;
  }

  .customer-table td::before,
  .customer-table th::before,
  .supplier-table td::before,
  .customer-orders-table td::before,
  .supplier-purchases-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--vz-secondary-color);
    font-size: 0.75rem;
    flex: 0 0 5rem;
  }

  .customer-orders-table td.mobile-card-amount,
  .supplier-purchases-table td.mobile-card-amount {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--vz-primary);
  }

  [data-layout-mode="dark"] .customer-orders-table td.mobile-card-amount,
  [data-layout-mode="dark"] .supplier-purchases-table td.mobile-card-amount {
    color: var(--vz-primary-text-emphasis, #6ea8fe);
  }

  .supplier-purchases-table td.ps-4,
  .supplier-purchases-table td.pe-4 {
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
  }

  .supplier-detail-page .card-body:has(.supplier-purchases-table) {
    padding: 0.75rem !important;
  }

  .supplier-purchases-table .mobile-card-title {
    background: transparent;
    border-bottom: 0;
    padding-top: 0.65rem !important;
    padding-bottom: 0.25rem !important;
  }

  .supplier-purchases-table tbody tr td:last-child {
    padding-bottom: 0.65rem;
  }

  /* Mobile page & section typography */
  .page-title-box h4 {
    font-size: 1.125rem;
  }

  .page-title-box .breadcrumb {
    font-size: 0.75rem;
  }

  #customerList .card-title,
  #supplierList .card-title,
  .expense-table-card-body~.card-header .card-title,
  .card-header .card-title {
    font-size: 1rem;
  }

  #customerList .card-header .btn,
  #supplierList .card-header .btn,
  .expense-filters-actions .btn,
  .customer-list-actions .btn,
  .supplier-list-actions .btn {
    font-size: 0.8125rem;
  }

  #customerList .search-box .form-control,
  #supplierList .search-box .form-control,
  .expense-filters-form .form-label {
    font-size: 0.875rem;
  }

  #customerList .noresult h5,
  #supplierList .noresult h5,
  .customer-table~.noresult h5,
  .supplier-table-wrap .noresult h5 {
    font-size: 1rem;
  }

  #customerList .noresult p,
  #supplierList .noresult p {
    font-size: 0.8125rem;
  }

  .supplier-detail-page h4.mb-0 {
    font-size: 1.125rem;
  }

  .supplier-detail-meta .text-uppercase {
    font-size: 0.6875rem;
    letter-spacing: 0.04em;
  }

  .supplier-detail-meta .fw-medium,
  .supplier-detail-meta .text-body {
    font-size: 0.875rem;
  }

  .supplier-detail-page .card-animate h4,
  .supplier-detail-page .card-animate .text-uppercase {
    font-size: 0.9375rem;
  }

  .supplier-detail-page .card-animate .text-uppercase {
    font-size: 0.6875rem;
    letter-spacing: 0.03em;
  }

  .supplier-detail-page .card-header .card-title {
    font-size: 0.9375rem;
  }

  .supplier-detail-page .card-header .badge {
    font-size: 0.6875rem;
  }

  .supplier-detail-actions .btn {
    font-size: 0.8125rem;
  }

  .customer-detail-page .user-detail-hero h3 {
    font-size: 1.25rem;
  }

  .customer-detail-page .user-detail-meta {
    font-size: 0.8125rem;
  }

  .customer-detail-page .user-detail-stat h4 {
    font-size: 1.125rem;
  }

  .customer-detail-page .user-detail-stat .small,
  .customer-detail-page .user-detail-stat p.text-muted {
    font-size: 0.75rem;
  }

  .customer-detail-page .user-detail-info-item .small,
  .customer-detail-page .user-detail-info-item .text-muted {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }

  .customer-detail-page .user-detail-info-item .fw-medium {
    font-size: 0.875rem;
  }

  .customer-detail-page .user-detail-tabs .nav-link {
    font-size: 0.8125rem;
    padding: 0.45rem 0.7rem;
  }

  .customer-detail-page .user-detail-tabs .badge {
    font-size: 0.65rem;
  }

  .customer-detail-page .user-detail-hero .btn {
    font-size: 0.8125rem;
  }

  .shops-table code,
  .supplier-table code {
    font-size: 0.8em;
  }

  .customer-list-actions,
  .supplier-list-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    width: 100%;
  }

  .customer-list-actions .btn,
  .supplier-list-actions .btn {
    width: 100%;
    margin: 0 !important;
  }

  .customer-list-actions #remove-actions {
    grid-column: 1 / -1;
    justify-self: end;
    width: auto;
    min-width: 2.5rem;
  }

  .customer-list-actions .add-btn,
  .supplier-list-actions .add-btn {
    grid-column: 1 / -1;
  }

  #customerList .card-header .row.g-4,
  #supplierList .card-header .row.g-4 {
    gap: 0.75rem !important;
  }

  #customerList .card-header .col-sm-auto,
  #supplierList .card-header .col-sm-auto {
    width: 100%;
  }

  .supplier-detail-meta {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .supplier-detail-meta .vr {
    display: none;
  }

  .supplier-detail-meta>div {
    text-align: left !important;
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--vz-border-color, #e9ebec);
  }

  .supplier-detail-meta>div:last-child {
    border-bottom: 0;
  }

  .supplier-detail-actions {
    width: 100%;
  }

  .supplier-detail-actions .btn {
    flex: 1 1 auto;
  }

  .customer-detail-page .user-detail-hero .d-flex.gap-2.ms-lg-auto {
    width: 100%;
    margin-left: 0 !important;
  }

  .customer-detail-page .user-detail-hero .d-flex.gap-2.ms-lg-auto .btn {
    flex: 1 1 auto;
  }

  .customer-detail-page .user-detail-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.25rem;
  }

  .customer-detail-page .user-detail-tabs .nav-link {
    white-space: nowrap;
  }

  /* Marketing pages */
  .marketing-page .marketing-quick-actions {
    flex-direction: column;
    align-items: stretch !important;
  }

  .marketing-page .marketing-quick-actions__buttons {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .marketing-page .marketing-quick-actions__buttons .btn,
  .marketing-page .marketing-create-btn {
    width: 100%;
    margin: 0 !important;
  }

  .marketing-page .marketing-create-btn {
    font-size: 0.9375rem;
    padding: 0.65rem 1rem;
  }

  .marketing-page .marketing-meta-alert>.d-flex.align-items-center {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 0.75rem;
  }

  .marketing-page .marketing-meta-alert .btn.ms-3 {
    margin-left: 0 !important;
    width: 100%;
  }

  .marketing-page .card-header>.d-flex.align-items-center.justify-content-between {
    flex-direction: column;
    align-items: stretch !important;
  }

  .marketing-list-actions {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.5rem;
    width: 100%;
  }

  .marketing-list-actions .btn {
    width: 100%;
    margin: 0 !important;
    font-size: 0.8125rem;
  }

  .marketing-campaign-table {
    min-width: 0;
    width: 100%;
  }

  .marketing-campaign-table thead {
    display: none;
  }

  .marketing-campaign-table tbody,
  .marketing-campaign-table tr {
    display: block;
    width: 100%;
  }

  .marketing-campaign-table tbody tr {
    border: 1px solid var(--vz-border-color, #e9ebec);
    border-radius: 0.625rem;
    background: var(--vz-card-bg, #fff);
    padding: 0;
    margin-bottom: 0.75rem;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  }

  [data-layout-mode="dark"] .marketing-campaign-table tbody tr {
    background: var(--vz-card-bg, #2a3042);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: none;
  }

  .marketing-campaign-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    border: 0;
    padding: 0.45rem 0.85rem;
    font-size: 0.875rem;
    line-height: 1.45;
  }

  .marketing-campaign-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--vz-secondary-color);
    font-size: 0.75rem;
    flex: 0 0 5rem;
  }

  .marketing-campaign-table .mobile-card-actions {
    padding: 0.75rem 0.85rem 0.85rem !important;
    background: transparent;
    border-top: 1px solid var(--vz-border-color, #e9ebec);
  }

  [data-layout-mode="dark"] .marketing-campaign-table .mobile-card-actions {
    background: transparent;
    border-top-color: rgba(255, 255, 255, 0.1);
  }

  .marketing-campaign-table .mobile-card-actions__grid {
    gap: 0.65rem;
    grid-template-columns: repeat(auto-fit, minmax(2.75rem, 1fr));
    width: 100%;
  }

  .marketing-campaign-table .mobile-card-actions__grid .btn {
    width: 100%;
    justify-content: center;
    padding: 0.5rem;
  }

  .marketing-campaign-table-wrap .card-body,
  .marketing-page .card-body:has(.marketing-campaign-table) {
    padding: 0.75rem !important;
  }

  .marketing-page .card-animate h3 {
    font-size: 1.25rem;
  }

  .marketing-page .card-animate .text-uppercase {
    font-size: 0.6875rem;
    letter-spacing: 0.03em;
  }

  .marketing-page .card-animate .small,
  .marketing-page .card-animate .badge {
    font-size: 0.75rem;
  }

  .marketing-detail-banner {
    flex-direction: column;
    align-items: stretch !important;
  }

  .marketing-detail-banner>.d-flex.align-items-center.gap-3 {
    width: 100%;
  }

  .marketing-detail-status {
    width: 100%;
    justify-content: flex-start;
  }

  .marketing-detail-status .btn,
  .marketing-detail-status form {
    flex: 1 1 auto;
  }

  .marketing-detail-status .btn {
    font-size: 0.8125rem;
  }

  .marketing-wizard-progress {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0.35rem !important;
    padding-bottom: 0.25rem;
  }

  .marketing-wizard-progress>.text-muted {
    display: none;
  }

  .marketing-wizard-progress .campaign-step-link {
    flex-shrink: 0;
  }

  .marketing-wizard-progress .step-circle {
    width: 32px !important;
    height: 32px !important;
    font-size: 12px !important;
  }

  .marketing-wizard-footer {
    flex-direction: column;
    align-items: stretch !important;
  }

  .marketing-wizard-footer>.d-flex {
    flex-direction: column;
    width: 100%;
  }

  .marketing-wizard-footer .btn {
    width: 100%;
    margin: 0 !important;
  }

  .marketing-form-actions {
    flex-direction: column;
    width: 100%;
  }

  .marketing-form-actions .btn {
    width: 100%;
    margin: 0 !important;
  }

  .marketing-sync-logs-table {
    min-width: 0;
    width: 100%;
  }

  .marketing-sync-logs-table thead {
    display: none;
  }

  .marketing-sync-logs-table tbody,
  .marketing-sync-logs-table tr {
    display: block;
    width: 100%;
  }

  .marketing-sync-logs-table tbody tr {
    border: 1px solid var(--vz-border-color, #e9ebec);
    border-radius: var(--vz-border-radius, 0.375rem);
    background: var(--vz-card-bg, #fff);
    padding: 0;
    margin-bottom: 0.5rem;
    overflow: hidden;
  }

  [data-layout-mode="dark"] .marketing-sync-logs-table tbody tr {
    background: var(--vz-card-bg, #2a3042);
    border-color: rgba(255, 255, 255, 0.1);
  }

  .marketing-sync-logs-table td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    border: 0;
    padding: 0.45rem 0.85rem;
    font-size: 0.8125rem;
  }

  .marketing-sync-logs-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--vz-secondary-color);
    font-size: 0.6875rem;
    flex: 0 0 4.5rem;
  }

  .marketing-page .card-header .card-title {
    font-size: 1rem;
  }
}

@media (max-width: 575.98px) {

  .mobile-card-title__text {
    font-size: 0.875rem;
  }

  .mobile-card-title__amount {
    font-size: 0.8125rem;
  }

  .mobile-card-title__meta {
    font-size: 0.6875rem;
  }

  .customer-table td,
  .supplier-table td,
  .customer-orders-table td,
  .supplier-purchases-table td,
  .expense-table td,
  .shops-table td,
  .shop-staff-table td {
    font-size: 0.8125rem;
    padding: 0.4rem 0.75rem;
  }

  .customer-table td::before,
  .supplier-table td::before,
  .customer-orders-table td::before,
  .supplier-purchases-table td::before,
  .expense-table td::before,
  .shops-table td::before,
  .shop-staff-table td::before {
    font-size: 0.6875rem;
    flex: 0 0 4.5rem;
  }

  .customer-orders-table td.mobile-card-amount,
  .supplier-purchases-table td.mobile-card-amount {
    font-size: 0.875rem;
  }

  .page-title-box h4 {
    font-size: 1.0625rem;
  }

  .customer-detail-page .user-detail-hero h3 {
    font-size: 1.125rem;
  }

  .supplier-detail-page h4.mb-0 {
    font-size: 1.0625rem;
  }

  .mobile-card-actions__grid>a {
    font-size: 1rem;
  }

  .customer-list-actions,
  .supplier-list-actions {
    grid-template-columns: 1fr;
  }

  .supplier-detail-actions {
    flex-direction: column;
  }

  .supplier-detail-actions .btn {
    width: 100%;
  }

  .customer-detail-page .user-detail-hero .d-flex.gap-2.ms-lg-auto {
    flex-direction: column;
  }

  .customer-detail-page .user-detail-hero .d-flex.gap-2.ms-lg-auto .btn {
    width: 100%;
  }

  .marketing-campaign-table td,
  .marketing-sync-logs-table td {
    font-size: 0.8125rem;
    padding: 0.4rem 0.75rem;
  }

  .marketing-campaign-table td::before,
  .marketing-sync-logs-table td::before {
    font-size: 0.6875rem;
    flex: 0 0 4.5rem;
  }

  .marketing-page .card-animate h3 {
    font-size: 1.125rem;
  }

  .marketing-detail-status {
    flex-direction: column;
    align-items: stretch !important;
  }

  .marketing-detail-status .btn,
  .marketing-detail-status form {
    width: 100%;
  }

  .marketing-wizard-progress .step-circle {
    width: 28px !important;
    height: 28px !important;
    font-size: 11px !important;
  }
}

/* Pending approvals hub */
.approval-page-hero {
  background: linear-gradient(135deg, rgba(var(--vz-warning-rgb), 0.08) 0%, rgba(var(--vz-primary-rgb), 0.06) 100%);
  border: 1px solid rgba(var(--vz-warning-rgb), 0.12);
}

.approval-section-card--products {
  border-top: 3px solid rgba(var(--vz-warning-rgb), 0.85) !important;
}

.approval-section-card--purchases {
  border-top: 3px solid rgba(var(--vz-info-rgb), 0.85) !important;
}

.approval-section-card--returns {
  border-top: 3px solid rgba(var(--vz-primary-rgb), 0.85) !important;
}

.approval-table thead th {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--vz-secondary-color);
  border-bottom-width: 1px;
  background: transparent;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.approval-table tbody tr {
  transition: background-color 0.15s ease;
}

.approval-table tbody tr.is-selected {
  background-color: rgba(var(--vz-success-rgb), 0.06);
}

.approval-row-actions .btn {
  width: 2rem;
  height: 2rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

[data-layout-mode="dark"] .approval-page-hero {
  background: linear-gradient(135deg, rgba(var(--vz-warning-rgb), 0.12) 0%, rgba(var(--vz-primary-rgb), 0.08) 100%);
  border-color: rgba(255, 255, 255, 0.06);
}

[data-layout-mode="dark"] .approval-table tbody tr.is-selected {
  background-color: rgba(var(--vz-success-rgb), 0.1);
}

/*# sourceMappingURL=custom.min.css.map */