/* style.css version 3, 2025-10-16 */

html {
  font-size: 16px; /* normal screens */
}

@media (max-width: 1400px) {
  html { font-size: 15px; }  /* ~94% */
}

@media (max-width: 1200px) {
  html { font-size: 14px; }  /* ~88% */
}

@media (max-width: 1000px) {
  html { font-size: 13px; }  /* ~81% */
}

table th, table td {
  padding: 0.5rem 0.75rem;
  vertical-align: middle;
}
table thead th {
  line-height: 1.1;   /* tighter header line spacing */
  font-weight: 600;   /* keep header bold but compact */
}


#screenLayout {
  position: relative;
  overflow-x: hidden;
}

/* Sidebar base */
#browseSidebar {
  width: 260px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Desktop (md and up): always visible */
@media (min-width: 768px) {
  #browseSidebar {
    transform: translateX(0);
    position: relative;
  }
  #mainContent {
    transition: margin-left 0.3s ease;
    margin-left: 0;
  }
}

/* ===============================
   Sidebar & Responsive Layout
=============================== */
#browseSidebar {
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Desktop (md and up): fixed visible */
@media (min-width: 768px) {
  #browseSidebar {
    transform: translateX(0);
    position: relative;
    width: 260px;
  }
  #mainContent {
    transition: margin-left 0.3s ease;
    margin-left: 0;
  }
}

/* ========================================
   Desktop view: keep sidebar always visible
======================================== */
@media (min-width: 768px) {
  #browseSidebar.offcanvas {
    position: relative !important;
    transform: none !important;
    visibility: visible !important;
    width: 260px !important;
    background: #f8f9fa;
    box-shadow: inset -1px 0 0 rgba(0,0,0,0.1);
  }
  #browseSidebar .offcanvas-header .btn-close {
    display: none; /* hide close button on desktop */
  }
  #mainContent {
    margin-left: 0 !important;
  }
}


/*-----------------------------------------------------------------------------------------------------------------------------*/
/* changes for mobile tables - to make fields bigger when they are quite a fie fields on the table - not scrolling - this size */
/*-----------------------------------------------------------------------------------------------------------------------------*/
/* === Fix table scroll on mobile === */
/* === Fix narrow mobile tables === */
.table-responsive {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
}

.table-responsive table {
  width: max-content;     /* allow table to expand naturally */
  min-width: 600px;       /* you can tweak this (try 800px if needed) */
  table-layout: auto;     /* don't force equal-width columns */
}

/* Prevent text wrapping */
.table td,
.table th {
  white-space: nowrap;
}

/* Optional: improve usability on very small screens */
@media (max-width: 768px) {
  .table-responsive {
    margin-bottom: 1rem;
  }
  .table td, .table th {
    padding: 0.35rem 0.5rem;
    font-size: 0.85rem;
  }
}
/* new additional section ----------------------------------------------------------------------------------------------------*/
/* Ensure input fields in tables never collapse on mobile */
/* ✅ Apply input width rules globally (not just mobile) */
.table input[type="text"],
.table input[type="number"],
.table input[type="date"],
.table select {
  min-width: 100px;     /* reasonable base width */
}

/* Wider for likely-long fields */
.table input[name*="desc"],
.table input[name*="name"],
.table input[name*="remarks"],
.table input[name*="note"] {
  min-width: 160px;
}

/* Narrower for IDs, qty, etc. */
.table input[name*="id"],
.table input[name*="qty"],
.table input[name*="code"] {
  min-width: 70px;
}

/* new additional section end----------------------------------------------------------------------------------------------------*/
/*  formatting for filter at top of dynamic table--------------------------------------------------------------------------------*/
/* --- Dynamic list tab filter bar --- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

/* Match input text color to table text (theme aware) */
.filter-bar .form-control,
.filter-bar .form-select {
  color: var(--bs-body-color);
}

/* Keep similar height for date inputs across browsers */
.filter-bar input[type="date"].form-control {
  min-height: calc(1.5em + 0.75rem + 2px);
}

/* When screen is wide enough, keep them in one row */
@media (min-width: 768px) {
  .filter-bar {
    flex-wrap: nowrap;
  }
}

/* On mobile, center them and allow wrapping */
@media (max-width: 767px) {
  .filter-bar {
    justify-content: center;
  }
}

/* Make filter inputs consistent size */
.filter-bar .form-control,
.filter-bar .form-select {
  min-width: 120px;
  flex: 0 1 auto;
}

/* Optional: compact spacing on mobile */
@media (max-width: 575px) {
  .filter-bar .form-control,
  .filter-bar .form-select {
    font-size: 0.85rem;
    padding: 0.3rem 0.4rem;
  }
}

/* --- Filter bar unified layout --- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.filter-bar .form-control,
.filter-bar .form-select {
  color: var(--bs-body-color);     /* match table text color */
  min-width: 120px;
  flex: 0 1 auto;
}

@media (min-width: 768px) {
  .filter-bar {
    flex-wrap: nowrap;             /* single row on desktop */
  }
}

@media (max-width: 767px) {
  .filter-bar {
    justify-content: center;       /* center nicely on mobile */
  }
}

input[type="date"].form-control {
  min-height: calc(1.5em + 0.75rem + 2px);
}


/* changes for mobile tables - end */
/*-----------------------------------------------------------------------------------------------------------------------------*/

/* Only raise dropdowns that are inside the top navbar */
.navbar .dropdown-menu {
  z-index: 2000 !important;
}



.table-responsive {
  max-height: calc(100vh - 250px); /* adjust as needed */
  overflow-y: auto;
}


/*-----------------------------------------------------------------------------------------------------------------------------*/
/* new side bar table formatting
/*-----------------------------------------------------------------------------------------------------------------------------*/
/*test*/

/*test*/
.table-horizontal-scroll {
    height: 350px; /* Or a suitable height for scrolling */
    overflow-y: auto; /* Enables vertical scrolling */
    position: relative; /* Important for sticky positioning context */
}

.table-horizontal-scroll thead th {
    position: sticky;
    top: 0;
    background-color: #f0f0f0; /* Solid background to hide content behind */
    z-index: 10; /* Ensure header is on top */
    padding: 10px;
    border-bottom: 1px solid #ccc;
}

.table-horizontal-scroll tbody td {
    padding: 1px;
    border-bottom: 1px solid #eee;
}






/*google test end
/* --- Sticky right-hand "Actions" column --- */

.delete-col {
  position: sticky;
  right: 0;                /* stick to right edge */
  background: #fff;        /* solid background so rows don't show through */
  z-index: 5;              /* sit above table content */
  
}


/* make delete button a bit smaller for dense tables */
#browseList .btn-delete-record {
  padding: 2px 5px;
  font-size: 0.75rem;
  line-height: 1;
}

#browseList .btn-delete-record {
  padding: 2px 4px;
  font-size: 0.75rem;

}


.table-light{ background-color: #160202;}
/*-----------------------------------------------------------------------------------------------------------------------------*/
/* new side bar table formatting - END
/*-----------------------------------------------------------------------------------------------------------------------------*/

