:root {
  --col1-width: 0px;
}

@media (max-width: 768px) {
  .modal-dialog {
    max-width: 100%;
    margin: 0.5rem;
  }

  .datatable-table th,
  .datatable-table td {
    /* padding: 0.4rem; */
    font-size: 0.75rem;
    text-align: center !important;
    padding: 8px 3px !important;
  }

  .datatable-table td {
    padding: 0.4rem;
  }

  /* .datatable-table th {
    padding: 0rem !important;
  } */

  .btn-tight {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
  }

  .table-view { display: none; }
  .card-view { display: block; }
}

@media (min-width: 769px) {
  .card-view { display: none; }
}

.sticky-wrapper {
  max-height: 70vh;
  overflow: auto;
}

.datatable-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
}

/* First column */
/* Header */
.datatable-table th:nth-child(1) {
  position: sticky;
  left: 0;
  z-index: 4;
}

/* First column */
/* .datatable-table th:nth-child(1), */
.datatable-table td:nth-child(1) {
  position: sticky;
  left: 0;
  z-index: 2;
}

/* Second column */
/* Header */
.datatable-table th:nth-child(2) {
  position: sticky;
  left: var(--col1-width);
  z-index: 4;
}

/* Second column */
.datatable-table td:nth-child(2) {
  position: sticky;
  left: var(--col1-width);
  z-index: 2;
}

/* Added by KL on 20260205 - Add button for searching by Date */
/* Push the button to the far right */
.datatable-top .btn-today {
  margin-left: auto;
}

/* Added by KL on 20260205 */
/* Force single-row layout */
.datatable-top {
  display: flex;
  flex-wrap: wrap;   /* KEY: prevents wrapping */
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

/* Remove 100% widths that break flex */
.datatable-top .datatable-dropdown,
.datatable-top .datatable-search {
  width: auto;
}

/* Control proportions */
.datatable-top .datatable-dropdown {
  display: flex;
  flex: 1 1 0;   /* fixed size */
}

.datatable-top .datatable-search {
  flex: 1 1 0;   /* fill remaining space */
}

.datatable-top .datatable-search input {
  width: 100%
}

.datatable-top .date-actions {
  flex: 0 0 100%;           /* full width → new row */
  display: flex;
  justify-content: center;
  margin-top: 0.5rem;
  align-items: center;
  gap: 0.2rem;
}

/* Base (mobile-first) */
.datatable-top .date-actions .btn-today {
  margin-left: 0;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  border-radius: 999px; /* pill look */
  transition: padding 0.2s ease, font-size 0.2s ease;
}

/* Tablet and up */
@media (min-width: 576px) {
  .datatable-top .date-actions .btn-today {
    padding: 0.5rem 1.2rem;
    font-size: 0.95rem;
  }
}

/* Desktop */ 
@media (min-width: 992px) {
  .datatable-top .date-actions .btn-today {
    padding: 0.6rem 1.5rem;
    font-size: 1rem;
  }
}

.btn-today:focus:not(:focus-visible) {
  outline: none;
  box-shadow: none;
}

.circle-btn {
  height: 35px;
  width: 35px;
  /* border-radius: 50%; */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0;
  padding: 0.4rem 0.4rem;
  font-size: 0.85rem;
  border-radius: 999px; /* pill look */
  transition: padding 0.2s ease, font-size 0.2s ease;
  user-select: none;
}

.circle-btn:focus {
  outline: none;
}

.circle-btn:active {
  transform: scale(0.95);
  background-color: #dee2e6;
}

/* Tablet and up */
@media (min-width: 576px) {
  .datatable-top .date-actions .circle-btn {
    padding: 0.8rem 0.8rem;
    font-size: 0.95rem;
  }
}

/* Desktop */ 
@media (min-width: 992px) {
  .datatable-top .date-actions .circle-btn {
    padding: 1.2rem 1.2rem;
    font-size: 1rem;
  }
}

@media (hover: hover) {
  .btn-today:not(.active):hover {
    background-color: inherit !important;
    box-shadow: none !important;
  }
}

.btn-today:not(.active):hover {
  background-color: inherit !important;
  color: inherit !important;
}

.btn-today:focus:not(.active),
.btn-today:focus-visible:not(.active) {
  background-color: inherit;
  box-shadow: none;
  outline: none;
}

.datatable-search {
  position: relative;
}

.datatable-search .clear-search {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  cursor: pointer;
  /* color: #888; */
  display: none;
  user-select: none;
  padding: 6px;
  color: var(--cui-body-color, #666);
}

.datatable-input {
  -webkit-appearance: searchfield;
  appearance: searchfield;
}

input[type="search"]::-webkit-search-cancel-button {

  /* Remove default */
  -webkit-appearance: none;

  /* Now your own custom styles */
   height: 14px;
   width: 14px;
   display: block;
   background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAAn0lEQVR42u3UMQrDMBBEUZ9WfQqDmm22EaTyjRMHAlM5K+Y7lb0wnUZPIKHlnutOa+25Z4D++MRBX98MD1V/trSppLKHqj9TTBWKcoUqffbUcbBBEhTjBOV4ja4l4OIAZThEOV6jHO8ARXD+gPPvKMABinGOrnu6gTNUawrcQKNCAQ7QeTxORzle3+sDfjJpPCqhJh7GixZq4rHcc9l5A9qZ+WeBhgEuAAAAAElFTkSuQmCC);
  /* setup all the background tweaks for our custom icon */
  background-repeat: no-repeat;

  /* icon size */
  background-size: 14px;

}

.datatable-bottom {
  width: max-content;
}