/* TENANT-WORKSPACE-CONNECTED-NAVIGATION-CSS-1B */
.tws-connected-navigation {
	display: grid;
	gap: 7px;
	margin-top: 8px;
	padding-top: 8px;
	border-top: 1px solid var(--tws-border);
}

.tws-connected-section-label {
	margin: 12px 12px 2px;
	color: var(--tws-text-muted);
	font-size: 10px;
	font-weight: 900;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

#dashboard-screen.tws-sidebar-collapsed .tws-connected-section-label {
	display: none;
}

.tws-connected-overlay {
	position: fixed;
	inset: 0;
	z-index: 220;
	overflow-y: auto;
	padding: 20px;
	background: rgba(2, 8, 23, 0.72);
	backdrop-filter: blur(4px);
}

body.tws-connected-modal-open {
	overflow: hidden;
}

.tws-connected-dialog {
	width: min(1050px, 100%);
	margin: 24px auto;
	overflow: hidden;
	border: 1px solid #dbe5f0;
	border-radius: 24px;
	background: #ffffff;
	box-shadow: 0 30px 80px rgba(2, 8, 23, 0.32);
}

.tws-connected-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 20px;
	padding: 24px;
	background:
		linear-gradient(
			135deg,
			#071c3d,
			#123b78 62%,
			#2459a2
		);
	color: #ffffff;
}

.tws-connected-header h2 {
	margin: 4px 0;
	font-size: clamp(24px, 4vw, 34px);
	font-weight: 900;
	line-height: 1.1;
}

.tws-connected-header p {
	margin: 0;
	color: #dbeafe;
	font-size: 14px;
	font-weight: 600;
}

.tws-connected-eyebrow {
	color: #fdba74 !important;
	font-size: 10px !important;
	font-weight: 900 !important;
	letter-spacing: 0.18em;
	text-transform: uppercase;
}

.tws-connected-close {
	display: grid;
	width: 44px;
	height: 44px;
	place-items: center;
	flex: 0 0 auto;
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 13px;
	background: rgba(255, 255, 255, 0.1);
	color: #ffffff;
	font-size: 25px;
	font-weight: 900;
	cursor: pointer;
}

.tws-connected-body {
	padding: 24px;
	background: #f8fafc;
}

.tws-connected-toolbar {
	display: grid;
	gap: 8px;
	margin-bottom: 18px;
}

.tws-connected-toolbar label {
	color: #102f63;
	font-size: 12px;
	font-weight: 900;
}

.tws-connected-toolbar input {
	width: 100%;
	min-height: 48px;
	border: 1px solid #cbd5e1;
	border-radius: 13px;
	padding: 0 15px;
	background: #ffffff;
	color: #0f172a;
	font: inherit;
	font-size: 14px;
}

.tws-connected-client-list {
	display: grid;
	gap: 10px;
	max-height: 58vh;
	overflow-y: auto;
}

.tws-connected-client {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
	width: 100%;
	border: 1px solid #dbe5f0;
	border-radius: 15px;
	padding: 15px;
	background: #ffffff;
	color: #102f63;
	font: inherit;
	text-align: left;
	cursor: pointer;
	transition:
		transform 150ms ease,
		border-color 150ms ease,
		box-shadow 150ms ease;
}

.tws-connected-client:hover {
	transform: translateY(-1px);
	border-color: #93b4df;
	box-shadow: 0 12px 28px rgba(15, 42, 91, 0.1);
}

.tws-connected-client strong,
.tws-connected-client small {
	display: block;
}

.tws-connected-client strong {
	font-size: 14px;
	font-weight: 900;
}

.tws-connected-client small {
	margin-top: 3px;
	color: #64748b;
	font-size: 12px;
}

.tws-connected-empty {
	margin: 0;
	border: 1px dashed #cbd5e1;
	border-radius: 15px;
	padding: 30px;
	background: #ffffff;
	color: #64748b;
	text-align: center;
}

.tws-settings-notice {
	margin-bottom: 18px;
	border-left: 5px solid #ec6427;
	border-radius: 15px;
	padding: 16px;
	background: #fff7ed;
	color: #7c2d12;
}

.tws-settings-notice strong {
	font-size: 15px;
	font-weight: 900;
}

.tws-settings-notice p {
	margin: 5px 0 0;
	font-size: 13px;
	line-height: 1.55;
}

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

.tws-settings-card {
	display: grid;
	grid-template-columns: 48px minmax(0, 1fr);
	gap: 14px;
	border: 1px solid #dbe5f0;
	border-radius: 18px;
	padding: 18px;
	background: #ffffff;
	box-shadow: 0 10px 26px rgba(15, 42, 91, 0.06);
}

.tws-settings-icon {
	display: grid;
	width: 48px;
	height: 48px;
	place-items: center;
	border-radius: 14px;
	background: #eaf2ff;
	color: #102f63;
	font-size: 21px;
	font-weight: 900;
}

.tws-settings-card h3 {
	margin: 0;
	color: #102f63;
	font-size: 16px;
	font-weight: 900;
}

.tws-settings-card p {
	margin: 7px 0 14px;
	color: #64748b;
	font-size: 13px;
	line-height: 1.55;
}

.tws-settings-card button {
	min-height: 39px;
	border: 0;
	border-radius: 11px;
	padding: 0 14px;
	background: #102f63;
	color: #ffffff;
	font: inherit;
	font-size: 12px;
	font-weight: 900;
	cursor: pointer;
}

.tws-connected-highlight {
	animation: tws-connected-pulse 1.4s ease;
}

@keyframes tws-connected-pulse {
	0% {
		box-shadow: 0 0 0 0 rgba(236, 100, 39, 0);
	}

	40% {
		box-shadow: 0 0 0 6px rgba(236, 100, 39, 0.38);
	}

	100% {
		box-shadow: 0 0 0 0 rgba(236, 100, 39, 0);
	}
}

.tws-connected-close:focus-visible,
.tws-connected-client:focus-visible,
.tws-settings-card button:focus-visible,
.tws-connected-toolbar input:focus-visible {
	outline: 3px solid #f59e0b;
	outline-offset: 2px;
}

@media (max-width: 760px) {
	.tws-connected-overlay {
		padding: 10px;
	}

	.tws-connected-dialog {
		margin: 10px auto;
		border-radius: 18px;
	}

	.tws-connected-header,
	.tws-connected-body {
		padding: 18px;
	}

	.tws-settings-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.tws-connected-client {
		align-items: flex-start;
		flex-direction: column;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tws-connected-client,
	.tws-connected-highlight {
		animation: none;
		transition: none;
	}
}

/* TENANT-SETTINGS-PREMIUM-DESIGN-1C */

/*
 * Premium Settings Hub presentation.
 * Visual-only enhancement.
 * No API, authorization, billing, or persistence behavior is changed.
 */

.tws-connected-dialog:has(.tws-settings-grid) {
	width: min(1180px, 100%);
	border-color: rgba(191, 211, 242, 0.9);
	background: #f7f9fc;
	box-shadow:
		0 40px 100px rgba(2, 8, 23, 0.38),
		0 0 0 1px rgba(255, 255, 255, 0.35);
}

.tws-connected-dialog:has(.tws-settings-grid) .tws-connected-header {
	position: relative;
	overflow: hidden;
	min-height: 146px;
	align-items: center;
	padding: 28px 32px;
	background:
		radial-gradient(
			circle at 86% 20%,
			rgba(96, 165, 250, 0.3),
			transparent 34%
		),
		linear-gradient(
			125deg,
			#071c3d 0%,
			#0d3670 52%,
			#2459a2 100%
		);
}

.tws-connected-dialog:has(.tws-settings-grid) .tws-connected-header::after {
	content: "";
	position: absolute;
	right: -46px;
	bottom: -96px;
	width: 260px;
	height: 260px;
	border: 1px solid rgba(255, 255, 255, 0.13);
	border-radius: 999px;
	box-shadow:
		0 0 0 38px rgba(255, 255, 255, 0.035),
		0 0 0 76px rgba(255, 255, 255, 0.025);
	pointer-events: none;
}

.tws-connected-dialog:has(.tws-settings-grid) .tws-connected-header > div {
	position: relative;
	z-index: 1;
	max-width: 720px;
}

.tws-connected-dialog:has(.tws-settings-grid) .tws-connected-header h2 {
	margin-top: 7px;
	font-size: clamp(30px, 4vw, 42px);
	letter-spacing: -0.035em;
}

.tws-connected-dialog:has(.tws-settings-grid) .tws-connected-header > div > p:last-child {
	max-width: 650px;
	margin-top: 8px;
	color: #dbeafe;
	font-size: 14px;
	line-height: 1.55;
}

.tws-connected-dialog:has(.tws-settings-grid) .tws-connected-close {
	position: relative;
	z-index: 2;
	width: 48px;
	height: 48px;
	border-color: rgba(255, 255, 255, 0.36);
	border-radius: 15px;
	background: rgba(255, 255, 255, 0.11);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
	transition:
		background-color 150ms ease,
		transform 150ms ease;
}

.tws-connected-dialog:has(.tws-settings-grid) .tws-connected-close:hover {
	background: rgba(255, 255, 255, 0.2);
	transform: translateY(-1px);
}

.tws-connected-dialog:has(.tws-settings-grid) .tws-connected-body {
	padding: 26px 28px 30px;
	background:
		linear-gradient(
			180deg,
			#f8fafc 0%,
			#f3f7fb 100%
		);
}

.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-notice {
	display: grid;
	grid-template-columns: 8px minmax(0, 1fr);
	column-gap: 16px;
	margin-bottom: 22px;
	border: 1px solid #fed7aa;
	border-left: 0;
	border-radius: 17px;
	padding: 17px 20px 17px 0;
	background:
		linear-gradient(
			100deg,
			#fff7ed,
			#fffbf7
		);
	color: #7c2d12;
	box-shadow: 0 8px 20px rgba(194, 65, 12, 0.06);
}

.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-notice::before {
	content: "";
	grid-row: 1 / span 2;
	align-self: stretch;
	border-radius: 0 999px 999px 0;
	background: linear-gradient(
		180deg,
		#fb923c,
		#ea580c
	);
}

.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-notice strong,
.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-notice p {
	grid-column: 2;
}

.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-notice strong {
	color: #7c2d12;
	font-size: 14px;
	letter-spacing: -0.01em;
}

.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-notice p {
	margin-top: 4px;
	color: #9a3412;
	font-size: 12px;
	line-height: 1.5;
}

.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-grid {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	gap: 16px;
}

.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-card {
	position: relative;
	grid-column: span 6;
	display: grid;
	grid-template-columns: 52px minmax(0, 1fr);
	min-height: 176px;
	overflow: hidden;
	border: 1px solid #d9e4f0;
	border-radius: 20px;
	padding: 19px;
	background:
		linear-gradient(
			145deg,
			#ffffff,
			#fbfdff
		);
	box-shadow:
		0 12px 30px rgba(15, 42, 91, 0.075),
		inset 0 1px 0 rgba(255, 255, 255, 0.9);
	transition:
		border-color 170ms ease,
		box-shadow 170ms ease,
		transform 170ms ease;
}

.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-card::before {
	content: "";
	position: absolute;
	top: 0;
	left: 18px;
	right: 18px;
	height: 4px;
	border-radius: 0 0 999px 999px;
	background: linear-gradient(
		90deg,
		#2563eb,
		#60a5fa
	);
	opacity: 0.96;
}

.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-card:nth-child(2)::before {
	background: linear-gradient(
		90deg,
		#f97316,
		#fb923c
	);
}

.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-card:nth-child(3)::before {
	background: linear-gradient(
		90deg,
		#0891b2,
		#22d3ee
	);
}

.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-card:nth-child(4)::before {
	background: linear-gradient(
		90deg,
		#16a34a,
		#4ade80
	);
}

.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-card:nth-child(5)::before {
	background: linear-gradient(
		90deg,
		#7c3aed,
		#a78bfa
	);
}

.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-card:hover {
	transform: translateY(-3px);
	border-color: #a8c1e3;
	box-shadow:
		0 20px 42px rgba(15, 42, 91, 0.13),
		inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-card > div {
	display: flex;
	min-width: 0;
	flex-direction: column;
	align-items: flex-start;
}

.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-icon {
	width: 52px;
	height: 52px;
	border: 1px solid #dbeafe;
	border-radius: 16px;
	background:
		linear-gradient(
			145deg,
			#eff6ff,
			#e4eeff
		);
	color: #173f7a;
	box-shadow: inset 0 1px 0 #ffffff;
	font-size: 20px;
}

.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-card:nth-child(2) .tws-settings-icon {
	border-color: #ffedd5;
	background: linear-gradient(145deg, #fff7ed, #ffedd5);
	color: #c2410c;
}

.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-card:nth-child(3) .tws-settings-icon {
	border-color: #cffafe;
	background: linear-gradient(145deg, #ecfeff, #cffafe);
	color: #0e7490;
}

.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-card:nth-child(4) .tws-settings-icon {
	border-color: #dcfce7;
	background: linear-gradient(145deg, #f0fdf4, #dcfce7);
	color: #15803d;
}

.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-card:nth-child(5) .tws-settings-icon {
	border-color: #ede9fe;
	background: linear-gradient(145deg, #f5f3ff, #ede9fe);
	color: #6d28d9;
}

.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-card h3 {
	color: #102f63;
	font-size: 16px;
	line-height: 1.3;
	letter-spacing: -0.015em;
}

.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-card p {
	margin: 7px 0 16px;
	color: #64748b;
	font-size: 12px;
	line-height: 1.6;
}

.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-card button {
	min-height: 41px;
	margin-top: auto;
	border: 1px solid #102f63;
	border-radius: 12px;
	padding: 0 16px;
	background:
		linear-gradient(
			135deg,
			#102f63,
			#17498f
		);
	box-shadow: 0 8px 18px rgba(15, 42, 91, 0.16);
	font-size: 12px;
	transition:
		box-shadow 150ms ease,
		transform 150ms ease,
		background-color 150ms ease;
}

.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-card button:hover {
	transform: translateY(-1px);
	box-shadow: 0 12px 23px rgba(15, 42, 91, 0.23);
}

#dashboard-screen[data-tws-theme="dark"] ~ .tws-connected-overlay .tws-connected-dialog:has(.tws-settings-grid),
body:has(#dashboard-screen[data-tws-theme="dark"]) .tws-connected-dialog:has(.tws-settings-grid) {
	border-color: #29415f;
	background: #0f1f35;
}

body:has(#dashboard-screen[data-tws-theme="dark"]) .tws-connected-dialog:has(.tws-settings-grid) .tws-connected-body {
	background:
		linear-gradient(
			180deg,
			#10233b,
			#0f1f35
		);
}

body:has(#dashboard-screen[data-tws-theme="dark"]) .tws-connected-dialog:has(.tws-settings-grid) .tws-settings-card {
	border-color: #29415f;
	background:
		linear-gradient(
			145deg,
			#142942,
			#10233a
		);
	box-shadow: 0 15px 32px rgba(0, 0, 0, 0.22);
}

body:has(#dashboard-screen[data-tws-theme="dark"]) .tws-connected-dialog:has(.tws-settings-grid) .tws-settings-card h3 {
	color: #e5efff;
}

body:has(#dashboard-screen[data-tws-theme="dark"]) .tws-connected-dialog:has(.tws-settings-grid) .tws-settings-card p {
	color: #b6c5d8;
}

@media (min-width: 1100px) {
	.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-card:nth-child(1),
	.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-card:nth-child(2),
	.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-card:nth-child(3) {
		grid-column: span 4;
	}

	.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-card:nth-child(4),
	.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-card:nth-child(5) {
		grid-column: span 6;
	}
}

@media (min-width: 761px) and (max-width: 1099px) {
	.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-card:nth-child(5) {
		grid-column: 1 / -1;
	}
}

@media (max-width: 760px) {
	.tws-connected-dialog:has(.tws-settings-grid) .tws-connected-header {
		min-height: auto;
		padding: 22px 20px;
	}

	.tws-connected-dialog:has(.tws-settings-grid) .tws-connected-header h2 {
		font-size: 30px;
	}

	.tws-connected-dialog:has(.tws-settings-grid) .tws-connected-body {
		padding: 18px;
	}

	.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-card {
		grid-column: 1;
		min-height: 0;
		padding: 18px;
	}

	.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-notice {
		grid-template-columns: 6px minmax(0, 1fr);
	}
}

@media (prefers-reduced-motion: reduce) {
	.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-card,
	.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-card button,
	.tws-connected-dialog:has(.tws-settings-grid) .tws-connected-close {
		transition: none;
	}
}

/* TENANT-SETTINGS-EXPANDED-OPTIONS-CSS-1D */

.tws-connected-dialog:has(.tws-settings-grid) {
	width: min(1220px, 100%);
}

.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-grid {
	grid-template-columns: repeat(12, minmax(0, 1fr));
	align-items: stretch;
}

.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-card {
	grid-column: span 4;
	min-height: 188px;
}

.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-card:nth-child(1)::before,
.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-card:nth-child(2)::before,
.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-card:nth-child(3)::before {
	background: linear-gradient(90deg, #2563eb, #60a5fa);
}

.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-card:nth-child(4)::before,
.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-card:nth-child(5)::before,
.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-card:nth-child(6)::before {
	background: linear-gradient(90deg, #f97316, #fb923c);
}

.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-card:nth-child(7)::before {
	background: linear-gradient(90deg, #0891b2, #22d3ee);
}

.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-card:nth-child(8)::before {
	background: linear-gradient(90deg, #16a34a, #4ade80);
}

.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-card:nth-child(9)::before {
	background: linear-gradient(90deg, #7c3aed, #a78bfa);
}

@media (min-width: 761px) and (max-width: 1099px) {
	.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-card {
		grid-column: span 6;
	}

	.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-card:nth-child(9) {
		grid-column: 1 / -1;
	}
}

@media (max-width: 760px) {
	.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-card,
	.tws-connected-dialog:has(.tws-settings-grid) .tws-settings-card:nth-child(9) {
		grid-column: 1;
		min-height: 0;
	}
}

