/**
 * Custom styles for Largear
 * Add your app-specific overrides here.
 */

/* ========== App-wide: allow page to scroll so all content and footer are visible ========== */
html {
  min-height: 100%;
  height: auto;
}
body {
  min-height: 100vh;
  height: auto;
  overflow-x: hidden;
  overflow-y: scroll;
}
/* Ensure main content area can grow and doesn't trap scroll */
.app-content.content {
  min-height: auto;
}
.app-content .content-wrapper {
  min-height: auto;
  overflow: visible;
}

/* Scrollable table containers: scroll only when content exceeds viewport */
.table-scroll-container {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  max-height: 70vh;
}
.table-scroll-container .datatables-basic {
  margin-bottom: 0;
}
.table-scroll-container .datatables-basic thead th {
  white-space: nowrap;
}

/* Card datatables */
.card-datatable {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.card-datatable.table-scroll-container {
  overflow: auto;
  max-height: 70vh;
}
.card-datatable .datatables-basic {
  margin-bottom: 0;
}
.card-datatable .datatables-basic thead th {
  white-space: nowrap;
}
.modal .card-datatable {
  max-height: min(50vh, 400px);
  overflow-y: auto;
}

/* Sticky columns (right side) */
.sticky-col {
  position: sticky;
  z-index: 2;
}
.sticky-col-action {
  right: 0;
}
.sticky-col-status {
  right: 100px; /* width of action column */
}
thead .sticky-col {
  z-index: 3;
  background-color: #f5f5f9;
}
/* Opaque background so scrolled content doesn't show through */
tbody tr .sticky-col {
  background-color: #fff;
  box-shadow: inset 0 0 0 9999px var(--bs-table-accent-bg, transparent);
}
tbody tr:hover .sticky-col {
  background-color: #f6f6f9;
}
/* Shadow to indicate scrollable content */
.sticky-col-status::before,
.sticky-col-action::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 0;
  bottom: 0;
  width: 6px;
  box-shadow: inset -6px 0 6px -6px rgba(0,0,0,0.15);
  pointer-events: none;
}

/* Add Inventory modal: last stock row no bottom border */
#add-inv-rows .add-inv-row:last-child {
  border-bottom: none !important;
}

/* App-wide pagination: consistent rounded buttons and visible page numbers */
.pagination-wrapper .pagination {
  gap: 2px;
}
.pagination-wrapper .page-link {
  border-radius: 0.375rem;
  min-width: 2.25rem;
  text-align: center;
}
.pagination-wrapper .page-item.active .page-link {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
}
.pagination-wrapper .page-item:not(.active) .page-link:hover {
  background-color: var(--bs-light);
}

/* Consistent button radius for form actions (Filter, Reset, etc.) */
.btn,
.form-control,
.form-select {
  border-radius: 0.375rem;
}

/* HSN / status badges: ensure readable contrast for Active/Inactive */
.badge.bg-label-success {
  background-color: rgba(115, 190, 115, 0.2);
  color: #198754;
}
.badge.bg-label-secondary {
  background-color: rgba(159, 168, 178, 0.2);
  color: #6c757d;
}
