
.sort_by_button {
    display: flex;
    align-self: center;
    min-width: 75px;
}

div.criteria-line {
    padding-top: 2px;
    padding-bottom: 2px;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    line-height: 1;
}

@media screen and (min-width: 1500px) {
    div.criteria-line {
        max-width: 35vw;
    }
}

div.sortby span.criteria-label {
    width: inherit;
}
div.sortby .custom-select {
    height: 1.6em;
    padding-top: 0px;
    padding-bottom: 0px;
}

.criteria-label {
    width: 10em;
    text-align: right;
    padding-right: .75em;
}

.criteria-input-custom{
    display: inline-block;
    max-width: 125px;
    gap: 15px;
    margin-right: 8px;
}

.criteria-input {
    display: inline-block;
    min-width: 125px;
    max-width: 425px;
}

.search_close {
    display: inline-block;
    margin-left: 15px;
    align-self: center;
    font-size: 27px;
    vertical-align: middle;
    color: grey;
}

.search_close:after {
    display: inline-block;
    content: "\00d7";
}

.criteria-adder {
    height: calc(1.5em + .75rem + 2px);
    padding: .375rem .75rem .375rem .75rem;
    font-size: 1rem;
    font-weight: bold;
    line-height: 1.5;
    color: white;
    vertical-align: middle;
    background: #ff6600;
    border-radius: .75rem;
    appearance: none;
    width: 9em;
    cursor: pointer;
    border: 1px solid #ff6600;
    text-align: center;
}

.criteria-input-and{
    margin-top: auto;
    margin-bottom: auto;
    font-size: 18px;
    padding-right: 10px;
    padding-left: 10px;
}

.criteria-date-line{
    display: inline;
}

.datepicker {
    width: 175px;
    display: inline-block;
}

button.criteria-applied {
    background-color: #39e75f;
    color: white;
    border: 1px solid #39e75f;
    animation: none;
}

button.criteria-not-applied {
    animation: pulse-animation 2s infinite;
    background-color: green;
    border: 1px solid green;
}

@keyframes pulse-animation {
  0% {
    box-shadow: 0 0 0 0px rgba(255, 102, 0, 0.4);
  }
  100% {
    box-shadow: 0 0 0 20px rgba(0, 0, 0, 0);
  }
}

.criteria-buttons button {
    height: calc(1.5em + .75rem + 2px);
    font-size: 1rem;
    font-weight: bold;
    line-height: 1.5;
    border-radius: .75rem;
    appearance: none;
    cursor: pointer;
}

.criteria-buttons {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    gap: 10px;
}

@media only screen and (max-width: 1050px) {
    .criteria-date-picker {
        display: inline-block;
    }
    .datepicker {
        width: 150px;
    }
    .criteria-input-custom{
        max-width: 100px;
    }
    .criteria-input-and{
        padding-right: 8px;
        padding-left: 8px;
    }
    
}

@media only screen and (max-width: 900px) {
    .datepicker {
        width: 135px;
    }
}

@media only screen and (max-width: 768px) {
    div.criteria-line {
        padding-top: 2px;
        padding-bottom: 2px;
        display: flex;
        flex-direction: row;
        justify-content: flex-start;
        line-height: 1;
    }
    .criteria-buttons {
        width: 100%;
        display: grid;
    }
    .criteria-button-add {
        max-width: 60vw;
        display: block;
        margin-left: auto;
        margin-right: auto;
    }

    .criteria-label {
        width: 100%;
        text-align: left;
        padding-bottom: 3px;
    }
    .criteria-adder {
        width: 7em;
        padding-right: 1rem;
    }

    .criteria-input {
        display: inline-block;
        width: 100%;
    }

    .search_close {
        margin-top: auto;
    }

    .multiselect__tags {
        font-size: 16px;
    }
}

@media only screen and (max-width: 600px) {
    .criteria-adder {
        width: 7em;
        padding-right: 1rem;
    }
}

@media only screen and (max-width: 500px) {
    .search_close {
        margin-left: 2px;
    }
    .criteria-input-and {
        padding-left: 3px;
        padding-right: 3px;
    }
}

@media only screen and (max-width: 375px) {
    .criteria-input-and {
        padding-left: 2px;
        padding-right: 2px;
    }

    .datepicker{
        max-width: 130px;
    }
}

/* ---------- Mobile polish (≤ 820px) ---------- */
@media (max-width: 820px) {
	/* card-like rows */
	.criteria-widget .criteria-line {
		position: relative;
		display: grid;
		grid-template-columns: 1fr;
		row-gap: 6px;
		padding: 12px;
		border-radius: 12px;
		background: #fff;
		box-shadow: 0 2px 10px rgba(0,0,0,.06);
	}

	/* label on its own line; stronger weight */
	.criteria-widget .criteria-label {
		width: 100%;
		text-align: left;
		padding: 0 0 2px 0;
		font-weight: 600;
		color: #374151;
	}

	/* inputs span full width */
	.criteria-widget .criteria-input,
	.criteria-widget .criteria-input-custom {
		display: block;
		min-width: 0;
		max-width: 100%;
		width: 100%;
		margin: 0;
	}

	/* multiselect: larger touch targets + scrollable tag tray */
	.multiselect {
		min-height: 44px;
	}
	.multiselect__tags {
		min-height: 44px;
		max-height: 84px;
		overflow-y: auto;
	}
	.multiselect__input,
	.multiselect__single {
		line-height: 42px;
	}

	/* row “×” clear button sits in the top-right of the card */
	.criteria-widget .search_close {
		position: absolute;
		top: 8px;
		right: 10px;
		margin: 0;
		font-size: 22px;
		line-height: 1;
		color: #9ca3af;
		cursor: pointer;
	}
	.criteria-widget .search_close:hover { color: #6b7280; }

	/* date range: presets + pickers feel native and fit */
	.criteria-date-line { display: grid; row-gap: 6px; }
	.criteria-date-picker {
		display: flex;
		gap: 8px;
		align-items: center;
	}
	.criteria-date-line .datepicker { flex: 1 1 0; width: auto; }
	.criteria-input-and {
		padding: 0 6px;
		font-size: 15px;
		color: #6b7280;
	}

	/* buttons area: neat grid, full-width tap targets */
	.criteria-buttons {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 5px;
		margin-top: 8px;
	}
	/* on very narrow phones, stack them */
	@media (max-width: 540px) {
		.criteria-buttons { grid-template-columns: 1fr; }
	}

	/* make the select for “Add Filter” look consistent & comfy */
	.criteria-adder {
		width: 100%;
		min-height: 44px;
		padding: .5rem .9rem;
		border-radius: .75rem;
	}

	/* sort row becomes a compact grid */
	.criteria-widget .sortby {
		display: grid !important;
		gap: 10px;
		align-items: center;
		padding: 0;
		box-shadow: none;
		background: transparent;
	}

    .criteria-buttons .criteria-input {
        display: flex !important;
        justify-content: center;
        gap: 5px;
    }
}

@media (min-width: 541px) and (max-width: 820px) {
	/* 2 columns: Add Filter | [Search, Clear, Run Report] */
	.criteria-buttons {
		align-items: center;
	}

	/* buttons sit in a single row */
	.criteria-buttons .criteria-input {
		display: flex;
		flex-wrap: nowrap;
		gap: 5px;
		justify-content: flex-start;
		align-items: stretch;
	}

	/* ensure buttons don't stretch full width */
	.criteria-buttons .criteria-input .btn,
	.criteria-buttons .criteria-input .b-button {
		width: auto;
		white-space: nowrap;
	}

	/* optional: give the Add Filter select a sensible min width */
	.criteria-button-add .criteria-adder {
		min-width: 180px; /* tweak to taste */
	}
}

/* ---------- Small step-downs so things don’t squish ---------- */
@media (max-width: 600px) {
	.criteria-adder { width: 100%; }
}
@media (max-width: 375px) {
	.criteria-input-and { padding: 0 3px; }
}


/* Issue with IOS devices fixed here for add filter button */
@media (max-width: 820px) {
	.criteria-button-add { display:block; }

	.criteria-adder {
		appearance: none;
		-webkit-appearance: none;
		height: 44px;
		line-height: 44px;
		padding: 0 1rem;
		text-align: center;
		text-align-last: center;
	}
}

/* iOS Safari-only tweak: ensure the line-height rule wins */
@supports (-webkit-touch-callout: none) {
	.criteria-adder{
		line-height: 44px !important;
	}
}

.criteria-widget,
.criteria-line,
.criteria-date-line,
.criteria-date-picker,
.datepicker {
	overflow: visible;
}

.criteria-widget .criteria-line {
	position: relative;
	z-index: 1;
}

.criteria-widget .criteria-line:focus-within {
	z-index: 2000;
}

.datepicker {
	position: relative;
	z-index: 2001;
}

.datepicker-dropdown,
.vdp-datepicker__calendar,
.mx-datepicker-popup,
.e-form-datepicker-calendar,
.ez-datepicker-calendar {
	z-index: 3000 !important;
}
