/* Settings page */
.subin-settings-workspace {
	display: grid;
	grid-template-columns: minmax(230px, 260px) minmax(0, 1fr);
	align-items: start;
	gap: 24px;
}

.subin-settings-page .subin-settings-tabs {
	position: sticky;
	top: 48px;
	display: grid;
	gap: 6px;
	max-height: calc(100vh - 76px);
	margin: 0;
	padding: 10px;
	overflow-y: auto;
	background: #fff;
	border: 1px solid #d8e2ee;
	border-radius: 16px;
	box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}

.subin-settings-page .subin-settings-tab {
	display: grid;
	grid-template-columns: 20px minmax(0, 1fr) auto;
	align-items: center;
	gap: 10px;
	min-height: 54px;
	margin: 0;
	padding: 9px 10px;
	color: #475569;
	background: transparent;
	border: 1px solid transparent;
	border-radius: 11px;
	line-height: 1.2;
	text-decoration: none;
	transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.subin-settings-page .subin-settings-tab:hover {
	color: #1d4ed8;
	background: #f8fafc;
	border-color: #d8e2ee;
}

.subin-settings-page .subin-settings-tab:focus-visible {
	color: #1d4ed8;
	border-color: #60a5fa;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
	outline: none;
}

.subin-settings-page .subin-settings-tab--active {
	color: #1d4ed8;
	background: #eff6ff;
	border-color: #bfdbfe;
}

.subin-settings-tab > .dashicons {
	width: 20px;
	height: 20px;
	font-size: 19px;
	line-height: 20px;
}

.subin-settings-tab__copy {
	display: grid;
	gap: 3px;
	min-width: 0;
}

.subin-settings-tab__copy strong {
	color: inherit;
	font-size: 13px;
	font-weight: 700;
}

.subin-settings-tab__copy small {
	color: #64748b;
	font-size: 11px;
	line-height: 1.3;
}

.subin-settings-tab__status {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 22px;
	padding: 3px 7px;
	color: #475569;
	background: #f1f5f9;
	border-radius: 999px;
	font-size: 10px;
	font-weight: 700;
	line-height: 1;
	white-space: nowrap;
}

.subin-settings-tab__status--success {
	color: #166534;
	background: #dcfce7;
}

.subin-settings-tab__status--warning {
	color: #92400e;
	background: #fef3c7;
}

.subin-settings-tab__status--danger {
	color: #991b1b;
	background: #fee2e2;
}

.subin-settings-panel {
	min-width: 0;
}

.subin-settings-panel:focus {
	outline: none;
}

.subin-settings-overview {
	display: grid;
	gap: 18px;
}

.subin-settings-overview__hero {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 20px;
	padding: 24px;
	color: #172033;
	background: linear-gradient(135deg, #eff6ff 0%, #fff 58%, #f0fdf4 100%);
	border: 1px solid #bfdbfe;
	border-radius: 18px;
}

.subin-settings-overview__hero h2,
.subin-settings-overview__hero p,
.subin-settings-overview-card h3,
.subin-settings-overview-card p {
	margin: 0;
}

.subin-settings-overview__hero h2 {
	font-size: 22px;
	line-height: 1.25;
}

.subin-settings-overview__hero > div > p:last-child {
	max-width: 720px;
	margin-top: 8px;
	color: #475569;
	line-height: 1.55;
}

.subin-settings-overview__eyebrow {
	margin-bottom: 6px !important;
	color: #2563eb;
	font-size: 11px;
	font-weight: 750;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.subin-settings-overview__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

.subin-settings-overview-card {
	display: flex;
	flex-direction: column;
	min-height: 210px;
	padding: 20px;
	background: #fff;
	border: 1px solid #d8e2ee;
	border-radius: 16px;
	box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}

.subin-settings-overview-card__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.subin-settings-overview-card__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	color: #1d4ed8;
	background: #eff6ff;
	border-radius: 11px;
	font-size: 20px;
	line-height: 1;
}

.subin-settings-overview-card h3 {
	margin-top: 14px;
	color: #172033;
	font-size: 17px;
}

.subin-settings-overview-card p {
	margin-top: 7px;
	color: #64748b;
	font-size: 13px;
	line-height: 1.5;
}

.subin-settings-overview-card__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: auto;
	padding-top: 18px;
}

.subin-settings-overview__secondary {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
}

.subin-settings-overview__secondary > a {
	display: grid;
	grid-template-columns: 22px minmax(0, 1fr);
	align-items: center;
	gap: 10px;
	padding: 14px;
	color: #334155;
	background: #fff;
	border: 1px solid #d8e2ee;
	border-radius: 13px;
	text-decoration: none;
}

.subin-settings-overview__secondary > a:hover,
.subin-settings-overview__secondary > a:focus-visible {
	color: #1d4ed8;
	border-color: #93c5fd;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
	outline: none;
}

.subin-settings-overview__secondary span:last-child {
	display: grid;
	gap: 3px;
}

.subin-settings-overview__secondary small {
	color: #64748b;
	font-size: 11px;
}

.subin-settings-form {
	display: grid;
	gap: 18px;
}

.subin-settings-section {
	margin-top: 0;
	padding: 20px 24px;
	background: #fff;
	border: 1px solid #d8e2ee;
	border-radius: 16px;
	box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}

.subin-settings-panel > .subin-settings-section {
	margin-top: 18px;
}

.subin-settings-panel > .subin-settings-section:first-child {
	margin-top: 0;
}

.subin-settings-section h2 {
	margin-top: 0;
}

.subin-settings-section__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 18px;
}

.subin-settings-section__header h2,
.subin-settings-section__header p {
	margin: 0;
}

.subin-settings-section__header p {
	margin-top: 6px;
	color: #64748b;
	line-height: 1.5;
}

.subin-settings-callout {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin-top: 16px;
	padding: 12px 14px;
	color: #334155;
	background: #f8fafc;
	border: 1px solid #cbd5e1;
	border-radius: 11px;
	font-size: 13px;
	line-height: 1.45;
}

.subin-settings-callout--warning {
	color: #7c2d12;
	background: #fff7ed;
	border-color: #fed7aa;
}

.subin-settings-callout--danger {
	color: #7f1d1d;
	background: #fef2f2;
	border-color: #fecaca;
}

.subin-settings-callout > .dashicons {
	flex: 0 0 20px;
}

.subin-settings-callout strong,
.subin-settings-callout p {
	margin: 0;
}

.subin-settings-callout p,
.subin-settings-callout label {
	display: block;
	margin-top: 4px;
}

.subin-settings-inline-check {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin-top: 10px;
	font-weight: 600;
}

.subin-settings-inline-check input {
	margin: 0;
}

.subin-settings-danger-zone {
	border-color: #fecaca;
	box-shadow: 0 10px 28px rgba(153, 27, 27, 0.05);
}

.subin-settings-savebar {
	position: sticky;
	bottom: 12px;
	z-index: 12;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 56px;
	padding: 10px 12px 10px 16px;
	background: rgba(255, 255, 255, 0.96);
	border: 1px solid #cbd5e1;
	border-radius: 14px;
	box-shadow: 0 14px 34px rgba(15, 23, 42, 0.14);
	backdrop-filter: blur(8px);
}

.subin-settings-savebar.is-dirty {
	border-color: #93c5fd;
	box-shadow: 0 14px 34px rgba(37, 99, 235, 0.16);
}

.subin-settings-savebar__state,
.subin-settings-savebar__actions {
	display: flex;
	align-items: center;
	gap: 9px;
}

.subin-settings-savebar__state {
	color: #64748b;
	font-size: 13px;
	font-weight: 650;
}

.subin-settings-savebar.is-dirty .subin-settings-savebar__state {
	color: #1d4ed8;
}

.subin-settings-savebar .submit {
	margin: 0;
	padding: 0;
}

.subin-integration-list {
	display: grid;
	gap: 16px;
	margin-top: 18px;
}

.subin-integration-card {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 18px;
	padding: 18px;
	border: 1px solid #d8e2ee;
	border-radius: 16px;
	background: #fff;
}

.subin-integration-card--planned {
	background: #f8fafc;
}

.subin-integration-card h3 {
	margin: 0 0 6px;
	color: #172033;
	font-size: 16px;
}

.subin-integration-card p {
	margin: 0;
	color: #64748b;
}

.subin-integration-card__controls {
	display: grid;
	justify-items: end;
	gap: 12px;
	min-width: 160px;
}

.subin-integration-card__controls .subin-settings-toggle {
	grid-template-columns: 46px auto;
}

.subin-integration-card__toggle {
	display: inline-flex;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
}

.subin-settings-section .form-table {
	margin-top: 0;
}

.subin-settings-page .form-table {
	margin: 0;
	border-collapse: separate;
	border-spacing: 0 12px;
}

.subin-settings-page .form-table th,
.subin-settings-page .form-table td {
	padding: 0;
	vertical-align: top;
}

.subin-settings-page .form-table th {
	width: 220px;
	padding-top: 9px;
	color: #172033;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.35;
}

.subin-settings-page .form-table label {
	color: #172033;
	font-size: 13px;
	font-weight: 650;
	line-height: 1.35;
}

.subin-settings-page input[type="text"],
.subin-settings-page input[type="email"],
.subin-settings-page input[type="number"],
.subin-settings-page input[type="password"],
.subin-settings-page input[type="url"],
.subin-settings-page select,
.subin-settings-page textarea {
	box-sizing: border-box;
	width: min(100%, 440px);
	min-height: 38px;
	margin: 0;
	padding: 7px 10px;
	color: #172033;
	background: #fff;
	border: 1px solid #c9d8e8;
	border-radius: 9px;
	box-shadow: none;
	font-size: 14px;
	line-height: 1.35;
}

.subin-settings-page input.small-text[type="number"] {
	width: 110px;
}

.subin-settings-page select {
	padding-right: 32px;
}

.subin-settings-page textarea {
	min-height: 96px;
	resize: vertical;
}

.subin-settings-page input[type="text"]:focus,
.subin-settings-page input[type="email"]:focus,
.subin-settings-page input[type="number"]:focus,
.subin-settings-page input[type="password"]:focus,
.subin-settings-page input[type="url"]:focus,
.subin-settings-page select:focus,
.subin-settings-page textarea:focus {
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
	outline: none;
}

.subin-settings-page .description {
	max-width: 680px;
	margin: 8px 0 0;
	color: #64748b;
	font-size: 13px;
	line-height: 1.45;
}

.subin-settings-page .submit {
	margin: 18px 0 0;
	padding: 0;
}

.subin-settings-page .submit .button,
.subin-settings-page .button-primary,
.subin-settings-page .button-secondary {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 38px;
	padding: 7px 14px;
	border-radius: 9px;
	font-weight: 650;
	line-height: 1.2;
	box-shadow: none;
}

.subin-settings-page .submit .button-primary,
.subin-settings-page .button-primary {
	color: #fff;
	background: #2563eb;
	border-color: #2563eb;
}

.subin-settings-page .submit .button-primary:hover,
.subin-settings-page .submit .button-primary:focus,
.subin-settings-page .button-primary:hover,
.subin-settings-page .button-primary:focus {
	color: #fff;
	background: #1d4ed8;
	border-color: #1d4ed8;
	box-shadow: none;
}

.subin-settings-page .button-secondary,
.subin-settings-page .submit .button:not(.button-primary) {
	color: #334155;
	background: #fff;
	border-color: #c9d8e8;
}

.subin-settings-page .button-secondary:hover,
.subin-settings-page .button-secondary:focus,
.subin-settings-page .submit .button:not(.button-primary):hover,
.subin-settings-page .submit .button:not(.button-primary):focus {
	color: #1d4ed8;
	background: #eff6ff;
	border-color: #bfdbfe;
	box-shadow: none;
}

.subin-team-access__header,
.subin-team-access__toolbar,
.subin-team-access__search,
.subin-team-access__identity,
.subin-team-access__form,
.subin-team-access__export {
	display: flex;
	align-items: center;
}

.subin-team-access__header {
	justify-content: space-between;
	gap: 20px;
}

.subin-team-access__header h2,
.subin-team-access__header p {
	margin: 0;
}

.subin-team-access__header p {
	margin-top: 7px;
	color: #64748b;
}

.subin-team-access__warning {
	margin: 20px 0 0;
	padding: 12px 16px;
	border-radius: 10px;
}

.subin-team-access__warning p {
	margin: 0;
}

.subin-team-access__warning p + p {
	margin-top: 5px;
}

.subin-team-access__presets {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
	margin-top: 18px;
}

.subin-team-access__preset {
	padding: 15px;
	background: #f8fafc;
	border: 1px solid #d8e2ee;
	border-radius: 12px;
}

.subin-team-access__preset p {
	margin: 10px 0 0;
	color: #475569;
	font-size: 13px;
	line-height: 1.45;
}

.subin-team-access__export-warning {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 16px 0 0;
	padding: 11px 13px;
	color: #7c2d12;
	background: #fff7ed;
	border: 1px solid #fed7aa;
	border-radius: 10px;
	font-size: 13px;
	line-height: 1.45;
}

.subin-team-access__export-warning .dashicons {
	flex: 0 0 auto;
	margin-top: 1px;
}

.subin-team-access__toolbar {
	justify-content: space-between;
	gap: 18px;
	margin-top: 20px;
}

.subin-team-access__toolbar .description {
	margin: 0;
	text-align: right;
}

.subin-team-access__search {
	flex: 1 1 420px;
	gap: 8px;
}

.subin-settings-page .subin-team-access__search input[type="search"] {
	width: min(100%, 360px);
	min-height: 38px;
	margin: 0;
	padding: 7px 10px;
	border: 1px solid #c9d8e8;
	border-radius: 9px;
	box-shadow: none;
}

.subin-team-access__table-wrap {
	overflow-x: auto;
	margin-top: 18px;
	border: 1px solid #d8e2ee;
	border-radius: 12px;
}

.subin-team-access__table {
	min-width: 820px;
	border: 0;
	box-shadow: none;
}

.subin-team-access__table th,
.subin-team-access__table td {
	vertical-align: middle;
}

.subin-team-access__table th:first-child,
.subin-team-access__table td:first-child {
	width: 28%;
}

.subin-team-access__table th:nth-child(2),
.subin-team-access__table td:nth-child(2) {
	width: 18%;
}

.subin-team-access__identity {
	gap: 10px;
}

.subin-team-access__avatar {
	width: 36px;
	height: 36px;
	border-radius: 50%;
}

.subin-team-access__identity span {
	display: grid;
	gap: 2px;
}

.subin-team-access__identity small {
	color: #64748b;
}

.subin-team-access__form {
	justify-content: flex-end;
	flex-wrap: wrap;
	gap: 12px;
}

.subin-team-access__control {
	display: grid;
	gap: 4px;
}

.subin-team-access__control label {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.subin-settings-page .subin-team-access__control select {
	width: 210px;
	min-height: 38px;
}

.subin-team-access__export {
	gap: 7px;
	min-height: 38px;
	font-weight: 600;
}

.subin-team-access__export input {
	margin: 0;
}

.subin-team-access__pagination {
	margin-top: 18px;
}

.subin-cloud-sync-queue {
	overflow-x: auto;
}

.subin-cloud-sync-events {
	min-width: 780px;
}

@media (max-width: 1100px) {
	.subin-settings-workspace {
		grid-template-columns: 220px minmax(0, 1fr);
		gap: 18px;
	}

	.subin-settings-page .subin-settings-tab {
		grid-template-columns: 20px minmax(0, 1fr);
	}

	.subin-settings-tab__status {
		grid-column: 2;
		justify-self: start;
	}
}

@media (max-width: 960px) {
	.subin-settings-workspace {
		grid-template-columns: minmax(0, 1fr);
	}

	.subin-settings-page .subin-settings-tabs {
		position: sticky;
		top: 32px;
		z-index: 15;
		display: flex;
		gap: 8px;
		max-height: none;
		padding: 8px;
		overflow-x: auto;
		overflow-y: hidden;
		scroll-snap-type: x proximity;
	}

	.subin-settings-page .subin-settings-tab {
		flex: 0 0 210px;
		grid-template-columns: 20px minmax(0, 1fr);
		scroll-snap-align: start;
	}

	.subin-settings-tab__status {
		display: none;
	}

	.subin-team-access__presets {
		grid-template-columns: 1fr;
	}

	.subin-team-access__toolbar {
		align-items: flex-start;
		flex-direction: column;
	}

	.subin-team-access__toolbar .description {
		text-align: left;
	}

	.subin-settings-overview__secondary {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 640px) {
	.subin-settings-overview__hero,
	.subin-settings-section__header,
	.subin-settings-savebar,
	.subin-integration-card {
		align-items: flex-start;
		flex-direction: column;
	}

	.subin-settings-overview__grid {
		grid-template-columns: 1fr;
	}

	.subin-settings-overview-card {
		min-height: 0;
	}

	.subin-settings-overview-card__actions,
	.subin-settings-overview-card__actions .button,
	.subin-settings-savebar__actions,
	.subin-settings-savebar__actions .button,
	.subin-settings-section__header > .button {
		width: 100%;
	}

	.subin-settings-savebar {
		bottom: 6px;
	}

	.subin-settings-savebar__actions {
		display: grid;
		grid-template-columns: 1fr 1fr;
	}

	.subin-integration-card__controls {
		justify-items: start;
		width: 100%;
		min-width: 0;
	}

	.subin-settings-page .form-table,
	.subin-settings-page .form-table tbody,
	.subin-settings-page .form-table tr,
	.subin-settings-page .form-table th,
	.subin-settings-page .form-table td {
		display: block;
		width: 100%;
	}

	.subin-settings-page .form-table th {
		padding-top: 0;
		padding-bottom: 7px;
	}

	.subin-settings-page input[type="text"],
	.subin-settings-page input[type="email"],
	.subin-settings-page input[type="number"],
	.subin-settings-page input[type="password"],
	.subin-settings-page input[type="url"],
	.subin-settings-page select,
	.subin-settings-page textarea {
		width: 100%;
		max-width: none;
	}

	.subin-team-access__header,
	.subin-team-access__search {
		align-items: flex-start;
		flex-direction: column;
	}

	.subin-team-access__search,
	.subin-settings-page .subin-team-access__search input[type="search"] {
		width: 100%;
	}
}
