/**
 * Admin CSS for Smart COD Control & Fraud Blocker
 */

/* Settings Page Wrapper */
.wcsf-settings-wrap {
	max-width: 1400px;
	margin: 20px 20px 20px 0;
}

/* Header with Logo */
.wcsf-header {
	display: flex;
	align-items: center;
	gap: 20px;
	margin-bottom: 30px;
	padding: 20px 0;
}

.wcsf-header-logo img {
	width: 120px;
	height: auto;
	display: block;
}

.wcsf-header-text h1 {
	font-size: 28px;
	font-weight: 600;
	margin: 0 0 5px 0;
	color: #6b4c9a;
	line-height: 1.2;
}

.wcsf-header-text .wcsf-plugin-description {
	color: #646970;
	font-size: 14px;
	margin: 0;
	line-height: 1.4;
}

.wcsf-settings-wrap h1 {
	font-size: 28px;
	font-weight: 500;
	margin-bottom: 10px;
	color: #1d2327;
	display: flex;
	align-items: center;
	gap: 12px;
}

.wcsf-settings-wrap h1:before {
	content: "🛡️";
	font-size: 32px;
}

.wcsf-plugin-description {
	color: #646970;
	font-size: 14px;
	margin-bottom: 25px;
	line-height: 1.6;
}

/* Tabs - Modern Design */
.wcsf-settings-wrap .nav-tab-wrapper {
	margin-bottom: 0;
	border-bottom: 2px solid #e5e7eb;
	background: transparent;
	padding: 0;
}

.wcsf-settings-wrap .nav-tab {
	border: none;
	border-bottom: 3px solid transparent;
	background: transparent;
	color: #646970;
	font-size: 14px;
	font-weight: 500;
	padding: 14px 20px;
	margin: 0 8px 0 0;
	border-radius: 0;
	transition: all 0.2s ease;
	position: relative;
}

.wcsf-settings-wrap .nav-tab:hover {
	background: rgba(99, 102, 241, 0.05);
	color: #6366f1;
	border-bottom-color: rgba(99, 102, 241, 0.3);
}

.wcsf-settings-wrap .nav-tab-active {
	background: transparent;
	color: #6366f1;
	border-bottom-color: #6366f1;
	font-weight: 600;
}

/* Sub-Tabs Sidebar Layout — high-specificity to beat WP admin overrides */
.wcsf-settings-wrap .wcsf-sub-tabs-sidebar {
	display: flex !important;
	flex-direction: row !important;
	align-items: flex-start;
	gap: 0;
	margin-top: 0;
	min-height: 500px;
}

.wcsf-settings-wrap .wcsf-sub-tabs-menu {
	width: 220px;
	min-width: 220px;
	flex-shrink: 0;
	background: #f9fafb;
	border-right: 1px solid #e5e7eb;
	padding: 12px 8px;
}

.wcsf-settings-wrap .wcsf-sub-tabs-content {
	flex: 1;
	min-width: 0;
	padding: 28px 30px;
	background: #ffffff;
}

.wcsf-settings-wrap .wcsf-sub-tab {
	display: flex !important;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	border-radius: 6px;
	background: transparent;
	color: #6b7280;
	font-size: 13px;
	font-weight: 500;
	text-decoration: none !important;
	transition: all 0.15s ease;
	border: 1px solid transparent;
	margin-bottom: 3px;
	width: 100%;
	box-sizing: border-box;
}

.wcsf-settings-wrap .wcsf-sub-tab-icon {
	font-size: 16px;
	line-height: 1;
	flex-shrink: 0;
	width: 20px;
	text-align: center;
}

.wcsf-settings-wrap .wcsf-sub-tab-label {
	flex: 1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.wcsf-settings-wrap .wcsf-sub-tab:hover {
	background: #ffffff;
	color: #4f46e5;
	border-color: #e5e7eb;
}

.wcsf-settings-wrap .wcsf-sub-tab-active,
.wcsf-settings-wrap .wcsf-sub-tab.wcsf-sub-tab-active {
	background: #6366f1 !important;
	color: #ffffff !important;
	border-color: #6366f1 !important;
	font-weight: 600;
	box-shadow: 0 2px 4px rgba(99,102,241,0.25);
}

.wcsf-settings-wrap .wcsf-sub-tab-active:hover {
	background: #4f46e5 !important;
	border-color: #4f46e5 !important;
}

/* Settings Content - Card Style */
.wcsf-settings-content {
	background: #fff;
	padding: 0;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
	margin-top: -1px;
}

.wcsf-settings-content form {
	padding: 30px;
}

/* Form Table Improvements */
.wcsf-settings-content .form-table {
	margin-top: 0;
}

.wcsf-settings-content .form-table th {
	padding: 20px 20px 20px 0;
	font-weight: 600;
	color: #1d2327;
	width: 280px;
}

.wcsf-settings-content .form-table td {
	padding: 20px 0;
}

.wcsf-settings-content .form-table tr {
	border-bottom: 1px solid #f3f4f6;
}

.wcsf-settings-content .form-table tr:last-child {
	border-bottom: none;
}

.wcsf-settings-content .form-table input[type="text"],
.wcsf-settings-content .form-table input[type="number"],
.wcsf-settings-content .form-table input[type="email"],
.wcsf-settings-content .form-table textarea,
.wcsf-settings-content .form-table select {
	border: 1px solid #d1d5db;
	border-radius: 6px;
	padding: 8px 12px;
	font-size: 14px;
	transition: all 0.2s ease;
}

.wcsf-settings-content .form-table input[type="text"]:focus,
.wcsf-settings-content .form-table input[type="number"]:focus,
.wcsf-settings-content .form-table input[type="email"]:focus,
.wcsf-settings-content .form-table textarea:focus,
.wcsf-settings-content .form-table select:focus {
	border-color: #6366f1;
	box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
	outline: none;
}

.wcsf-settings-content .form-table .description {
	color: #6b7280;
	font-size: 13px;
	margin-top: 6px;
	line-height: 1.5;
}

/* Submit Button */
.wcsf-settings-content .submit {
	margin: 30px 0 0 0;
	padding: 0;
	background: transparent;
	border: none;
}

.wcsf-settings-content .button-primary {
	background: #6366f1;
	border-color: #6366f1;
	color: #fff;
	text-shadow: none;
	box-shadow: none;
	padding: 10px 24px;
	height: auto;
	font-size: 14px;
	font-weight: 500;
	border-radius: 6px;
	transition: all 0.2s ease;
}

.wcsf-settings-content .button-primary:hover {
	background: #4f46e5;
	border-color: #4f46e5;
	transform: translateY(-1px);
	box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.3);
}

.wcsf-settings-content .button-primary:active {
	transform: translateY(0);
}

/* Blacklist Section - Modern Cards */
.wcsf-blacklist-section {
	padding: 30px;
}

.wcsf-blacklist-section h3 {
	font-size: 16px;
	font-weight: 600;
	color: #1d2327;
	margin: 30px 0 15px;
	padding-bottom: 10px;
	border-bottom: 2px solid #f3f4f6;
}

.wcsf-blacklist-section h3:first-child {
	margin-top: 0;
}

.wcsf-add-item-form {
	margin: 15px 0 20px;
	display: flex;
	gap: 10px;
	align-items: center;
	background: #f9fafb;
	padding: 15px;
	border-radius: 6px;
	border: 1px solid #e5e7eb;
}

.wcsf-add-item-form input[type="email"],
.wcsf-add-item-form input[type="text"] {
	flex: 1;
	max-width: 400px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	padding: 8px 12px;
	font-size: 14px;
}

.wcsf-add-item-form input[type="email"]:focus,
.wcsf-add-item-form input[type="text"]:focus {
	border-color: #6366f1;
	box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
	outline: none;
}

.wcsf-add-item-form .button {
	background: #6366f1;
	border-color: #6366f1;
	color: #fff;
	padding: 8px 16px;
	border-radius: 6px;
	font-weight: 500;
	transition: all 0.2s ease;
}

.wcsf-add-item-form .button:hover {
	background: #4f46e5;
	border-color: #4f46e5;
	transform: translateY(-1px);
}

#wcsf_blocked_emails_table,
#wcsf_blocked_phones_table {
	margin-top: 15px;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	overflow: hidden;
}

#wcsf_blocked_emails_table thead th,
#wcsf_blocked_phones_table thead th {
	background: #f9fafb;
	font-weight: 600;
	color: #374151;
	padding: 12px 15px;
	text-align: left;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

#wcsf_blocked_emails_table tbody tr,
#wcsf_blocked_phones_table tbody tr {
	border-top: 1px solid #f3f4f6;
	transition: background 0.15s ease;
}

#wcsf_blocked_emails_table tbody tr:hover,
#wcsf_blocked_phones_table tbody tr:hover {
	background-color: #f9fafb;
}

#wcsf_blocked_emails_table tbody td,
#wcsf_blocked_phones_table tbody td {
	padding: 12px 15px;
	font-size: 14px;
}

.wcsf-remove-item {
	color: #ef4444;
	cursor: pointer;
	font-weight: 500;
	transition: color 0.2s ease;
}

.wcsf-remove-item:hover {
	color: #dc2626;
	text-decoration: underline;
}

/* Logs Section - Modern Table */
.wcsf-logs-section {
	padding: 30px;
}

.wcsf-logs-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
	padding-bottom: 15px;
	border-bottom: 2px solid #f3f4f6;
}

.wcsf-logs-header h2 {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
	color: #1d2327;
}

.wcsf-logs-header .button {
	background: #ef4444;
	border-color: #ef4444;
	color: #fff;
	padding: 8px 16px;
	border-radius: 6px;
	font-weight: 500;
	transition: all 0.2s ease;
}

.wcsf-logs-header .button:hover {
	background: #dc2626;
	border-color: #dc2626;
	transform: translateY(-1px);
}

#wcsf_logs_table {
	margin-top: 15px;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	overflow: hidden;
}

#wcsf_logs_table thead th {
	background: #f9fafb;
	font-weight: 600;
	color: #374151;
	padding: 12px 15px;
	text-align: left;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	border-bottom: 2px solid #e5e7eb;
}

#wcsf_logs_table tbody tr {
	border-top: 1px solid #f3f4f6;
	transition: background 0.15s ease;
}

#wcsf_logs_table tbody tr:hover {
	background: #f9fafb;
}

#wcsf_logs_table tbody td {
	padding: 12px 15px;
	font-size: 14px;
	color: #374151;
}

.wcsf-delete-log {
	color: #ef4444;
	cursor: pointer;
	font-weight: 500;
	transition: color 0.2s ease;
}

.wcsf-delete-log:hover {
	color: #dc2626;
	text-decoration: underline;
}

/* Status Badges */
.wcsf-status-badge {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.wcsf-status-blocked {
	background: #fee2e2;
	color: #991b1b;
}

.wcsf-status-allowed {
	background: #d1fae5;
	color: #065f46;
}

.wcsf-status-pending {
	background: #fef3c7;
	color: #92400e;
}

/* Heatmap Section */
.wcsf-heatmap-section {
	padding: 30px;
}

.wcsf-heatmap-container {
	background: #f9fafb;
	padding: 20px;
	border-radius: 6px;
	border: 1px solid #e5e7eb;
	margin-top: 20px;
}

.wcsf-heatmap-title {
	font-size: 16px;
	font-weight: 600;
	color: #1d2327;
	margin-bottom: 15px;
}

.wcsf-heatmap-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 12px;
}

.wcsf-heatmap-item {
	background: #fff;
	padding: 15px;
	border-radius: 6px;
	border: 1px solid #e5e7eb;
	text-align: center;
	transition: all 0.2s ease;
}

.wcsf-heatmap-item:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.wcsf-heatmap-postal {
	font-size: 18px;
	font-weight: 700;
	color: #1d2327;
	margin-bottom: 5px;
}

.wcsf-heatmap-count {
	font-size: 14px;
	color: #6b7280;
}

.wcsf-heatmap-item.high {
	background: #fee2e2;
	border-color: #fca5a5;
}

.wcsf-heatmap-item.medium {
	background: #fef3c7;
	border-color: #fde68a;
}

.wcsf-heatmap-item.low {
	background: #dbeafe;
	border-color: #93c5fd;
}

/* Test Mode Section */
.wcsf-test-section {
	padding: 30px;
}

.wcsf-test-simulator {
	background: #f9fafb;
	padding: 25px;
	border-radius: 6px;
	border: 1px solid #e5e7eb;
	margin-top: 20px;
}

.wcsf-test-simulator h3 {
	font-size: 16px;
	font-weight: 600;
	color: #1d2327;
	margin: 0 0 15px;
}

.wcsf-test-result {
	margin-top: 20px;
	padding: 15px 20px;
	border-radius: 6px;
	border-left: 4px solid;
	font-weight: 500;
}

.wcsf-test-result.success {
	background: #d1fae5;
	border-color: #10b981;
	color: #065f46;
}

.wcsf-test-result.error {
	background: #fee2e2;
	border-color: #ef4444;
	color: #991b1b;
}

.wcsf-test-result.warning {
	background: #fef3c7;
	border-color: #f59e0b;
	color: #92400e;
}

/* Info Box */
.wcsf-info-box {
	background: #eff6ff;
	border: 1px solid #bfdbfe;
	border-left: 4px solid #3b82f6;
	padding: 15px 20px;
	border-radius: 6px;
	margin: 20px 0;
}

.wcsf-info-box p {
	margin: 0;
	color: #1e40af;
	line-height: 1.6;
}

.wcsf-info-box strong {
	color: #1e3a8a;
}

/* Warning Box */
.wcsf-warning-box {
	background: #fffbeb;
	border: 1px solid #fde68a;
	border-left: 4px solid #f59e0b;
	padding: 15px 20px;
	border-radius: 6px;
	margin: 20px 0;
}

.wcsf-warning-box p {
	margin: 0;
	color: #92400e;
	line-height: 1.6;
}

/* Country / Enhanced Select — let Select2 control the sizing */
.wcsf-settings-content .select2-container {
	width: 100% !important;
	max-width: 600px;
}

.wcsf-settings-content .select2-container--default .select2-selection--multiple {
	border: 1px solid #d1d5db;
	border-radius: 6px;
	min-height: 42px;
	padding: 4px 8px;
	cursor: text;
}

.wcsf-settings-content .select2-container--default.select2-container--focus .select2-selection--multiple {
	border-color: #6366f1;
	box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
	outline: none;
}

.wcsf-settings-content .select2-container--default .select2-selection--multiple .select2-selection__choice {
	background: #6366f1;
	border: none;
	border-radius: 4px;
	color: #fff;
	font-size: 12px;
	font-weight: 500;
	padding: 3px 8px;
	margin: 3px 4px 3px 0;
	line-height: 1.4;
}

.wcsf-settings-content .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
	color: rgba(255,255,255,0.75);
	margin-right: 5px;
	font-size: 14px;
	border: none;
	background: transparent;
}

.wcsf-settings-content .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
	color: #fff;
	background: transparent;
}

.wcsf-settings-content .select2-container--default .select2-selection--multiple .select2-selection__rendered {
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 2px;
}

.wcsf-settings-content .select2-dropdown {
	border: 1px solid #d1d5db;
	border-radius: 6px;
	box-shadow: 0 4px 16px rgba(0,0,0,0.1);
	font-size: 13px;
}

.wcsf-settings-content .select2-container--default .select2-results__option--highlighted {
	background: #6366f1;
}

/* Country quick-actions bar */
.wcsf-select-actions {
	display: flex;
	gap: 8px;
	margin-bottom: 8px;
	align-items: center;
}

.wcsf-select-actions .button {
	font-size: 12px;
	padding: 3px 10px;
	height: auto;
	line-height: 1.6;
	color: #6366f1;
	border-color: #6366f1;
}

.wcsf-select-actions .button:hover {
	background: #6366f1;
	color: #fff;
	border-color: #6366f1;
}

.wcsf-select-actions .wcsf-count-badge {
	font-size: 12px;
	color: #9ca3af;
	margin-left: auto;
}

/* Checkbox Styling */
.wcsf-settings-content input[type="checkbox"] {
	width: 20px;
	height: 20px;
	border-radius: 4px;
	cursor: pointer;
	margin: 0 8px 0 0;
	vertical-align: middle;
	position: relative;
	top: -1px;
	accent-color: #6366f1;
}

.wcsf-settings-content input[type="checkbox"]:focus {
	outline: 2px solid rgba(99, 102, 241, 0.5);
	outline-offset: 2px;
}

.wcsf-settings-content label {
	display: inline-flex;
	align-items: center;
	cursor: pointer;
}

/* Color Picker Wrapper */
.wcsf-color-picker-wrapper {
	display: flex;
	align-items: center;
	gap: 10px;
}

.wcsf-color-picker-wrapper .wp-picker-container {
	display: inline-block;
}

/* Responsive */
@media screen and (max-width: 782px) {
	.wcsf-settings-wrap {
		margin: 10px 10px 10px 0;
	}
	
	.wcsf-settings-content form {
		padding: 20px;
	}
	
	.wcsf-settings-content .submit {
		padding: 15px 20px;
		margin-left: -20px;
		margin-right: -20px;
		margin-bottom: -20px;
	}
	
	.wcsf-add-item-form {
		flex-direction: column;
		align-items: stretch;
	}

	.wcsf-add-item-form input[type="email"],
	.wcsf-add-item-form input[type="text"] {
		max-width: none;
		width: 100%;
	}

	.wcsf-logs-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
	}

	#wcsf_logs_table {
		font-size: 13px;
	}

	#wcsf_logs_table th,
	#wcsf_logs_table td {
		padding: 8px 5px;
	}
	
	.wcsf-heatmap-grid {
		grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
		gap: 8px;
	}
}

/* Loading Spinner */
.wcsf-loading {
	display: inline-block;
	width: 16px;
	height: 16px;
	border: 2px solid #f3f3f3;
	border-top: 2px solid #6366f1;
	border-radius: 50%;
	animation: wcsf-spin 1s linear infinite;
}

@keyframes wcsf-spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

/* Success Message */
.wcsf-success-message {
	background: #d1fae5;
	border: 1px solid #6ee7b7;
	border-left: 4px solid #10b981;
	padding: 12px 20px;
	border-radius: 6px;
	margin: 15px 0;
	color: #065f46;
	font-weight: 500;
}

/* Error Message */
.wcsf-error-message {
	background: #fee2e2;
	border: 1px solid #fca5a5;
	border-left: 4px solid #ef4444;
	padding: 12px 20px;
	border-radius: 6px;
	margin: 15px 0;
	color: #991b1b;
	font-weight: 500;
}

/* Empty State */
.wcsf-empty-state {
	text-align: center;
	padding: 60px 20px;
	color: #9ca3af;
}

.wcsf-empty-state-icon {
	font-size: 48px;
	margin-bottom: 15px;
	opacity: 0.5;
}

.wcsf-empty-state-text {
	font-size: 16px;
	font-weight: 500;
	color: #6b7280;
}

/* Settings Section Group — visual divider inside form-table */
.wcsf-form-section-row th {
	padding-top: 28px !important;
	padding-bottom: 8px !important;
	padding-right: 0 !important;
	border-bottom: none;
}

.wcsf-form-section-title {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	color: #6366f1;
	border-bottom: 2px solid #e5e7eb;
	padding-bottom: 8px;
}

.wcsf-form-section-title .wcsf-section-icon {
	font-size: 15px;
	line-height: 1;
}

/* Collapsible legend (<details>) */
.wcsf-collapsible {
	background: #eff6ff;
	border: 1px solid #bfdbfe;
	border-left: 4px solid #3b82f6;
	border-radius: 6px;
	margin: 20px 0;
	overflow: hidden;
}

.wcsf-collapsible summary {
	cursor: pointer;
	padding: 12px 20px;
	font-weight: 600;
	color: #1e40af;
	list-style: none;
	display: flex;
	align-items: center;
	gap: 8px;
	user-select: none;
}

.wcsf-collapsible summary::-webkit-details-marker {
	display: none;
}

.wcsf-collapsible summary::before {
	content: "▶";
	font-size: 10px;
	transition: transform 0.2s ease;
	flex-shrink: 0;
}

.wcsf-collapsible[open] summary::before {
	transform: rotate(90deg);
}

.wcsf-collapsible .wcsf-collapsible-body {
	padding: 0 20px 15px;
	color: #1e40af;
}

.wcsf-collapsible .wcsf-collapsible-body ul {
	margin: 0;
	padding-left: 20px;
	line-height: 1.8;
}

/* Sticky Save Button */
.wcsf-sticky-save {
	position: sticky;
	bottom: 0;
	background: rgba(255, 255, 255, 0.95);
	backdrop-filter: blur(4px);
	border-top: 1px solid #e5e7eb;
	padding: 14px 30px;
	margin: 0 -30px -30px;
	display: flex;
	align-items: center;
	gap: 12px;
	z-index: 10;
	box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
}

.wcsf-sticky-save .button-primary {
	background: #6366f1;
	border-color: #6366f1;
	color: #fff;
	text-shadow: none;
	box-shadow: none;
	padding: 10px 28px;
	height: auto;
	font-size: 14px;
	font-weight: 600;
	border-radius: 6px;
	transition: all 0.2s ease;
}

.wcsf-sticky-save .button-primary:hover {
	background: #4f46e5;
	border-color: #4f46e5;
	transform: translateY(-1px);
	box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.3);
}

.wcsf-sticky-save .wcsf-save-hint {
	font-size: 12px;
	color: #9ca3af;
}

/* Section Headers */
.wcsf-section-header {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 25px 0 15px;
	padding-bottom: 12px;
	border-bottom: 2px solid #f3f4f6;
}

.wcsf-section-header h3 {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	color: #1d2327;
}

.wcsf-section-header .badge {
	background: #6366f1;
	color: #fff;
	font-size: 11px;
	padding: 3px 8px;
	border-radius: 10px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* Stats Grid */
.wcsf-stats-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 15px;
	margin: 20px 0;
}

.wcsf-stat-card {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	padding: 20px;
	border-radius: 8px;
	color: #fff;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.wcsf-stat-card.blue {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.wcsf-stat-card.green {
	background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.wcsf-stat-card.red {
	background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.wcsf-stat-card.yellow {
	background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.wcsf-stat-label {
	font-size: 13px;
	opacity: 0.9;
	margin-bottom: 8px;
	font-weight: 500;
}

.wcsf-stat-value {
	font-size: 32px;
	font-weight: 700;
	line-height: 1;
}

.wcsf-spinner {
	border-radius: 50%;
	animation: wcsf-spin 1s linear infinite;
	vertical-align: middle;
	margin-left: 8px;
}

@keyframes wcsf-spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

/* Notice Styling */
.wcsf-notice {
	padding: 10px 15px;
	margin: 10px 0;
	border-left: 4px solid;
	background: #fff;
}

.wcsf-notice.success {
	border-left-color: #46b450;
	background: #ecf7ed;
}

.wcsf-notice.error {
	border-left-color: #dc3232;
	background: #fef7f7;
}

/* Form Table Enhancements */
.form-table th {
	padding-top: 20px;
	padding-bottom: 20px;
}

.form-table td {
	padding-top: 15px;
	padding-bottom: 15px;
}

.form-table td p.description {
	margin-top: 5px;
	font-style: italic;
}

/* Button Styling */
.button.wcsf-delete-log,
.button.wcsf-remove-item {
	color: #dc3232;
	border-color: #dc3232;
}

.button.wcsf-delete-log:hover,
.button.wcsf-remove-item:hover {
	background: #dc3232;
	border-color: #dc3232;
	color: #fff;
}

/* Pagination */
.tablenav.bottom {
	padding: 15px 0 0;
}

.tablenav-pages {
	float: right;
}

.tablenav-pages .pagination-links {
	font-size: 14px;
}

.tablenav-pages .pagination-links a,
.tablenav-pages .pagination-links span {
	padding: 5px 10px;
	border: 1px solid #ddd;
	background: #fff;
	text-decoration: none;
	margin: 0 2px;
}

.tablenav-pages .pagination-links a:hover {
	background: #f6f7f7;
}

.tablenav-pages .pagination-links span.current {
	background: #2271b1;
	color: #fff;
	border-color: #2271b1;
}

/* ═══════════════════════════════════════════════════════════════════
   RULES DASHBOARD (v1.3.0)
═══════════════════════════════════════════════════════════════════ */

.wcsf-rules-dashboard {
	padding: 24px 30px;
}

/* Plugin toggle bar */
.wcsf-plugin-toggle-bar {
	background: #f6f7f7;
	border: 1px solid #dcdcde;
	border-radius: 6px;
	padding: 14px 18px;
	margin-bottom: 16px;
	display: flex;
	flex-direction: column;
	gap: 4px;
}
/* Shared toggle styles for both plugin toggle and rule card toggles */
.wcsf-toggle-label,
.wcsf-rule-toggle {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	user-select: none;
	line-height: 1;
}
.wcsf-toggle-label input[type="checkbox"],
.wcsf-rule-toggle input[type="checkbox"] {
	-webkit-appearance: none;
	appearance: none;
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
	margin: 0;
}
.wcsf-toggle-track {
	position: relative;
	display: inline-block;
	width: 40px;
	height: 22px;
	background: #ccc;
	border-radius: 22px;
	transition: background 0.2s;
	flex-shrink: 0;
	cursor: pointer;
}
.wcsf-toggle-track::after {
	content: '';
	position: absolute;
	top: 3px;
	left: 3px;
	width: 16px;
	height: 16px;
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 1px 3px rgba(0,0,0,0.3);
	transition: left 0.2s;
}
.wcsf-toggle-label input:checked ~ .wcsf-toggle-track,
.wcsf-rule-toggle input:checked ~ .wcsf-toggle-track {
	background: #2271b1;
}
.wcsf-toggle-label input:checked ~ .wcsf-toggle-track::after,
.wcsf-rule-toggle input:checked ~ .wcsf-toggle-track::after {
	left: 21px;
}
.wcsf-toggle-hint {
	margin: 4px 0 0;
	font-size: 12px;
	color: #787c82;
}

/* Default message bar */
.wcsf-global-message-bar {
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 6px;
	padding: 16px 18px;
	margin-bottom: 16px;
}
.wcsf-global-message-bar label {
	display: block;
	font-weight: 600;
	margin-bottom: 8px;
}
.wcsf-message-fields {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	margin-bottom: 10px;
}
.wcsf-message-fields {
	display: flex;
	gap: 10px;
	margin-bottom: 12px;
}
.wcsf-message-fields input[type="text"] {
	flex: 1;
}
.wcsf-message-color-row {
	display: flex;
	align-items: flex-end;
	gap: 20px;
	flex-wrap: wrap;
	margin-bottom: 12px;
}
.wcsf-color-field {
	display: flex;
	flex-direction: column;
	gap: 5px;
}
.wcsf-color-field label {
	font-size: 12px;
	color: #50575e;
	font-weight: 600;
}
.wcsf-color-field--save {
	justify-content: flex-end;
}
.wcsf-message-preview {
	padding: 10px 14px;
	border-radius: 5px;
	font-size: 14px;
	border: 1px solid rgba(0,0,0,0.1);
	display: none;
}
.wcsf-message-preview.is-visible {
	display: block;
}

/* Rules section card */
.wcsf-rules-section {
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 6px;
	overflow: hidden;
	margin-bottom: 20px;
}

/* Rules header */
.wcsf-rules-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 18px;
	border-bottom: 1px solid #dcdcde;
	background: #f6f7f7;
}
.wcsf-rules-header h3 {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
}

/* Rules list inner */
.wcsf-rules-list-inner {
	padding: 12px 18px;
}

/* Rule card */
.wcsf-rule-card {
	display: flex;
	align-items: center;
	gap: 14px;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-left: 4px solid #2271b1;
	border-radius: 6px;
	padding: 12px 14px;
	margin-bottom: 8px;
	transition: opacity 0.2s, border-color 0.2s;
}
.wcsf-rule-card:last-child {
	margin-bottom: 0;
}
.wcsf-rule-card.is-inactive {
	border-left-color: #c3c4c7;
	opacity: 0.6;
}
.wcsf-rule-card-left {
	flex-shrink: 0;
}
.wcsf-rule-card-body {
	flex: 1;
	min-width: 0;
}
.wcsf-rule-name {
	font-weight: 600;
	font-size: 14px;
	color: #1d2327;
	margin-bottom: 3px;
}
.wcsf-rule-summary {
	font-size: 12px;
	color: #787c82;
}
.wcsf-rule-card-actions {
	display: flex;
	gap: 6px;
	flex-shrink: 0;
	align-items: center;
}

/* Empty state */
.wcsf-empty-state {
	text-align: center;
	padding: 40px 24px;
	background: #f6f7f7;
	border: 2px dashed #dcdcde;
	border-radius: 6px;
}
.wcsf-empty-icon {
	font-size: 40px;
	margin-bottom: 12px;
}
.wcsf-empty-state h3 {
	margin: 0 0 8px;
	font-size: 18px;
}
.wcsf-empty-state p {
	color: #787c82;
	margin: 0 0 20px;
}

/* Rule editor drawer */
.wcsf-rule-editor {
	margin-top: 24px;
	border: 1px solid #2271b1;
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}
.wcsf-rule-editor-inner {
	padding: 0;
}
.wcsf-editor-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 20px;
	border-bottom: 1px solid #dcdcde;
	background: #f6f7f7;
	border-radius: 8px 8px 0 0;
}
.wcsf-editor-header h3 {
	margin: 0;
}
#wcsf-close-editor {
	background: none;
	border: none;
	font-size: 20px;
	cursor: pointer;
	color: #787c82;
	line-height: 1;
	padding: 0 4px;
}
#wcsf-close-editor:hover { color: #1d2327; }
.wcsf-editor-body {
	padding: 20px;
}
.wcsf-editor-row {
	margin-bottom: 16px;
}
.wcsf-editor-row label {
	display: block;
	font-weight: 600;
	margin-bottom: 6px;
}
.wcsf-editor-row-inline {
	display: flex;
	gap: 20px;
	flex-wrap: wrap;
}
.wcsf-editor-row-inline > div {
	flex: 1;
	min-width: 200px;
}
.wcsf-editor-row-inline label {
	display: block;
}

/* Conditions */
.wcsf-conditions-section {
	margin-top: 8px;
	border: 1px solid #dcdcde;
	border-radius: 6px;
	overflow: hidden;
}
.wcsf-conditions-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 14px;
	background: #f6f7f7;
	border-bottom: 1px solid #dcdcde;
}
#wcsf-no-conditions {
	padding: 14px;
	color: #787c82;
	font-style: italic;
	margin: 0;
}
.wcsf-condition-row {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 12px 14px;
	border-bottom: 1px solid #f0f0f0;
	flex-wrap: wrap;
}
.wcsf-condition-row:last-child { border-bottom: none; }
.wcsf-condition-type-label {
	font-size: 12px;
	font-weight: 600;
	background: #e0e7ff;
	color: #2271b1;
	padding: 3px 8px;
	border-radius: 4px;
	white-space: nowrap;
	align-self: center;
}
.wcsf-condition-fields {
	flex: 1;
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}
.wcsf-condition-fields textarea {
	width: 100%;
	font-family: monospace;
	font-size: 12px;
}
.wcsf-cond-multi {
	min-height: 80px;
	min-width: 200px;
}
.wcsf-day-boxes {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-bottom: 8px;
}
.wcsf-day-boxes label {
	font-weight: normal;
	display: flex;
	align-items: center;
	gap: 4px;
}
.wcsf-time-row {
	display: flex;
	gap: 12px;
	align-items: center;
}
.wcsf-remove-condition {
	background: none;
	border: none;
	cursor: pointer;
	color: #d63638;
	font-size: 18px;
	line-height: 1;
	padding: 0;
	align-self: flex-start;
	margin-top: 2px;
}
.wcsf-remove-condition:hover { color: #b32d2e; }

/* Editor footer */
.wcsf-editor-footer {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	padding: 14px 20px;
	border-top: 1px solid #dcdcde;
	background: #f6f7f7;
	border-radius: 0 0 8px 8px;
}

/* ── Quick-start presets bar ──────────────────────────────────────────────── */
.wcsf-presets-bar {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 18px;
	background: #f0f6fc;
	border-bottom: 1px solid #dcdcde;
	flex-wrap: wrap;
}
.wcsf-presets-label {
	font-size: 12px;
	font-weight: 600;
	color: #50575e;
	white-space: nowrap;
}
.wcsf-preset-btn.button {
	font-size: 12px;
	padding: 3px 11px;
	height: auto;
	line-height: 1.7;
	color: #2271b1;
	border-color: #2271b1;
	background: #fff;
	border-radius: 4px;
	transition: all 0.15s ease;
}
.wcsf-preset-btn.button:hover {
	background: #2271b1;
	color: #fff;
	border-color: #2271b1;
}

/* Empty-state preset cards */
.wcsf-empty-presets {
	display: flex;
	gap: 12px;
	justify-content: center;
	flex-wrap: wrap;
	margin: 16px 0 4px;
}
.wcsf-preset-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	width: 160px;
	padding: 18px 14px;
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.15s ease;
	text-align: center;
	font-family: inherit;
}
.wcsf-preset-card:hover {
	border-color: #2271b1;
	box-shadow: 0 2px 8px rgba(34,113,177,0.15);
	transform: translateY(-2px);
}
.wcsf-preset-card-icon {
	font-size: 28px;
	line-height: 1;
}
.wcsf-preset-card strong {
	font-size: 13px;
	color: #1d2327;
	line-height: 1.3;
}
.wcsf-preset-card span {
	font-size: 11px;
	color: #787c82;
	line-height: 1.4;
}

/* ── Rule groups (Restricted / Allowed) ───────────────────────────────────── */
.wcsf-rule-group {
	margin-bottom: 12px;
}
.wcsf-rule-group:last-child {
	margin-bottom: 0;
}

.wcsf-rule-group-label {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 7px 12px;
	border-radius: 5px;
	margin-bottom: 8px;
	border-left: 3px solid transparent;
}
.wcsf-rule-group-label--block {
	background: #fff5f5;
	border-left-color: #e53e3e;
}
.wcsf-rule-group-label--allow {
	background: #f0fff4;
	border-left-color: #38a169;
}
.wcsf-rule-group-title {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.6px;
}
.wcsf-rule-group-label--block .wcsf-rule-group-title {
	color: #c53030;
}
.wcsf-rule-group-label--allow .wcsf-rule-group-title {
	color: #276749;
}
.wcsf-rule-group-desc {
	font-size: 12px;
	color: #6b7280;
}

/* Action-based card border colors */
.wcsf-rule-card.action-block {
	border-left-color: #e53e3e;
}
.wcsf-rule-card.action-allow_only {
	border-left-color: #38a169;
}
.wcsf-rule-card.is-inactive.action-block {
	border-left-color: #fc8181;
}
.wcsf-rule-card.is-inactive.action-allow_only {
	border-left-color: #68d391;
}

/* ── Condition row improvements ───────────────────────────────────────────── */

/* Top row: label badge + remove button */
.wcsf-condition-row-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 8px;
}
.wcsf-condition-row {
	background: #fafafa;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	padding: 10px 12px;
	margin-bottom: 0;
}
.wcsf-condition-row:last-child {
	border-bottom: 1px solid #e5e7eb;
}
/* Fields now stack vertically by default */
.wcsf-condition-fields {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}
/* Full-width elements in condition fields */
.wcsf-day-boxes,
.wcsf-time-row,
.wcsf-cond-textarea {
	width: 100%;
}
.wcsf-day-boxes {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 4px;
}
.wcsf-day-label {
	font-weight: normal;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: #fff;
	border: 1px solid #d1d5db;
	border-radius: 4px;
	padding: 3px 8px;
	font-size: 12px;
	cursor: pointer;
}
.wcsf-day-label input[type="checkbox"] {
	width: 14px;
	height: 14px;
	margin: 0;
	accent-color: #6366f1;
}
.wcsf-time-row {
	display: flex;
	gap: 16px;
	align-items: center;
}
.wcsf-time-row label {
	font-size: 13px;
	display: flex;
	align-items: center;
	gap: 6px;
}
.wcsf-cond-prefix {
	font-size: 13px;
	color: #374151;
	white-space: nowrap;
}
.wcsf-cond-hint {
	font-size: 11px;
	color: #9ca3af;
	width: 100%;
}
.wcsf-cond-mode {
	min-width: 160px;
}

/* Select2 inside condition fields */
.wcsf-condition-fields .select2-container {
	flex: 1;
	min-width: 220px;
	max-width: 100%;
}
.wcsf-condition-fields .select2-container--default .select2-selection--multiple {
	border: 1px solid #d1d5db;
	border-radius: 6px;
	min-height: 36px;
	padding: 3px 6px;
	cursor: text;
	background: #fff;
}
.wcsf-condition-fields .select2-container--default.select2-container--focus .select2-selection--multiple {
	border-color: #6366f1;
	box-shadow: 0 0 0 2px rgba(99,102,241,0.15);
	outline: none;
}
.wcsf-condition-fields .select2-container--default .select2-selection--multiple .select2-selection__choice {
	background: #6366f1;
	border: none;
	border-radius: 4px;
	color: #fff;
	font-size: 11px;
	font-weight: 500;
	padding: 2px 6px;
	margin: 2px 3px 2px 0;
}
.wcsf-condition-fields .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
	color: rgba(255,255,255,0.8);
	margin-right: 4px;
	border: none;
	background: transparent;
}
.wcsf-condition-fields .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
	color: #fff;
	background: transparent;
}

/* AND / OR connector between condition rows */
.wcsf-condition-connector {
	display: flex;
	align-items: center;
	padding: 4px 0;
	gap: 8px;
}
.wcsf-condition-connector::before,
.wcsf-condition-connector::after {
	content: '';
	flex: 1;
	height: 1px;
	background: #e5e7eb;
}
.wcsf-condition-connector-badge {
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: #9ca3af;
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 3px;
	padding: 1px 7px;
}
/* Remove old border-bottom separator since we use connector elements */
.wcsf-condition-row:not(:last-child) {
	border-bottom: 1px solid #e5e7eb;
}
/* Weight labels */
.wcsf-weight-label {
	font-size: 13px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

/* ── OTP Preview ───────────────────────────────────────────── */
.wcsf-otp-preview-wrap {
	margin-top: 32px;
	padding: 24px;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
}
.wcsf-otp-preview-heading {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 15px;
	font-weight: 600;
	margin: 0 0 6px;
	color: #1f2937;
}
.wcsf-otp-preview-step {
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: #6b7280;
	margin: 0 0 8px;
}
