/* ============================================================
   EXISTING FUNCTIONAL STYLES (unchanged)
   ============================================================ */
.form-check-input {
  border: 1px solid #dbdade !important;
}
.card-header.crud {
  border-bottom: 1px solid var(--bs-border-color) !important;
  margin-bottom: 15px !important;
  padding-bottom: 15px !important;
}
.disabled {
  color: rgba(79, 70, 229, 0.5);
  background-color: rgba(79, 70, 229, 0.05);
  pointer-events: none;
  cursor: default;
  opacity: 0.6;
}
.was-validated .custom-select:invalid + .select2 .select2-selection { border-color: #dc3545 !important; }
.was-validated .custom-select:valid   + .select2 .select2-selection { border-color: #28a745 !important; }
*:focus { outline: 0; }
.cursor-pointer { cursor: pointer !important; }

.loader {
  position: fixed; height: 100%; top: 0; left: 0;
  width: 100%; z-index: 99999; background: #fffdfd61; display: none;
}
.loader.active-loader { display: block; }
.loader .ajax-content { text-align: center; position: absolute; top: 50%; left: 50%; }

.fancybox__container { z-index: 1080 !important; }
.selectrevertcategory { display: flex; align-items: center; }
.selectrevertcategory .form-check-label { margin-left: 0.5rem; }

.light-style .select2-container--default.select2-container--focus .select2-selection--single .select2-selection__rendered,
.light-style .select2-container--default.select2-container--open  .select2-selection--single .select2-selection__rendered {
  line-height: calc(2.125rem - 1px) !important;
  padding-inline-start: calc(.9375rem - 1px) !important;
  padding-inline-end:   calc(2.25rem  - 1px) !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow   { top: 0; }
.select2-container--default .select2-selection--single .select2-selection__arrow b { background-size: 19px 19px !important; }
.select2-container--default.select2-container--focus .select2-selection,
.select2-container--default.select2-container--open  .select2-selection { border-width: 1px !important; }

.app-brand-logo { max-width: 200px; }

.table.table-capitalize th { text-transform: capitalize; }
.table.table-sm thead tr th           { padding-block: 0.94rem !important; }
.table.table-sm>:not(caption)>*>*    { padding: 0.494rem 0.5rem !important; }
.table.table-sm.fs-sm>:not(caption)>*>* { font-size: 0.9rem !important; }

.img-container { width: 50px; max-width: 50px; margin: 0 auto; }

/* Marketplace brand colours */
.text-walmart { color: #0071ce !important; }
.text-amazon  { color: #ff9900 !important; }
.btn-text-secondary.show.dropdown-toggle.bg-walmart,
.show>.btn-text-secondary.dropdown-toggle.bg-walmart,
.bg-walmart { background: #0071ce !important; }
.btn-text-secondary.show.dropdown-toggle.bg-amazon,
.show>.btn-text-secondary.dropdown-toggle.bg-amazon,
.bg-amazon  { background: #ff9900 !important; }

@media (min-width: 1200px) {
  .layout-navbar .navbar-dropdown.dropdown-marketplace .dropdown-menu {
    min-width: 18rem; overflow: hidden;
  }
}
.dropdown-marketplace-item { padding: 0.75rem 1rem; transition: all 0.2s ease; }
.dropdown-marketplace-item:hover  { background-color: rgba(var(--bs-primary-rgb), 0.08); }
.dropdown-marketplace-item.active { background-color: rgba(var(--bs-primary-rgb), 0.12); border-left: 3px solid var(--bs-primary); }
.badge-marketplace { width: 6px; height: 6px; top: -2px; right: -2px; }

@media (max-width: 575.98px) {
  .table.table-sm thead tr th        { padding-block: 0.66rem !important; text-align: center; }
  .table.table-sm>:not(caption)>*>* { padding: 0.494rem 0.3rem !important; }
  .table.table-sm.fs-sm>:not(caption)>*>* { font-size: 0.70rem !important; }
  .sku { font-size: 10px; }
  .img-container { max-width: 35px; }
}


/* ============================================================
   MODERN COLOUR PALETTE  — Indigo + Emerald
   Primary  : #4f46e5  (indigo-600)
   Success  : #10b981  (emerald-500)
   Warning  : #f59e0b  (amber-500)
   Info     : #06b6d4  (cyan-500)
   Danger   : #ef4444  (red-500)
   ============================================================ */

/* --- CSS variable overrides (Bootstrap 5 picks these up globally) --- */
:root {
  --bs-primary:               #4f46e5;
  --bs-primary-rgb:           79, 70, 229;
  --bs-primary-text-emphasis: #1e1b72;
  --bs-primary-bg-subtle:     #ede9fe;
  --bs-primary-border-subtle: #c4b5fd;

  --bs-success:               #10b981;
  --bs-success-rgb:           16, 185, 129;
  --bs-success-text-emphasis: #065f46;
  --bs-success-bg-subtle:     #d1fae5;
  --bs-success-border-subtle: #6ee7b7;

  --bs-warning:               #f59e0b;
  --bs-warning-rgb:           245, 158, 11;
  --bs-warning-text-emphasis: #78350f;
  --bs-warning-bg-subtle:     #fef3c7;
  --bs-warning-border-subtle: #fde68a;

  --bs-info:                  #06b6d4;
  --bs-info-rgb:              6, 182, 212;
  --bs-info-text-emphasis:    #164e63;
  --bs-info-bg-subtle:        #cffafe;
  --bs-info-border-subtle:    #a5f3fc;

  --bs-danger:                #ef4444;
  --bs-danger-rgb:            239, 68, 68;
  --bs-danger-text-emphasis:  #7f1d1d;
  --bs-danger-bg-subtle:      #fee2e2;
  --bs-danger-border-subtle:  #fecaca;

  --bs-body-bg:               #f0f4ff;
  --bs-link-color:            #4f46e5;
  --bs-link-color-rgb:        79, 70, 229;
}

/* --- Body background --- */
body, .bg-body { background: #f0f4ff !important; }

/* ================================================================
   SIDEBAR  (semi-dark theme bg-menu-theme override)
   ================================================================ */
.bg-menu-theme {
  background: linear-gradient(160deg, #1a1744 0%, #2d2b6e 60%, #312e81 100%) !important;
  border-right: none !important;
}

/* Sidebar brand area */
.bg-menu-theme .app-brand {
  border-bottom: 1px solid rgba(255,255,255,0.08) !important;
  padding-bottom: 0.75rem !important;
}

/* Sidebar menu text and icons */
.bg-menu-theme .menu-link,
.bg-menu-theme .menu-horizontal-prev,
.bg-menu-theme .menu-horizontal-next {
  color: #c7d2fe !important;
}
.bg-menu-theme .menu-link:hover,
.bg-menu-theme .menu-link:focus {
  color: #fff !important;
  background: rgba(255,255,255,0.08) !important;
}
.bg-menu-theme .menu-header { color: #818cf8 !important; }
.bg-menu-theme .menu-icon   { color: #a5b4fc !important; }

/* Active sidebar item */
.bg-menu-theme .menu-item.active > .menu-link:not(.menu-toggle) {
  background: linear-gradient(90deg, #4f46e5 0%, #7c3aed 100%) !important;
  color: #fff !important;
  box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4) !important;
  border-radius: 0.375rem !important;
}
.bg-menu-theme .menu-item.active > .menu-link:not(.menu-toggle) .menu-icon {
  color: #fff !important;
}

/* Open toggle (submenu parent) */
.bg-menu-theme .menu-item.open:not(.menu-item-closing) > .menu-toggle,
.bg-menu-theme .menu-item.active > .menu-link {
  color: #fff !important;
}
.bg-menu-theme .menu-item.open > .menu-link.menu-toggle {
  background: rgba(255,255,255,0.06) !important;
}

/* Submenu bullet */
.bg-menu-theme .menu-sub > .menu-item > .menu-link::before {
  color: #818cf8 !important;
}

/* ================================================================
   NAVBAR
   ================================================================ */
.layout-navbar {
  background: rgba(240, 244, 255, 0.92) !important;
  backdrop-filter: saturate(180%) blur(10px) !important;
  border-bottom: 1px solid rgba(79, 70, 229, 0.1) !important;
  box-shadow: 0 1px 0 rgba(79, 70, 229, 0.06) !important;
}

/* ================================================================
   CARDS
   ================================================================ */
.card {
  border: 1px solid rgba(79, 70, 229, 0.08) !important;
  box-shadow: 0 1px 4px rgba(30, 27, 114, 0.06), 0 4px 16px rgba(30, 27, 114, 0.04) !important;
  border-radius: 0.75rem !important;
}
.card-header {
  border-bottom: 1px solid rgba(79, 70, 229, 0.08) !important;
}

/* ================================================================
   BUTTONS
   ================================================================ */
.btn-primary {
  background: linear-gradient(135deg, #4f46e5 0%, #6d28d9 100%) !important;
  border-color: transparent !important;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35) !important;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #4338ca 0%, #5b21b6 100%) !important;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.45) !important;
}

/* ================================================================
   SUMMARY / STAT CARDS  (bg-label-* classes used in report pages)
   ================================================================ */
.bg-label-primary {
  background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%) !important;
  border-left: 3px solid #4f46e5 !important;
  color: #1e1b72 !important;
}
.bg-label-success {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%) !important;
  border-left: 3px solid #10b981 !important;
  color: #065f46 !important;
}
.bg-label-warning {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
  border-left: 3px solid #f59e0b !important;
  color: #78350f !important;
}
.bg-label-info {
  background: linear-gradient(135deg, #cffafe 0%, #a5f3fc 100%) !important;
  border-left: 3px solid #06b6d4 !important;
  color: #164e63 !important;
}
.bg-label-danger {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%) !important;
  border-left: 3px solid #ef4444 !important;
  color: #7f1d1d !important;
}

/* ================================================================
   TABLES
   ================================================================ */
.table-dark,
thead.table-dark tr,
thead.table-dark th {
  background: linear-gradient(90deg, #1e1b4b 0%, #312e81 100%) !important;
  color: #e0e7ff !important;
  border-color: rgba(255,255,255,0.06) !important;
}
.table-hover > tbody > tr:hover > * {
  background-color: rgba(79, 70, 229, 0.04) !important;
}

/* ================================================================
   BADGES
   ================================================================ */
.badge.bg-primary   { background: #4f46e5 !important; }
.badge.bg-success   { background: #10b981 !important; }
.badge.bg-warning   { background: #f59e0b !important; }
.badge.bg-info      { background: #06b6d4 !important; }
.badge.bg-danger    { background: #ef4444 !important; }
.badge.bg-label-primary { background: rgba(79, 70, 229, 0.16) !important; color: #4f46e5 !important; }
.badge.bg-label-success { background: rgba(16, 185, 129, 0.16) !important; color: #065f46 !important; }
.badge.bg-label-warning { background: rgba(245, 158, 11, 0.16) !important; color: #78350f !important; }

/* ================================================================
   PROGRESS BARS
   ================================================================ */
.progress-bar.bg-primary { background: linear-gradient(90deg, #4f46e5, #7c3aed) !important; }
.progress-bar.bg-success { background: #10b981 !important; }
.progress-bar.bg-warning { background: #f59e0b !important; }
.progress-bar.bg-danger  { background: #ef4444 !important; }
.progress-bar.bg-info    { background: #06b6d4 !important; }

/* ================================================================
   FORM ELEMENTS — focus rings in new primary
   ================================================================ */
.form-control:focus,
.form-select:focus {
  border-color: rgba(79, 70, 229, 0.5) !important;
  box-shadow: 0 0 0 0.2rem rgba(79, 70, 229, 0.15) !important;
}

/* ================================================================
   NAV TABS  (used in Inventory Investment and other pages)
   ================================================================ */
.nav-tabs .nav-link.active {
  color: #4f46e5 !important;
  border-bottom-color: #4f46e5 !important;
  font-weight: 600 !important;
}
.nav-tabs .nav-link:hover {
  color: #4f46e5 !important;
}

/* ================================================================
   TEXT UTILITIES
   ================================================================ */
.text-primary { color: #4f46e5 !important; }
.text-success { color: #10b981 !important; }
.text-warning { color: #f59e0b !important; }
.text-info    { color: #06b6d4 !important; }
.text-danger  { color: #ef4444 !important; }
