/* Richiesta prove: campi, righe, modali di scelta prove, cantiere e intestatario.
   Caricato in ordine dopo gli altri file override (site, forms, content, customer, order-request, extras):
   la cascata è quella di un unico foglio. */

/* Form "Richiesta prove" (order-request.cfm) — stessa skin del form "Richiesta preventivo"
   sopra (.estimate-request-*): le regole identiche sono raggruppate lì, qui restano solo le
   differenze. Classi proprie perché i due form vivono su pagine diverse. */

.order-request-section-title {
	margin-bottom: 10px;
}

.order-request-field {
	position: relative;
}

.order-request-readonly-value {
	margin: 0;
	padding: 0;
	line-height: 1.4;
	color: var(--gray-700);
}

.order-request-contact-row {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	margin-top: 5px;
}

.order-request-contact-row .order-request-field {
	flex: 1 1 160px;
	margin-top: 0;
}

.order-request-picker {
	margin-top: 20px;
}

.order-request-toggle-new {
	margin-top: 8px;
}

.order-request-new-panel {
	margin-top: 5px;
	padding: 16px;
	border: 1px solid var(--border-color);
	border-radius: 4px;
	background: #fafafa;
}

#order-request-site-save,
#order-request-company-save {
	margin-top: 16px;
}

/* "Annulla" accanto a "Salva": btn-reset non ha padding verticale, qui lo si allinea all'altezza
   di btn-primary (6px 16px). */
.order-request-panel-cancel {
	margin-top: 16px;
	margin-left: 8px;
	padding-top: 6px;
	padding-bottom: 6px;
}

.order-request-panel-message {
	display: inline-block;
	margin-left: 12px;
	font-size: 14px;
}

#order-request-company-new-panel [data-company-field] {
	display: none;
}

.order-request-radio-group {
	margin-top: 5px;
}

.order-request-radio-group+.order-request-contact-row {
	margin-top: 8px;
}

.order-request-radio-group-label {
	display: block;
	margin-bottom: 6px;
	font-weight: bold;
}

.order-request-radio {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-right: 20px;
	font-weight: normal;
}

.order-request-rows-list {
	margin-bottom: 8px;
}

.order-row-empty {
	color: var(--muted-color);
	font-size: 14px;
	margin: 0px;
}

.order-row-card {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 8px;
	padding: 12px 48px 12px 16px;
	border: 1px solid var(--border-color);
	border-radius: 4px;
}

.order-row-card-summary {
	font-size: 14px;
}

.order-row-card .btn-reset {
	flex-shrink: 0;
	/* stesso padding verticale di .order-request-toggle-new ("+ Nuovo intestatario"); niente
	   margin-top qui: la card è un flex con align-items: center */
	padding-top: 8px;
	padding-bottom: 8px;
}

.order-row-card .order-row-remove {
	top: 50%;
	transform: translateY(-50%);
}

.order-row-field-line {
	display: flex;
	gap: 16px;
	margin-bottom: 12px;
}

.order-row-field {
	flex: 1 1 0;
	min-width: 0;
}

.order-row-field-half {
	flex: 0 0 calc(50% - 8px);
}

.order-row-field label {
	display: block;
	margin-bottom: 4px;
	font-size: 13px;
}

/* Modale di dettaglio del preventivo: campi e select a tutta la larghezza della colonna. */
#estimate-request-details-fields .form-input,
#estimate-request-details-fields .form-select {
	width: 100%;
	box-sizing: border-box;
}

.order-row-input {
	width: 100%;
	box-sizing: border-box;
}

.order-row-tests {
	margin-top: 16px;
	margin-bottom: 16px;
}

.order-row-tests label {
	display: block;
	font-weight: bold;
	font-size: 13px;
	padding: 0;
	margin: 0;
}

.order-row-tests label input {
	margin-right: 10px;
}

.order-row-tests-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.order-row-test-checkboxes {
	width: 100%;
	margin: 0;
	padding: 0;
	list-style: none;
}

.order-row-test-checkboxes li {
	margin-bottom: 0;
}

.order-row-test-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 8px;
	border-radius: 12px;
	background: #eef0fa;
	font-size: 13px;
}

.order-row-test-chip button {
	border: 0;
	background: transparent;
	color: var(--muted-color);
	cursor: pointer;
	line-height: 1;
}

.order-row-test-chip button:hover {
	color: var(--error-color);
}

.order-request-modal {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.5);
}

.order-request-modal[hidden] {
	display: none;
}

/* Lo z-index delle modali impilate lo imposta LM.modal (app-core.js); la pagina sotto non scorre. */
body.modal-open {
	overflow: hidden;
}

.order-row-tests-status {
	margin: 4px 0 0;
	font-size: 13px;
	color: var(--muted-color);
}

.order-request-modal .btn-primary[disabled] {
	opacity: 0.5;
	cursor: not-allowed;
}

.order-request-modal-content {
	width: 90%;
	max-width: 520px;
	max-height: 80vh;
	display: flex;
	flex-direction: column;
	padding: 20px;
	border-radius: 4px;
	background: var(--white);
	/* Cresce con il contenuto fino a 80vh, poi scorre: se c'è una lista (.order-request-modal-list)
	   scorre quella, con intestazione e ricerca sempre visibili; altrimenti scorre la modale. */
	overflow-y: auto;
}

.order-request-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
	font-weight: bold;
	font-size: 16px;
}

.order-request-modal-close {
	border: 0;
	background: transparent;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	color: var(--muted-color);
}

.order-request-modal-close:hover {
	color: var(--error-color);
}

#order-request-test-modal-search,
.estimate-test-modal-search {
	width: 100%;
	box-sizing: border-box;
	margin-bottom: 12px;
}

.order-request-modal-list {
	flex: 0 1 auto;
	min-height: 0;
	overflow-y: auto;
	margin: 0 0 16px;
	padding: 0;
	list-style: none;
	border: 1px solid #eee;
}

.order-request-modal-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 3px 10px;
	font-size: 14px;
	line-height: 1.3;
	font-weight: normal;
	cursor: pointer;
}

.order-request-modal-item:hover {
	background: #f7f7f7;
}

/* Modali di scelta cantiere/intestatario: più larghe (contengono anche il pannello "+ Nuovo...") e
   scorrevoli, il pannello può superare l'altezza dello schermo. */
.order-request-modal-content-wide {
	max-width: 720px;
}

/* Il suggest dentro una modale scorrevole: app-suggest.js lo posiziona in fixed (coordinate dal campo)
   perché un absolute verrebbe tagliato dal bordo (overflow-y: auto) o allungherebbe la modale. */
.suggest-list.is-floating {
	position: fixed;
	z-index: 1500;
	top: auto;
	left: auto;
	width: auto;
}

.order-request-picker-row {
	display: flex;
	gap: 8px;
}

.order-request-picker-row input[type="text"] {
	flex: 1 1 auto;
	cursor: pointer;
}

.order-request-picker-row .btn-primary {
	flex: 0 0 auto;
}

.order-request-picker-list-view {
	display: flex;
	flex-direction: column;
	flex: 0 1 auto;
	min-height: 0;
}

.order-request-picker-list-view[hidden] {
	display: none;
}

.order-request-picker-search {
	width: 100%;
	box-sizing: border-box;
	margin-bottom: 12px;
}

.order-request-modal-pick {
	width: 100%;
	border: 0;
	background: transparent;
	text-align: left;
	font: inherit;
}

/* Titoletto di categoria nelle liste di prove (LM.modal.categoryHeader) */
.order-request-modal-group {
	padding: 3px 10px;
	background: #f2f2f2;
	color: var(--muted-color);
	font-size: 12px;
	font-weight: bold;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.order-request-modal-more {
	padding: 8px 10px;
	text-align: center;
}

.order-request-modal-empty {
	padding: 6px 10px;
	color: var(--muted-color);
	font-style: italic;
}
