.modal,
.swal2-container {
	--md-primary: #1b8fd6;
	--md-primary-dark: #1577b4;
	--md-primary-soft: #e8f4fc;
	--md-ink: #14213d;
	--md-text: #3a4a63;
	--md-muted: #6b7a90;
	--md-line: #dde3ec;
	--md-ground: #f7f9fc;
	--md-danger: #d23a3a;
	--md-success: #1f9d61;
}

.modal-backdrop.show {
	background: #14213d;
	opacity: .45;
}

.modal-lg {
	max-width: 900px;
}

.modal-content {
	border: 0;
	border-radius: 16px;
	background: #fff;
	color: var(--md-ink);
	font-size: 15px;
	box-shadow: 0 24px 64px rgba(20, 33, 61, .28);
	overflow: clip;
}

.modal-header {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 1.1rem 1.5rem;
	border-bottom: 1px solid var(--md-line);
	background: #fff;
}

.modal-title,
.modal-title.blue {
	margin: 0;
	color: var(--md-ink);
	font-size: 1.1rem;
	font-weight: 700;
	line-height: 1.3;
}

.modal-header .btn-close,
.modal-header .close {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	margin: 0 0 0 auto;
	padding: 0;
	border: 0;
	border-radius: 10px;
	background-color: transparent;
	background-size: 12px;
	color: var(--md-muted);
	font-size: 1.5rem;
	font-weight: 400;
	line-height: 1;
	text-shadow: none;
	opacity: 1;
	float: none;
	transition: background-color .15s ease, color .15s ease;
}

.modal-header .btn-close:hover,
.modal-header .close:hover {
	background-color: #eef2f7;
	color: var(--md-ink);
}

.modal-header .btn-close:focus,
.modal-header .close:focus {
	outline: 0;
	box-shadow: 0 0 0 4px rgba(27, 143, 214, .2);
}

.modal-body {
	padding: 1.25rem 1.5rem;
	color: var(--md-ink);
}

.modal-body .form-group,
.modal-body .form-row {
	margin-bottom: .25rem;
}

.modal-body .form-group > label,
.modal-body .form-row > label,
.modal-body [class*="col-"] > label:first-child,
.modal-body .col-form-label,
.modal-body .control-label {
	margin-bottom: .35rem;
	padding-left: 0;
	color: var(--md-text);
	font-size: .82rem;
	font-weight: 600;
}

.modal-body .col-form-label,
.modal-body .control-label {
	padding-top: calc(.6rem + 1px);
}

.modal-body .form-control,
.modal-body .custom-select,
.modal-body .form-select {
	display: block;
	width: 100%;
	height: 42px;
	padding: .45rem .85rem;
	border: 1px solid var(--md-line);
	border-radius: 10px;
	background-color: #fff;
	color: var(--md-ink);
	font-size: .95rem;
	box-shadow: none;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.modal-body textarea.form-control {
	height: auto;
	min-height: 84px;
}

.modal-body .form-control[type="file"] {
	height: auto;
	padding: .4rem .6rem;
}

.modal-body .form-control-sm,
.modal-body .input-sm {
	height: 34px;
	padding: .3rem .65rem;
	font-size: .88rem;
}

.modal-body .custom-select,
.modal-body .form-select {
	padding-right: 2.2rem;
	appearance: none;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%236b7a90' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m3 6 5 5 5-5'/%3E%3C/svg%3E") no-repeat right .85rem center;
}

.modal-body .form-control:hover,
.modal-body .custom-select:hover,
.modal-body .form-select:hover {
	border-color: #c3cdda;
}

.modal-body .form-control:focus,
.modal-body .custom-select:focus,
.modal-body .form-select:focus {
	outline: 0;
	border-color: var(--md-primary);
	box-shadow: 0 0 0 4px rgba(27, 143, 214, .15);
}

.modal-body .form-control:disabled,
.modal-body .form-control[readonly],
.modal-body .custom-select:disabled {
	background-color: var(--md-ground);
	color: var(--md-muted);
}

.modal-body .form-control.is-invalid,
.modal-body .custom-select.is-invalid,
.modal-body .form-select.is-invalid {
	border-color: var(--md-danger);
	background-image: none;
	box-shadow: 0 0 0 4px rgba(210, 58, 58, .1);
}

.modal-body .invalid-feedback,
.modal-body .invalid-tooltip {
	margin-top: .35rem;
	color: var(--md-danger);
	font-size: .78rem;
}

.modal-body .invalid-tooltip {
	position: static;
	padding: 0;
	background: none;
	border-radius: 0;
}

.modal-body .form-check-input {
	accent-color: var(--md-primary);
}

.modal-body .form-check-input:checked {
	background-color: var(--md-primary);
	border-color: var(--md-primary);
}

.modal-body .form-check-input:focus {
	border-color: var(--md-primary);
	box-shadow: 0 0 0 4px rgba(27, 143, 214, .15);
}

.modal-body .form-check-label {
	color: var(--md-ink);
	font-size: .92rem;
}

.modal-body .chosen-container {
	width: 100% !important;
	font-size: .95rem;
}

.modal-body .chosen-container-single .chosen-single {
	height: 42px;
	line-height: 40px;
	padding: 0 0 0 .85rem;
	border: 1px solid var(--md-line);
	border-radius: 10px;
	background: #fff;
	box-shadow: none;
	color: var(--md-ink);
}

.modal-body .chosen-container-single .chosen-single div {
	right: .5rem;
}

.modal-body .chosen-container-single .chosen-single div b {
	background-position: 0 10px;
}

.modal-body .chosen-container-single .chosen-default {
	color: var(--md-muted);
}

.modal-body .chosen-container-active .chosen-single,
.modal-body .chosen-container-active.chosen-with-drop .chosen-single {
	border-color: var(--md-primary);
	box-shadow: 0 0 0 4px rgba(27, 143, 214, .15);
}

.modal-body .chosen-container-active.chosen-with-drop .chosen-single {
	border-radius: 10px 10px 0 0;
	background: #fff;
}

.modal-body .chosen-container-active.chosen-with-drop .chosen-single div b {
	background-position: -18px 10px;
}

.modal-body .chosen-container .chosen-drop {
	border-color: var(--md-primary);
	border-radius: 0 0 10px 10px;
	box-shadow: 0 12px 24px rgba(20, 33, 61, .12);
}

.modal-body .chosen-container .chosen-search input[type="text"] {
	height: 36px;
	border: 1px solid var(--md-line);
	border-radius: 8px;
}

.modal-body .chosen-container .chosen-results li.highlighted {
	background: var(--md-primary);
}

.modal-body select.is-invalid + .chosen-container .chosen-single {
	border-color: var(--md-danger);
	box-shadow: 0 0 0 4px rgba(210, 58, 58, .1);
}

.modal-body h1,
.modal-body h2,
.modal-body h3,
.modal-body h4,
.modal-body h5,
.modal-body h6 {
	color: var(--md-ink);
	font-weight: 700;
}

.modal-body hr {
	margin: 1rem 0;
	border-color: var(--md-line);
	opacity: 1;
}

.modal-body .table {
	margin-bottom: 0;
	color: var(--md-ink);
	font-size: .9rem;
}

.modal-body .table > thead > tr > th,
.modal-body .table thead th {
	border-top: 0;
	border-bottom: 1px solid var(--md-line);
	background: var(--md-ground);
	color: var(--md-muted);
	font-size: .74rem;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	white-space: nowrap;
}

.modal-body .table td,
.modal-body .table th {
	padding: .6rem .75rem;
	border-color: #edf1f6;
	vertical-align: middle;
}

.modal-body .alert {
	border: 1px solid transparent;
	border-radius: 10px;
	font-size: .9rem;
}

.modal-body .nav-tabs {
	gap: .25rem;
	border-bottom: 1px solid var(--md-line);
}

.modal-body .nav-tabs .nav-link {
	border: 0;
	border-bottom: 2px solid transparent;
	border-radius: 0;
	background: none;
	color: var(--md-muted);
	font-weight: 600;
}

.modal-body .nav-tabs .nav-link:hover {
	color: var(--md-ink);
}

.modal-body .nav-tabs .nav-link.active {
	border-bottom-color: var(--md-primary);
	background: none;
	color: var(--md-primary) !important;
}

.mf-head {
	display: flex;
	align-items: center;
	gap: .8rem;
	min-width: 0;
}

.mf-head-icon {
	flex: none;
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border-radius: 10px;
	background: var(--md-primary-soft);
	color: var(--md-primary);
	font-size: 1rem;
}

.mf-head-sub {
	margin: .1rem 0 0;
	color: var(--md-muted);
	font-size: .8rem;
}

.mf-section {
	padding: 0 0 1.25rem;
	margin: 0 0 1.25rem;
	border-bottom: 1px solid var(--md-line);
}

.mf-section:last-child {
	padding-bottom: 0;
	margin-bottom: 0;
	border-bottom: 0;
}

.modal-body .mf-section-title {
	display: flex;
	align-items: center;
	gap: .5rem;
	margin: 0 0 .9rem;
	color: var(--md-muted);
	font-size: .74rem;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.mf-section-title i {
	color: var(--md-primary);
	font-size: .85rem;
}

.mf-grid {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	gap: .9rem 1rem;
	align-items: start;
}

.mf-span-2 { grid-column: span 2; }
.mf-span-3 { grid-column: span 3; }
.mf-span-4 { grid-column: span 4; }
.mf-span-5 { grid-column: span 5; }
.mf-span-6 { grid-column: span 6; }
.mf-span-7 { grid-column: span 7; }
.mf-span-8 { grid-column: span 8; }
.mf-span-12 { grid-column: span 12; }

.mf-field {
	min-width: 0;
}

.mf-field:empty {
	display: none;
}

.modal-body .mf-field > label {
	display: block;
	flex: none;
	width: auto;
	max-width: none;
	margin: 0 0 .35rem;
	padding: 0;
	color: var(--md-text);
	font-size: .82rem;
	font-weight: 600;
}

.mf-req {
	margin-left: .15rem;
	color: var(--md-danger);
}

.mf-help {
	display: block;
	margin-top: .1rem;
	color: var(--md-muted);
	font-size: .74rem;
	font-weight: 400;
}

.mf-amount {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: .85rem 1rem;
	border: 1px solid var(--md-line);
	border-radius: 12px;
	background: var(--md-ground);
}

.mf-amount-label {
	color: var(--md-muted);
	font-size: .82rem;
	font-weight: 600;
}

.mf-amount-value {
	color: var(--md-ink);
	font-size: 1.15rem;
	font-weight: 700;
}

.mf-amount-value:empty::before {
	content: "…";
	color: var(--md-muted);
}

.mf-choices {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
}

.mf-choice {
	position: relative;
	margin: 0;
}

.mf-choice input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.mf-choice span {
	display: inline-flex;
	align-items: center;
	height: 38px;
	padding: 0 1rem;
	border: 1px solid var(--md-line);
	border-radius: 10px;
	background: #fff;
	color: var(--md-text);
	font-size: .88rem;
	font-weight: 600;
	cursor: pointer;
	transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}

.mf-choice span:hover {
	border-color: #c3cdda;
}

.mf-choice input:checked + span {
	border-color: var(--md-primary);
	background: var(--md-primary-soft);
	color: var(--md-primary-dark);
}

.mf-choice input:focus-visible + span {
	box-shadow: 0 0 0 4px rgba(27, 143, 214, .2);
}

.mf-summary {
	padding: .15rem 1rem;
	border: 1px solid var(--md-line);
	border-radius: 12px;
	background: var(--md-ground);
}

.mf-summary-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	padding: .65rem 0;
	border-top: 1px solid var(--md-line);
}

.mf-summary-row:first-child {
	border-top: 0;
}

.mf-summary-row > span {
	color: var(--md-muted);
	font-size: .85rem;
	font-weight: 600;
}

.mf-summary-row > strong {
	color: var(--md-ink);
	font-size: 1rem;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.mf-summary-row--total > span {
	color: var(--md-ink);
}

.mf-summary-row--total > strong {
	color: var(--md-primary-dark);
	font-size: 1.25rem;
}

.mf-unit {
	position: relative;
}

.mf-unit > .mf-unit-label {
	position: absolute;
	top: 0;
	right: .9rem;
	display: flex;
	align-items: center;
	height: 100%;
	color: var(--md-muted);
	font-size: .85rem;
	font-weight: 700;
	pointer-events: none;
}

.mf-unit > .form-control {
	padding-right: 5.5rem;
}

.modal-body .form-control.mf-input-lg {
	height: 54px;
	font-size: 1.4rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.modal-body .form-control.mf-input-lg::placeholder {
	color: #a3afbf;
	font-size: 1.05rem;
	font-weight: 500;
}

.mf-hero {
	padding: 1.25rem 1rem;
	border-radius: 14px;
	background: #e9f7f0;
	color: #17784a;
	text-align: center;
}

.mf-hero-label {
	display: block;
	margin-bottom: .25rem;
	font-size: .74rem;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	opacity: .85;
}

.mf-hero-value {
	display: block;
	font-size: 1.9rem;
	font-weight: 800;
	line-height: 1.15;
	font-variant-numeric: tabular-nums;
}

.mf-hero-note {
	display: block;
	margin-top: .35rem;
	font-size: .88rem;
	font-weight: 600;
}

.mf-hero--danger {
	background: #fdf0f0;
	color: var(--md-danger);
}

.mf-hero--muted {
	background: var(--md-ground);
	color: var(--md-muted);
}

.mf-hero + .mf-grid,
.mf-summary + .mf-grid {
	margin-top: 1.1rem;
}

.modal-body .form-control.borderRed {
	border-color: var(--md-danger);
	box-shadow: 0 0 0 4px rgba(210, 58, 58, .1);
}

.modal-body .mf-field > label.labelRed {
	color: var(--md-danger);
}

.mf-options {
	display: grid;
	gap: .6rem;
}

.mf-option {
	display: flex;
	align-items: center;
	gap: .8rem;
	margin: 0;
	padding: .85rem 1rem;
	border: 1px solid var(--md-line);
	border-radius: 12px;
	background: #fff;
	cursor: pointer;
	transition: border-color .15s ease, background-color .15s ease;
}

.mf-option:hover {
	border-color: #c3cdda;
}

.mf-option:has(input:checked) {
	border-color: var(--md-primary);
	background: var(--md-primary-soft);
}

.mf-option > input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.mf-option-box {
	flex: none;
	display: grid;
	place-items: center;
	width: 22px;
	height: 22px;
	border: 1.5px solid #b9c4d3;
	border-radius: 6px;
	background: #fff;
	color: transparent;
	font-size: .7rem;
	transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.mf-option > input:checked + .mf-option-box {
	border-color: var(--md-primary);
	background: var(--md-primary);
	color: #fff;
}

.mf-option > input:focus-visible + .mf-option-box {
	box-shadow: 0 0 0 4px rgba(27, 143, 214, .2);
}

.mf-option-text {
	color: var(--md-ink);
	font-size: .93rem;
	font-weight: 600;
	line-height: 1.35;
}

.mf-option-meta {
	flex: none;
	margin-left: auto;
	padding: .2rem .6rem;
	border-radius: 999px;
	background: #eef2f7;
	color: var(--md-text);
	font-size: .78rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.mf-option-meta.is-full {
	background: #fdf0f0;
	color: var(--md-danger);
}

.mf-color {
	display: flex;
	align-items: center;
	gap: .5rem;
}

.mf-color input[type="color"] {
	flex: none;
	width: 42px;
	height: 42px;
	padding: 3px;
	border: 1px solid var(--md-line);
	border-radius: 10px;
	background: #fff;
	cursor: pointer;
}

.mf-color input[type="color"]::-webkit-color-swatch-wrapper {
	padding: 0;
}

.mf-color input[type="color"]::-webkit-color-swatch {
	border: 0;
	border-radius: 7px;
}

.mf-preview {
	display: flex;
	align-items: center;
	height: 42px;
}

.mf-preview-badge {
	display: inline-block;
	max-width: 100%;
	padding: .35rem .8rem;
	border: 1px solid var(--md-line);
	border-radius: 8px;
	background: #fff;
	color: var(--md-ink);
	font-size: .82rem;
	font-weight: 700;
	text-transform: uppercase;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.mf-suboptions {
	margin-top: .9rem;
	padding: .9rem;
	border: 1px dashed var(--md-line);
	border-radius: 12px;
}

.modal-body .mf-section-title.labelRed,
.modal-body .mf-section-title.labelRed i {
	color: var(--md-danger);
}

.mf-choice input[type="checkbox"]:checked + span::before {
	content: "\f00c";
	margin-right: .4rem;
	font-family: "Font Awesome 5 Free";
	font-size: .7rem;
	font-weight: 900;
}

.modal-footer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: .6rem;
	padding: .9rem 1.5rem;
	border-top: 1px solid var(--md-line);
	background: var(--md-ground);
}

.modal-footer > * {
	margin: 0;
}

.modal .btn,
.bootbox .btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .45rem;
	border-radius: 10px;
	background-image: none;
	font-weight: 600;
	text-shadow: none;
	box-shadow: none;
	transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.modal-footer .btn:not(.btn-sm):not(.btn-xs) {
	min-height: 42px;
	padding: .45rem 1.15rem;
	font-size: .93rem;
}

.modal .btn:focus,
.modal .btn:focus-visible {
	outline: 0;
	box-shadow: 0 0 0 4px rgba(27, 143, 214, .2);
}

.modal .btn-primary {
	border-color: var(--md-primary);
	background-color: var(--md-primary);
	color: #fff;
}

.modal .btn-primary:hover,
.modal .btn-primary:active {
	border-color: var(--md-primary-dark);
	background-color: var(--md-primary-dark);
	color: #fff;
}

.modal-footer .btn-primary,
.modal-footer .btn-success {
	box-shadow: 0 4px 12px rgba(27, 143, 214, .25);
}

.modal .btn-success {
	border-color: var(--md-success);
	background-color: var(--md-success);
	color: #fff;
}

.modal .btn-success:hover {
	border-color: #188350;
	background-color: #188350;
	color: #fff;
}

.modal-footer .btn-success {
	box-shadow: 0 4px 12px rgba(31, 157, 97, .25);
}

.modal .btn-danger {
	border-color: var(--md-danger);
	background-color: var(--md-danger);
	color: #fff;
}

.modal .btn-danger:hover {
	border-color: #b42f2f;
	background-color: #b42f2f;
	color: #fff;
}

.modal .btn-secondary,
.modal .btn-default,
.modal-footer .btn-danger[data-bs-dismiss="modal"],
.modal-footer .btn-danger[data-dismiss="modal"],
.bootbox .bootbox-cancel {
	border-color: var(--md-line);
	background-color: #fff;
	color: var(--md-text);
	box-shadow: none;
}

.modal .btn-secondary:hover,
.modal .btn-default:hover,
.modal-footer .btn-danger[data-bs-dismiss="modal"]:hover,
.modal-footer .btn-danger[data-dismiss="modal"]:hover,
.bootbox .bootbox-cancel:hover {
	border-color: #c3cdda;
	background-color: #eef2f7;
	color: var(--md-ink);
}

.modal .btn-outline-primary {
	border-color: var(--md-primary);
	background-color: #fff;
	color: var(--md-primary);
}

.modal .btn-outline-primary:hover {
	background-color: var(--md-primary-soft);
	color: var(--md-primary-dark);
}

.modal .btn:disabled,
.modal .btn.disabled {
	opacity: .55;
	box-shadow: none;
}

.bootbox .modal-body {
	padding: 1.4rem 1.5rem;
	font-size: .98rem;
	line-height: 1.5;
}

.bootbox .modal-header + .modal-body {
	padding-top: 1.25rem;
}

.bootbox .bootbox-close-button {
	margin-left: auto;
}

.swal2-container.swal2-backdrop-show {
	background: rgba(20, 33, 61, .45);
}

.swal2-popup {
	border-radius: 16px;
	padding: 1.75rem 1.5rem 1.5rem;
	color: var(--md-ink);
	font-family: inherit;
	box-shadow: 0 24px 64px rgba(20, 33, 61, .28);
}

.swal2-title {
	color: var(--md-ink);
	font-size: 1.3rem;
	font-weight: 700;
}

.swal2-html-container {
	color: var(--md-text);
	font-size: .98rem;
	line-height: 1.5;
}

.swal2-actions {
	gap: .6rem;
}

.swal2-styled {
	margin: 0;
	min-height: 42px;
	padding: .45rem 1.25rem;
	border-radius: 10px;
	font-size: .93rem;
	font-weight: 600;
}

.swal2-styled.swal2-confirm {
	background-color: var(--md-primary);
	box-shadow: 0 4px 12px rgba(27, 143, 214, .25);
}

.swal2-styled.swal2-confirm:hover {
	background-color: var(--md-primary-dark);
	background-image: none;
}

.swal2-styled.swal2-deny {
	background-color: var(--md-danger);
}

.swal2-styled.swal2-cancel {
	border: 1px solid var(--md-line);
	background-color: #fff;
	color: var(--md-text);
}

.swal2-styled.swal2-cancel:hover {
	background-color: #eef2f7;
	background-image: none;
	color: var(--md-ink);
}

.swal2-styled:focus {
	box-shadow: 0 0 0 4px rgba(27, 143, 214, .2);
}

.swal2-input,
.swal2-textarea,
.swal2-select {
	border: 1px solid var(--md-line);
	border-radius: 10px;
	box-shadow: none;
	font-size: .95rem;
}

.swal2-input:focus,
.swal2-textarea:focus,
.swal2-select:focus {
	border-color: var(--md-primary);
	box-shadow: 0 0 0 4px rgba(27, 143, 214, .15);
}

@media (max-width: 575.98px) {
	.modal-dialog {
		margin: .75rem 8px;
	}

	.modal-header,
	.modal-body,
	.modal-footer {
		padding-left: 1rem;
		padding-right: 1rem;
	}

	.modal-footer .btn:not(.btn-sm):not(.btn-xs) {
		flex: 1 1 auto;
	}
}

@media (max-width: 767.98px) {
	.mf-grid > [class*="mf-span-"] {
		grid-column: span 12;
	}
}
