/* Typeahead, richiesta preventivo, elenchi e tabelle dell'area clienti, allegati.
   Caricato in ordine dopo gli altri file override (site, forms, content, customer, order-request, extras):
   la cascata è quella di un unico foglio. */

.suggest-list {
	position: absolute;
	z-index: 10;
	top: calc(100% + 6px);
	left: 0;
	width: 100%;
	margin: 0;
	padding: 6px;
	list-style: none;
	background: var(--white);
	border-radius: 6px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
	max-height: 240px;
	overflow-y: auto;
}

.suggest-list li {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 10px;
	border-radius: 4px;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.suggest-list li:not(:last-child) {
	border-bottom: 1px solid #f0f0f0;
}

.suggest-list li:hover:not(.suggest-empty),
.suggest-list li.is-highlighted {
	background: #ecf3ff;
}

.suggest-item-icon {
	font-size: 14px;
	color: var(--main-color-dark);
}

.suggest-item-name {
	flex: 1 1 auto;
}

.suggest-item-badge {
	font-size: 12px;
	color: var(--gray-400);
	background: #f2f2f2;
	border-radius: 3px;
	padding: 2px 6px;
}

.suggest-empty {
	padding: 9px 10px;
	color: var(--gray-400);
	font-style: italic;
	cursor: default;
}

.estimate-row {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-bottom: 10px;
	padding-bottom: 10px;
	border-bottom: 1px solid #f0f0f0;
}

/* Colonna della prova: base 0 + min-width 0, così occupa lo spazio che resta senza dipendere dalla
   lunghezza del testo. Con flex 1 1 auto una prova lunga allargava la colonna oltre la riga e
   quantità e "x" andavano a capo sotto; ora il testo va a capo dentro il pulsante. */
.estimate-row-details {
	flex: 1 0 100%;
	font-size: 13px;
	color: var(--muted-color);
}

.estimate-row-details-edit {
	margin-left: 10px;
	text-decoration: underline;
}

.estimate-row-search {
	position: relative;
	flex: 1 1 0;
	min-width: 0;
}

.estimate-row-pick {
	width: 100%;
	box-sizing: border-box;
	padding: 9px 10px;
	border: 1px solid var(--border-color);
	border-radius: 2px;
	background: var(--white);
	color: var(--muted-color);
	text-align: left;
	white-space: normal;
	overflow-wrap: anywhere;
	cursor: pointer;
}

.estimate-test-modal-item {
	width: 100%;
	border: 0;
	background: transparent;
	text-align: left;
}

.estimate-row-qty {
	width: 40px;
	padding-left: 4px;
	padding-right: 4px;
	text-align: right;
	flex: 0 0 auto;
}

.estimate-row-remove,
.order-row-remove {
	width: 32px;
	height: 32px;
	border: 1px solid var(--border-color);
	border-radius: 2px;
	background: var(--white);
	color: var(--muted-color);
	cursor: pointer;
	font-size: 16px;
	line-height: 1;
}

.estimate-row-remove:hover,
.order-row-remove:hover {
	color: var(--danger-hover-color);
	border-color: var(--danger-hover-color);
}

.estimate-row-remove {
	flex: 0 0 auto;
}

.order-row-remove {
	position: absolute;
	top: 12px;
	right: 12px;
}

.sites-table {
	width: 100%;
	border-collapse: collapse;
}

.sites-table th,
.sites-table td {
	text-align: left;
	padding: 10px 12px;
	border-bottom: 1px solid #eee;
}

/* Sovrascrivono table th{color:#fff}/table td{background:#f0f0f0} di base.css:616-631,
pensate per table tr.odd/tr.even con td sempre a sfondo bianco (base.css:698-701) — qui serve
lo zebra sul td stesso, non sul tr, perché il background del td copre sempre quello del tr. */
.sites-table th {
	color: #333;
	background: transparent;
	font-weight: bold;
	text-shadow: none;
}

.sites-table tbody tr:nth-child(odd) td {
	background: var(--white);
}

.sites-table tbody tr:nth-child(even) td {
	background: #f7f7f7;
}

.sites-table .col-id {
	width: 50px;
}

.sites-table .col-actions {
	width: 90px;
	text-align: right;
}

a.link-underline,
a.link-underline:hover {
	text-decoration: underline;
}

.entity-short-id {
	font-size: 12px;
	font-weight: normal;
	color: var(--gray-400);
}

.sampling-report-role-icon {
	margin-left: 6px;
	font-size: 14px;
	color: var(--main-color-dark);
}

#estimate-request-add-row,
#estimate-request-add-contact,
.order-request-add-row {
	margin-top: 20px;
}

#estimate-request-add-row,
#estimate-request-add-contact,
.order-request-add-row,
.order-request-toggle-new {
	padding-top: 8px;
	padding-bottom: 8px;
}

#estimate-request-add-row {
	margin-right: 12px;
}

.estimate-request-submit-wrapper,
.order-request-submit-wrapper {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 16px;
	margin-top: 20px;
}

/* Più grandi di "Aggiungi riga" (padding verticale 8px): sono i pulsanti principali della pagina. */
.order-request-submit-wrapper .btn-primary {
	padding: 10px 24px;
	font-size: 16px;
}

.estimate-request-submit-wrapper .btn-primary[disabled],
.order-request-submit-wrapper .btn-primary[disabled] {
	opacity: 0.5;
	cursor: not-allowed;
}

.estimate-request-message,
.order-request-message {
	font-size: 14px;
}

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

.estimate-request-contact-row .estimate-request-field {
	flex: 1 1 0;
	margin-top: 0;
}

#estimate-request-notes-field[hidden],
#estimate-request-attachments-section[hidden] {
	display: none;
}

.estimate-request-textarea-short {
	height: 100px;
	/* -20% rispetto ai 150px di default (base.css) */
}

.user-account-name {
	font-size: 18px;
	font-weight: bold;
}

.user-account-links p {
	margin: 4px 0;
}

.estimate-request-field,
.order-request-field {
	margin-top: 20px;
}

.estimate-request-field label,
.order-request-field label {
	display: block;
	margin-bottom: 4px;
	font-weight: bold;
}

.estimate-request-rows-section,
.estimate-request-contacts-section,
.estimate-request-attachments-section,
.order-request-rows-section,
.order-request-section-title {
	margin-top: 30px;
	padding-top: 20px;
	border-top: 1px solid var(--border-color);
}

.estimate-request-rows-label,
.estimate-request-contacts-label,
.estimate-request-attachments-label,
.order-request-rows-label {
	display: block;
	margin-bottom: 10px;
	font-weight: bold;
}

.estimate-request-rows-label,
.order-request-rows-label {
	text-align: center;
}

.estimate-contact-row,
.order-certificate-contact-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-bottom: 10px;
}

.estimate-contact-row input,
.order-certificate-contact-row input {
	flex: 1 1 160px;
}

.order-request-certificate-contacts {
	margin-bottom: 20px;
}

.order-request-certificate-pec {
	margin: 0 0 10px;
	color: var(--gray-700);
}

.estimate-dropzone {
	margin-top: 10px;
	padding: 24px 16px;
	border: 2px dashed var(--border-color);
	border-radius: 4px;
	background: #fafafa;
	color: var(--muted-color);
	text-align: center;
	cursor: pointer;
}

.estimate-dropzone:hover,
.estimate-dropzone:focus,
.estimate-dropzone.is-dragover {
	border-color: var(--main-color);
	outline: none;
}

.estimate-dropzone.is-dragover {
	background: #f3f1f8;
}

/* Gli elementi interni non devono catturare il drag: dragleave scatterebbe passandoci sopra. */
.estimate-dropzone * {
	pointer-events: none;
}

.estimate-dropzone-link {
	color: var(--main-color);
	text-decoration: underline;
}

.estimate-dropzone-hint {
	display: block;
	margin-top: 4px;
	font-size: 12px;
}

.estimate-request-attachments-error {
	margin-top: 6px;
	font-size: 12px;
	color: var(--error-color);
}

.estimate-request-attachments-error:empty {
	display: none;
}

#estimate-request-attachments-list {
	list-style: none;
	margin: 10px 0 0;
	padding: 0;
}

#estimate-request-attachments-list li {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 4px 0;
	font-size: 13px;
}

#estimate-request-attachments-list li button {
	border: 0;
	background: transparent;
	color: var(--muted-color);
	cursor: pointer;
	line-height: 1;
}

#estimate-request-attachments-list li button:hover {
	color: var(--error-color);
}

/* Riga di categoria: il tema dà sfondo #333 (base.css, table tr td.highlight); con testo nero
   resterebbe nero su nero, quindi sfondo grigio. Il selettore .elenco tr td.highlight batte la
   zebra .elenco tr:nth-child(even) td (stessa specificità, ma questa regola viene dopo): senza,
   le righe di categoria pari restavano azzurrine (#e9edf0) e le dispari grigie. */
table tr td.highlight,
.elenco tr td.highlight {
	color: #000;
	background-color: #bdbdbd;
}

.elenco td:first-child {
	width: 80px;
	min-width: 70px;
}

.faq-body {
	white-space: pre-wrap;
	word-wrap: break-word;
}

.faq-category h2 {
	font-size: 24px;
}

/* Pagina gate preventivi (estimate-gate.cfm): "Accedi" e "Iscriviti" uno sotto l'altro, separati
   da "- oppure -"; larghezza uguale per i due pulsanti. */
.estimate-gate-actions {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	max-width: 240px;
	margin: 0 auto;
}

.estimate-gate-actions .btn-primary {
	width: 100%;
	text-align: center;
	box-sizing: border-box;
}
