body {
  font-family: Arial, sans-serif;
  margin: 20px;
  background-color: #F9F5E5;
}

table {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 10px;
  table-layout: fixed;
  min-width: 1600px; /* Adjust depending on your dataset */
}

th, td {
  border: 1px solid #ddd;
  padding: 8px;
}

th {
  cursor: pointer;
  background: #f2f2f2;
  position: sticky;
  top: 0;
  z-index: 2;
}

td:first-child, th:first-child {
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 3;
}

input {
  width: 95%;
  padding: 4px;
  margin: 2px 0;
}

.pagination {
  margin-top: 10px;
}
.pagination button {
  margin: 2px;
  padding: 5px 10px;
}

/* Select2 adjustments */
.select2-container {
  width: 100% !important;
  font-size: 0.9em;
}
.select2-selection__choice {
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.select2-selection__rendered {
  display: flex !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
}
.select2-dropdown {
  z-index: 1000 !important;
}

/* Responsive table wrapper */
.table-wrapper {
  overflow-x: auto;
  max-width: 100%;
}

/* Responsive stacked layout */
@media (max-width: 800px) {
  .table-wrapper {
    overflow-x: visible;
  }
  table, thead, tbody, th, td, tr {
    display: block;
    width: 100%;
  }
  thead { display: none; }
  tr {
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0.5rem;
    background: #fff;
    max-width: 500px;
  }
  td {
    display: block;
    border: none;
    padding: 0.25rem 0;
  }
  td::before {
    content: attr(data-label);
    display: block;
    font-weight: bold;
    margin-bottom: 0.2rem;
    color: #444;
  }
}

/* Filters panel */
#filterPanel { margin-bottom: 1rem; }
#filterToggle {
  display: none;
  width: 100%;
  text-align: left;
  padding: 0.5rem;
  background: #f2f2f2;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
}
#filterControls {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.5rem;
  margin-top: 0.5rem;
}
#filterControls.collapsed { display: none; }
#filterControls label {
  display: block;
  font-size: 0.8rem;
  margin-bottom: 0.2rem;
  color: #444;
}
@media (max-width: 800px) {
  #filterToggle { display: block; }
  #filterControls { display: none; }
  #filterControls.expanded { display: grid; }
}

/* Tooltip styling */
.tooltip-float {
  position: absolute;
  z-index: 99999;
  background-color: #333;
  color: #fff;
  text-align: left;
  padding: 6px 8px;
  border-radius: 4px;
  max-width: 250px;
  font-size: 0.85em;
  line-height: 1.3;
  white-space: normal;
  pointer-events: none;
}
.tooltip-float::after {
  content: "";
  position: absolute;
  border-width: 5px;
  border-style: solid;
  border-color: #333 transparent transparent transparent;
  top: 100%;
  left: 10px;
}

.col-title {
  width: 200px;
  min-width: 200px;
}

.col-fills {
  width: 200px;
  min-width: 200px;
}

.banner {
  display: block;
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  margin: 1rem 0;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
