body {
  padding-top: 100px;
  padding-bottom: 200px;
}

@media screen {
  .header-image-print {
    display: none;
  }
}

.customTooltipBigSize {
  min-width: 500px !important;
}
.introjs-tooltipReferenceLayer:has(.customTooltipBigSize) {
  min-width: 500px !important;
  top: 65% !important;
  left: 50% !important;
}
.customTooltip .introjs-tooltip-title, .customTooltipBigSize .introjs-tooltip-title {
  color: #ffffff;
}
.introjs-helperLayer {
  border: 2px solid #ffffff;
}
#startDashboardTour, #startPackingSlipIndexTour, #startCreatePackingSlipIndexTour, #startSinglePackingSlipTour, #startProjectTour {
  position: absolute;
  top: 11%;
  left: 1%;
}


/* ************************ */
/* DASHBOARD */
/* ************************ */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: none;
}




.btn-group-vertical .btn {
  margin-bottom: 5px;
}

.navbar {
  transition: all 0.3s ease;
}

.navbar.shrink {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.nav-item.active {
  font-weight: bold;
}

body#login {
  padding-top: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background-color: #f5f5f5;
}

.form-signin {
  width: 100%;
  max-width: 330px;
  padding: 15px;
  margin: 0 auto;
}

footer {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 50px;
  z-index: 1000;
  padding: 0 2%;
  background-color: #030000;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

footer img {
  height: 60%;
  max-width: 100%;
  object-fit: contain;
}

footer p {
  margin: 0;
}

.bi.bi-file-earmark-plus.float-end {
  cursor: pointer;
}

/* Create Packing Slip Page */
.table-sm th, .table-sm td {
  padding: 0.5rem !important;
}

.form-group-inline {
  display: flex;
  flex-wrap: wrap;
}

.form-group-inline>div {
  flex: 1;
  max-width: 100%;
}

@media (min-width: 768px) {
  .form-group-inline>div {
    min-width: 0;
  }
}
@media (max-width: 768px) {
  footer p.no-print {
    font-size: 70% !important;
  }
  .table.table-striped.table-sm {
    width: 700px !important;
  }
  #uploadReceiptBtn {
    margin-top: 10px;
  }
  h1.card-title {
    font-size: 1.3rem !important;
  }
  #createProjectModal, #editProjectModal {
    top: 20% !important;
  }
}

table thead th {
  white-space: nowrap;
}

.form-group-inline .form-group:first-child {
  margin-right: 1.5rem;
}

.img-preview-container {
  display: flex;
  flex-wrap: wrap;
  margin-top: 10px;
}

.img-preview-wrapper {
  width: 80px;
  position: relative;
  margin-right: 10px;
}

.img-preview {
  width: 80px;
  height: 80px;
  object-fit: contain;
  box-sizing: border-box;
}

.remove-preview {
  position: absolute;
  top: 0;
  right: 0;
  background: #030000;
  border: none;
  color: #ffffff;
  font-size: 16px;
  cursor: pointer;
  z-index: 10;
}

.col-0 {
  width: 1%;
}

/* END Create Packing Slip Page */
.lightbox .lb-image {
  max-width: 90vw;
  /* Set the maximum width */
  max-height: 40vh;
  /* Set the maximum height */
  /* width: auto;
  height: auto; */
  /* min-width: 800px;
  min-height: 600px; */
  object-fit: contain;
  /* Ensure the image fits within the dimensions */
}

.info-card {
  border: 2px solid #030000;
  border-radius: 1px;
  padding: 20px;
  margin-bottom: 20px;
  background-color: #f8f9fa;
}

.info-card h1 {
  color: #030000;
}

.info-card p {
  font-size: 1.1em;
}

.info-card p strong {
  font-weight: bold;
  color: #333;
}

.important-info {
  background-color: #e9ecef;
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 10px;
}

.lb-nav a.lb-prev, .lb-nav a.lb-next {
  opacity: 1;
}

.lb-image {
  max-height: 80vh !important;
  max-width: 80vw !important; 
}

/* .lightbox {
  top: 35% !important; 
} */

/* PRINT SETTINGS */
.print-only,
.print-address {
  display: none;
}

.offscreen {
  position: absolute;
  top: -9999px;
  left: -9999px;
  width: 100%;
}

#pageNumber {
  display: none;
}

/* ************************ */
/* EDIT PACKING SLIP */
/* ************************ */
.img-thumbnail-container {
  position: relative;
  display: inline-block;
  margin-right: 10px;
}
.img-thumbnail-container .remove-image-btn {
  position: absolute;
  top: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}


th:first-child, td:first-child
{
  position:sticky;
  left:0px;
}

/* ************************ */
/* PRINT PACKING SLIP */
/* ************************ */
@media print {
  .no-print, .introjs-hints  {
    display: none !important;
  }

  table { 
    page-break-after:auto;
    width: 100% !important;
    /* table-layout: fixed;  */
  }
  tr    { page-break-inside:avoid; page-break-after:auto }
  td    { 
    page-break-inside:avoid; 
    page-break-after:auto;
    word-wrap: break-word; /* Prevents text overflow */
    overflow-wrap: break-word;
  }
  thead { 
    display:table-header-group; 
    /* Removed margin-top:150px that was causing overlap */
  }
  tfoot { 
    display:table-footer-group;
    page-break-inside: avoid;
  }
  .no-border{
    border: none !important;
  }
  
  /* Ensure tfoot is always visible */
  .table tfoot tr {
    page-break-inside: avoid !important;
    border-top: 2px solid #000 !important;
  }

  @page {
    size: 8.5in 11in;
    margin-top: 0.5in !important;
    margin-bottom: 0.5in;
    margin-left: 0.25in;
    margin-right: 0.25in;
  }

  .pagebreak {
    clear: both;
    page-break-before: always;
    margin-top: 0;
    padding-top: 0.25in;
  }
  
  /* Prevent orphaned headings */
  h3, .lead {
    page-break-after: avoid;
    page-break-inside: avoid;
  }
  
  /* Keep sections together when possible */
  .card {
    page-break-inside: avoid;
  }

  #pageNumber {
    display: block;
    position: fixed;
    bottom: 0.2in;
    right: 0.5in;
    z-index: 2000;
    color: white;
    font-size: 50%;
    font-weight: bold;
  }

  .card {
    margin-bottom: 0.25rem !important;
  }
  
  /* Ensure notes section doesn't orphan */
  #notes {
    margin-top: 0.5rem;
    page-break-before: auto;
  }
  
  #notes + p {
    page-break-before: avoid;
  }

  .last-content {
    margin-bottom: 1rem !important;
  }

  header,
  nav,
  .navbar {
    display: none;
    /* Hides the header */
  }
  .navbar {
    padding-top: 24px;
    padding-bottom: 24px;
    font-size: 0.875rem;
  }

  /* main {
    padding-top: 0.25in;
    padding-bottom: 0;
    width: 100vw;
  } */
  body,
  html {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    box-sizing: border-box;
  }
  
  .table-responsive {
    overflow: visible !important; /* Prevents table from being clipped */
  }
  
  .table-responsive .table, .card, .signature-section {
    font-size: 88% !important;
  }

  .table.table-striped.table-sm.mb-5 {
    margin-bottom: 1rem !important;
  }
  
  /* Ensure table content doesn't overlap with fixed header on subsequent pages */
  .table thead th {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
    background-color: white !important;
  }
  
  /* Prevent table rows from breaking awkwardly */
  .table tbody tr {
    page-break-inside: avoid;
  }
  /* @page :blank {
    @top-center { content: "This page is intentionally left blank." }
  } */


  /* h1, h2, h3, p, div {
    page-break-inside: avoid;
  } */
  .content-section {
    margin-top: 5cm;
  }

  /* footer p {
    color: black;
  } */
  footer {
    display: none !important;
  }

  main {
    padding-top: 0 !important;
    padding-bottom: 0.5in !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    max-width: 100% !important;
  }

  .footer-image-screen {
    display: none;
  }

  .header-image-print {
    display: block;
    width: 2.5in;
    max-height: 0.6in;
    object-fit: contain;
    margin-bottom: 0.15in;
  }

  .print-address {
    display: block;
    font-size: 9pt;
    line-height: 1.3;
    text-align: right;
    float: right;
    margin-top: -0.6in; /* Align with logo */
    margin-bottom: 0.15in;
  }
  
  .print-address p {
    margin: 0;
    padding: 0;
    line-height: 1.3;
  }

  .badge {
    color: black;
    border: 1px solid black;
  }

  .print-only {
    display: block;
  }
}
