body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: 13px;
  padding: 30px;
  background-color: #fff;
  color: #333;
}

.section {
  border: 1px solid #ccc;
  margin-bottom: 20px;
  padding: 15px;
}

h3 {
  color: #0056b3;
  font-size: 15px;
  margin-bottom: 10px;
}

.period-display {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.period-display input[type="datetime-local"] {
  padding: 5px;
  font-size: 13px;
}

.filter-btns button,
.pagination button,
.search-button {
  background-color: #fff;
  border: 1px solid #ccc;
  color: #333;
  padding: 5px 10px;
  margin: 3px 3px 3px 0;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

.filter-btns button:hover,
.pagination button:hover,
.search-button:hover {
  background-color: #007bff;
  color: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  table-layout: fixed;
}

th,
td {
  border: 1px solid #ddd;
  padding: 6px 8px;
  text-align: center;
  word-wrap: break-word;
}

th {
  background-color: #f4f4f4;
}

tr:nth-child(even) td {
  background-color: #fdfdfd;
}

input[type="text"] {
  border: none;
  background: transparent;
  width: 100%;
  text-align: center;
  font-family: inherit;
  font-size: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.print-link {
  color: #007bff;
  text-decoration: underline;
  cursor: pointer;
}

.pagination {
  text-align: right;
  margin-top: 10px;
}

.recharged-value input {
  color: red;
  font-weight: bold;
}

.redeemed-value input {
  color: purple;
  font-weight: bold;
}

th:nth-child(10),
td:nth-child(10) {
  width: 60px; /* Remark */
}

th:nth-child(11),
td:nth-child(11) {
  width: 160px; /* Date */
}

th:nth-child(9),
td:nth-child(9) {
  width: 160px; /* Cashier */
}

@media print {
  tr {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  table {
    width: 100% !important;
    table-layout: auto !important;
    border-collapse: collapse;
  }

  td,
  th {
    word-break: keep-all;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 10px !important;
    vertical-align: middle !important;
    line-height: 1.2;
  }

  .section {
    page-break-inside: avoid !important;
  }

  input[type="text"] {
    width: 100%;
    border: none !important;
    background: transparent !important;
    color: black !important;
    font-size: 10px !important;
  }
}

.section:nth-of-type(2) input[type="text"] {
  padding: 4px;
}

@media print {
  #summary-add-row {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
  }
}

/* Make table scrollable on mobile */
@media (max-width: 768px) {
  .section table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }

  /* Prevent word breaks in table cells */
  th,
  td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .period-display,
  .filter-btns,
  .pagination {
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
  }

  .period-display input,
  .filter-btns button,
  .pagination button,
  .search-button {
    width: 100%;
    box-sizing: border-box;
  }

  .section {
    padding: 10px;
  }

  body {
    padding: 10px;
  }

  h3 {
    font-size: 14px;
  }

  input[type="text"] {
    font-size: 12px;
  }

  .pagination {
    text-align: center;
  }
}
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-responsive table {
  min-width: 1000px; /* Force horizontal scroll if too many columns */
}
