/* Modal styles */

.modal-body {
	max-height: 70vh;
	overflow-y: auto;
}

/* Mobile: taller modals to reduce nested scrolling */
@media (max-width: 767.98px) {
	.modal-body {
		max-height: 80vh;
	}
}

/* Phone: full-screen-like modals for complex forms */
@media (max-width: 576px) {
	.modal-body {
		max-height: 85vh;
	}

	.modal-dialog {
		margin: 0.25rem;
	}

	.modal-dialog.modal-lg,
	.modal-dialog.modal-xl {
		margin: 0;
		max-width: 100%;
		height: 100%;
	}

	.modal-dialog.modal-lg .modal-content,
	.modal-dialog.modal-xl .modal-content {
		border-radius: 0;
		min-height: 100vh;
		display: flex;
		flex-direction: column;
	}

	.modal-dialog.modal-lg .modal-body,
	.modal-dialog.modal-xl .modal-body {
		flex: 1;
		max-height: none;
	}
}

.modal-body .spinner-border {
    color: var(--sa-primary-color);
}

/* Form Section Styles */
.sa-form-section {
	background: #f8f9fa;
	border-radius: 0;
	padding: 0.875rem 1rem;
	border: 1px solid #e9ecef;
}

.sa-form-section-title {
	font-size: 0.8rem;
	font-weight: 600;
	color: #495057;
	margin-bottom: 0.75rem;
	padding-bottom: 0.5rem;
	border-bottom: 1px solid #dee2e6;
	display: flex;
	align-items: center;
}

.sa-form-section-title i {
	color: var(--sa-primary-color, #667eea);
	font-size: 0.75rem;
}

/* Compact labels inside form sections */
.sa-form-section .form-label,
.sa-form-section label {
	font-size: 0.8rem;
	margin-bottom: 0.25rem;
}

.sa-form-section .form-control,
.sa-form-section .form-select {
	font-size: 0.875rem;
}

/* Mobile: form sections need more breathing room for touch */
@media (max-width: 767.98px) {
	.sa-form-section .form-label,
	.sa-form-section label {
		font-size: 0.82rem;
		margin-bottom: 0.375rem;
	}

	.sa-form-section .form-control,
	.sa-form-section .form-select {
		min-height: 40px;
	}
}

@media (max-width: 576px) {
	.sa-form-section {
		padding: 0.75rem;
	}

	.sa-form-section-title {
		font-size: 0.78rem;
	}
}

/* Extra small button — desktop only; mobile override in mobile.css section 45 */
.btn-xs {
	padding: 0.15rem 0.4rem;
	font-size: 0.7rem;
	line-height: 1.2;
	border-radius: 0;
}

@media (max-width: 767.98px) {
	.btn-xs {
		padding: 0.3rem 0.625rem;
		font-size: 0.75rem;
		min-height: 32px;
		display: inline-flex;
		align-items: center;
	}
}

/* Modal Section Styles */
.sa-modal-section {
	background: #f8f9fa;
	border-radius: 0;
	padding: 1rem 1.25rem;
	border: 1px solid #e9ecef;
}

.sa-modal-section__title {
	font-size: 0.9rem;
	font-weight: 600;
	color: #495057;
	margin-bottom: 1rem;
	padding-bottom: 0.75rem;
	border-bottom: 1px solid #dee2e6;
	display: flex;
	align-items: center;
}

.sa-modal-section__title i {
	color: var(--sa-primary-color, #667eea);
}

/* Collapsible section styles */
.sa-modal-section--collapsible {
	background: #fff;
	border: 1px dashed #dee2e6;
}

.sa-modal-section--collapsible .sa-modal-section__header {
	cursor: pointer;
	padding: 0.25rem 0;
	transition: background-color 0.15s ease;
}

.sa-modal-section--collapsible .sa-modal-section__header:hover {
	background: #f8f9fa;
	margin: -0.25rem;
	padding: 0.5rem 0.25rem;
	border-radius: 0;
}

.sa-modal-section--collapsible .sa-modal-section__title {
	border-bottom: none;
	margin-bottom: 0;
	padding-bottom: 0;
}

.sa-modal-section__toggle-icon {
	font-size: 0.7rem;
	color: #6c757d;
	transition: transform 0.2s ease;
}

/* Product Lot Number Table */
.sa-product-lot-table {
	background: #fff;
	border-radius: 0;
	border: 1px solid #e9ecef;
	overflow: hidden;
}

.sa-product-lot-table table {
	margin-bottom: 0;
}

.sa-product-lot-table thead th {
	background: #f1f3f5;
	font-size: 0.75rem;
	font-weight: 600;
	color: #495057;
	text-transform: uppercase;
	letter-spacing: 0.025em;
	padding: 0.625rem 0.75rem;
	border-bottom: 1px solid #dee2e6;
}

.sa-product-lot-table tbody td {
	padding: 0.625rem 0.75rem;
	vertical-align: middle;
	font-size: 0.875rem;
	border-bottom: 1px solid #f1f3f5;
}

.sa-product-lot-table tbody tr:last-child td {
	border-bottom: none;
}

.sa-product-lot-table tbody tr:hover {
	background: #f8f9fa;
}

/* Multiple lot number inputs container */
.sa-lot-inputs {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
}

.sa-lot-input-row {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.sa-lot-input-label {
	font-size: 0.75rem;
	font-weight: 500;
	color: #6c757d;
	min-width: 1.25rem;
}

.sa-product-lot-table .lot-number-input {
	max-width: 140px;
	font-size: 0.8125rem;
}

/* Expiration date inputs (matches lot number pattern) */
.sa-exp-inputs {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
}

.sa-product-lot-table .expiration-date-input {
	max-width: 150px;
	font-size: 0.8125rem;
}

/* Mobile: lot/expiration inputs need full width */
@media (max-width: 576px) {
	.sa-product-lot-table .lot-number-input,
	.sa-product-lot-table .expiration-date-input {
		max-width: 100%;
		width: 100%;
	}

	.sa-product-lot-table thead th {
		font-size: 0.68rem;
		padding: 0.4rem 0.5rem;
	}

	.sa-product-lot-table tbody td {
		padding: 0.4rem 0.5rem;
		font-size: 0.8rem;
	}

	.sa-lot-input-row {
		flex-wrap: wrap;
	}
}

.sa-product-lot-table .badge {
	font-size: 0.75rem;
	font-weight: 500;
}