/* DashStack-inspired table filters, adapted to OCCITRAVEL's operational UI. */
.workspace-ui .section-head:has(.table-filter-shell-ready) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-content: stretch;
}

.workspace-ui .table-tools.table-filter-shell-ready {
  display: grid;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 10px;
  width: 100% !important;
  min-width: 0;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.workspace-ui .table-tools.table-filter-shell-ready .table-search-group {
  display: flex !important;
  flex-wrap: wrap;
  gap: var(--layout-gap);
  min-width: 0;
  max-width: 100%;
  width: min(680px, 100%);
  justify-content: flex-start;
}

.workspace-ui .table-tools.table-filter-shell-ready .table-search-group .search {
  flex: 1 1 16ch;
  min-width: 0 !important;
  width: auto;
  grid-column: auto;
  min-height: 46px;
  border-color: #dbe5e1;
  border-radius: 8px;
  background: var(--bg-surface, #fff);
}

.workspace-ui .table-tools.table-filter-shell-ready .table-search-btn {
  flex: 0 1 auto;
  width: auto;
  white-space: normal;
  min-height: 46px;
  border-radius: 8px;
}

.workspace-ui .table-filter-panel {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-height: 58px;
  width: 100%;
  min-width: 0;
  flex-wrap: wrap;
  max-width: 100%;
  overflow: visible;
  border: 1px solid #dbe5e1;
  border-radius: 8px;
  background: var(--bg-surface, #fff);
  box-shadow: 0 5px 16px rgba(22, 52, 44, .05);
}

.workspace-ui .table-filter-panel-head {
  display: contents;
}

.workspace-ui .table-filter-panel-head > strong,
.workspace-ui .table-filter-panel > .dash-filter-select,
.workspace-ui .table-filter-panel > .dash-filter-range,
.workspace-ui .table-filter-panel-clear {
  min-height: 58px;
  border: 0;
  border-right: 1px solid #e3ebe8;
  border-radius: 0;
  background: var(--bg-surface, #fff);
}

.workspace-ui .table-filter-panel-head > strong {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 18px;
  color: #253b34;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  order: -10;
}

.workspace-ui .table-filter-lead-icon {
  width: 17px;
  height: 17px;
  display: inline-block;
  background: var(--accent);
  clip-path: polygon(6% 12%, 94% 12%, 60% 49%, 60% 88%, 40% 78%, 40% 49%);
}

.workspace-ui .table-filter-panel > .dash-filter-select {
  width: auto;
  min-width: 150px;
  padding: 0 40px 0 18px;
  color: #344b43;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.workspace-ui .table-filter-panel > .dash-filter-range {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 0;
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
}

.workspace-ui .dash-filter-range label {
  display: grid;
  align-content: center;
  gap: 2px;
  min-width: 146px;
  padding: 7px 14px;
  border-right: 1px solid #e3ebe8;
  color: #6d7d77;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.workspace-ui .dash-filter-range label:last-child {
  border-right: 0;
}

.workspace-ui .dash-filter-range .date-filter-input {
  width: 118px;
  min-height: 25px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #344b43;
  font-size: 12px;
  font-weight: 700;
}

.workspace-ui .table-filter-panel-clear {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 18px;
  border-right: 0;
  color: #d44a3d;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  order: 10;
}

.workspace-ui .table-filter-panel-clear:hover {
  background: var(--bg-surface, #fff7f5);
}

.workspace-ui .table-filter-panel select:focus-visible,
.workspace-ui .table-filter-panel input:focus-visible,
.workspace-ui .table-filter-panel-clear:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid rgba(31, 124, 91, .28);
  outline-offset: -3px;
}

.workspace-ui .table-filter-toggle {
  border-radius: 8px;
}

@media (max-width: 720px) {
  .workspace-ui .table-tools.table-filter-shell-ready {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px;
    padding: 0 !important;
  }

  .workspace-ui .table-tools.table-filter-shell-ready .table-search-group {
    grid-column: 1;
    width: 100%;
  }

  .workspace-ui .table-filter-toggle {
    grid-column: 1;
    justify-self: stretch;
    width: 100%;
    min-height: 44px;
  }

  .workspace-ui .table-filter-panel {
    grid-column: 1;
    display: none;
    grid-template-columns: 1fr;
    width: 100%;
    padding: 0;
    overflow: visible;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(22, 52, 44, .08);
  }

  .workspace-ui .table-filter-panel-open .table-filter-panel {
    display: grid;
  }

  .workspace-ui .table-filter-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    border-bottom: 1px solid #e3ebe8;
  }

  .workspace-ui .table-filter-panel-head > strong,
  .workspace-ui .table-filter-panel-clear {
    min-height: 47px;
    border: 0;
  }

  .workspace-ui .table-filter-panel > .dash-filter-select {
    width: 100%;
    min-height: 48px;
    border-right: 0;
    border-bottom: 1px solid #e3ebe8;
  }

  .workspace-ui .table-filter-panel > .dash-filter-range {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: 58px;
    border: 0;
  }

  .workspace-ui .dash-filter-range label {
    min-width: 0;
    width: 100%;
    padding: 8px 12px;
  }

  .workspace-ui .dash-filter-range .date-filter-input {
    width: 100%;
  }

  .workspace-ui .table-search-clear {
    display: none !important;
  }
}
