// Configure terms, Edit term, Bulk Add and Bulk Edit (admin/terms and admin/bulk-edit bundles;
// PLAN Phase 9, appendix C §2–§4). WordPress's own markup takes the design: the script adds
// `.ssw-admin.ssw-terms` to its `.wrap`; nothing changes without JavaScript.
@use "tokens" as *;
@use "components";
@use "admin/pro";

/* stylelint-disable selector-class-pattern, selector-id-pattern -- WordPress's ids and classes */

$checker: repeating-conic-gradient(#eef0f2 0 25%, #fff 0 50%) 50% / 8px 8px;
$texture-stops: #ded5c4 25%, #c9bfae 25%, #c9bfae 50%, #ded5c4 50%, #ded5c4 75%, #c9bfae 75%;
$texture: linear-gradient(45deg, $texture-stops) 0 0 / 10px 10px;

.ssw-terms {
	font-size: 13px;
	color: $ink-2;

	h1 {
		font-size: 23px;
		font-weight: 400;
		color: $ink;
	}

	.ssw-native-field {
		display: none !important;
	}
}

.ssw-terms__intro {
	max-width: 80ch;
	margin: 0 0 4px;
	font-size: 13px;
	color: $muted;

	&:last-of-type {
		margin-bottom: 20px;
	}
}

/* List screen ------------------------------------------------------------------------------------ */

.ssw-terms.is-list {

	#col-container {
		display: flex;
		flex-wrap: wrap;
		align-items: flex-start;
		gap: 24px;

		// The wp-clearfix ::after would be a third flex item (and an extra gap).
		&::after {
			display: none;
		}
	}

	#col-left {
		order: -1;
		flex: 35 1 0;
		min-width: 280px;
		width: auto;
		float: none;
	}

	#col-right {
		flex: 65 1 0;
		min-width: 300px;
		width: auto;
		float: none;
	}

	#col-left .col-wrap,
	#col-right .col-wrap {
		padding: 0;
	}

	.form-wrap {

		.ssw-term-card .form-field {
			margin: 0;
		}

		h2 {
			margin: 0 0 14px;
			padding: 0;
			font-size: 14px;
			font-weight: 600;
			color: $ink;
		}

		.form-field {
			margin: 0 0 16px;
			padding: 0;
		}

		label {
			display: block;
			margin: 0 0 8px;
			padding: 0;
			font-size: 14px;
			font-weight: 500;
			color: $text;
		}

		p:not(.submit) {
			margin: 4px 0 0;
			font-size: 13px;
			color: $muted;
		}

		.ssw-wpta {
			min-height: 80px;
		}
	}

	p.submit {
		margin: 0;
		padding: 0;

		.button-primary {
			height: 40px;
			min-height: 40px;
			padding: 0 16px;
			border-radius: 4px;
			font-size: 14px;
			font-weight: 600;
			line-height: normal;
		}
	}
}

// Bulk Add / Bulk Edit buttons.
.ssw-terms__bulk {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin: 0 0 20px;

	a.ssw-tbtn {
		text-decoration: none;
	}
}

// Toolbar: Bulk actions + Apply on the left, item count and search on the right.
.ssw-terms .tablenav.top {
	display: flex;
	align-items: center;
	gap: 10px;
	height: auto;
	margin: 0 0 10px;
	padding: 0;

	.actions {
		display: flex;
		gap: 10px;
		padding: 0;
		overflow: visible;
	}

	select,
	.button {
		height: 36px;
		min-height: 36px;
		padding: 0 12px;
		border: 1px solid $line-ring-strong;
		border-radius: 3px;
		font-size: 13px;
		line-height: 34px;
	}

	select {
		padding-right: 28px;
	}

	.tablenav-pages {
		margin: 0 0 0 auto;
		float: none;
		font-size: 13px;
		color: $muted;
	}

	br {
		display: none;
	}
}

.ssw-terms__search {
	margin: 0;

	.search-box {
		margin: 0;
		float: none;
	}

	label,
	#search-submit {
		position: absolute !important;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip-path: inset(50%);
	}

	input[type="search"] {
		width: 200px;
		height: 36px;
		min-height: 36px;
		margin: 0;
		padding: 0 12px;
		border: 1px solid $line-ring;
		border-radius: 4px;
		font-size: 14px;

		&:focus {
			border-color: $blue;
			box-shadow: 0 0 0 1px $blue;
		}
	}
}

// The terms table.
.ssw-terms table.wp-list-table {
	border: 1px solid $line-card;
	border-radius: 3px;
	border-collapse: separate;
	border-spacing: 0;
	box-shadow: none;
	overflow: hidden;
	font-size: 14px;

	thead th,
	thead td,
	tfoot th,
	tfoot td {
		padding: 10px 12px;
		border-bottom: 1px solid $line-card;
		font-size: 14px;
		font-weight: 400;
	}

	tfoot {
		display: none;
	}

	tbody td,
	tbody th {
		padding: 10px 12px;
		vertical-align: middle;
		font-size: 14px;
		border-bottom: 1px solid $line-list;
	}

	tbody tr:nth-child(odd) > * {
		background: $surface-2;
	}

	tbody tr:nth-child(even) > * {
		background: #fff;
	}

	tbody tr:hover > * {
		background: $surface-2;
	}

	tbody tr:last-child > * {
		border-bottom: 0;
	}

	.check-column {
		width: 36px;
		padding: 10px 0 10px 12px;
	}

	.column-ssw_preview {
		width: 70px;
	}

	.column-posts {
		width: 70px;
		text-align: right;
	}

	.column-description,
	.column-slug {
		color: $muted;
	}

	.column-slug {
		font-variant-numeric: tabular-nums;
	}

	.row-title {
		font-weight: 600;
	}

	thead th {
		white-space: nowrap;

		a,
		> span {
			display: inline-flex;
			align-items: center;
			gap: 2px;
			padding: 0;
		}
	}

	.column-posts {
		width: 84px;
	}

	// WooCommerce's drag handle (custom ordering).
	.column-handle {
		width: 18px;
		padding-left: 0;
		padding-right: 10px;
	}

	// Row actions show over the bottom of the name cell, so rows keep the design's height.
	td.column-name {
		position: relative;
	}

	.row-actions {
		position: absolute;
		left: -9999em;
		bottom: 2px;
		padding: 0;
		font-size: 12px;
	}

	tr:hover .row-actions,
	tr:focus-within .row-actions {
		left: 12px;
	}
}

// The design keeps one toolbar, above the table.
.ssw-terms .tablenav.bottom {
	display: none;
}

.ssw-terms .ssw-term-card [name="ssw_term[tooltip]"] {
	width: 100%;
}

// Name and Slug fill the column as in the design (WordPress's `.form-field input` sets 95%).
.ssw-terms.is-list .form-field input.ssw-wpi {
	width: 100%;
}

.ssw-terms__note {
	margin: 10px 0 0;
	font-size: 12.5px;
	color: $muted;
}

// Preview chips.
.ssw-chip {
	display: inline-block;
	flex: 0 0 auto;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	vertical-align: middle;
	box-sizing: border-box;
	box-shadow: inset 0 0 0 1px rgba(16, 17, 20, 0.08);

	&.is-empty,
	&.is-unset {
		background: #c6c7cb;
	}

	&.is-unset {
		background: $checker;
	}

	&.is-image {
		border-radius: 4px;
		background-color: #eef1f2;
		background-position: center;
		background-size: cover;
	}

	&.is-empty-image {
		background: $checker;
	}

	&.is-label {
		display: inline-flex;
		align-items: center;
		width: auto;
		min-width: 28px;
		height: 22px;
		padding: 0 8px;
		border: 1px solid #c6c7cb;
		border-radius: 4px;
		box-shadow: none;
		font-size: 12px;
		color: #45464a;
	}
}

// Empty state.
.ssw-terms .no-items td {
	padding: 0;
}

.ssw-terms-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	padding: 44px 24px;
	text-align: center;

	p {
		max-width: 42ch;
		margin: 0;
		font-size: 13px;
		color: $muted;
	}
}

.ssw-terms-empty .ssw-pbtn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 40px;
	padding: 0 18px;
	font-size: 14px;
	font-weight: 600;
	text-transform: capitalize;
}

.ssw-terms-empty__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 10px;
	background: $tint;
	color: $blue;
}

.ssw-terms-empty__title {
	font-size: 16px;
	font-weight: 600;
	color: $ink;
	text-transform: capitalize;
}

/* Swatch card ------------------------------------------------------------------------------------ */

.ssw-term-card__rule {
	margin: 4px 0 16px;
	border-top: 1px solid #dcdce0;
}

.ssw-term-card {
	margin: 0 0 16px;
	border: 1px solid #e4e4e6;
	border-radius: 8px;
	background: #f4f4f5;

	.ssw-terms & .form-field {
		margin: 0;
	}
}

.ssw-term-card__head {
	padding: 12px 16px;
	border-bottom: 1px solid #e7e7e9;
	border-radius: 8px 8px 0 0;
	background: #efeff0;
}

.ssw-term-card__brand {
	font-size: 14px;
	font-weight: 600;
	color: #e2574c;

	img {
		display: block;
		height: 22px;
		width: auto;
	}
}

.ssw-term-card__body {
	display: flex;
	flex-direction: column;
	gap: 24px;
	padding: 16px;
}

.ssw-term-controls {
	display: flex;
	flex-direction: column;
	gap: 24px;

	.ssw-frow {
		align-items: flex-start;
	}

	.ssw-flbl {
		padding-top: 11px;
	}

	// Edit term: the rows line up with WordPress's form table (label column, then the control).
	&.is-edit {
		gap: 20px;

		.ssw-frow {
			display: grid;
			grid-template-columns: 210px 1fr;
			gap: 0;
			align-items: center;
		}

		.ssw-flbl {
			padding-top: 0;
			font-weight: 600;
			color: $ink;
		}

		.ssw-fctrl {
			justify-content: flex-start;
		}
	}
}

.ssw-term-wells {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.ssw-term-wells__plus {
	color: $faint-2;
}

// Colour well.
.ssw-cwell-wrap {
	position: relative;
	display: inline-flex;
}

.ssw-cwell {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 40px;
	padding: 0 8px;
	border: 1px solid $line-ring;
	border-radius: 4px;
	background: #fff;
	cursor: pointer;
	font-family: inherit;
	transition: border-color 150ms ease, box-shadow 150ms ease;

	&:hover {
		border-color: $faint-2;
	}

	&.is-open {
		border-color: $blue;
		box-shadow: 0 0 0 1px $blue;
	}

	@include focus-visible;

	&.is-row {
		width: 40px;
		justify-content: center;
		padding: 0;
	}

	&.is-cell {
		height: 40px;
		width: 110px;
	}
}

.ssw-cwell__dot {
	flex: 0 0 26px;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: $checker;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3), inset 0 0 0 1px rgba(16, 17, 20, 0.06);

	.ssw-cwell.is-row &,
	.ssw-cwell.is-cell & {
		flex-basis: 20px;
		width: 20px;
		height: 20px;
	}

	.ssw-cwell.is-row & {
		flex-basis: 22px;
		width: 22px;
		height: 22px;
	}
}

.ssw-cwell__text {
	width: 66px;
	overflow: hidden;
	white-space: nowrap;
	text-align: left;
	font-size: 14px;
	color: $ink;
	text-transform: uppercase;
	font-variant-numeric: tabular-nums;

	.ssw-cwell.is-empty & {
		font-size: 12.5px;
		color: $faint-2;
		text-transform: none;
	}

	.ssw-cwell.is-cell & {
		width: auto;
		font-size: 11px;
	}

	.ssw-cwell.is-cell.is-empty & {
		font-size: 11px;
		text-transform: uppercase;
		letter-spacing: 0.02em;
	}
}

// The picker under a well (appendix C §2.3; positions as the settings picker does).
.ssw-term-picker {
	top: calc(100% + 6px);
	z-index: 60;
}

// Tone strip under Name.
.ssw-has-tones {
	position: relative;
}

.ssw-tones {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	z-index: 40;
	display: flex;
	gap: 6px;
	padding: 10px;
	border: 1px solid #e2e3e6;
	border-radius: 6px;
	background: #fff;
	box-shadow: 0 8px 24px rgba(16, 17, 20, 0.12);
	animation: ssw-menu-in 150ms $ease; // replays each time the strip is shown

	&[hidden] {
		display: none;
	}
}

.ssw-tones__tile {
	flex: 1;
	height: 34px;
	padding: 0;
	border: 0;
	border-radius: 5px;
	box-shadow: inset 0 0 0 1px rgba(16, 17, 20, 0.08);
	cursor: pointer;
	transition: transform 120ms ease;

	&:hover {
		transform: translateY(-2px);
	}
}

/* Edit term ------------------------------------------------------------------------------------- */

.ssw-terms.is-edit {

	.form-table .ssw-wpi {
		max-width: 646px;
	}

	.ssw-term-edit-row td {
		padding: 16px 0;
	}
}

/* Bulk Add ------------------------------------------------------------------------------------- */

.ssw-bulk {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.ssw-bulk__cards {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.ssw-bulk__card {
	position: relative;
	padding: 8px;
	border: 1px solid $line-card;
	border-radius: 8px;
	background: #fff;
}

.ssw-bulk__card-head {
	display: flex;
	align-items: center;
	gap: 8px;
}

.ssw-bulk__toggle {
	flex: 1;
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 34px;
	padding: 0;
	border: 0;
	background: none;
	font-family: inherit;
	text-align: left;
	cursor: pointer;
}

.ssw-bulk__chev {
	color: $text-2;
	transition: transform 180ms ease;

	&.is-open {
		transform: rotate(90deg);
	}
}

.ssw-bulk__term {
	font-size: 14px;
	font-weight: 600;
	color: $ink;
}

.ssw-bulk__summary {
	font-size: 14px;
	font-weight: 500;
	color: $text;
}

.ssw-bulk__remove {
	position: relative;

	// Right-aligned under the trash button, with an arrow pointing at it (the design's `.confpop`).
	.ssw-confpop {
		position: absolute;
		top: calc(100% + 10px);
		right: 0;
		left: auto;
		z-index: 60;
		width: 232px;
		transform-origin: top right;

		&::before {
			content: "";
			position: absolute;
			bottom: 100%;
			right: 14px;
			border: 6px solid transparent;
			border-bottom-color: #fff;
			filter: drop-shadow(0 -1px 0 #e2e3e6);
		}
	}
}

.ssw-bulk__card-body {
	display: grid;
	grid-template-rows: 1fr;
	opacity: 1;
	transition: grid-template-rows 220ms $ease, opacity 180ms ease;

	.ssw-bulk__card.is-collapsed & {
		grid-template-rows: 0fr;
		opacity: 0;
	}
}

.ssw-bulk__card-inner {
	min-height: 0;
	overflow: hidden;

	.ssw-bulk__card:not(.is-collapsed) & {
		overflow: visible;
	}

	> .ssw-field {
		margin-bottom: 10px;
	}

	> .ssw-bulk__desc {
		margin-bottom: 0;
	}
}

.ssw-bulk__name-row {
	display: flex;
	align-items: flex-end;
	gap: 10px;
	margin: 13px 0 10px;

	.ssw-bulk__name {
		flex: 1;
	}

	.ssw-field {
		margin-bottom: 0;
	}

	.ssw-bulk__swatch .ssw-lbl {
		text-align: right;
	}
}

.ssw-req {
	color: $danger;
}

.ssw-admin .ssw-wpi.is-tabular {
	font-variant-numeric: tabular-nums;
}

.ssw-bulk__tip {
	margin-top: 18px;
}

.ssw-bulk__tip-row {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.ssw-bulk__tip-toggle {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 0;
	border: 0;
	background: none;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	color: $blue;
	cursor: pointer;

	.ssw-bulk__chev {
		color: $blue;
	}
}

.ssw-bulk__tip-body {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows 200ms $ease;

	&:not([inert]) {
		grid-template-rows: 1fr;
	}
}

.ssw-bulk__tip-inner {
	display: flex;
	align-items: flex-end;
	gap: 12px;
	min-height: 0;
	overflow: hidden;

	.ssw-field {
		margin: 12px 0 0;
	}
}

.ssw-bulk__tip-text {
	flex: 1;
	min-width: 160px;
}

.ssw-bulk__count {
	font-size: 12.5px;
	color: $muted;

	strong {
		color: $ink;
	}
}

.ssw-bulk__dual {
	display: flex;
	align-items: center;
	gap: 10px;
	padding-bottom: 12px;
}

.ssw-seg.is-small .ssw-seg__item {
	height: 26px;
	padding: 0 10px;
	font-size: 13px;
}

.ssw-bulk__slots {
	display: inline-flex;
	gap: 6px;
}

.ssw-bulk__slot {
	width: 30px;
	height: 30px;
	padding: 0;
	border: 1px solid $line-ring;
	border-radius: 50%;
	cursor: pointer;

	&.is-empty {
		background: $checker;
	}

	&.is-on {
		border: 2px solid $blue;
	}
}

.ssw-thumb.is-texture {
	background: $texture;
}

/* Bulk Edit ------------------------------------------------------------------------------------- */

.ssw-bulk-edit-screen #wpcontent {
	padding-left: 0;
}

.ssw-bulk-edit-screen #wpbody-content > .wrap {
	margin: 0;
}

.ssw-be {
	margin: 20px;
	border: 1px solid #e2e3e6;
	border-radius: 8px;
	background: #fff;
	overflow: hidden;
	font-size: 14px;
	color: $ink-2;
}

.ssw-be--loading {
	padding: 40px 20px;
	color: $muted;
}

.ssw-be__head {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 14px;
	padding: 15px 20px;
	border-bottom: 1px solid #ececed;
}

.ssw-be__back {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 13px;
	color: $blue;
	text-decoration: none;

	&:hover {
		color: $blue-2;
	}
}

.ssw-be__divider {
	width: 1px;
	height: 18px;
	background: #dcdce0;
}

.ssw-admin .ssw-be__title {
	margin: 0;
	padding: 0;
	font-size: 16px;
	line-height: 24px;
	font-weight: 600;
	color: $ink;
	text-transform: capitalize;
}

.ssw-be__tools {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-left: auto;
}

.ssw-be__columns {
	position: relative;
	width: 34px;
	padding: 0;
	justify-content: center;

	&.is-open {
		border-color: $text;
		color: $text;
	}

	&.has-hidden::after {
		content: "";
		position: absolute;
		top: -3px;
		right: -3px;
		width: 6px;
		height: 6px;
		border-radius: 50%;
		background: $blue;
		box-shadow: 0 0 0 2px #fff;
	}
}

.ssw-be__colmenu {
	position: absolute;
	top: calc(100% + 4px);
	right: 0;
	z-index: 30;
	width: 220px;
	padding: 6px;

	hr {
		margin: 6px 0;
		border: 0;
		border-top: 1px solid $line-list;
	}
}

.ssw-be__colcap {
	padding: 6px 8px 4px;
	font-size: 11px;
	font-weight: 600;
	color: $faint;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.ssw-be__colopt {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 7px 8px;
	border-radius: 4px;
	font-size: 13px;
	color: $text;
	cursor: pointer;

	&:hover {
		background: $tint;
	}

	em {
		margin-left: auto;
		font-style: normal;
		font-size: 12px;
		color: $faint;
	}

	&.is-fixed,
	&.is-disabled {
		cursor: default;

		&:hover {
			background: none;
		}
	}

	&.is-disabled {
		opacity: 0.5;
	}

	input {
		margin: 0;
	}
}

.ssw-be__tick {
	width: 16px;
	height: 16px;
	border-radius: 3px;
	background: #c6c7cb;
}

.ssw-be__showall {
	display: block;
	width: 100%;
	padding: 7px 8px;
	border: 0;
	border-radius: 4px;
	background: none;
	color: $blue;
	font-family: inherit;
	font-size: 13px;
	text-align: center;
	cursor: pointer;

	&:hover {
		background: $tint;
	}
}

.ssw-tmenu__sep {
	margin: 4px 0;
	border: 0;
	border-top: 1px solid $line-list;
}

// Autofill bar.
.ssw-be__auto {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 14px;
	padding: 11px 20px;
	border-bottom: 1px solid $line-list;
	background: $tint;
	font-size: 13px;
	color: $text;
}

.ssw-be__auto-icon {
	display: inline-flex;
	color: $blue;
}

.ssw-be__auto-note {
	color: $muted;
}

.ssw-be__auto-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 30px;
	padding: 0 10px;
	border: 0;
	border-radius: 4px;
	background: #fff;
	box-shadow: inset 0 0 0 1px $blue-ring;
	font-family: inherit;
	font-size: 13px;
	font-weight: 500;
	color: $blue;
	cursor: pointer;

	&:hover:not(:disabled) {
		box-shadow: inset 0 0 0 1px #72aee6;
		color: $blue-2;
	}

	&:disabled {
		opacity: 0.6;
		cursor: default;
	}
}

// Grid.
.ssw-be__scroll {
	overflow: auto;
}

.ssw-be__grid {
	width: 100%;
	min-width: 640px;
	border-collapse: collapse;
	font-size: 14px;

	th {
		padding: 10px 8px;
		background: $surface-2;
		border-bottom: 1px solid $line-card;
		font-size: 11px;
		font-weight: 600;
		color: $text-2;
		text-align: left;
		text-transform: uppercase;
		letter-spacing: 0.04em;
		white-space: nowrap;
	}

	td {
		padding: 12px 8px;
		border-bottom: 1px solid $line-list;
		vertical-align: middle;
	}

	tr.is-selected td {
		background: #f6fafd;
	}

	.ssw-wpi {
		height: 40px;
	}

	.ssw-wpi.is-muted {
		color: $muted;
	}
}

.ssw-be__c-drag {
	width: 34px;
	padding-left: 20px !important;
}

.ssw-be__c-check {
	width: 34px;
}

.ssw-be__c-preview {
	width: 56px;
}

.ssw-be__c-swatch {
	width: 140px;
}

.ssw-be__c-slug {
	width: 130px;
}

.ssw-be__c-tip {
	width: 150px;
}

.ssw-be__c-tipimg {
	width: 70px;
	padding-right: 20px !important;
}

.ssw-be__drag {
	display: inline-flex;
	padding: 4px;
	border: 0;
	background: none;
	color: $text-2;
	cursor: grab;

	@include focus-visible;
}

.ssw-ckbox {
	width: 16px;
	height: 16px;
	margin: 0;
}

.ssw-be__none {
	padding: 40px 20px !important;
	text-align: center;
	color: $muted;
}

.ssw-be__more {
	padding: 14px 20px;
	text-align: center;
}

.ssw-be__foot {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 13px 20px;
	border-top: 1px solid #ececed;
	background: $surface-3;

	.ssw-pbtn {
		margin-left: auto;
	}

	.ssw-gbtn.is-danger {
		border-color: $danger;
		color: $danger;
	}
}

.ssw-be__status {
	font-size: 12.5px;
	color: $muted;

	strong {
		color: $ink;
	}
}

.ssw-be__busy {
	font-size: 12.5px;
	color: $text-2;

	&.is-error {
		color: $danger-2;
	}
}

/* Import modal (terms) -------------------------------------------------------------------------- */

.ssw-import__stats {
	display: flex;
	gap: 10px;
	margin-bottom: 14px;
}

.ssw-import__stat {
	flex: 1;
	min-width: 90px;
	padding: 12px 14px;
	border: 1px solid;
	border-radius: 8px;
	font-size: 12px;

	strong {
		display: block;
		font-size: 22px;
		font-weight: 700;
		font-variant-numeric: tabular-nums;
	}

	&.is-new {
		border-color: #cdeccf;
		background: #f0f9f2;
		color: #1a7f37;
	}

	&.is-update {
		border-color: #cfe0f5;
		background: #f2f7fc;
		color: $blue;
	}

	&.is-skip {
		border-color: #e2e3e6;
		background: #f6f7f8;
		color: #787c82;
	}
}

.ssw-import__conflict {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 14px;
	font-size: 13px;
	font-weight: 500;
	color: $text;
}

.ssw-import__choices {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.ssw-import__choice {
	height: 34px;
	padding: 0 13px;
	border: 1px solid $line-ring;
	border-radius: 6px;
	background: #fff;
	font-family: inherit;
	font-size: 13px;
	font-weight: 500;
	color: #45464a;
	cursor: pointer;

	&.is-on {
		border-color: $blue;
		background: $tint;
		color: $blue;
	}
}

.ssw-import__table {
	border: 1px solid $line-card;
	border-radius: 8px;
	overflow: hidden;
}

.ssw-import__tr {
	display: grid;
	grid-template-columns: 22px 1fr 92px 84px;
	align-items: center;
	gap: 10px;
	padding: 9px 12px;
	border-bottom: 1px solid #f2f3f4;
	font-size: 13px;

	> :last-child {
		text-align: right;
	}

	&.is-head {
		padding: 8px 12px;
		background: #f6f7f8;
		font-size: 11px;
		font-weight: 600;
		color: $muted;
		text-transform: uppercase;
		letter-spacing: 0.04em;
	}
}

.ssw-import__tbody {
	max-height: 220px;
	overflow-y: auto;
}

.ssw-import__term {
	font-weight: 500;
	color: $ink;

	&.is-missing {
		color: $danger;
	}
}

.ssw-import__value {
	font-size: 12px;
	color: $muted;
	text-transform: uppercase;
	font-variant-numeric: tabular-nums;
}

.ssw-import__pill {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 20px;
	font-size: 11px;
	font-weight: 600;

	&.is-new {
		background: #e6f6ec;
		color: #1a7f37;
	}

	&.is-update {
		background: #e7f0fb;
		color: $blue;
	}

	&.is-skip {
		background: #eef0f2;
		color: #787c82;
	}

	&.is-invalid {
		background: #fdecec;
		color: $danger;
	}

	&.is-duplicate {
		background: #fff4e5;
		color: #bf6b0b;
	}
}

.ssw-import__more {
	padding: 8px 12px;
	background: #fafbfc;
	font-size: 12px;
	color: $muted;
}
