.tsro-warehouse {
	width: calc(100vw - 40px);
	max-width: 1800px;
	margin: 32px auto;
	padding: 0 18px;
	position: relative;
	left: 50%;
	transform: translateX(-50%);
}

body.wp-admin .tsro-warehouse {
	width: auto;
	max-width: none;
	margin: 20px 20px 0 0;
	padding: 0;
	left: auto;
	transform: none;
}

.column-tsro_warehouse_status {
	width: 280px;
	min-width: 280px;
}

.column-tsro_warehouse_action {
	width: 170px;
}

.tsro-warehouse table {
	width: 100%;
	border-collapse: collapse;
	background: #fff;
}

.tsro-warehouse th,
.tsro-warehouse td {
	padding: 10px;
	border: 1px solid #dcdcde;
	text-align: left;
	vertical-align: top;
}

.tsro-warehouse th {
	background: #f6f7f7;
}

.tsro-filters {
	display: grid;
	grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr) auto;
	gap: 10px;
	margin: 0 0 18px;
	align-items: stretch;
}

.tsro-filters input[type="search"] {
	min-width: 0;
}

.tsro-filters input[type="search"],
.tsro-filters select,
.tsro-filters .button {
	height: 48px;
	margin: 0;
}

.tsro-filters .button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.tsro-status {
	display: inline-block;
	padding: 5px 9px;
	border-radius: 999px;
	background: #e2e3e5;
	color: #2b2f32;
	font-weight: 700;
}

.tsro-status-sent,
.tsro-status-in_progress {
	background: #cfe2ff;
	color: #084298;
}

.tsro-status-needs_input {
	background: #fff3cd;
	color: #664d03;
}

.tsro-status-packed,
.tsro-status-ready {
	background: #d1e7dd;
	color: #0f5132;
}

.tsro-status-cancelled {
	background: #f8d7da;
	color: #842029;
}

.tsro-alert {
	margin: 12px 0;
	padding: 12px 14px;
	border-left: 5px solid #d63638;
	background: #fff0f0;
	color: #6d1a1a;
}

.tsro-savebar {
	position: sticky;
	top: 4rem;
	z-index: 50;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	margin: 14px 0 18px;
	padding: 12px 16px;
	border: 1px solid #c3c4c7;
	border-left: 5px solid #2271b1;
	border-radius: 6px;
	background: rgba(255, 255, 255, 0.97);
	box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
}

.tsro-save-button {
	min-width: 170px;
	font-weight: 700;
}

.tsro-savebar.is-dirty {
	border-left-color: #dba617;
	background: #fffaf0;
}

.tsro-notice-success {
	margin: 12px 0;
	padding: 12px 14px;
	border-left: 5px solid #16803a;
	background: #edf9f1;
	color: #0f5132;
}

.tsro-steps {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 8px;
	margin: 20px 0;
	padding: 0;
	list-style: none;
}

.tsro-steps li {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px;
	border-radius: 6px;
	background: #eceff1;
	color: #646970;
	font-weight: 600;
}

.tsro-steps li span,
.tsro-stage summary > span {
	display: inline-flex;
	width: 26px;
	height: 26px;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: #c3c4c7;
	color: #fff;
	font-weight: 700;
}

.tsro-steps li.is-current {
	background: #e8f3fc;
	color: #135e96;
}

.tsro-steps li.is-current span {
	background: #2271b1;
}

.tsro-steps li.is-done {
	background: #edf9f1;
	color: #0f5132;
}

.tsro-steps li.is-done span {
	background: #16803a;
}

.tsro-stage {
	margin: 14px 0;
	border: 1px solid #c3c4c7;
	border-radius: 7px;
	background: #fff;
}

.tsro-stage > summary {
	display: grid;
	grid-template-columns: 34px 1fr auto;
	gap: 10px;
	align-items: center;
	padding: 14px 16px;
	cursor: pointer;
	background: #f6f7f7;
	list-style: none;
}

.tsro-stage > summary::-webkit-details-marker {
	display: none;
}

.tsro-stage > summary strong {
	font-size: 17px;
}

.tsro-stage > summary em {
	color: #646970;
	font-style: normal;
}

.tsro-stage[open] > summary {
	border-bottom: 1px solid #dcdcde;
}

.tsro-stage-content {
	padding: 16px;
	overflow-x: auto;
}

.tsro-actions {
	display: flex;
	gap: 12px;
	justify-content: flex-end;
}

.tsro-warehouse .tsro-primary-action {
	background: #16803a;
	border-color: #16803a;
}

.tsro-cancel-button {
	border-color: #b32d2e !important;
	color: #b32d2e !important;
}

.tsro-cancelled-notice {
	margin: 14px 0;
	padding: 14px 16px;
	border-left: 5px solid #b32d2e;
	background: #fcf0f1;
	color: #8a2424;
}

.tsro-work-form.is-readonly {
	opacity: 0.78;
}

.tsro-work-form.is-readonly input,
.tsro-work-form.is-readonly select,
.tsro-work-form.is-readonly textarea,
.tsro-work-form.is-readonly button {
	cursor: not-allowed;
}

.tsro-location {
	display: inline-block;
	margin-top: 5px;
	color: #135e96;
	font-weight: 600;
}

.tsro-products-table {
	min-width: 1180px;
}

.tsro-products-table th:nth-child(1) { width: 14%; }
.tsro-products-table th:nth-child(2) { width: 20%; }
.tsro-products-table th:nth-child(3) { width: 8%; }
.tsro-products-table th:nth-child(4) { width: 10%; }
.tsro-products-table th:nth-child(5) { width: 19%; }
.tsro-products-table th:nth-child(6) { width: 15%; }
.tsro-products-table th:nth-child(7) { width: 14%; }

.tsro-products-table td {
	vertical-align: middle;
}

.tsro-quantity-input {
	width: 72px;
}

.tsro-measurements {
	display: grid;
	grid-template-columns: repeat(2, minmax(75px, 1fr));
	gap: 10px;
}

.tsro-measurements label span {
	display: block;
	margin-bottom: 3px;
	font-weight: 600;
}

.tsro-measurements input,
.tsro-full-field {
	width: 100%;
}

textarea.tsro-full-field {
	min-height: 82px;
	margin-top: 6px;
}

.tsro-product-list {
	display: grid;
	gap: 18px;
	margin: 20px 0 30px;
}

.tsro-product-card {
	overflow: hidden;
	border: 1px solid #dcdcde;
	border-radius: 10px;
	background: #fff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.tsro-product-header {
	display: flex;
	gap: 16px;
	align-items: center;
	padding: 18px 20px;
	border-bottom: 1px solid #e7e7e7;
	background: #f8fafc;
}

.tsro-product-header h2 {
	margin: 0 0 5px;
	font-size: 20px;
}

.tsro-product-image {
	display: flex;
	width: 72px;
	height: 72px;
	flex: 0 0 72px;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	border: 1px solid #ddd;
	border-radius: 7px;
	background: #fff;
}

.tsro-product-image img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.tsro-product-code {
	color: #50575e;
}

.tsro-product-fields {
	display: grid;
	grid-template-columns: minmax(260px, 0.7fr) minmax(520px, 1.5fr);
	gap: 24px;
	padding: 20px;
}

.tsro-quantity-panel {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	align-items: end;
	padding: 16px;
	border-radius: 8px;
	background: #eef5fb;
}

.tsro-quantity-panel span,
.tsro-quantity-panel label {
	display: block;
	font-weight: 600;
}

.tsro-quantity-panel strong {
	display: block;
	margin-top: 7px;
	font-size: 24px;
}

.tsro-quantity-panel input {
	display: block;
	width: 100%;
	margin-top: 7px;
	font-size: 18px;
}

.tsro-dimensions {
	display: grid;
	grid-template-columns: repeat(4, minmax(100px, 1fr));
	gap: 12px;
	margin: 0;
	padding: 12px 16px 16px;
	border: 1px solid #dcdcde;
	border-radius: 8px;
}

.tsro-dimensions legend,
.tsro-dimensions label span {
	font-weight: 600;
}

.tsro-dimensions label div {
	display: flex;
	align-items: center;
	margin-top: 7px;
}

.tsro-dimensions input {
	width: 100%;
	min-width: 0;
}

.tsro-dimensions em {
	padding-left: 6px;
	color: #646970;
	font-style: normal;
}

.tsro-product-notes {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
	padding: 0 20px 20px;
}

.tsro-product-notes section {
	padding: 16px;
	border: 1px solid #e1e1e1;
	border-radius: 8px;
}

.tsro-product-notes h3 {
	margin: 0 0 10px;
}

.tsro-product-notes input,
.tsro-product-notes textarea,
.tsro-product-notes select {
	width: 100%;
	margin-top: 7px;
}

.tsro-product-notes textarea {
	min-height: 82px;
}

.tsro-warehouse input,
.tsro-warehouse select,
.tsro-warehouse textarea {
	box-sizing: border-box;
	max-width: 100%;
}

.tsro-warehouse .button,
.tsro-warehouse input[type="submit"] {
	display: inline-block;
	padding: 8px 14px;
	border: 1px solid #2271b1;
	border-radius: 4px;
	background: #2271b1;
	color: #fff;
	text-decoration: none;
	cursor: pointer;
}

.tsro-replacement-status {
	display: block;
	margin-top: 6px;
	padding: 5px 8px;
	border-radius: 4px;
	background: #fff3cd;
	color: #664d03;
}

.tsro-replacement-status.tsro-approved {
	background: #d1e7dd;
	color: #0f5132;
}

.tsro-replacement-status.tsro-rejected {
	background: #f8d7da;
	color: #842029;
}

@media (max-width: 900px) {
	.tsro-steps {
		grid-template-columns: 1fr;
	}
	.tsro-filters {
		align-items: stretch;
		flex-direction: column;
		grid-template-columns: 1fr;
	}

	.tsro-filters input[type="search"] {
		min-width: 0;
	}
	.tsro-warehouse {
		overflow-x: auto;
		padding: 0 10px;
	}

	.tsro-warehouse table {
		min-width: 850px;
	}

	.tsro-product-fields,
	.tsro-product-notes {
		grid-template-columns: 1fr;
	}

	.tsro-dimensions {
		grid-template-columns: repeat(2, 1fr);
	}
}
