/*
 * EPMS #1f5099 when a file is chosen; empty thumb grey. Loading: .custom-file-card--loading + spinner.
 */
.custom-file-uploader {
	position: relative;
}

.custom-file-card {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	min-height: 56px;
	padding: 0.65rem 0.85rem;
	background: #fff;
	border: 1px solid #dee2e6;
	border-radius: 6px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
	box-sizing: border-box;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.custom-file-card:not(.empty) {
	cursor: pointer;
}

.custom-file-card.empty {
	cursor: pointer;
}

.custom-file-card.empty:hover {
	border-color: #1f5099;
	box-shadow: 0 1px 4px rgba(31, 80, 153, 0.18);
}

.custom-file-card.drag-over {
	border-color: #1f5099;
	background-color: rgba(31, 80, 153, 0.06);
	box-shadow: 0 0 0 0.15rem rgba(31, 80, 153, 0.22);
}

.custom-file-card.custom-file-card--loading {
	cursor: wait;
	pointer-events: none;
}

.custom-file-card.custom-file-card--loading.custom-file-card.empty:hover {
	border-color: #dee2e6;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.custom-file-card__thumb {
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	aspect-ratio: 1 / 1;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #e9ecef;
	border-radius: 5px;
	color: #495057;
	font-size: 1.05rem;
	transition: filter 0.12s ease, background-color 0.12s ease, color 0.12s ease;
}

.custom-file-card:not(.empty) .custom-file-card__thumb {
	background: #1f5099;
	color: #fff;
}

.custom-file-card.empty:hover .custom-file-card__thumb {
	filter: none;
	background: #dee2e6;
	color: #495057;
}

.custom-file-card__text {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 2px;
	line-height: 1.3;
}

.custom-file-card__label {
	font-size: 0.9375rem;
	line-height: 1.3;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.custom-file-card.empty .custom-file-card__label {
	color: #6c757d;
	font-weight: 400;
}

.custom-file-card:not(.empty) .custom-file-card__label {
	color: #212529;
	font-weight: 600;
}

.custom-file-card__sub {
	font-size: 0.8125rem;
	color: #868e96;
	line-height: 1.25;
}

.custom-file-card__sub:empty {
	display: none;
}

.custom-file-card__actions {
	flex-shrink: 0;
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	gap: 2px;
	padding: 0 0 0 0.5rem;
	margin-left: 0.125rem;
	border-left: 1px solid #e9ecef;
	align-self: center;
}

.custom-file-card__actions .custom-file-card__action {
	width: 36px;
	height: 36px;
	border-radius: 5px;
}

.custom-file-card__actions .custom-file-card__action i {
	font-size: 0.95rem;
}

.custom-file-card__action {
	flex-shrink: 0;
	width: 36px;
	height: 36px;
	padding: 0;
	margin: 0;
	border: 1px solid transparent;
	border-radius: 5px;
	background: transparent;
	color: #6c757d;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color 0.12s ease, border-color 0.12s ease, background-color 0.12s ease;
}

.custom-file-card__action:hover {
	color: #1f5099;
	background: rgba(31, 80, 153, 0.1);
	border-color: rgba(31, 80, 153, 0.28);
}

.custom-file-card__action:focus {
	outline: none;
	box-shadow: 0 0 0 2px rgba(31, 80, 153, 0.35);
}

.custom-file-card__action--remove:hover {
	color: #dc3545;
	background: rgba(220, 53, 69, 0.08);
	border-color: rgba(220, 53, 69, 0.25);
}

.custom-file-card__action i {
	font-size: 0.95rem;
	pointer-events: none;
}

/* Loading removes .empty so :not(.empty) rules must be overridden */
.custom-file-card.custom-file-card--loading .custom-file-card__thumb {
	background: #e9ecef;
	color: #495057;
	font-size: 1.05rem;
}

.custom-file-card.custom-file-card--loading .custom-file-card__label {
	color: #6c757d;
	font-weight: 400;
}

.custom-file-card.custom-file-card--readonly,
.custom-file-card.custom-file-card--readonly.empty,
.custom-file-card.custom-file-card--readonly:not(.empty) {
	cursor: default;
}

.custom-file-card.custom-file-card--readonly.empty:hover {
	border-color: #dee2e6;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.custom-file-card.custom-file-card--readonly.empty:hover .custom-file-card__thumb {
	filter: none;
	background: #e9ecef;
	color: #495057;
}
