/**
 * Ultimate Order Shield — Admin Styles
 *
 * Uses the same --wu-* CSS custom properties as the main plugin.
 *
 * @package DropProduct
 * @since   1.0.2
 */

/* ═══════════════════════════════════════════════════════════
   Layout Wrapper
   ═══════════════════════════════════════════════════════════ */

.dpshield-wrap {
	max-width: 1060px;
	margin: 24px 0;
	font-family: var(--wu-font, 'Inter', system-ui, sans-serif);
}

/* ═══════════════════════════════════════════════════════════
   Header
   ═══════════════════════════════════════════════════════════ */

.dpshield-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4f46e5 100%);
	border-radius: 16px;
	padding: 28px 32px;
	margin-bottom: 20px;
	box-shadow: 0 8px 32px rgba(79, 70, 229, 0.3);
}

.dpshield-header__brand {
	display: flex;
	align-items: center;
	gap: 18px;
}

.dpshield-header__icon {
	font-size: 42px;
	line-height: 1;
	filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.dpshield-header__brand h1 {
	font-size: 22px;
	font-weight: 700;
	color: #fff;
	margin: 0 0 4px;
	line-height: 1.2;
}

.dpshield-header__brand p {
	font-size: 13px;
	color: rgba(255,255,255,0.6);
	margin: 0;
}

.dpshield-header__status {
	font-size: 13px;
	font-weight: 700;
	padding: 7px 18px;
	border-radius: 20px;
	letter-spacing: 0.3px;
}

.dpshield-header__status.is-active {
	background: rgba(16, 185, 129, 0.2);
	color: #6ee7b7;
	border: 1px solid rgba(16, 185, 129, 0.35);
}

.dpshield-header__status.is-inactive {
	background: rgba(255,255,255,0.08);
	color: rgba(255,255,255,0.45);
	border: 1px solid rgba(255,255,255,0.15);
}

/* ═══════════════════════════════════════════════════════════
   Stats Bar
   ═══════════════════════════════════════════════════════════ */

.dpshield-stats {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 14px;
	margin-bottom: 20px;
}

.dpshield-stat {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 18px 20px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.dpshield-stat__value {
	font-size: 28px;
	font-weight: 800;
	color: #111827;
	line-height: 1;
}

.dpshield-stat__label {
	font-size: 11px;
	font-weight: 600;
	color: #9ca3af;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.dpshield-stat--block  { border-left: 4px solid #ef4444; }
.dpshield-stat--block  .dpshield-stat__value { color: #ef4444; }

.dpshield-stat--hold   { border-left: 4px solid #f59e0b; }
.dpshield-stat--hold   .dpshield-stat__value { color: #d97706; }

.dpshield-stat--allow  { border-left: 4px solid #10b981; }
.dpshield-stat--allow  .dpshield-stat__value { color: #059669; }

/* ═══════════════════════════════════════════════════════════
   Tab Navigation
   ═══════════════════════════════════════════════════════════ */

.dpshield-tab-nav {
	display: flex;
	gap: 4px;
	border-bottom: 2px solid #e5e7eb;
	margin-bottom: 22px;
}

.dpshield-tab-nav__item {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 10px 20px;
	font-size: 13px;
	font-weight: 600;
	color: #6b7280;
	text-decoration: none;
	border-radius: 8px 8px 0 0;
	border: 1px solid transparent;
	border-bottom: none;
	position: relative;
	bottom: -2px;
	transition: all 0.15s ease;
}

.dpshield-tab-nav__item:hover {
	color: #4f46e5;
	background: #eef2ff;
}

.dpshield-tab-nav__item.is-active {
	color: #4f46e5;
	background: #fff;
	border-color: #e5e7eb;
	border-bottom-color: #fff;
}

.dpshield-tab-nav__item .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}

.dpshield-tab-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	font-size: 11px;
	font-weight: 700;
	background: #ef4444;
	color: #fff;
	border-radius: 10px;
	line-height: 1;
}

/* ═══════════════════════════════════════════════════════════
   Cards
   ═══════════════════════════════════════════════════════════ */

.dpshield-card {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 14px;
	margin-bottom: 18px;
	box-shadow: 0 1px 6px rgba(0,0,0,0.04);
	overflow: hidden;
}

.dpshield-card__head {
	padding: 20px 24px 16px;
	border-bottom: 1px solid #f3f4f6;
}

.dpshield-card__head h2 {
	font-size: 15px;
	font-weight: 700;
	color: #111827;
	margin: 0 0 4px;
}

.dpshield-card__head p {
	font-size: 13px;
	color: #6b7280;
	margin: 0;
}

.dpshield-card__body {
	padding: 22px 24px;
}

/* ═══════════════════════════════════════════════════════════
   Risk Gauge Card
   ═══════════════════════════════════════════════════════════ */

.dpshield-card--gauge .dpshield-card__head {
	border-bottom: none;
}

.dpshield-gauge {
	padding: 0 24px 24px;
}

.dpshield-gauge__track {
	display: flex;
	height: 14px;
	border-radius: 8px;
	overflow: hidden;
	gap: 2px;
}

.dpshield-gauge__zone {
	height: 100%;
	border-radius: 4px;
	transition: width 0.4s ease;
}

.dpshield-gauge__zone--allow { background: linear-gradient(90deg, #a7f3d0, #6ee7b7); }
.dpshield-gauge__zone--hold  { background: linear-gradient(90deg, #fde68a, #fbbf24); }
.dpshield-gauge__zone--block { background: linear-gradient(90deg, #fca5a5, #ef4444); }

.dpshield-gauge__labels {
	display: flex;
	justify-content: space-between;
	margin-top: 10px;
}

.dpshield-gauge__label {
	font-size: 12px;
	font-weight: 600;
}

.dpshield-gauge__label--allow { color: #059669; }
.dpshield-gauge__label--hold  { color: #d97706; }
.dpshield-gauge__label--block { color: #dc2626; }

/* ═══════════════════════════════════════════════════════════
   Form Fields
   ═══════════════════════════════════════════════════════════ */

.dpshield-field {
	margin-bottom: 18px;
}

.dpshield-field:last-child {
	margin-bottom: 0;
}

.dpshield-field__label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	font-weight: 600;
	color: #374151;
	margin-bottom: 6px;
}

.dpshield-field__hint {
	display: block;
	font-size: 12px;
	color: #9ca3af;
	margin-top: 2px;
}

.dpshield-field-row {
	display: flex;
	gap: 20px;
	flex-wrap: wrap;
}

.dpshield-field-row .dpshield-field {
	flex: 1;
	min-width: 140px;
}

/* Toggle field */
.dpshield-field--toggle {
	display: flex;
	align-items: flex-start;
	gap: 14px;
}

/* ─── Toggle Switch ─────────────────────────────────────── */
.dpshield-toggle-switch {
	position: relative;
	display: inline-block;
	width: 46px;
	height: 26px;
	flex-shrink: 0;
	margin-top: 1px;
}

.dpshield-toggle-switch input {
	opacity: 0;
	width: 0;
	height: 0;
}

.dpshield-toggle-switch__slider {
	position: absolute;
	inset: 0;
	background: #d1d5db;
	border-radius: 26px;
	cursor: pointer;
	transition: 0.25s ease;
}

.dpshield-toggle-switch__slider::before {
	content: '';
	position: absolute;
	left: 3px;
	top: 3px;
	width: 20px;
	height: 20px;
	background: #fff;
	border-radius: 50%;
	transition: 0.25s ease;
	box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.dpshield-toggle-switch input:checked + .dpshield-toggle-switch__slider {
	background: #4f46e5;
}

.dpshield-toggle-switch input:checked + .dpshield-toggle-switch__slider::before {
	transform: translateX(20px);
}

/* ─── Radio Cards ───────────────────────────────────────── */
.dpshield-radio-group {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

.dpshield-radio {
	display: flex;
	flex-direction: column;
	gap: 4px;
	flex: 1;
	min-width: 180px;
	padding: 16px;
	border: 2px solid #e5e7eb;
	border-radius: 10px;
	cursor: pointer;
	transition: all 0.18s ease;
	background: #f9fafb;
}

.dpshield-radio:hover {
	border-color: #a5b4fc;
	background: #eef2ff;
}

.dpshield-radio.is-selected,
.dpshield-radio input:checked ~ * {
	border-color: #4f46e5 !important;
	background: #eef2ff !important;
}

.dpshield-radio input {
	position: absolute;
	opacity: 0;
}

.dpshield-radio__icon {
	font-size: 20px;
}

.dpshield-radio__label {
	font-size: 13px;
	font-weight: 700;
	color: #111827;
}

.dpshield-radio__hint {
	font-size: 12px;
	color: #6b7280;
}

/* ─── Text Inputs ───────────────────────────────────────── */
.dpshield-input-wrap {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.dpshield-input {
	height: 36px;
	padding: 0 12px;
	background: #fff;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font-size: 13px;
	font-family: var(--wu-font, inherit);
	color: #111827;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
	outline: none;
}

.dpshield-input:focus {
	border-color: #4f46e5;
	box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.dpshield-input--sm {
	width: 90px;
	text-align: center;
	font-weight: 700;
}

.dpshield-input-suffix {
	font-size: 12px;
	color: #9ca3af;
}

.dpshield-textarea {
	width: 100%;
	padding: 12px;
	background: #fff;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font-size: 12px;
	font-family: monospace;
	color: #374151;
	resize: vertical;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
	outline: none;
	box-sizing: border-box;
}

.dpshield-textarea:focus {
	border-color: #4f46e5;
	box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

/* ═══════════════════════════════════════════════════════════
   Rule Reference Table (inside Detection card)
   ═══════════════════════════════════════════════════════════ */

.dpshield-rule-table {
	border-radius: 10px;
	overflow: hidden;
	border: 1px solid #e5e7eb;
	font-size: 13px;
}

.dpshield-rule-table__head,
.dpshield-rule-table__row {
	display: grid;
	grid-template-columns: 2fr 70px 1fr;
	gap: 0;
	padding: 10px 16px;
	align-items: center;
}

.dpshield-rule-table__head {
	background: #f3f4f6;
	font-size: 11px;
	font-weight: 700;
	color: #6b7280;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.dpshield-rule-table__row {
	border-top: 1px solid #f3f4f6;
	color: #374151;
}

.dpshield-rule-table__row:hover {
	background: #fafafa;
}

.dpshield-rule-pts {
	font-weight: 800;
	color: #d97706;
	text-align: center;
}

.dpshield-rule-pts.is-block {
	color: #dc2626;
}

.dpshield-rule-note {
	font-size: 11px;
	color: #9ca3af;
}

/* ═══════════════════════════════════════════════════════════
   Badges
   ═══════════════════════════════════════════════════════════ */

.dpshield-badge {
	display: inline-flex;
	align-items: center;
	padding: 2px 8px;
	border-radius: 20px;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.4px;
}

.dpshield-badge--block {
	background: #fee2e2;
	color: #dc2626;
}

.dpshield-badge--hold {
	background: #fef3c7;
	color: #d97706;
}

.dpshield-badge--allow {
	background: #d1fae5;
	color: #059669;
}

/* ═══════════════════════════════════════════════════════════
   Save Bar
   ═══════════════════════════════════════════════════════════ */

.dpshield-save-bar {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 20px 0 8px;
}

.dpshield-save-msg {
	font-size: 13px;
	font-weight: 600;
	opacity: 0;
	transition: opacity 0.25s ease;
}

.dpshield-save-msg.is-visible {
	opacity: 1;
}

.dpshield-save-msg.is-success  { color: #059669; }
.dpshield-save-msg.is-error    { color: #dc2626; }

/* ═══════════════════════════════════════════════════════════
   Buttons
   ═══════════════════════════════════════════════════════════ */

.dpshield-btn {
	display: inline-flex !important;
	align-items: center !important;
	gap: 7px !important;
	padding: 9px 22px !important;
	font-size: 13px !important;
	font-weight: 600 !important;
	font-family: var(--wu-font, inherit) !important;
	border-radius: 8px !important;
	cursor: pointer !important;
	border: none !important;
	transition: all 0.18s ease !important;
	text-decoration: none !important;
}

.dpshield-btn .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}

.dpshield-btn--primary {
	background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%) !important;
	color: #fff !important;
	box-shadow: 0 3px 12px rgba(79, 70, 229, 0.3) !important;
}

.dpshield-btn--primary:hover:not(:disabled) {
	transform: translateY(-1px) !important;
	box-shadow: 0 6px 18px rgba(79, 70, 229, 0.4) !important;
	color: #fff !important;
}

.dpshield-btn--primary:disabled {
	opacity: 0.6 !important;
	cursor: not-allowed !important;
}

.dpshield-btn--danger-ghost {
	background: transparent !important;
	color: #dc2626 !important;
	border: 1px solid #fca5a5 !important;
}

.dpshield-btn--danger-ghost:hover {
	background: #fee2e2 !important;
	border-color: #ef4444 !important;
	color: #dc2626 !important;
}

/* ═══════════════════════════════════════════════════════════
   Logs Tab
   ═══════════════════════════════════════════════════════════ */

.dpshield-log-filters {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 16px;
	flex-wrap: wrap;
	gap: 10px;
}

.dpshield-log-filters__left {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.dpshield-filter-pill {
	padding: 6px 14px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 600;
	border: 1px solid #e5e7eb;
	background: #fff;
	color: #374151;
	text-decoration: none;
	transition: all 0.15s ease;
}

.dpshield-filter-pill:hover {
	border-color: #4f46e5;
	color: #4f46e5;
}

.dpshield-filter-pill.is-active {
	background: #4f46e5;
	border-color: #4f46e5;
	color: #fff;
}

/* Log Table */
.dpshield-log-table {
	border-radius: 12px !important;
	overflow: hidden;
	border: 1px solid #e5e7eb !important;
	font-size: 13px;
}

.dpshield-log-table thead th {
	background: #f9fafb !important;
	color: #6b7280 !important;
	font-size: 11px !important;
	font-weight: 700 !important;
	text-transform: uppercase !important;
	letter-spacing: 0.5px !important;
	border-bottom: 1px solid #e5e7eb !important;
	padding: 12px 14px !important;
}

.dpshield-log-table tbody td {
	padding: 11px 14px !important;
	border-bottom: 1px solid #f3f4f6 !important;
	vertical-align: middle !important;
	color: #374151 !important;
}

.dpshield-log-tr:hover td {
	background: #fafafa !important;
}

.dpshield-log-id {
	color: #9ca3af !important;
	font-size: 11px !important;
}

.dpshield-log-time {
	font-size: 11px !important;
	color: #9ca3af !important;
	white-space: nowrap;
}

.dpshield-na {
	color: #d1d5db;
}

/* Score cell */
.dpshield-score {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 26px;
	padding: 0 8px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 700;
}

.dpshield-score--block  { background: #fee2e2; color: #dc2626; }
.dpshield-score--on_hold { background: #fef3c7; color: #d97706; }
.dpshield-score--allow  { background: #d1fae5; color: #059669; }

/* Action badge */
.dpshield-action-badge {
	display: inline-flex;
	align-items: center;
	padding: 3px 10px;
	border-radius: 20px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.4px;
}

.dpshield-action--block  { background: #fee2e2; color: #dc2626; }
.dpshield-action--hold   { background: #fef3c7; color: #d97706; }
.dpshield-action--allow  { background: #d1fae5; color: #059669; }

/* Rule chips */
.dpshield-rules-cell { max-width: 240px; }

.dpshield-rule-chip {
	display: inline-block;
	padding: 2px 7px;
	margin: 2px 2px 2px 0;
	background: #eef2ff;
	color: #4f46e5;
	border-radius: 4px;
	font-size: 10px;
	font-weight: 600;
	white-space: nowrap;
}

/* Delete button */
.dpshield-delete-log {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 6px;
	background: transparent;
	border: none;
	cursor: pointer;
	color: #9ca3af;
	transition: all 0.15s ease;
	padding: 0 !important;
}

.dpshield-delete-log:hover {
	background: #fee2e2;
	color: #dc2626;
}

.dpshield-delete-log .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}

/* Empty state */
.dpshield-empty-state {
	text-align: center;
	padding: 60px 20px;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 14px;
}

.dpshield-empty-state__icon {
	font-size: 48px;
	margin-bottom: 16px;
}

.dpshield-empty-state h3 {
	font-size: 17px;
	color: #374151;
	margin: 0 0 8px;
}

.dpshield-empty-state p {
	font-size: 13px;
	color: #9ca3af;
}

/* Pagination */
.dpshield-pagination {
	display: flex;
	gap: 6px;
	margin-top: 16px;
	flex-wrap: wrap;
}

.dpshield-page-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 34px;
	height: 34px;
	padding: 0 10px;
	border: 1px solid #e5e7eb;
	border-radius: 7px;
	font-size: 13px;
	font-weight: 600;
	color: #374151;
	text-decoration: none;
	transition: all 0.15s ease;
}

.dpshield-page-btn:hover {
	border-color: #4f46e5;
	color: #4f46e5;
}

.dpshield-page-btn.is-current {
	background: #4f46e5;
	border-color: #4f46e5;
	color: #fff;
}

/* ═══════════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════════ */

@media screen and (max-width: 780px) {
	.dpshield-stats {
		grid-template-columns: 1fr 1fr;
	}

	.dpshield-header {
		flex-direction: column;
		gap: 16px;
		align-items: flex-start;
	}

	.dpshield-field-row {
		flex-direction: column;
	}

	.dpshield-rule-table__head,
	.dpshield-rule-table__row {
		grid-template-columns: 1fr 60px;
	}

	.dpshield-rule-note {
		display: none;
	}
}
