﻿label.is-invalid {
  display: none !important;
}

.custom-header {
  background-color: #3b7ddd;
}
@media screen and (max-width: 576px) {
  .refill-qty {
    font-size: 14px;
  }

  .change-btn {
    padding: 5px 10px;
    font-size: 13px;
  }
}
.slot-box {
  width: 7rem; /* Same as image size */
}

.slot-box .product-img {
  width: 7rem;
  height: 7rem;
  object-fit: contain;
}

.slot-box .change-btn,
.slot-box .form-select {
  width: 100%;
  font-size: 0.875rem;
  padding: 0.25rem 0.5rem;
  box-sizing: border-box;
  text-align: center;
}

.price-label {
  font-size: 0.9rem;
}
div.dataTables_filter {
  display: none;
}
.select2-selection__arrow {
  display: none !important;
}

.select2-container .select2-selection--single {
  height: 32px !important; /* Match with the input field height */
  border: 1px solid #ced4da !important; /* Bootstrap default input border color */
  padding: 5px 10px !important; /* Adjust padding to align with textboxes */
}

.select2-container--default
  .select2-selection--single
  .select2-selection__rendered {
  line-height: 19px !important;
}
.badge {
  padding: 0.4em 1.2em 0.4em 1.2em !important;
  font-size: 80% !important;
  font-weight: 500 !important;
  border-radius: 10px !important;
}
.modern-service-orders {
  background: #fff;
  border: none;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.day-section {
  border: 1px solid #e8ecef;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  background: #fff;
}

.day-name {
  font-size: 1.1rem;
}

.order-count {
  background-color: rgba(255, 255, 255, 0.25);
  color: black;
  font-size: 0.85rem;
  padding: 4px 8px;
}

.today-badge {
  background-color: #ff6b6b;
  color: white;
  font-size: 0.8rem;
  padding: 4px 8px;
}

.tomorrow-badge {
  background-color: #feca57;
  color: #333;
  font-size: 0.8rem;
  padding: 4px 8px;
}

.orders-table-container {
  overflow-x: auto;
}

/* Separate scroll for Service Orders list area */
.so-scroll {
  max-height: 70vh;
  overflow: auto;
}

.modern-orders-table {
  width: 100%;
  border-collapse: collapse;
}

.modern-orders-table thead {
  background-color: #f8fafc;
}

.modern-orders-table th {
  padding: 14px 10px;
}

.modern-orders-table td {
  padding: 14px 10px;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
}

.modern-orders-table tbody tr {
  transition: all 0.2s ease;
}

.modern-orders-table tbody tr:hover {
  background-color: #f7fafc;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.location-link {
  color: #4a69bd;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.location-link:hover {
  color: #1e3799;
  text-decoration: underline;
}

.modern-assign-select,
.modern-move-day-select {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.85rem;
  transition: all 0.2s;
  background: white;
}

.modern-assign-select:focus,
.modern-move-day-select:focus {
  border-color: #4a69bd;
  box-shadow: 0 0 0 3px rgba(74, 105, 189, 0.1);
  outline: none;
}

.no-orders {
  background-color: #f8fafc;
  color: #718096;
}

.no-orders-icon {
  font-size: 2rem;
  margin-bottom: 12px;
  opacity: 0.6;
}

.no-orders-text {
  font-style: italic;
  font-size: 0.9rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .modern-orders-table {
    font-size: 0.82rem;
  }

  .modern-orders-table th,
  .modern-orders-table td {
    padding: 10px 6px;
  }

  .day-name {
    font-size: 1rem;
  }

  .modern-move-back-btn {
    padding: 4px 8px;
    font-size: 0.75rem;
  }

  .modern-assign-select,
  .modern-move-day-select {
    font-size: 0.8rem;
    padding: 4px 8px;
  }

  .order-count,
  .today-badge,
  .tomorrow-badge {
    font-size: 0.75rem;
    padding: 3px 6px;
  }
}
.day-header {
  background: #e1e2e2;
}
/* Default (desktop/laptop) */
.col-status {
  width: 8%;
}

.col-group {
  width: 8%;
}

.col-location {
  width: 20%;
}

.col-count {
  width: 5%;
}

.col-sales {
  width: 10%;
}

.col-sales-prev {
  width: 10%;
}

.col-assigned {
  width: 15%;
}

.col-move {
  width: 15%;
}

.col-actions {
  width: 10%;
}

/* Medium screens (iPad ~ ≤ 991px) */
@media (max-width: 991px) {
  .col-status {
    width: 8%;
  }

  .col-group {
    width: 8%;
  }

  .col-location {
    width: 15%;
  }

  .col-count {
    width: 5%;
  }

  .col-sales {
    width: 10%;
  }

  .col-sales-prev {
    width: 10%;
  }

  .col-assigned {
    width: 15%;
  }

  .col-move {
    width: 25%;
  }

  .col-actions {
    width: 10%;
  }
}

/* Small screens (phones ~ ≤ 767px) */
@media (max-width: 767px) {
  .col-status {
    width: 8%;
  }

  .col-group {
    width: 8%;
  }

  .col-location {
    width: 15%;
  }

  .col-count {
    width: 5%;
  }

  .col-sales {
    width: 10%;
  }

  .col-sales-prev {
    width: 10%;
  }

  .col-assigned {
    width: 15%;
  }

  .col-move {
    width: 25%;
  }

  .col-actions {
    width: 10%;
  }
}
/* Responsive horizontal scrolling for daily breakdown tables */
.daily-table-scroll {
  -webkit-overflow-scrolling: touch;
  position: relative;
  max-height: none;
}

/* Make entire header row sticky at top - header stays fixed */
#tblDailyLocations thead tr,
#tblDailyMachines thead tr,
#tblDailyItems thead tr {
  position: sticky;
  top: 0;
  z-index: 100;
}

/* All header cells stay fixed at top (sticky top) - they scroll horizontally with content */
#tblDailyLocations thead th,
#tblDailyMachines thead th,
#tblDailyItems thead th {
  background-color: #f8f9fa !important;
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Sticky first column for name column - stays on left when scrolling horizontally */
/* First column header: sticky both top and left */
/* Items Sold header stays single line */
#tblDailyItems thead th:first-child {
  position: sticky;
  left: 0;
  top: 0;
  z-index: 101;
  background-color: #f8f9fa !important;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
  min-width: 200px;
  max-width: 200px;
}

/* Location and Machine headers: allow wrapping for long names */
#tblDailyLocations thead th:first-child,
#tblDailyMachines thead th:first-child {
  position: sticky;
  left: 0;
  top: 0;
  z-index: 101;
  background-color: #f8f9fa !important;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
  white-space: normal;
  word-wrap: break-word;
  word-break: break-word;
  line-height: 1.4;
  min-width: 200px;
  max-width: 200px;
}

/* First column body cells: sticky left only (not top) */
/* Location and Machine tables: allow text wrapping for long names */
#tblDailyLocations tbody td:first-child,
#tblDailyMachines tbody td:first-child {
  position: sticky;
  left: 0;
  z-index: 10;
  word-wrap: break-word;
  word-break: break-word;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
  white-space: normal;
  min-width: 200px;
  max-width: 200px;
  background-color: #fff;
  line-height: 1.4;
  padding: 8px;
}

/* Items Sold first column: allow text wrapping for long product names */
#tblDailyItems thead th:first-child {
  white-space: nowrap;
}

#tblDailyItems tbody td:first-child {
  position: sticky;
  left: 0;
  z-index: 10;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
  white-space: normal;
  word-wrap: break-word;
  word-break: break-word;
  min-width: 200px;
  max-width: 200px;
  background-color: #fff;
  line-height: 1.4;
  padding: 8px;
}

/* Ensure table wrapper doesn't break layout */
#tblDailyLocations_wrapper,
#tblDailyMachines_wrapper,
#tblDailyItems_wrapper {
  width: 100%;
}

/* Striped row background handling for sticky column */
#tblDailyLocations tbody tr:nth-child(even) td:first-child,
#tblDailyMachines tbody tr:nth-child(even) td:first-child,
#tblDailyItems tbody tr:nth-child(even) td:first-child {
  background-color: #f9f9f9;
}

#tblDailyLocations tbody tr:nth-child(odd) td:first-child,
#tblDailyMachines tbody tr:nth-child(odd) td:first-child,
#tblDailyItems tbody tr:nth-child(odd) td:first-child {
  background-color: #fff;
}

/* Mobile responsive styles for daily breakdown tables */
@media (max-width: 767px) {
  /* Adjust table container for mobile */
  .daily-table-scroll {
    margin-left: -15px;
    margin-right: -15px;
    padding-left: 15px;
    padding-right: 15px;
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
    overflow-y: visible;
  }

  /* Reduce first column width on mobile */
  #tblDailyLocations thead th:first-child,
  #tblDailyMachines thead th:first-child,
  #tblDailyItems thead th:first-child {
    min-width: 150px;
    max-width: 150px;
    font-size: 0.875rem;
    padding: 8px 6px;
  }

  #tblDailyLocations tbody td:first-child,
  #tblDailyMachines tbody td:first-child {
    min-width: 150px;
    max-width: 150px;
    font-size: 0.875rem;
    padding: 8px 6px;
  }

  #tblDailyItems tbody td:first-child {
    min-width: 150px;
    max-width: 150px;
    font-size: 0.875rem;
    padding: 8px 6px;
  }

  /* Reduce font size for date columns on mobile */
  #tblDailyLocations thead th:not(:first-child),
  #tblDailyLocations tbody td:not(:first-child),
  #tblDailyMachines thead th:not(:first-child),
  #tblDailyMachines tbody td:not(:first-child),
  #tblDailyItems thead th:not(:first-child),
  #tblDailyItems tbody td:not(:first-child) {
    font-size: 0.8rem;
    padding: 8px 6px;
    white-space: nowrap;
    min-width: 80px;
  }

  /* Ensure tables have minimum width for scrolling */
  #tblDailyLocations,
  #tblDailyMachines,
  #tblDailyItems {
    min-width: 100%;
  }

  /* Adjust wrapper width on mobile */
  #tblDailyLocations_wrapper,
  #tblDailyMachines_wrapper,
  #tblDailyItems_wrapper {
    width: 100%;
    overflow-x: auto;
  }

  /* Improve touch scrolling on mobile */
  .daily-table-scroll::-webkit-scrollbar {
    height: 8px;
  }

  .daily-table-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
  }

  .daily-table-scroll::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
  }

  .daily-table-scroll::-webkit-scrollbar-thumb:hover {
    background: #555;
  }

  /* Section headings adjustment */
  #dailyBreakdownContent h6 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
  }
}

/* Small mobile devices (≤ 576px) */
@media (max-width: 576px) {
  /* Further reduce first column width on very small screens */
  #tblDailyLocations thead th:first-child,
  #tblDailyMachines thead th:first-child,
  #tblDailyItems thead th:first-child {
    min-width: 120px;
    max-width: 120px;
    font-size: 0.8rem;
    padding: 6px 4px;
  }

  #tblDailyLocations tbody td:first-child,
  #tblDailyMachines tbody td:first-child {
    min-width: 120px;
    max-width: 120px;
    font-size: 0.8rem;
    padding: 6px 4px;
  }

  #tblDailyItems tbody td:first-child {
    min-width: 120px;
    max-width: 120px;
    font-size: 0.8rem;
    padding: 6px 4px;
  }

  /* Further reduce date column sizes */
  #tblDailyLocations thead th:not(:first-child),
  #tblDailyLocations tbody td:not(:first-child),
  #tblDailyMachines thead th:not(:first-child),
  #tblDailyMachines tbody td:not(:first-child),
  #tblDailyItems thead th:not(:first-child),
  #tblDailyItems tbody td:not(:first-child) {
    font-size: 0.75rem;
    padding: 6px 4px;
    min-width: 70px;
  }

  /* Table container adjustments for very small screens */
  .daily-table-scroll {
    margin-left: -10px;
    margin-right: -10px;
    padding-left: 10px;
    padding-right: 10px;
  }
}
