/* Scope everything to the Backline settings page */
.blr-ba-settings {
	--blr-ba-bg: #f5f7fb;
	--blr-ba-surface: #ffffff;
	--blr-ba-surface-soft: #f8fafc;
	--blr-ba-border: #d8dee8;
	--blr-ba-border-soft: #e8edf4;
	--blr-ba-text: #18212b;
	--blr-ba-text-soft: #5d6875;
	--blr-ba-heading: #0f1720;
	--blr-ba-shadow-sm: 0 1px 2px rgba(15, 23, 32, 0.04), 0 8px 24px rgba(15, 23, 32, 0.05);
	--blr-ba-shadow-lg: 0 10px 35px rgba(15, 23, 32, 0.08);
	--blr-ba-radius: 6px;
	--blr-ba-radius-md: 6px;
	--blr-ba-radius-sm: 6px;
	--blr-ba-primary: #ff7b01;
	--blr-ba-primary-soft: #eef3f9;
	--blr-ba-success: #12715b;
	--blr-ba-danger: #b42318;
	--blr-ba-tab: #6b7683;
	--blr-ba-space-1: 8px;
	--blr-ba-space-2: 12px;
	--blr-ba-space-3: 16px;
	--blr-ba-space-4: 20px;
	--blr-ba-space-5: 24px;
	--blr-ba-space-6: 32px;
	max-width: 1440px;
	color: var(--blr-ba-text);
}

.blr-ba-settings * {
	box-sizing: border-box;
}

.blr-ba-settings__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 24px;
	margin: 24px 0 18px;
}

.blr-ba-settings__title {
	display: flex;
	align-items: center;
	gap: 10px;
}

.blr-ba-settings__logo {
	display: block;
	width: 50px;
	height: auto;
	object-fit: contain;
	flex: 0 0 auto;
}

.blr-ba-settings__header h1 {
	margin: 0 0 6px;
	font-size: 30px;
	line-height: 1.1;
	font-weight: 700;
	color: var(--blr-ba-heading);
}

.blr-ba-settings__header p {
	margin: 0;
	max-width: 78ch;
	color: var(--blr-ba-text-soft);
	font-size: 14px;
	line-height: 1.6;
}

.blr-ba-settings__header-actions {
	display: flex;
	gap: 10px;
	padding: 10px 1em 0 0;
}

.blr-ba-settings__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: 24px;
	align-items: start;
}

.blr-ba-settings__main,
.blr-ba-settings__side {
	min-width: 0;
}

.blr-ba-settings__panel,
.blr-ba-sidecard {
	background: var(--blr-ba-surface);
	border: 1px solid var(--blr-ba-border-soft);
	border-radius: var(--blr-ba-radius);
	box-shadow: var(--blr-ba-shadow-sm);
}

.blr-ba-settings__panel {
	overflow: hidden;
}

.blr-ba-settings__tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 18px 18px;
	border-bottom: 1px solid var(--blr-ba-border-soft);
	background: linear-gradient(180deg, #fbfcfe 0%, #ffffff 100%);
}

.blr-ba-settings__tab {
	appearance: none;
	border: 1px solid transparent;
	background: transparent;
	color: var(--blr-ba-tab);
	font-size: 13px;
	line-height: 1;
	font-weight: 600;
	padding: 11px 14px;
	border-radius: var(--blr-ba-radius);
	cursor: pointer;
	transition: all 0.18s ease;
}

.blr-ba-settings__tab:hover {
	background: #f2f6fb;
	color: var(--blr-ba-heading);
}

.blr-ba-settings__tab.is-active {
	background: var(--blr-ba-primary);
	color: #fff;
}

.blr-ba-settings form {
	margin: 0;
}

.blr-ba-settings__tab-panel {
	padding: 24px;
}

.blr-ba-settings__section-head {
	margin: 0 0 20px;
}

.blr-ba-settings__section-head h2 {
	margin: 0 0 6px;
	font-size: 19px;
	line-height: 1.2;
	color: var(--blr-ba-heading);
}

.blr-ba-settings__section-head p {
	margin: 0;
	color: var(--blr-ba-text-soft);
	font-size: 14px;
	line-height: 1.6;
}

.blr-ba-setting-row {
	display: grid;
	grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
	gap: 24px;
	padding: 18px 0;
	border-top: 1px solid var(--blr-ba-border-soft);
}

.blr-ba-setting-row:first-of-type {
	border-top: 0;
	padding-top: 0;
}

.blr-ba-setting-row__label label,
.blr-ba-setting-row__label > span {
	display: inline-block;
	margin: 0 0 6px;
	font-size: 14px;
	font-weight: 600;
	color: var(--blr-ba-heading);
}

.blr-ba-setting-row__label p {
	margin: 0;
	font-size: 13px;
	line-height: 1.55;
	color: var(--blr-ba-text-soft);
}

.blr-ba-setting-row__control {
	min-width: 0;
}

.blr-ba-settings input[type="text"],
.blr-ba-settings input[type="email"],
.blr-ba-settings input[type="url"],
.blr-ba-settings input[type="number"],
.blr-ba-settings input[type="password"],
.blr-ba-settings textarea,
.blr-ba-settings select {
	width: 100%;
	max-width: 100%;
	min-height: 44px;
	padding: 10px 14px;
	border-radius: var(--blr-ba-radius);
	border: 1px solid #c8d2de;
	background: #fff;
	box-shadow: none;
}

.blr-ba-settings input[type="text"]:focus,
.blr-ba-settings input[type="email"]:focus,
.blr-ba-settings input[type="url"]:focus,
.blr-ba-settings input[type="number"]:focus,
.blr-ba-settings input[type="password"]:focus,
.blr-ba-settings textarea:focus,
.blr-ba-settings select:focus {
	border-color: #2b6cb0;
	box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.12);
	outline: 0;
}

.blr-ba-settings input.regular-text,
.blr-ba-settings input.large-text,
.blr-ba-settings textarea.large-text,
.blr-ba-settings textarea.regular-text,
.blr-ba-settings select.regular-text {
	width: 100%;
	max-width: 100%;
}

.blr-ba-settings textarea {
	min-height: 130px;
	resize: vertical;
}

.blr-ba-settings .description,
.blr-ba-settings p.description {
	margin-top: 8px;
	color: var(--blr-ba-text-soft);
	font-size: 13px;
	line-height: 1.55;
}

.blr-ba-inline-note {
	margin-top: 10px;
}

.blr-ba-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 28px;
	padding: 0 10px;
	border-radius: var(--blr-ba-radius);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.blr-ba-badge.is-success {
	background: rgba(18, 113, 91, 0.12);
	color: var(--blr-ba-success);
}

.blr-ba-badge.is-muted {
	background: #eef2f6;
	color: #607080;
}

.blr-ba-color-control {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.blr-ba-color-control input[type="color"] {
	width: 56px;
	min-width: 56px;
	padding: 4px;
	border-radius: var(--blr-ba-radius);
}

.blr-ba-color-control__value {
	display: inline-flex;
	align-items: center;
	min-height: 34px;
	padding: 0 12px;
	border-radius: var(--blr-ba-radius);
	background: var(--blr-ba-primary-soft);
	color: var(--blr-ba-heading);
	font-size: 13px;
	font-weight: 600;
}

.blr-ba-checkgrid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 12px;
}

.blr-ba-checkcard {
	position: relative;
	display: grid;
	grid-template-columns: 20px minmax(0, 1fr);
	gap: 12px;
	align-items: start;
	padding: 14px;
	background: var(--blr-ba-surface-soft);
	border: 1px solid var(--blr-ba-border-soft);
	border-radius: var(--blr-ba-radius);
	cursor: pointer;
	transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.blr-ba-checkcard:hover {
	border-color: #c7d3e1;
	box-shadow: 0 6px 18px rgba(15, 23, 32, 0.06);
	transform: translateY(-1px);
}

.blr-ba-checkcard input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.blr-ba-checkcard__box {
	position: relative;
	display: block;
	width: 20px;
	height: 20px;
	margin-top: 1px;
	border: 1.5px solid #b2bdca;
	border-radius: var(--blr-ba-radius);
	background: #fff;
	transition: all 0.18s ease;
}

.blr-ba-checkcard__box::after {
	content: "";
	position: absolute;
	top: 2px;
	left: 6px;
	width: 5px;
	height: 10px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg) scale(0);
	transition: transform 0.18s ease;
}

.blr-ba-checkcard input[type="checkbox"]:checked + .blr-ba-checkcard__box {
	border-color: var(--blr-ba-primary);
	background: var(--blr-ba-primary);
}

.blr-ba-checkcard input[type="checkbox"]:checked + .blr-ba-checkcard__box::after {
	transform: rotate(45deg) scale(1);
}

.blr-ba-checkcard input[type="checkbox"]:focus + .blr-ba-checkcard__box {
	box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.15);
}

.blr-ba-checkcard input[type="checkbox"]:checked ~ .blr-ba-checkcard__content strong {
	color: var(--blr-ba-heading);
}

.blr-ba-checkcard--danger {
	background: #fff8f7;
	border-color: #f2d2cf;
}

.blr-ba-checkcard__content {
	display: grid;
	gap: 4px;
	min-width: 0;
}

.blr-ba-checkcard__content strong {
	font-size: 14px;
	line-height: 1.35;
	color: var(--blr-ba-heading);
}

.blr-ba-checkcard__content span {
	font-size: 12px;
	line-height: 1.5;
	color: var(--blr-ba-text-soft);
}

.blr-ba-settings .select2-container {
	display: block;
	width: 100% !important;
	max-width: 760px;
}

.blr-ba-settings .select2-container .select2-selection--multiple {
	min-height: 44px;
	padding: 5px 8px;
	border-radius: var(--blr-ba-radius);
	border-color: #c8d2de;
}

.blr-ba-settings .select2-container--default.select2-container--focus .select2-selection--multiple {
	border-color: #2b6cb0;
	box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.12);
}

.blr-ba-codebox {
	display: block;
	padding: 12px 14px;
	background: #0f1720;
	border-radius: var(--blr-ba-radius);
	border: 1px solid #111927;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
	overflow-x: auto;
}

.blr-ba-codebox code {
	display: block;
	margin: 0;
	color: #e5edf5;
	font-size: 12px;
	line-height: 1.6;
	white-space: pre-wrap;
	word-break: break-word;
}

.blr-ba-sidebar-logo-admin-control {
	display: grid;
	gap: 14px;
}

.blr-ba-sidebar-logo-admin-preview {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 120px;
	width: 125px;
	border-radius: var(--blr-ba-radius);
}

.blr-ba-sidebar-logo-admin-preview img {
	display: block;
	max-width: 100%;
	max-height: 72px;
	width: auto;
	height: auto;
	object-fit: contain;
}

.blr-ba-sidebar-logo-admin-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
}

.blr-ba-settings .submit {
	margin: 0;
	padding: 0;
}

.blr-ba-settings__footer {
	padding: 24px 24px;
	border-top: 1px solid var(--blr-ba-border-soft);
	background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
}

.blr-ba-settings__footer .button-primary {
	min-height: 44px;
	padding: 0 18px;
	border-radius: var(--blr-ba-radius);
	font-weight: 600;
}

.blr-ba-sidecard {
	position: sticky;
	top: 32px;
	padding: 18px;
}

.blr-ba-sidecard h2 {
	margin: 0 0 14px;
	font-size: 16px;
	line-height: 1.3;
	color: var(--blr-ba-heading);
}

.blr-ba-statlist {
	list-style: none;
	margin: 5px 0 0 0;
	padding: 0;
	display: grid;
	gap: 10px;
}

.blr-ba-statlist li {
	display: grid;
	gap: 4px;
	padding: 6px 0;
	border-top: 1px solid var(--blr-ba-border-soft);
}

.blr-ba-statlist li:first-child {
	padding-top: 0;
	border-top: 0;
}

.blr-ba-statlist span {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: var(--blr-ba-text-soft);
	margin-bottom: 5px;
}

.blr-ba-statlist strong,
.blr-ba-statlist a {
	font-size: 14px;
	line-height: 1.45;
	color: var(--blr-ba-heading);
	text-decoration: none;
	word-break: break-word;
}

.blr-ba-doc-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

.blr-ba-doc-card {
	padding: 18px;
	border-radius: var(--blr-ba-radius);
	border: 1px solid var(--blr-ba-border-soft);
	background: var(--blr-ba-surface-soft);
	display: grid;
	gap: 12px;
}

.blr-ba-doc-card h3 {
	margin: 0;
	font-size: 16px;
	line-height: 1.3;
	color: var(--blr-ba-heading);
}

.blr-ba-doc-card p {
	margin: 0;
	font-size: 14px;
	line-height: 1.6;
	color: var(--blr-ba-text-soft);
}

.blr-ba-doc-list {
	margin: 0;
	padding-left: 18px;
	color: var(--blr-ba-text);
	display: grid;
	gap: 8px;
}

.blr-ba-doc-list li {
	line-height: 1.55;
}

.blr-ba-settings .notice,
.blr-ba-settings div.updated,
.blr-ba-settings div.error {
	margin: 0 0 16px;
	border-radius: var(--blr-ba-radius);
	overflow: hidden;
}

.blr-warning {
	color: #b12704;
	font-weight: 600;
}

.blr-notice {
	color: #ff7b00;
	font-weight: 600;
}

.blr-em-mb {
	margin-bottom: 4em;
}

.blr-settings-divider {
	width: 100%;
	margin: 0 0 20px 0;
}

.blr-fw {
	width: 100%;
}


.blr-ba-alert {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	margin: 0 0 20px;
	padding: 16px 18px;
	border: 1px solid transparent;
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.blr-ba-alert__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	flex: 0 0 32px;
	border-radius: 999px;
	font-size: 16px;
	font-weight: 700;
	line-height: 1;
}

.blr-ba-alert__content {
	min-width: 0;
}

.blr-ba-alert__title {
	margin: 0 0 4px;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.3;
	color: #0f172a;
}

.blr-ba-alert__content p {
	margin: 0;
	font-size: 13px;
	line-height: 1.5;
	color: #475569;
}

.blr-ba-alert--success {
	border-color: rgba(22, 163, 74, 0.18);
	background: linear-gradient(180deg, rgba(240, 253, 244, 0.9) 0%, #ffffff 100%);
}

.blr-ba-alert--success .blr-ba-alert__icon {
	background: rgba(22, 163, 74, 0.12);
	color: #15803d;
}

.blr-ba-alert--error {
	border-color: rgba(220, 38, 38, 0.18);
	background: linear-gradient(180deg, rgba(254, 242, 242, 0.92) 0%, #ffffff 100%);
}

.blr-ba-alert--error .blr-ba-alert__icon {
	background: rgba(220, 38, 38, 0.12);
	color: #b91c1c;
}


@media (max-width: 1120px) {
	.blr-ba-settings__layout {
		grid-template-columns: 1fr;
	}

	.blr-ba-sidecard {
		position: static;
	}

	.blr-ba-doc-grid {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 782px) {
	.blr-ba-settings {
		margin-right: 10px;
	}

	.blr-ba-settings__header {
		flex-direction: column;
		align-items: stretch;
	}

	.blr-ba-setting-row {
		grid-template-columns: 1fr;
		gap: 12px;
	}

	.blr-ba-settings__tab-panel,
	.blr-ba-settings__footer {
		padding-left: 18px;
		padding-right: 18px;
	}
}

@media (max-width: 640px) {
	.blr-ba-settings__header h1 {
		font-size: 25px;
	}

	.blr-ba-settings__tabs {
		padding-left: 14px;
		padding-right: 14px;
	}

	.blr-ba-settings__tab-panel,
	.blr-ba-settings__footer {
		padding-left: 14px;
		padding-right: 14px;
	}

	.blr-ba-checkgrid {
		grid-template-columns: 1fr;
	}

	.blr-ba-sidebar-logo-admin-actions {
		flex-direction: column;
		align-items: stretch;
	}

	.blr-ba-settings__footer .button-primary,
	.blr-ba-settings__header-actions .button {
		width: 100%;
		justify-content: center;
		text-align: center;
	}
}



.blr-ba-docs-layout {
	display: grid;
	grid-template-columns: 240px minmax(0, 1fr);
	gap: 24px;
	align-items: start;
}

.blr-ba-docs-nav {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.blr-ba-docs-tab {
	display: block;
	width: 100%;
	text-align: left;
	border: 1px solid var(--blr-ba-border, #dcdcde);
	background: var(--blr-ba-surface, #fff);
	color: inherit;
	padding: 12px 14px;
	border-radius: 10px;
	cursor: pointer;
	font: inherit;
}

.blr-ba-docs-tab.is-active {
	border-color: var(--blr-ba-primary, #2271b1);
	box-shadow: 0 0 0 1px var(--blr-ba-primary, #2271b1) inset;
}

.blr-ba-docs-content {
	min-width: 0;
}

.blr-ba-docs-panel {
	border: 1px solid var(--blr-ba-border, #dcdcde);
	background: var(--blr-ba-surface, #fff);
	border-radius: 14px;
	padding: 20px;
}

.blr-ba-docs-panel h3 {
	margin-top: 0;
}

.blr-ba-docs-panel .blr-ba-codebox + .blr-ba-codebox {
	margin-top: 12px;
}

.blr-ba-docs-panel p:last-child {
	margin-bottom: 0;
}

@media (max-width: 900px) {
	.blr-ba-docs-layout {
		grid-template-columns: 1fr;
	}

	.blr-ba-docs-nav {
		flex-direction: row;
		flex-wrap: wrap;
	}
}



.blr-ba-checkcard {
	display: flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	position: relative;
}

/* Hide the native checkbox but keep it accessible */
.blr-ba-checkcard input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

/* Custom checkbox box */
.blr-ba-checkcard__box {
	width: 24px;
	height: 24px;
	border: 2px solid #8c8f94;
	border-radius: 4px;
	background: #fff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 24px;
	transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Green selected state */
.blr-ba-checkcard input[type="checkbox"]:checked + .blr-ba-checkcard__box {
	background: #22c55e;
	border-color: #22c55e;
}

/* White checkmark */

.blr-ba-checkcard input[type="checkbox"]:checked + .blr-ba-checkcard__box::after {
  content: "";
  width: 6px;
  height: 11px;
  border: solid #fff;
    border-top-width: medium;
    border-right-width: medium;
    border-bottom-width: medium;
    border-left-width: medium;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin: 0px 0px 0 1px;

}

/* Keyboard focus state */
.blr-ba-checkcard input[type="checkbox"]:focus-visible + .blr-ba-checkcard__box {
	box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
}

/* Optional hover */
.blr-ba-checkcard:hover .blr-ba-checkcard__box {
	border-color: #22c55e;
}

/* BLR Backline local presentation utilities. Keep simple display tweaks in CSS instead of inline style attributes. */
.blr-ba-checkcard--stacked {
  display: block;
  margin-bottom: 16px;
}

.blr-ba-w-100 {
  width: 100%;
}

.blr-ba-mt-12 {
  margin-top: 12px;
}
