/**
 * B2B Pricing admin screens.
 */

/*
 * Core marks the current tab with a background a shade off its neighbours,
 * which is hard to spot across five of them. The stylesheet loads only on this
 * page, so the plain core selectors are safe to sharpen here. The `:hover` and
 * `:focus` copies exist because core zeroes the shadow on those states.
 */
.nav-tab-wrapper .nav-tab-active,
.nav-tab-wrapper .nav-tab-active:hover,
.nav-tab-wrapper .nav-tab-active:focus,
.nav-tab-wrapper .nav-tab-active:focus:active {
	border-bottom-color: #f0f0f1;
	box-shadow: inset 0 3px 0 #2271b1;
	color: #1d2327;
	font-weight: 600;
}

/*
 * The status filter links sit directly under the tab strip, which carries no
 * bottom margin of its own, and WooCommerce pulls them up a further 8px with a
 * negative top margin on `.woocommerce .subsubsub:not(.list-table-filters)` —
 * leaving them reading as part of the tabs. Both classes are on the same wrap
 * div, so repeating that `:not()` puts this selector one class ahead of
 * WooCommerce's; anything shorter ties and loses, because its stylesheet is
 * enqueued after ours.
 */
.bccentralconnector-pricing.woocommerce .subsubsub:not(.list-table-filters) {
	margin-top: 10px;
}

.bccentralconnector-pill {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 3px;
	font-size: 12px;
	line-height: 1.6;
	white-space: nowrap;
}

.bccentralconnector-pill--success {
	background: #edfaef;
	color: #00650a;
}

.bccentralconnector-pill--pending {
	background: #fcf3e3;
	color: #8a5700;
}

.bccentralconnector-pill--danger {
	background: #fcf0f1;
	color: #8a2424;
}

.bccentralconnector-pill--neutral {
	background: #f0f0f1;
	color: #50575e;
}

.bccentralconnector-edit .postbox-header h2,
.bccentralconnector-preview .postbox-header h2 {
	padding: 0 12px;
}

.bccentralconnector-fields .form-field {
	margin: 0 0 12px;
}

.bccentralconnector-fields .form-field label {
	display: block;
	font-weight: 600;
	margin-bottom: 4px;
}

.bccentralconnector-fields input[type="text"],
.bccentralconnector-fields input[type="number"],
.bccentralconnector-fields input[type="date"],
.bccentralconnector-fields select,
.bccentralconnector-rule-form input[type="text"],
.bccentralconnector-rule-form input[type="number"],
.bccentralconnector-rule-form select,
.bccentralconnector-generate input[type="text"],
.bccentralconnector-generate select {
	max-width: 340px;
	width: 100%;
}

/* select2 copies the field's inline width onto the container it renders in
   place of it, but not the cap that keeps every field the same width. */
.bccentralconnector-fields .select2-container,
.bccentralconnector-rule-form .select2-container,
.bccentralconnector-generate .select2-container {
	max-width: 340px;
}

/* selectWoo greys a disabled field and refuses to open it, but disabling it
   only sets tabindex="-1" on the box it renders in place of the select, which
   a mouse can still focus - and WooCommerce paints a focused field blue.
   Ignoring the pointer is what a native disabled control does. Fading the
   whole container is what makes it read as disabled: select2 paints a solid
   grey box at full-strength text, where wp-admin fades fill, border and text
   alike. */
.bccentralconnector-fields .select2-container--disabled,
.bccentralconnector-rule-form .select2-container--disabled,
.bccentralconnector-generate .select2-container--disabled {
	opacity: 0.5;
	pointer-events: none;
}

/* Laid out as a row rather than left to inline alignment: core gives .button
   `vertical-align: top` but leaves .button-primary on the baseline, so the
   status label sat differently depending on which buttons the state offers. */
.bccentralconnector-statusbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 12px 0;
	padding: 10px 12px;
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 3px;
}

.bccentralconnector-statusbar__label {
	margin-right: 4px;
	font-weight: 600;
}

.bccentralconnector-rule-form,
.bccentralconnector-generate {
	margin-top: 16px;
	padding: 12px 16px;
	background: #f6f7f7;
	border: 1px solid #dcdcde;
	border-radius: 3px;
}

.bccentralconnector-rule-form .form-field,
.bccentralconnector-generate .form-field {
	margin: 0 0 12px;
}

.bccentralconnector-rule-form .form-field label,
.bccentralconnector-generate .form-field label {
	display: block;
	font-weight: 600;
	margin-bottom: 4px;
}

/* The skip report. Every skip is named rather than counted (PRC-R-032), so it
   is a list and needs its markers back — core's admin reset removes them. */
.bccentralconnector-generate-summary ul {
	margin: 0 0 8px 20px;
	list-style: disc;
}

.bccentralconnector-feedback.is-error {
	color: #b32d2e;
}

.bccentralconnector-rules {
	margin-bottom: 12px;
}

/* Quick Edit (PRC-R-033) opens under the row it edits, inside the grid, so it
   is tinted rather than boxed — a border here would read as a second table. */
.bccentralconnector-quick-edit > td {
	background: #f6f7f7;
}

.bccentralconnector-quick-edit .bccentralconnector-fields {
	display: flex;
	flex-wrap: wrap;
	gap: 0 16px;
}

.bccentralconnector-quick-edit .submit {
	margin: 0;
	padding: 0;
}

/* The bulk report names every rejected item rather than counting them, so it is
   a list and needs its markers back — core's admin reset removes them. */
.bccentralconnector-bulk-summary ul {
	margin: 0 0 8px 20px;
	list-style: disc;
}

.bccentralconnector-preview-result {
	padding: 12px 16px;
}

.bccentralconnector-preview-price {
	margin: 0;
	font-size: 24px;
}

/* The rule that won, called out so the table is scannable at a glance. */
.bccentralconnector-preview-result tr.is-winner td {
	background: #cfeed7;
	font-weight: 600;
}

.bccentralconnector-preview-result tr.is-winner td:first-child {
	box-shadow: inset 3px 0 0 #00a32a;
}

/* Pricing groups registry: the Attributes-screen two-column layout. */
.bccentralconnector-col-container {
	display: flex;
	gap: 20px;
	align-items: flex-start;
	margin-top: 16px;
}

.bccentralconnector-col-left {
	flex: 0 0 320px;
}

.bccentralconnector-col-right {
	flex: 1 1 auto;
	overflow-x: auto;
}

.bccentralconnector-col-left .form-wrap {
	background: #fff;
	border: 1px solid #c3c4c7;
	padding: 12px 16px;
}

.bccentralconnector-col-left .form-field {
	margin: 0 0 12px;
}

.bccentralconnector-col-left .form-field label {
	display: block;
	font-weight: 600;
	margin-bottom: 4px;
}

.bccentralconnector-col-left .form-field input[type="text"],
.bccentralconnector-col-left .form-field input[type="number"],
.bccentralconnector-col-left .form-field select {
	width: 100%;
}

.bccentralconnector-col-right .num {
	text-align: right;
}

@media screen and (max-width: 782px) {

	.bccentralconnector-col-container {
		flex-direction: column;
	}

	.bccentralconnector-col-left {
		flex-basis: auto;
		width: 100%;
	}
}
