
.bd-placeholder-img {
font-size: 1.125rem;
text-anchor: middle;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}

@media (min-width: 768px) {
.bd-placeholder-img-lg {
  font-size: 3.5rem;
}
}

button:focus:not(:focus-visible) {
  box-shadow: none;
  outline: none;
}

#starRating svg {
  stroke: gray;
  fill: none;
  stroke-width: 2;
  margin-right: 4px;
  cursor: pointer;
  transition: fill 0.2s ease, stroke 0.2s ease;
}

#starRating svg.active,
#starRating-x svg.active {
  stroke: gray;
  fill: gold;
}

.tooltip-inner {
  text-align: left;
}

@media (max-width: 767.98px) {
  .table-responsive.col-lg-6 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

#toggle-events {
  min-width: 100px; /* Adjust to fit longest text */
}

html {
  scroll-behavior: smooth;
}

/* Prevent small horizontal scroll on tables */
@media (min-width: 768px) {
  .table-responsive {
    overflow-x: visible;
  }

  body {
    overflow-x: hidden;
  }
}


/* Let pagination wrap on narrow screens */
.dataTables_paginate .pagination {
  flex-wrap: wrap;
}

/* Slight spacing between wrapped rows */
.dataTables_paginate .pagination .page-item {
  margin-bottom: .25rem;
}

/* Tighter buttons on phones */
@media (max-width: 576px) {
  .dataTables_paginate .pagination .page-link {
    padding: .375rem .5rem;
    font-size: .9rem;
  }
}

/* Optional: prefer no wrap on wider screens */
@media (min-width: 768px) {
  .dataTables_paginate .pagination {
    flex-wrap: nowrap;
  }
}

/* Make sidebar scrollable */
.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  overflow-y: auto;
  padding-top: 60px; /* adjust for navbar height if needed */
  background-color: #fff; /* optional for visual consistency */
  z-index: 1000; /* ensure it's above content */
}


/* ======================================================
   TOM SELECT — Bootstrap-Compatible Global Styling
   ====================================================== */

/* ------------------------------------------------------
   Base Input Styling (used for all selects)
   ------------------------------------------------------ */
.ts-control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  min-height: 38px;
  padding: 6px 12px;
  font-size: 1rem;
  line-height: 1.5;
  color: #212529;
  background-color: #fff;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

/* Focus */
.ts-control.focus {
  border-color: #86b7fe;
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Input field inside control */
.ts-control input {
  font-size: 1rem;
  font-weight: 500;
  border: none;
  outline: none;
  background: none;
  flex-grow: 1;
  padding: 4px 6px;
}

/* Remove duplicate borders from TomSelect wrapper */
.tomselect-bootstrap.ts-wrapper {
  border: none !important;
  box-shadow: none !important;
  background: none;
  padding: 0;
}

/* ======================================================
   SINGLE SELECTS (Origin, Roast Level if single, etc.)
   ====================================================== */
.tomselect-bootstrap.ts-wrapper.single .ts-control {
  position: relative;
  height: 38px;
  padding: 0.375rem 2rem 0.375rem 0.75rem;
  cursor: pointer;
}

/* Optional clear button inside single selects */
.tomselect-bootstrap.ts-wrapper.single .ts-control .ts-clear-button {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  color: #6c757d;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.tomselect-bootstrap.ts-wrapper.single .ts-control .ts-clear-button:hover {
  opacity: 1;
  color: #dc3545;
}

/* ======================================================
   MULTI SELECTS (Tags, Origin, Roast Level, Roaster Type)
   ====================================================== */
.tomselect-bootstrap.ts-wrapper.multi .ts-control {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  min-height: 38px;
  padding: 4px 8px;
  font-size: 1rem;
  line-height: 1.5;
  background-color: #fff;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  gap: 6px;
  transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

/* Focus */
.tomselect-bootstrap.ts-wrapper.multi .ts-control.focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Input spacing & height normalization */
.tomselect-bootstrap.ts-wrapper.multi .ts-control input {
  min-height: 24px;
  padding: 0 4px !important;
  margin: 0 !important;
  line-height: 1.3;
  font-size: 1rem;
}

/* Tag “pills” inside multi-selects */
.tomselect-bootstrap.ts-wrapper.multi .ts-control > .item,
.ts-control > .item.tag-pill {
  background-color: #0d6efd;
  color: #fff;
  border-radius: 5px;
  padding: 2px 8px;
  font-size: 0.95rem;
  font-weight: 500;
  margin: 2px 4px 0 0;
  display: inline-flex;
  align-items: center;
  line-height: 1.4;
}

/* “×” icon spacing */
.tomselect-bootstrap.ts-wrapper.multi .ts-control > .item .remove {
  margin-left: 4px;
  font-size: 1.1rem;
  line-height: 1;
}

/* Hover state for tag pills */
.tomselect-bootstrap.ts-wrapper.multi .ts-control > .item:hover {
  background-color: #0b5ed7;
  cursor: pointer;
  box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.3);
}

/* Scrollable controls (avoid growing too tall) */
.tomselect-bootstrap.ts-wrapper.multi .ts-control {
  max-height: 120px;
  overflow-y: auto;
  overflow-x: hidden;
  align-content: flex-start;
  padding-right: 1rem;
}

/* Gentle bottom fade to hint scrollability */
.tomselect-bootstrap.ts-wrapper.multi {
  position: relative;
}

.tomselect-bootstrap.ts-wrapper.multi::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1.5rem;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(255,255,255,0), #fff);
}

/* ======================================================
   DROPDOWN MENU
   ====================================================== */
.tomselect-bootstrap .ts-dropdown {
  font-size: 1rem;
  line-height: 1.5;
  background-color: #fff;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 0.375rem;
  box-shadow: 0 .5rem 1rem rgba(0,0,0,.15);
  z-index: 1050;
}

.tomselect-bootstrap .ts-dropdown .option {
  padding: 0.375rem 0.75rem;
  color: #212529;
  cursor: pointer;
}

.tomselect-bootstrap .ts-dropdown .option:hover,
.tomselect-bootstrap .ts-dropdown .option.active {
  background-color: #e9ecef;
}

/* ======================================================
   FILTER FORM LAYOUT
   ====================================================== */
.filter-form .ts-control {
  min-height: 38px;
  align-items: flex-start;
}

.filter-form select.tomselect-bootstrap {
  width: 100%;
}

/* “Match ANY” checkbox */
.filter-form .form-check {
  margin-top: 4px;
  font-size: 0.9rem;
}

/* Buttons */
.filter-form .btn {
  white-space: nowrap;
}

@media (max-width: 768px) {
  .filter-form .d-flex.gap-2 {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ======================================================
   TAG LIMIT REACHED STATE
   ====================================================== */
.ts-limit-reached .ts-control {
  background-color: #f8f9fa !important; /* Bootstrap light gray */
  border-color: #ced4da !important;
  color: #6c757d !important;
  opacity: 0.75;
  cursor: not-allowed;
}

/* Placeholder text styling (smaller + muted) */
.ts-wrapper .ts-control input::placeholder,
.tomselect-bootstrap .ts-control input::placeholder {
  font-size: 0.8rem;          /* slightly smaller than normal text */
  font-style: italic;
  color: #6c757d;             /* Bootstrap “text-muted” gray */
  opacity: 1;                 /* ensures color shows on all browsers */
}


/* ======================================================
   FILTER FORM — Clean, Consistent Alignment
   ====================================================== */

.filter-form {
  --input-height: 38px; /* Bootstrap default input height */
}

/* Keep rows stable and align form controls by bottom edge */
.filter-form .d-flex.flex-nowrap {
  flex-wrap: nowrap !important;
  align-items: flex-end;
}

/* Labels stack naturally above inputs */
.filter-form label.form-label {
  margin-bottom: 0.5rem;
}

/* Inputs and TomSelect controls share consistent sizing */
.filter-form input.form-control,
.filter-form .tomselect-bootstrap.ts-wrapper .ts-control {
  min-height: var(--input-height);
  line-height: 1.5;
  box-sizing: border-box;
}

/* Multi-selects expand downward without pushing other elements */
.filter-form .tomselect-bootstrap.ts-wrapper.multi .ts-control {
  overflow-y: auto;
  max-height: 140px;
  align-items: flex-start;
}

/* ======================================================
   FILTER BUTTONS — Visually Centered with Inputs
   ====================================================== */

.filter-form .button-group {
  display: flex;
  flex-wrap: nowrap;
  align-items: center; /* centers vertically relative to inputs */
  gap: 0.5rem;
  margin-top: calc(1.5rem + 2px); /* offset to account for label spacing */
}

/* Make buttons match form-control height */
.filter-form .button-group .btn {
  height: var(--input-height);
  padding: 0.35rem 1rem; /* visually balanced top/bottom padding */
  line-height: 1.3;      /* keeps text optically centered */
  white-space: nowrap;
  margin-top: 1px;       /* tiny nudge to align baselines perfectly */
  box-sizing: border-box;
}

/* Responsive: stack buttons on small screens */
/*@media (max-width: 768px) {
  .filter-form .button-group {
    flex-direction: column;
    align-items: stretch;
    margin-top: 0.5rem;
  }
}*/


/* ======================================================
   FILTER FORM — Tags / Title / Buttons (stable layout)
   ====================================================== */

/* Row 2 main flex container */
.filter-form .col-md-12.d-flex {
  align-items: flex-start;
  flex-wrap: nowrap;
  gap: 1rem;
}

/* Tag box — takes up to 65%, never expands beyond that */
.filter-form .col-md-12.d-flex > .flex-grow-1:first-child {
  flex: 1 1 60%;
  max-width: 65%;
  min-width: 250px;
}

/* Title box — flexible, can shrink but not vanish */
.filter-form .col-md-12.d-flex > .flex-grow-1:nth-child(2) {
  flex: 1 1 25%;
  min-width: 180px;
}

/* Buttons — fixed width, stay on right */
.filter-form .col-md-12.d-flex > .button-group {
  flex: 0 0 auto;
  align-self: flex-start;   /* <-- top align (no vertical centering) */
  white-space: nowrap;
}

/* ---------- Medium screens ---------- */
@media (max-width: 1200px) {
  /* Prevent buttons from being pushed off-screen */
  .filter-form .col-md-12.d-flex > .flex-grow-1:first-child {
    flex: 1 1 50%;
    max-width: 55%;
  }

  .filter-form .col-md-12.d-flex > .flex-grow-1:nth-child(2) {
    flex: 1 1 25%;
  }
}

/* ---------- Tablets ---------- */
@media (max-width: 991.98px) {
  .filter-form .col-md-12.d-flex {
    flex-wrap: wrap;
  }

  /* Tags span full width */
  .filter-form .col-md-12.d-flex > .flex-grow-1:first-child {
    flex: 1 1 100%;
    max-width: 100%;
    margin-bottom: 0.5rem;
  }

  /* Title + buttons share one row */
  .filter-form .col-md-12.d-flex > .flex-grow-1:nth-child(2) {
    flex: 1 1 auto;
    min-width: 220px;
  }

  .filter-form .col-md-12.d-flex > .button-group {
    flex: 0 0 auto;
    align-self: flex-end;
    margin-left: auto;
  }
}

/* ---------- Mobile ---------- */
@media (max-width: 575.98px) {
  .filter-form .col-md-12.d-flex {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-form .col-md-12.d-flex > .button-group {
    align-self: flex-start;
    margin-left: 0;
    margin-top: 0.5rem;
  }
}



/* Force Filter + Reset buttons to stay side by side, even on small screens */
.filter-form .button-group .d-flex {
  flex-wrap: nowrap !important;    /* prevent wrapping */
  flex-direction: row !important;  /* ensure horizontal */
  justify-content: flex-start;
  gap: 0.5rem;
}

/* Prevent horizontal overflow around 991px breakpoint */
@media (max-width: 1200px) {
  .filter-form .col-md-12.d-flex {
    flex-wrap: wrap !important;           /* allow wrapping earlier */
  }

  .filter-form .col-md-12.d-flex > div {
    flex: 1 1 100%;
  }

  /* Keep buttons aligned to the right on medium screens */
  .filter-form .button-group {
    flex-direction: row !important;
    justify-content: flex-end;
    width: 100%;
    margin-top: 0.5rem;
  }

  .filter-form .button-group .d-flex {
    flex-wrap: nowrap !important;
    justify-content: flex-end;
    gap: 0.5rem;
  }
}

/* ======================================================
   FILTER ROW — Full-width input, buttons always visible
   ====================================================== */

.filter-row {
  width: 100%;
}

.filter-row .flex-grow-1 input.form-control {
  width: 100%;
  min-width: 200px;
}

/* Buttons group */
.filter-row .btn {
  height: 38px;
  line-height: 1.3;
  padding: 0.35rem 1rem;
  box-sizing: border-box;
}

/* On small screens: buttons below input, full width */
@media (max-width: 767.98px) {
  .filter-row .d-flex {
    justify-content: flex-start;
    width: 100%;
  }
  .filter-row .btn {
    flex: 1 1 auto;
  }
}

/* On medium+ screens: inline right */
@media (min-width: 768px) {
  .filter-row .d-flex {
    justify-content: flex-end;
  }
}



/* ======================================================
   AUTHED FILTER ROW — Fine-tuned responsive alignment (active overrides)
   ====================================================== */

/* ---------- 1. Medium screens (≈1200px): tighten button spacing ---------- */
@media (max-width: 1200px) and (min-width: 992px) {
  .filter-form .col-md-12.d-flex > .button-group {
    margin-top: 0.1rem !important;    /* tighter gap above buttons */
  }
  .filter-form .col-md-12.d-flex > .flex-grow-1:nth-child(2) {
    margin-bottom: 0 !important;      /* remove extra white space below title */
  }
}

/* ---------- 2. Tablet range (≈992→768px): tighten tags ↔ title spacing ---------- */
@media (max-width: 991.98px) and (min-width: 768px) {
  .filter-form .col-md-12.d-flex {
    row-gap: 0.5rem !important;       /* control internal spacing explicitly */
  }
  .filter-form .col-md-12.d-flex > .flex-grow-1:first-child {
    margin-bottom: 0.25rem !important;
  }
  .filter-form .col-md-12.d-flex > .button-group {
    margin-top: 0.25rem !important;
  }
}

/* ---------- 3. Small screens (<768px): force full width + tighter vertical rhythm ---------- */
@media (max-width: 767.98px) {
  .filter-form .col-md-12.d-flex {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.25rem !important;
  }

  /* Tag + title inputs span full width */
  .filter-form .col-md-12.d-flex > .flex-grow-1 {
    flex: 1 1 100% !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  /* Make TomSelect + input always fill */
  .filter-form select.tomselect-bootstrap,
  .filter-form input.form-control,
  .filter-form .ts-control {
    width: 100% !important;
  }

  /* Buttons stay together, tight gap */
  .filter-form .col-md-12.d-flex > .button-group {
    width: 100% !important;
    justify-content: flex-end !important;
    margin-top: 0.4rem !important;
  }

  .filter-form .button-group .d-flex {
    justify-content: flex-end !important;
    gap: 0.5rem !important;
  }
}

/* ======================================================
   FINAL SPACING FIX — tighten button gap (991–1200px)
   ====================================================== */
@media (min-width: 992px) and (max-width: 1200px) {
  /* Reduce space above buttons */
  .filter-form .col-md-12.d-flex > .button-group {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }

  /* Slightly tighten vertical spacing of the entire row */
  .filter-form .col-md-12.d-flex {
    row-gap: 0.25rem !important;
  }

  /* Align the title input bottom with the button group */
  .filter-form .col-md-12.d-flex > .flex-grow-1:nth-child(2) {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }
}

/* ======================================================
   SAFARI PATCH — TomSelect focus + dropdown fix
   ====================================================== */
@supports (-webkit-touch-callout: none) {
  .tomselect-bootstrap.ts-wrapper.multi .ts-control {
    overflow-y: visible !important;     /* let Safari expand naturally */
    max-height: none !important;        /* don’t clip */
  }
}