/* ================================================
   Trade Settings Editor Styles
   Scoped with '.ts-view' wrapper class
   ================================================ */

/* Container */
.ts-view .ts-container {
	max-width: 900px;
}

/* Box Panel */
.ts-view .ts-box {
	background: #f8f9fa;
	border: 1px solid #dee2e6;
	border-radius: 8px;
	padding: 20px;
	margin-bottom: 20px;
}

.ts-view .ts-box-highlight {
	background: #e7f3ff;
	border-color: #b8daff;
}

.ts-view .ts-box-title {
	margin: 0 0 5px 0;
	padding: 0;
	color: #495057;
	font-weight: 600;
	font-size: 16px;
}

.ts-view .ts-box-title i {
	margin-right: 8px;
	color: #6c757d;
}

.ts-view .ts-box-desc {
	color: #6c757d;
	font-size: 13px;
	margin: 0 0 20px 0;
}

/* Tab Navigation */
.ts-view .ts-tab-nav {
	padding: 15px 20px;
}

.ts-view .ts-tab-buttons {
	display: flex;
	flex-direction: row;
	gap: 10px;
}

.ts-view .ts-tab-btn {
	display: inline-flex;
	align-items: center;
	padding: 12px 20px;
	border: 2px solid #dee2e6;
	border-radius: 6px;
	background: #fff;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	color: #495057;
	transition: all 0.2s ease;
}

.ts-view .ts-tab-btn:hover {
	border-color: #007bff;
	background: #f8f9fa;
}

.ts-view .ts-tab-btn.ts-tab-active {
	border-color: #007bff;
	background: #e7f3ff;
	color: #0056b3;
}

.ts-view .ts-tab-btn i {
	margin-right: 8px;
	font-size: 16px;
}

.ts-view .ts-tab-btn.ts-tab-active i {
	color: #007bff;
}

/* Tab Content */
.ts-view .ts-tab-content {
	margin-top: 0;
}

/* Empty State */
.ts-view .ts-empty {
	text-align: center;
	padding: 40px 20px;
	color: #6c757d;
}

.ts-view .ts-empty i {
	font-size: 48px;
	margin-bottom: 15px;
	display: block;
	opacity: 0.5;
}

.ts-view .ts-empty p {
	margin: 0;
	font-size: 14px;
}

/* Tags */
.ts-view .ts-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.ts-view .ts-tag {
	display: inline-flex;
	align-items: center;
	padding: 10px 16px;
	border: 1px solid #dee2e6;
	border-radius: 6px;
	background: #fff;
	font-size: 14px;
	color: #495057;
}

.ts-view .ts-tag i {
	margin-right: 8px;
	color: #007bff;
}

/* TimeFrame Styles */
.ts-view .ts-tf-list {
	margin-bottom: 20px;
}

.ts-view .ts-tf-card {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	gap: 15px;
	align-items: center;
	background: #fff;
	border: 1px solid #dee2e6;
	border-radius: 6px;
	padding: 15px;
	margin-bottom: 12px;
}

.ts-view .ts-tf-field {
	display: flex;
	flex-direction: column;
	flex: 0 0 auto;
}

.ts-view .ts-tf-field label {
	font-size: 12px;
	font-weight: 500;
	color: #6c757d;
	margin-bottom: 5px;
}

.ts-view .ts-tf-field input[type="text"],
.ts-view .ts-tf-field input[type="number"] {
	width: 100%;
	max-width: 100%;
}

.ts-view .ts-tf-key {
	flex: 0 0 180px;
	max-width: 180px;
}

.ts-view .ts-tf-num {
	flex: 0 0 80px;
	max-width: 80px;
}

.ts-view .ts-tf-num input {
	text-align: center;
}

.ts-view .ts-tf-status {
	flex: 0 0 90px;
}

.ts-view .ts-tf-status .ts-badge {
	min-height: 34px;
	display: inline-flex;
	align-items: center;
}

.ts-view .ts-tf-action {
	flex: 0 0 90px;
}

.ts-view .ts-action-buttons {
	display: flex;
	flex-direction: row;
	gap: 4px;
	min-height: 34px;
	align-items: center;
}

/* Read-only display values */
.ts-view .ts-readonly-value {
	padding: 6px 10px;
	background: #f8f9fa;
	border: 1px solid #e9ecef;
	border-radius: 4px;
	font-size: 14px;
	color: #495057;
	min-height: 34px;
	display: flex;
	align-items: center;
}

.ts-view .ts-tf-num .ts-readonly-value {
	justify-content: center;
}

/* Edit icon button */
.ts-view .ts-btn-icon-edit {
	color: #007bff;
}

.ts-view .ts-btn-icon-edit:hover {
	background: #e7f3ff;
}

.ts-view .ts-btn-icon-success {
	color: #28a745;
}

.ts-view .ts-btn-icon-success:hover {
	background: #d4edda;
}

/* Badges */
.ts-view .ts-badge {
	display: inline-flex;
	align-items: center;
	padding: 4px 10px;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 500;
	white-space: nowrap;
}

.ts-view .ts-badge i {
	margin-right: 5px;
}

.ts-view .ts-badge-sm {
	padding: 2px 8px;
	font-size: 11px;
}

.ts-view .ts-badge-success {
	background: #d4edda;
	color: #155724;
}

.ts-view .ts-badge-danger {
	background: #f8d7da;
	color: #721c24;
}

.ts-view .ts-badge-warning {
	background: #fff3cd;
	color: #856404;
}

.ts-view .ts-badge-info {
	background: #cce5ff;
	color: #004085;
}

.ts-view .ts-badge-default {
	background: #e9ecef;
	color: #6c757d;
}

.ts-view .ts-badge-muted {
	background: #f8f9fa;
	color: #adb5bd;
	border: 1px dashed #dee2e6;
}

.ts-view .ts-badge-long {
	background: #28a745;
	color: #fff;
}

.ts-view .ts-badge-short {
	background: #dc3545;
	color: #fff;
}

/* Buttons */
.ts-view .ts-btn {
	display: inline-flex;
	align-items: center;
	padding: 8px 16px;
	border: none;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s ease;
}

.ts-view .ts-btn i {
	margin-right: 6px;
}

.ts-view .ts-btn-sm {
	padding: 4px 10px;
	font-size: 12px;
}

.ts-view .ts-btn-primary {
	background: #007bff;
	color: #fff;
}

.ts-view .ts-btn-primary:hover:not(:disabled) {
	background: #0056b3;
}

.ts-view .ts-btn-secondary {
	background: #6c757d;
	color: #fff;
}

.ts-view .ts-btn-secondary:hover:not(:disabled) {
	background: #545b62;
}

.ts-view .ts-btn-success {
	background: #28a745;
	color: #fff;
}

.ts-view .ts-btn-success:hover:not(:disabled) {
	background: #1e7e34;
}

.ts-view .ts-btn-danger {
	background: #dc3545;
	color: #fff;
}

.ts-view .ts-btn-danger:hover:not(:disabled) {
	background: #bd2130;
}

.ts-view .ts-btn-info {
	background: #17a2b8;
	color: #fff;
}

.ts-view .ts-btn-info:hover:not(:disabled) {
	background: #138496;
}

.ts-view .ts-btn-warning {
	background: #ffc107;
	color: #212529;
}

.ts-view .ts-btn-warning:hover:not(:disabled) {
	background: #e0a800;
}

.ts-view .ts-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.ts-view .ts-btn-outline-danger {
	background: transparent;
	color: #dc3545;
	border: 1px solid #dc3545;
}

.ts-view .ts-btn-outline-danger:hover:not(:disabled) {
	background: #dc3545;
	color: #fff;
}

.ts-view .ts-btn-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	background: transparent;
	transition: all 0.2s ease;
}

.ts-view .ts-btn-icon-danger {
	color: #dc3545;
}

.ts-view .ts-btn-icon-danger:hover {
	background: #f8d7da;
}

.ts-view .ts-btn-icon-warning {
	color: #856404;
}

.ts-view .ts-btn-icon-warning:hover {
	background: #fff3cd;
}

/* Actions Bar */
.ts-view .ts-actions {
	display: flex;
	flex-direction: row;
	gap: 10px;
	margin-top: 20px;
	padding-top: 15px;
	border-top: 1px solid #dee2e6;
}

/* Add Strategy */
.ts-view .ts-add-strategy {
	display: flex;
	flex-direction: row;
	gap: 15px;
	align-items: center;
}

.ts-view .ts-strategy-select {
	flex: 1;
	max-width: 500px;
}

/* Strategy Card */
.ts-view .ts-strategy-card {
	transition: all 0.2s ease;
}

.ts-view .ts-strategy-invalid {
	border-color: #f5c6cb;
	background: #fff5f5;
}

.ts-view .ts-strategy-new {
	border-color: #b8daff;
	background: #f0f7ff;
}

.ts-view .ts-strategy-header {
	display: flex;
	flex-direction: row;
	justify-content: space-between;
	align-items: center;
	cursor: pointer;
	padding: 5px 0;
	margin-bottom: 15px;
}

.ts-view .ts-strategy-header:hover {
	opacity: 0.8;
}

.ts-view .ts-strategy-title {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 10px;
	font-size: 16px;
	font-weight: 600;
	color: #495057;
}

.ts-view .ts-strategy-title > i {
	color: #6c757d;
}

.ts-view .ts-strategy-meta {
	display: flex;
	align-items: center;
}

.ts-view .ts-leg-count {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 13px;
	color: #6c757d;
	background: #e9ecef;
	padding: 4px 10px;
	border-radius: 4px;
}

/* Alert */
.ts-view .ts-alert {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 15px;
	border-radius: 6px;
	margin-bottom: 15px;
	font-size: 14px;
}

.ts-view .ts-alert-danger {
	background: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
}

/* Legs Section */
.ts-view .ts-legs {
	margin-bottom: 15px;
}

.ts-view .ts-section-title {
	font-size: 14px;
	font-weight: 600;
	color: #495057;
	margin: 0 0 15px 0;
	display: flex;
	align-items: center;
	gap: 8px;
}

.ts-view .ts-section-title i {
	color: #6c757d;
}

.ts-view .ts-leg {
	background: #fff;
	border: 1px solid #dee2e6;
	border-radius: 6px;
	margin-bottom: 15px;
	overflow: hidden;
}

.ts-view .ts-leg-header {
	background: #e9ecef;
	padding: 10px 15px;
	font-weight: 600;
	font-size: 14px;
	color: #495057;
	display: flex;
	align-items: center;
	gap: 8px;
}

.ts-view .ts-leg-header i {
	color: #6c757d;
}

.ts-view .ts-leg-body {
	padding: 15px;
}

.ts-view .ts-rp-title {
	font-size: 13px;
	font-weight: 600;
	color: #6c757d;
	margin: 0 0 12px 0;
	display: flex;
	align-items: center;
	gap: 6px;
}

/* Risk Profile Row */
.ts-view .ts-rp-row {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 15px;
	padding: 10px 0;
	border-bottom: 1px solid #eee;
}

.ts-view .ts-rp-row:last-child {
	border-bottom: none;
}

.ts-view .ts-rp-defined {
	background: #f8f9fa;
	margin: 0 -15px;
	padding: 10px 15px;
}

.ts-view .ts-rp-key {
	min-width: 120px;
	font-size: 14px;
}

.ts-view .ts-rp-status {
	min-width: 100px;
}

.ts-view .ts-rp-method {
	flex: 0 0 140px;
	max-width: 140px;
}

.ts-view .ts-rp-method select {
	width: 100%;
}

.ts-view .ts-rp-value {
	flex: 0 0 200px;
	max-width: 200px;
}

.ts-view .ts-rp-value input {
	width: 100%;
}

.ts-view .ts-hint {
	display: block;
	font-size: 11px;
	color: #6c757d;
	margin-top: 4px;
}

.ts-view .ts-rp-action {
	min-width: 40px;
}

.ts-view .ts-rp-define {
	flex: 1;
}

/* Strategy Actions */
.ts-view .ts-strategy-actions {
	display: flex;
	flex-direction: row;
	gap: 10px;
	margin-top: 20px;
	padding-top: 15px;
	border-top: 1px solid #dee2e6;
	align-items: center;
}

.ts-view .ts-spinner {
	color: #007bff;
	font-size: 18px;
}

.ts-view .ts-strategy-actions-spacer {
	flex: 1;
}

.ts-view .ts-btn-add-rp {
	background: transparent;
	color: #6c757d;
	border: 1px dashed #adb5bd;
}

.ts-view .ts-btn-add-rp:hover:not(:disabled) {
	background: #f8f9fa;
	color: #495057;
	border-color: #6c757d;
}

/* Responsive */
@media (max-width: 992px) {
	.ts-view .ts-tf-card {
		flex-wrap: wrap;
	}

	.ts-view .ts-tf-field {
		min-width: calc(50% - 10px);
	}

	.ts-view .ts-rp-row {
		flex-wrap: wrap;
	}

	.ts-view .ts-rp-key,
	.ts-view .ts-rp-status,
	.ts-view .ts-rp-method,
	.ts-view .ts-rp-value {
		min-width: calc(50% - 10px);
	}
}

@media (max-width: 768px) {
	.ts-view .ts-tab-buttons {
		flex-direction: column;
	}

	.ts-view .ts-add-strategy {
		flex-direction: column;
		align-items: stretch;
	}

	.ts-view .ts-strategy-select {
		max-width: 100%;
	}
}

/* Confirmation Dialog */
.ts-view .ts-confirm-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 9999;
}

.ts-view .ts-confirm-box {
	background: #fff;
	padding: 25px 35px;
	border-radius: 8px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
	min-width: 350px;
	max-width: 450px;
	text-align: center;
}

.ts-view .ts-confirm-box p {
	font-size: 15px;
	color: #333;
	margin: 0 0 20px 0;
	line-height: 1.5;
}

.ts-view .ts-confirm-actions {
	display: flex;
	justify-content: center;
	gap: 12px;
}

/* Templates Panel */
.ts-view .ts-templates-panel {
	background: #f0f7ff;
	border-color: #b8daff;
}

.ts-view .ts-templates-header {
	display: flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	font-weight: 600;
	color: #0056b3;
	font-size: 15px;
	padding: 5px 0;
}

.ts-view .ts-templates-header:hover {
	opacity: 0.8;
}

.ts-view .ts-templates-header > i:first-child {
	color: #6c757d;
	width: 16px;
}

.ts-view .ts-templates-body {
	margin-top: 15px;
	padding-top: 15px;
	border-top: 1px solid #b8daff;
}

.ts-view .ts-template-section {
	margin-bottom: 20px;
	padding-bottom: 20px;
	border-bottom: 1px solid #d4e5f7;
}

.ts-view .ts-template-section:last-child {
	margin-bottom: 0;
	padding-bottom: 0;
	border-bottom: none;
}

.ts-view .ts-template-section-title {
	font-size: 14px;
	font-weight: 600;
	color: #495057;
	margin: 0 0 12px 0;
}

.ts-view .ts-template-form {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	gap: 20px;
	align-items: flex-end;
}

.ts-view .ts-template-field {
	display: flex;
	flex-direction: column;
}

.ts-view .ts-template-field label {
	font-size: 12px;
	font-weight: 500;
	color: #495057;
	margin-bottom: 5px;
}

.ts-view .ts-template-field-select {
	flex: 1;
	min-width: 250px;
	max-width: 400px;
}

.ts-view .ts-template-options {
	display: flex;
	flex-direction: row;
	gap: 20px;
	align-items: center;
	padding-bottom: 6px;
}

.ts-view .ts-template-count {
	color: #6c757d;
	font-size: 12px;
}

.ts-view .ts-checkbox {
	display: flex;
	align-items: center;
	gap: 6px;
	cursor: pointer;
	font-size: 14px;
	color: #495057;
}

.ts-view .ts-checkbox input {
	width: auto;
	margin: 0;
}

.ts-view .ts-template-actions {
	padding-bottom: 6px;
}

/* Template List */
.ts-view .ts-template-list-section {
	background: #fff;
	margin: 0 -20px;
	padding: 15px 20px;
	border-radius: 0;
}

.ts-view .ts-template-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.ts-view .ts-template-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 12px;
	background: #f8f9fa;
	border: 1px solid #dee2e6;
	border-radius: 6px;
	transition: all 0.2s ease;
}

.ts-view .ts-template-item:hover {
	border-color: #b8daff;
}

.ts-view .ts-template-item-selected {
	background: #e7f3ff;
	border-color: #007bff;
}

.ts-view .ts-template-item-info {
	display: flex;
	flex-direction: column;
	gap: 2px;
	flex: 1;
	min-width: 0;
}

.ts-view .ts-template-item-name {
	font-weight: 600;
	font-size: 14px;
	color: #495057;
}

.ts-view .ts-template-item-meta {
	font-size: 12px;
	color: #6c757d;
}

.ts-view .ts-template-item-desc {
	font-size: 12px;
	color: #6c757d;
	font-style: italic;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ts-view .ts-template-item-actions {
	flex-shrink: 0;
	margin-left: 10px;
}

/* Save as Template Section */
.ts-view .ts-template-save-section {
	background: #f8f9fa;
	margin: 0 -20px -20px -20px;
	padding: 15px 20px;
	border-radius: 0 0 8px 8px;
}

.ts-view .ts-template-save-desc {
	font-size: 13px;
	color: #6c757d;
	margin: 0 0 12px 0;
}

.ts-view .ts-alert-warning {
	background: #fff3cd;
	color: #856404;
	border: 1px solid #ffc107;
}

/* Modal Styles */
.ts-view .ts-modal-box {
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
	min-width: 400px;
	max-width: 500px;
	overflow: hidden;
}

.ts-view .ts-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 15px 20px;
	background: #f8f9fa;
	border-bottom: 1px solid #dee2e6;
}

.ts-view .ts-modal-header h4 {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	color: #495057;
	display: flex;
	align-items: center;
	gap: 8px;
}

.ts-view .ts-modal-header h4 i {
	color: #6c757d;
}

.ts-view .ts-modal-close {
	background: transparent;
	border: none;
	font-size: 18px;
	color: #6c757d;
	cursor: pointer;
	padding: 5px;
	line-height: 1;
}

.ts-view .ts-modal-close:hover {
	color: #dc3545;
}

.ts-view .ts-modal-body {
	padding: 20px;
}

.ts-view .ts-modal-field {
	margin-bottom: 15px;
}

.ts-view .ts-modal-field:last-child {
	margin-bottom: 0;
}

.ts-view .ts-modal-field label {
	display: block;
	font-size: 13px;
	font-weight: 500;
	color: #495057;
	margin-bottom: 5px;
}

.ts-view .ts-required {
	color: #dc3545;
}

.ts-view .ts-modal-field input,
.ts-view .ts-modal-field textarea {
	width: 100%;
}

.ts-view .ts-modal-footer {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	padding: 15px 20px;
	background: #f8f9fa;
	border-top: 1px solid #dee2e6;
}

@media (max-width: 768px) {
	.ts-view .ts-template-form {
		flex-direction: column;
		align-items: stretch;
	}

	.ts-view .ts-template-field-select {
		max-width: 100%;
	}

	.ts-view .ts-modal-box {
		min-width: 90%;
		max-width: 95%;
		margin: 0 10px;
	}
}

/* Filter and Sort Controls */
.ts-view .ts-filter-box {
	padding: 15px 20px;
	background: #fff;
}

.ts-view .ts-filter-controls {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	gap: 15px;
	align-items: center;
}

.ts-view .ts-search-wrap {
	position: relative;
	flex: 1;
	min-width: 200px;
	max-width: 350px;
}

.ts-view .ts-search-icon {
	position: absolute;
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
	color: #6c757d;
	font-size: 14px;
	pointer-events: none;
}

.ts-view .ts-search-input {
	padding-left: 36px;
	padding-right: 36px;
}

.ts-view .ts-search-clear {
	position: absolute;
	right: 4px;
	top: 50%;
	transform: translateY(-50%);
	color: #6c757d;
}

.ts-view .ts-search-clear:hover {
	color: #dc3545;
	background: transparent;
}

.ts-view .ts-sort-wrap {
	display: flex;
	flex-direction: row;
	gap: 8px;
	align-items: center;
}

.ts-view .ts-sort-label {
	font-size: 13px;
	color: #6c757d;
	margin: 0;
	white-space: nowrap;
	display: flex;
	align-items: center;
	gap: 5px;
}

.ts-view .ts-sort-select {
	width: 160px;
}

.ts-view .ts-sort-direction {
	color: #495057;
	border: 1px solid #ced4da;
	border-radius: 4px;
}

.ts-view .ts-sort-direction:hover {
	background: #e9ecef;
}

.ts-view .ts-filter-info {
	font-size: 12px;
	color: #6c757d;
	margin-left: auto;
}

@media (max-width: 768px) {
	.ts-view .ts-filter-controls {
		flex-direction: column;
		align-items: stretch;
	}

	.ts-view .ts-search-wrap {
		max-width: 100%;
	}

	.ts-view .ts-sort-wrap {
		flex-wrap: wrap;
	}

	.ts-view .ts-sort-select {
		flex: 1;
	}

	.ts-view .ts-filter-info {
		margin-left: 0;
		text-align: center;
	}
}

/* Risk Profile Groups (pivoted view) - Multi-column grid */
.ts-view .ts-risk-profiles {
	margin-bottom: 15px;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
	gap: 12px;
}

.ts-view .ts-empty-sm {
	text-align: center;
	padding: 20px;
	color: #6c757d;
}

.ts-view .ts-empty-sm i {
	font-size: 24px;
	margin-bottom: 10px;
	display: block;
	opacity: 0.5;
}

.ts-view .ts-empty-sm p {
	margin: 0;
	font-size: 13px;
}

.ts-view .ts-rp-group {
	background: #fff;
	border: 1px solid #dee2e6;
	border-radius: 6px;
	overflow: hidden;
	/* Allow flex column to fill grid cell */
	display: flex;
	flex-direction: column;
}

.ts-view .ts-rp-group-defined {
	border-color: #ffc107;
}

.ts-view .ts-rp-group-complete {
	border-color: #28a745;
}

.ts-view .ts-rp-group-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
	background: #f8f9fa;
	transition: background 0.2s ease;
}

.ts-view .ts-rp-group-header-main {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 1;
	min-width: 0;
	cursor: pointer;
}

.ts-view .ts-rp-group-header-main:hover {
	opacity: 0.8;
}

.ts-view .ts-rp-group-header-main > i:first-child {
	color: #6c757d;
	width: 14px;
	flex-shrink: 0;
}

.ts-view .ts-rp-group-title {
	font-weight: 600;
	font-size: 14px;
	color: #495057;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ts-view .ts-rp-group-actions {
	display: flex;
	gap: 6px;
	flex-shrink: 0;
}

.ts-view .ts-rp-group-leg-count {
	font-size: 11px;
	color: #6c757d;
	flex-shrink: 0;
}

.ts-view .ts-rp-group-body {
	padding: 10px 12px;
	border-top: 1px solid #dee2e6;
	flex: 1;
}

.ts-view .ts-rp-leg-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	padding: 8px 0;
	border-bottom: 1px solid #eee;
}

.ts-view .ts-rp-leg-row:last-child {
	border-bottom: none;
}

.ts-view .ts-rp-leg-defined {
	background: #f8f9fa;
	margin: 0 -12px;
	padding: 8px 12px;
}

.ts-view .ts-rp-leg-info {
	display: flex;
	align-items: center;
	gap: 5px;
	min-width: 110px;
	font-weight: 500;
	font-size: 13px;
	color: #495057;
}

.ts-view .ts-rp-leg-info i {
	color: #6c757d;
	font-size: 12px;
}

.ts-view .ts-rp-leg-method {
	min-width: 100px;
	flex: 1;
}

.ts-view .ts-rp-leg-method select {
	width: 100%;
	font-size: 12px;
	padding: 4px 6px;
}

.ts-view .ts-rp-leg-value {
	flex: 1;
	min-width: 80px;
}

.ts-view .ts-rp-leg-value input {
	width: 100%;
	font-size: 12px;
	padding: 4px 6px;
}

.ts-view .ts-rp-leg-actions {
	display: flex;
	gap: 2px;
	flex-shrink: 0;
}

.ts-view .ts-rp-leg-actions .ts-btn-icon {
	width: 26px;
	height: 26px;
}

.ts-view .ts-rp-leg-define {
	flex: 1;
}

.ts-view .ts-rp-leg-missing {
	flex: 1;
	font-size: 12px;
}

.ts-view .ts-readonly-value-sm {
	display: inline-block;
	padding: 3px 6px;
	background: #f8f9fa;
	border: 1px solid #e9ecef;
	border-radius: 4px;
	font-size: 12px;
	color: #495057;
}

/* Empty state for multi-column grid */
.ts-view .ts-risk-profiles .ts-empty-sm {
	grid-column: 1 / -1;
}

@media (max-width: 768px) {
	.ts-view .ts-risk-profiles {
		grid-template-columns: 1fr;
	}

	.ts-view .ts-rp-group-header {
		flex-wrap: wrap;
	}

	.ts-view .ts-rp-group-header-main {
		flex: 0 0 100%;
		margin-bottom: 8px;
	}

	.ts-view .ts-rp-group-actions {
		flex: 1;
	}

	.ts-view .ts-rp-leg-info {
		flex: 0 0 100%;
		margin-bottom: 6px;
	}
}
