.wsr-wrap {
	max-width: 1760px;
	margin: 0 auto;
	padding: 24px 32px 32px 64px;
	box-sizing: border-box;
	position: relative;
}

.wsr-header {
	margin-bottom: 20px;
}

.wsr-title {
	margin: 0 0 6px;
	font-size: 36px;
	line-height: 1.08;
	letter-spacing: -0.025em;
	color: #101828;
}

.wsr-subtitle {
	color: #667085;
	font-size: 14px;
}

.wsr-controls {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	gap: 14px 14px;
	margin: 18px 0 30px;
	padding: 16px;
	background: #ffffff;
	border: 1px solid #e7e9ee;
	border-radius: 18px;
	box-shadow: 0 6px 18px rgba(16, 24, 40, 0.04);
	box-sizing: border-box;
}

.wsr-control {
	display: flex;
	flex-direction: column;
	align-self: flex-start;
	gap: 6px;
	min-width: 180px;
	margin-right: 0;
	margin-bottom: 0;
	box-sizing: border-box;
}

.wsr-control span {
	font-size: 13px;
	font-weight: 600;
	color: #475467;
	min-height: 18px;
	display: inline-flex;
	align-items: center;
}

.wsr-control-grow {
	flex: 1 1 320px;
	min-width: 320px;
}

#wsr-supplier-control {
	order: 1;
	flex: 1 1 520px;
	min-width: 360px;
	align-self: stretch;
	justify-content: flex-start;
	margin-top: 0;
}

#wsr-supplier-control > span:first-child {
	margin-bottom: 0;
}

#wsr-supplier-control small {
	margin-top: 8px;
	line-height: 1.45;
}

#wsr-supplier-pills {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 0;
	min-height: 42px;
}

#wsr-supplier-pills > div:first-child {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

#wsr-supplier-pills > div:last-child {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: flex-start;
}

.wsr-control:has(#wsr-time-range) {
	order: 2;
	flex: 0 0 220px;
	min-width: 220px;
	align-self: center;
}

.wsr-control:has(#wsr-branch) {
	order: 3;
	flex: 0 0 220px;
	min-width: 220px;
	align-self: center;
}

.wsr-control:has(#wsr-search) {
	order: 4;
	flex: 1 1 360px;
	min-width: 300px;
	align-self: center;
}

.wsr-control:has(#wsr-clear) {
	order: 5;
	flex: 0 0 auto;
	min-width: 120px;
	align-self: center;
}

.wsr-control select,
.wsr-control input {
	width: 100%;
	min-height: 44px;
	padding: 11px 12px;
	border: 1px solid #d7dbe0;
	border-radius: 10px;
	background: #fff;
	color: #101828;
	font-size: 14px;
	line-height: 1.3;
	outline: none;
	box-sizing: border-box;
	transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.wsr-control select:focus,
.wsr-control input:focus {
	border-color: #b7bcc4;
	box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.06);
	background: #fcfcfd;
}

#wsr-clear {
	min-width: 110px;
}

.wsr-grid {
	display: flex;
	flex-wrap: wrap;
	margin: 14px -9px 26px -9px;
}

.wsr-grid .wsr-card {
	width: calc(25% - 18px);
	margin: 0 9px 18px 9px;
}

.wsr-grid-summary {
	max-width: 1120px;
	margin-left: auto;
	margin-right: auto;
}

.wsr-grid-summary .wsr-card {
	width: calc(33.3333% - 18px);
}

.wsr-card {
	background: linear-gradient(180deg, #ffffff 0%, #fcfcfd 100%);
	border: 1px solid #e8eaef;
	border-radius: 20px;
	padding: 18px 18px 16px;
	box-shadow: 0 8px 24px rgba(16, 24, 40, 0.04);
	box-sizing: border-box;
	min-width: 0;
}

.wsr-card-label {
	color: #667085;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.4;
}

.wsr-card-value {
	font-size: 30px;
	font-weight: 700;
	line-height: 1.08;
	letter-spacing: -0.03em;
	color: #101828;
	margin-top: 8px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.wsr-panels {
	display: flex;
	flex-wrap: wrap;
	margin: 16px -9px 24px -9px;
	align-items: stretch;
}

.wsr-panels > .wsr-panel {
	width: calc(50% - 18px);
	margin: 0 9px 18px 9px;
}

.wsr-panels-balanced > .wsr-panel {
	min-height: 100%;
}

.wsr-panel {
	background: linear-gradient(180deg, #ffffff 0%, #fcfcfd 100%);
	border: 1px solid #e8eaef;
	border-radius: 20px;
	padding: 18px;
	box-shadow: 0 8px 24px rgba(16, 24, 40, 0.04);
	box-sizing: border-box;
	min-width: 0;
}

.wsr-panel-header {
	margin-bottom: 10px;
}

.wsr-panel-header h3 {
	margin: 0 0 6px;
	font-size: 22px;
	line-height: 1.16;
	letter-spacing: -0.03em;
	color: #101828;
}

.wsr-panel-header p {
	margin: 0;
	color: #667085;
	font-size: 14px;
	line-height: 1.6;
	max-width: 82ch;
}

.wsr-panel-title-row {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
}

.wsr-panel-title-row > div:first-child {
	flex: 1 1 auto;
	min-width: 0;
}

.wsr-actions {
	white-space: nowrap;
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 0 0 auto;
	margin-left: 12px;
}

.wsr-actions .button,
#wsr-clear,
#wsr-modal-close {
	border-radius: 12px;
	min-height: 42px;
	padding: 0 15px;
	font-size: 14px;
	font-weight: 600;
	line-height: 40px;
	box-shadow: none;
}

.wsr-actions .button {
	flex: 0 0 auto;
}

.wsr-toggle[data-toggle] {
	min-width: 46px;
	padding: 0 10px;
	text-align: center;
	font-size: 20px;
	line-height: 38px;
}

.wsr-table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	margin-top: 14px;
	border: 1px solid #ebeef2;
	border-radius: 16px;
	overflow: hidden;
	background: #fff;
	table-layout: auto;
	box-sizing: border-box;
}

.wsr-table thead th {
	background: #fafbfc;
}

.wsr-table th,
.wsr-table td {
	border-bottom: 1px solid #eef1f4;
	padding: 13px 15px;
	text-align: left;
	vertical-align: top;
}

.wsr-table tr:last-child td {
	border-bottom: 0;
}

.wsr-table th {
	font-size: 12px;
	font-weight: 700;
	color: #667085;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	line-height: 1.5;
}

.wsr-table td {
	font-size: 14px;
	line-height: 1.65;
	color: #101828;
	word-break: break-word;
	background: #fff;
}

.wsr-table tbody tr:nth-child(even) td {
	background: #fcfcfd;
}

.wsr-num {
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.wsr-muted {
	color: #667085;
}

.wsr-link {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
}

.wsr-link:hover {
	opacity: 0.78;
}

.wsr-section-intro {
	margin-bottom: 8px;
	padding-top: 14px;
	padding-bottom: 12px;
}

.wsr-section-intro .wsr-panel-header {
	margin-bottom: 0;
}

.wsr-section-intro .wsr-panel-header h3:first-child,
.wsr-panel .wsr-panel-header h3:first-child {
	position: relative;
}

.wsr-section-intro .wsr-panel-header h3:first-child:after,
.wsr-panel .wsr-panel-header h3:first-child:after {
	content: "";
	display: block;
	width: 56px;
	height: 3px;
	border-radius: 999px;
	background: rgba(16, 24, 40, 0.12);
	margin-top: 10px;
}

.wsr-panel-centered,
.wsr-panel-feature,
.wsr-panel-narrow,
.wsr-panel-summary {
	margin-left: auto;
	margin-right: auto;
	margin-top: 8px;
	margin-bottom: 20px;
}

.wsr-panel-centered {
	max-width: 1180px;
	width: 100%;
}

.wsr-panel-feature {
	max-width: 1320px;
	width: 100%;
}

.wsr-panel-narrow {
	max-width: 820px;
	width: 100%;
}

.wsr-panel-summary {
	max-width: 1120px;
	width: 100%;
}

.wsr-panel-narrow .wsr-panel-header p,
.wsr-panel-summary .wsr-panel-header p {
	max-width: none;
}

.wsr-grid-kpis .wsr-card {
	min-height: 112px;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.wsr-panel-summary + .wsr-section-intro,
.wsr-section-intro + .wsr-panels,
.wsr-section-intro + .wsr-panel,
.wsr-panels + .wsr-section-intro,
.wsr-panel + .wsr-section-intro {
	margin-top: 2px;
}

/* Improve readability for branch/name columns and item-code columns */
#wsr-replenishment th:nth-child(1),
#wsr-replenishment td:nth-child(1) {
	min-width: 170px;
	width: 170px;
	word-break: normal;
	overflow-wrap: normal;
	white-space: normal;
}

#wsr-replenishment th:nth-child(2),
#wsr-replenishment td:nth-child(2) {
	min-width: 86px;
	width: 86px;
	word-break: normal;
	overflow-wrap: anywhere;
	white-space: normal;
}

#wsr-stockouts th:nth-child(3),
#wsr-stockouts td:nth-child(3),
#wsr-repeat-stockouts th:nth-child(3),
#wsr-repeat-stockouts td:nth-child(3),
#wsr-delta-new th:nth-child(1),
#wsr-delta-new td:nth-child(1),
#wsr-delta-del th:nth-child(1),
#wsr-delta-del td:nth-child(1),
#wsr-delta-movers th:nth-child(1),
#wsr-delta-movers td:nth-child(1),
#wsr-delta-newso th:nth-child(1),
#wsr-delta-newso td:nth-child(1),
#wsr-delta-recso th:nth-child(1),
#wsr-delta-recso td:nth-child(1),
#wsr-top10 th:nth-child(3),
#wsr-top10 td:nth-child(3),
#wsr-bottom10 th:nth-child(3),
#wsr-bottom10 td:nth-child(3),
#wsr-branches th:nth-child(1),
#wsr-branches td:nth-child(1),
#wsr-top-branches th:nth-child(1),
#wsr-top-branches td:nth-child(1),
#wsr-worst-branches th:nth-child(1),
#wsr-worst-branches td:nth-child(1),
#wsr-listed-branches th:nth-child(1),
#wsr-listed-branches td:nth-child(1) {
	min-width: 160px;
	width: 160px;
	word-break: normal;
	overflow-wrap: normal;
	white-space: normal;
}

#wsr-stagnant th:nth-child(1),
#wsr-stagnant td:nth-child(1),
#wsr-listed-in-branch th:nth-child(1),
#wsr-listed-in-branch td:nth-child(1),
#wsr-not-listed th:nth-child(1),
#wsr-not-listed td:nth-child(1) {
	min-width: 92px;
	width: 92px;
	word-break: normal;
	overflow-wrap: anywhere;
	white-space: normal;
}

#wsr-stagnant .wsr-link,
#wsr-replenishment .wsr-link,
#wsr-stockouts .wsr-link,
#wsr-repeat-stockouts .wsr-link,
#wsr-delta-new .wsr-link,
#wsr-delta-del .wsr-link,
#wsr-delta-movers .wsr-link,
#wsr-delta-newso .wsr-link,
#wsr-delta-recso .wsr-link,
#wsr-top10 .wsr-link,
#wsr-bottom10 .wsr-link,
#wsr-branches .wsr-link,
#wsr-top-branches .wsr-link,
#wsr-worst-branches .wsr-link,
#wsr-listed-branches .wsr-link,
#wsr-listed-in-branch .wsr-link,
#wsr-not-listed .wsr-link {
	word-break: normal;
	overflow-wrap: normal;
	white-space: normal;
	line-height: 1.55;
}

/* Reporting Terms floating pill */
#wsr-reporting-terms-btn {
	position: fixed;
	top: 170px;
	right: 28px;
	z-index: 9997;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 42px;
	padding: 0 16px;
	border: 1px solid #b8d4ee;
	border-radius: 999px;
	background: #eef6ff;
	color: #114a76;
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
	box-shadow: 0 8px 18px rgba(16, 24, 40, 0.08);
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

#wsr-reporting-terms-btn:hover {
	background: #e0f0ff;
	border-color: #9fc5e8;
	box-shadow: 0 10px 20px rgba(16, 24, 40, 0.12);
	transform: translateY(-1px);
}

#wsr-reporting-terms-btn:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.16), 0 10px 20px rgba(16, 24, 40, 0.12);
}

#wsr-reporting-terms-btn:active {
	transform: translateY(0);
}

/* Modal content polish for Reporting Terms */
.wsr-terms-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 18px;
}

.wsr-terms-block {
	background: #fcfcfd;
	border: 1px solid #ebeef2;
	border-radius: 14px;
	padding: 14px 16px;
}

.wsr-terms-block h4 {
	margin: 0 0 10px;
	font-size: 15px;
	line-height: 1.3;
	color: #101828;
}

.wsr-terms-block ul {
	margin: 0;
	padding-left: 18px;
}

.wsr-terms-block li {
	margin: 0 0 9px;
	color: #475467;
	font-size: 13px;
	line-height: 1.55;
}

.wsr-terms-block li:last-child {
	margin-bottom: 0;
}

@media (max-width: 1280px) {
	.wsr-wrap {
		padding: 20px 22px 28px 28px;
	}

	.wsr-controls {
		align-items: stretch;
	}

	#wsr-supplier-control {
		flex: 1 1 100%;
		min-width: 100%;
		align-self: stretch;
	}

	.wsr-control:has(#wsr-time-range),
	.wsr-control:has(#wsr-branch) {
		flex: 1 1 220px;
		min-width: 220px;
		align-self: flex-start;
	}

	.wsr-control:has(#wsr-search) {
		flex: 1 1 280px;
		min-width: 280px;
		align-self: flex-start;
	}

	.wsr-control:has(#wsr-clear) {
		align-self: flex-start;
	}

	.wsr-grid .wsr-card {
		width: calc(50% - 18px);
	}

	.wsr-grid-summary .wsr-card {
		width: calc(100% - 18px);
	}

	.wsr-panels > .wsr-panel {
		width: calc(100% - 18px);
	}

	.wsr-panel-centered,
	.wsr-panel-feature,
	.wsr-panel-narrow,
	.wsr-panel-summary {
		max-width: none;
	}

	#wsr-reporting-terms-btn {
		top: 156px;
		right: 20px;
	}
}

@media (max-width: 900px) {
	.wsr-title {
		font-size: 30px;
	}

	.wsr-controls {
		gap: 12px;
	}

	#wsr-supplier-control,
	.wsr-control:has(#wsr-time-range),
	.wsr-control:has(#wsr-branch),
	.wsr-control:has(#wsr-search),
	.wsr-control:has(#wsr-clear) {
		flex: 1 1 100%;
		min-width: 100%;
		align-self: stretch;
	}

	.wsr-panel-title-row {
		flex-direction: column;
		align-items: stretch;
	}

	.wsr-actions {
		justify-content: flex-start;
		flex-wrap: wrap;
		margin-left: 0;
	}

	.wsr-table {
		display: block;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	#wsr-reporting-terms-btn {
		position: static;
		margin: 0 0 16px auto;
		display: inline-flex;
	}

	.wsr-terms-grid {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 700px) {
	.wsr-wrap {
		padding: 14px 14px 20px 14px;
	}

	.wsr-controls,
	.wsr-panel,
	.wsr-card {
		border-radius: 16px;
	}

	.wsr-title {
		font-size: 27px;
	}

	.wsr-grid .wsr-card {
		width: calc(100% - 18px);
	}

	.wsr-card-value {
		font-size: 26px;
	}

	.wsr-table th,
	.wsr-table td {
		padding: 10px 12px;
	}

	#wsr-reporting-terms-btn {
		width: 100%;
		justify-content: center;
		margin: 0 0 14px 0;
	}
}