/* ==========================================================================
   DawsonyWeb Catalog Ops — Admin UI
   Brand: #36648b (steel blue) — matches Dawsony design system
   Prefix: dwco-
   ========================================================================== */

:root {
	--dwco-brand: #36648b;
	--dwco-brand-dark: #2a4f6e;
	--dwco-brand-light: #4a87b5;
	--dwco-brand-bg: #edf2f7;
	--dwco-success: #16a34a;
	--dwco-danger: #dc2626;
	--dwco-warn: #d97706;
	--dwco-radius: 8px;
	--dwco-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
	--dwco-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
	--dwco-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

.dwco-wrap {
	margin: -8px 0 0 -20px;
	overflow-x: hidden;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
	background: var(--dwco-brand-bg);
	min-height: 100vh;
}

/* ---------- Header ---------- */

.dwco-header {
	background: linear-gradient(135deg, var(--dwco-brand) 0%, var(--dwco-brand-dark) 100%);
	padding: 0;
}

.dwco-header-inner {
	max-width: 1400px;
	margin: 0 auto;
	padding: 20px 24px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.dwco-header-brand {
	display: flex;
	align-items: center;
	gap: 14px;
}

.dwco-header-logo {
	border-radius: 10px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
	background: #fff;
	padding: 2px;
}

.dwco-header h1 {
	margin: 0;
	padding: 0;
	font-size: 20px;
	font-weight: 600;
	color: #fff;
	line-height: 1.3;
	letter-spacing: -0.01em;
}

.dwco-header-version {
	display: inline-block;
	font-size: 11px;
	font-weight: 500;
	color: rgba(255, 255, 255, 0.7);
	background: rgba(255, 255, 255, 0.15);
	padding: 2px 8px;
	border-radius: 10px;
	margin-top: 2px;
}

/* ---------- Toast ---------- */

.dwco-toast {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 24px;
	background: #f0fdf4;
	color: var(--dwco-success);
	font-weight: 500;
	font-size: 13px;
	border-bottom: 1px solid #bbf7d0;
}

.dwco-toast svg {
	flex-shrink: 0;
}

/* ---------- Sidebar Navigation ---------- */

.dwco-body {
	display: flex;
	align-items: flex-start;
	max-width: 1400px;
	margin: 0 auto;
	padding: 24px 24px 0;
	gap: 24px;
}

.dwco-sidebar {
	width: 200px;
	flex-shrink: 0;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: var(--dwco-radius);
	box-shadow: var(--dwco-shadow-sm);
	overflow: hidden;
	position: sticky;
	top: 32px;
}

.dwco-sidebar-item {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 11px 16px;
	font-size: 13px;
	font-weight: 500;
	color: #475569;
	text-decoration: none;
	border-left: 3px solid transparent;
	transition: background 0.12s, color 0.12s;
	line-height: 1.4;
}

.dwco-sidebar-item:hover {
	background: #f8fafc;
	color: #1e293b;
	text-decoration: none;
}

.dwco-sidebar-item .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	color: #94a3b8;
	transition: color 0.12s;
}

.dwco-sidebar-item:hover .dashicons {
	color: #64748b;
}

.dwco-sidebar-item-active {
	background: var(--dwco-brand-bg);
	color: var(--dwco-brand);
	border-left-color: var(--dwco-brand);
	font-weight: 600;
}

.dwco-sidebar-item-active .dashicons {
	color: var(--dwco-brand);
}

/* ---------- Main Content ---------- */

.dwco-main {
	flex: 1;
	min-width: 0;
	padding-bottom: 24px;
}

.dwco-content {
	min-height: 200px;
}

/* ---------- Cards ---------- */

.dwco-card {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: var(--dwco-radius);
	box-shadow: var(--dwco-shadow-sm);
	overflow: hidden;
}

.dwco-card-header {
	padding: 20px 24px 16px;
	border-bottom: 1px solid #f1f5f9;
}

.dwco-card-header h2 {
	font-size: 15px;
	font-weight: 600;
	color: #1e293b;
	margin: 0 0 4px;
	padding: 0;
}

/* ---------- Info Text ---------- */

.dwco-info-text {
	font-size: 13px;
	color: #64748b;
	margin: 4px 0 0;
	line-height: 1.6;
}

/* ---------- Form Tables ---------- */

.dwco-content .form-table {
	background: transparent;
	margin-top: 0;
	border: none;
	width: 100%;
}

.dwco-content .form-table th {
	width: 200px;
	padding: 16px 20px;
	font-weight: 600;
	color: #334155;
	font-size: 13px;
	vertical-align: top;
}

.dwco-content .form-table td {
	padding: 16px 20px;
}

.dwco-content .form-table tr {
	border-bottom: 1px solid #f1f5f9;
}

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

/* ---------- Submit Row ---------- */

.dwco-submit-row {
	margin: 20px 0;
	padding: 0;
}

/* ---------- Primary Button ---------- */

.dwco-btn-primary,
.dwco-content .submit .button-primary,
.dwco-submit-row .button-primary {
	background: var(--dwco-brand) !important;
	border-color: var(--dwco-brand-dark) !important;
	border-radius: 6px;
	padding: 6px 18px;
	font-size: 13px;
	font-weight: 500;
	height: auto;
	line-height: 1.6;
	color: #fff !important;
	transition: background 0.15s;
}

.dwco-btn-primary:hover,
.dwco-content .submit .button-primary:hover,
.dwco-submit-row .button-primary:hover {
	background: var(--dwco-brand-dark) !important;
	border-color: var(--dwco-brand-dark) !important;
	color: #fff !important;
}

/* ---------- Toolbar Buttons ---------- */

.dwco-toolbar {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.dwco-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 8px 18px;
	border: 1px solid #e2e8f0;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s;
	text-decoration: none;
	line-height: 1.4;
}

.dwco-btn-secondary {
	background: #fff;
	color: #1e293b;
	border-color: #e2e8f0;
}

.dwco-btn-secondary:hover {
	background: #f8fafc;
	color: #1e293b;
	border-color: #d1d5db;
	text-decoration: none;
}

.dwco-btn-primary-solid {
	background: var(--dwco-brand);
	color: #fff;
	border-color: var(--dwco-brand-dark);
}

.dwco-btn-primary-solid:hover {
	background: var(--dwco-brand-dark);
	color: #fff;
}

.dwco-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* ---------- Sub-tabs ---------- */

.dwco-subtabs {
	display: flex;
	gap: 0;
	margin-bottom: -1px;
	position: relative;
	z-index: 1;
}

.dwco-subtab {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 18px;
	font-size: 13px;
	font-weight: 500;
	color: #64748b;
	text-decoration: none;
	border: 1px solid transparent;
	border-bottom: none;
	border-radius: var(--dwco-radius) var(--dwco-radius) 0 0;
	background: transparent;
	transition: color 0.12s, background 0.12s;
}

.dwco-subtab:hover {
	color: #1e293b;
	background: #f8fafc;
	text-decoration: none;
}

.dwco-subtab-active {
	color: #1e293b;
	background: #fff;
	border-color: #e2e8f0;
	font-weight: 600;
}

.dwco-subtab-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	font-size: 11px;
	font-weight: 600;
	border-radius: 10px;
	background: #f1f5f9;
	color: #64748b;
}

.dwco-subtab-active .dwco-subtab-count {
	background: var(--dwco-brand-bg);
	color: var(--dwco-brand);
}

/* ---------- Import Result ---------- */

.dwco-import-result {
	margin-top: 12px;
	padding: 10px 14px;
	background: #f0fdf4;
	color: #1e293b;
	border: 1px solid #bbf7d0;
	border-radius: 6px;
	font-size: 13px;
}

/* ---------- Toggle ---------- */

.dwco-toggle-wrap {
	position: relative;
	display: inline-block;
	flex-shrink: 0;
	vertical-align: middle;
}

.dwco-toggle-input {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.dwco-toggle-track {
	display: block;
	width: 44px;
	height: 24px;
	background: #cbd5e1;
	border-radius: 12px;
	cursor: pointer;
	transition: background 0.2s;
	position: relative;
}

.dwco-toggle-knob {
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
	transition: transform 0.2s;
}

.dwco-toggle-input:checked + .dwco-toggle-track {
	background: var(--dwco-brand);
}

.dwco-toggle-input:checked + .dwco-toggle-track .dwco-toggle-knob {
	transform: translateX(20px);
}

/* ---------- Severity / Status Badges ---------- */

.dwco-badge {
	display: inline-flex;
	align-items: center;
	padding: 2px 8px;
	border-radius: 10px;
	font-size: 11px;
	font-weight: 600;
	white-space: nowrap;
}

.dwco-badge-critical { background: #fee2e2; color: #b91c1c; }
.dwco-badge-warning  { background: #fef9c3; color: #a16207; }
.dwco-badge-info     { background: #dbeafe; color: #1e40af; }
.dwco-badge-open     { background: #f1f5f9; color: #64748b; }
.dwco-badge-resolved { background: #dcfce7; color: #16a34a; }
.dwco-badge-ignored  { background: #f1f5f9; color: #94a3b8; }

/* ---------- Stats Row (Dashboard) ---------- */

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

.dwco-stat-card {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: var(--dwco-radius);
	padding: 20px 16px;
	box-shadow: var(--dwco-shadow-sm);
	text-align: center;
}

.dwco-stat-card.dwco-stat-critical { border-top: 3px solid #dc2626; }
.dwco-stat-card.dwco-stat-warning  { border-top: 3px solid #d97706; }
.dwco-stat-card.dwco-stat-info     { border-top: 3px solid #3b82f6; }

.dwco-stat-number {
	font-size: 32px;
	font-weight: 700;
	color: var(--dwco-brand);
	line-height: 1;
	margin-bottom: 8px;
}

.dwco-stat-label {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #64748b;
}

/* ---------- Audit spinner ---------- */

.dwco-audit-spinner {
	display: none;
}

.dwco-audit-spinner.is-active {
	display: inline-block;
}

/* ---------- Empty State ---------- */

.dwco-empty-state {
	text-align: center;
	padding: 48px 24px;
	color: #64748b;
}

.dwco-empty-state strong {
	display: block;
	font-size: 15px;
	color: #334155;
	margin-bottom: 8px;
}

.dwco-empty-state p {
	font-size: 13px;
	color: #64748b;
	margin: 0;
}

/* ---------- WP List Table overrides ---------- */

.dwco-card .wp-list-table {
	border: none;
	box-shadow: none;
}

.dwco-card .tablenav {
	margin: 0;
	padding: 6px 16px;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 4px 0;
}

.dwco-card .tablenav .actions {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 0;
}

.dwco-card .tablenav .tablenav-pages {
	margin: 0;
	float: none;
	margin-left: auto;
}

.dwco-card .tablenav .displaying-num {
	margin-right: 6px;
}

.dwco-card .tablenav.top {
	border-bottom: 1px solid #f1f5f9;
}

.dwco-card .tablenav.bottom {
	border-top: 1px solid #f1f5f9;
}

.dwco-card .column-actions {
	white-space: nowrap;
}

/* ---------- Pro banner container ---------- */

.dwco-upgrade-wrap {
	margin-top: 24px;
	padding: 0 0 24px;
}

/* ---------- Footer ---------- */

.dwco-footer {
	max-width: 1400px;
	margin: 0 auto;
	padding: 16px 24px;
	text-align: center;
	font-size: 12px;
	color: #94a3b8;
}

.dwco-footer a {
	color: var(--dwco-brand);
	text-decoration: none;
}

.dwco-footer a:hover {
	text-decoration: underline;
}

.dwco-footer-pro {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	color: #16a34a;
	font-size: 12px;
	font-weight: 500;
	margin-bottom: 4px;
}

.dwco-footer-pro .dashicons {
	font-size: 14px;
	width: 14px;
	height: 14px;
}

/* ---------- Notice overrides ---------- */

.dwco-content .notice {
	margin: 0 0 16px;
	border-radius: var(--dwco-radius);
}

/* ---------- Responsive ---------- */

@media (max-width: 782px) {
	.dwco-wrap {
		margin: -8px 0 0 -10px;
	}

	.dwco-header-inner {
		padding: 16px;
	}

	.dwco-upgrade-wrap {
		padding: 0 0 16px;
	}

	.dwco-body {
		flex-direction: column;
		padding: 16px 16px 0;
	}

	.dwco-sidebar {
		width: 100%;
		position: static;
		display: flex;
		flex-wrap: wrap;
		flex-direction: row;
	}

	.dwco-sidebar-item {
		border-left: none;
		border-bottom: 2px solid transparent;
		flex: 0 0 auto;
		font-size: 12px;
		padding: 9px 12px;
	}

	.dwco-sidebar-item .dashicons {
		display: none;
	}

	.dwco-sidebar-item-active {
		border-bottom-color: var(--dwco-brand);
		border-left-color: transparent;
	}

	.dwco-stats-row {
		grid-template-columns: 1fr 1fr;
	}

	.dwco-content .form-table th {
		width: auto;
	}
}

/* ---------- Pro Upgrade / Active Cards ---------- */

.dwco-pro-upgrade-card {
	background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
	border-radius: 8px; padding: 28px; margin-bottom: 20px; color: #fff;
}
.dwco-pro-upgrade-card__inner { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.dwco-pro-upgrade-card__badge { display: inline-block; font-size: 11px; font-weight: 700; color: #c4b5fd; background: rgba(255,255,255,.12); padding: 3px 10px; border-radius: 10px; margin-bottom: 12px; letter-spacing: .05em; text-transform: uppercase; }
.dwco-pro-upgrade-card__title { font-size: 18px; font-weight: 700; color: #fff; margin: 0 0 12px; }
.dwco-pro-upgrade-card__features { list-style: none; margin: 0; padding: 0; font-size: 13px; line-height: 2.1; color: rgba(255,255,255,.9); }
.dwco-pro-upgrade-card__actions { flex-shrink: 0; text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.dwco-pro-upgrade-card__btn { display: inline-block; background: #fff; color: #4338ca; font-size: 13px; font-weight: 700; padding: 10px 22px; border-radius: 6px; text-decoration: none; white-space: nowrap; }
.dwco-pro-upgrade-card__btn:hover { background: #f5f3ff; color: #4338ca; text-decoration: none; }
.dwco-pro-upgrade-card__sub { font-size: 11px; color: rgba(255,255,255,.6); }
.dwco-pro-upgrade-card__sub a { color: rgba(255,255,255,.7); text-decoration: none; }
.dwco-pro-upgrade-card__sub a:hover { text-decoration: underline; color: #fff; }
.dwco-pro-feature-coming { opacity: .75; }
.dwco-pro-active-card { background: linear-gradient(135deg,#16a34a 0%,#15803d 100%); border-radius: 8px; padding: 20px 24px; margin-bottom: 20px; color: #fff; display: flex; align-items: center; gap: 16px; }
.dwco-pro-active-card__icon { font-size: 36px; color: #fff; flex-shrink: 0; }
.dwco-pro-active-card__title { font-size: 15px; font-weight: 700; }
.dwco-pro-active-card__sub { font-size: 13px; opacity: .85; margin-top: 3px; }

/* ---------- Help Tab — Pro Features & Coming Soon ---------- */

.dwco-help-pro-grid,
.dwco-help-coming-soon-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 12px;
	margin-top: 12px;
}

.dwco-help-pro-card {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-top: 3px solid var(--dwco-brand);
	border-radius: 6px;
	padding: 14px 16px;
}

.dwco-help-pro-card strong {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: #1e293b;
	margin-bottom: 4px;
}

.dwco-help-pro-card p {
	margin: 0;
	font-size: 12px;
	color: #64748b;
	line-height: 1.5;
}

.dwco-help-pro-active-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 11px;
	font-weight: 600;
	color: #16a34a;
	background: #f0fdf4;
	border: 1px solid #bbf7d0;
	padding: 2px 8px;
	border-radius: 10px;
	margin-top: 6px;
}

.dwco-help-icon-wrap {
	margin-bottom: 6px;
}

.dwco-help-icon-wrap .dashicons {
	font-size: 22px;
	width: 22px;
	height: 22px;
	color: var(--dwco-brand);
}

.dwco-help-coming-soon {
	border-top: 3px solid #f59e0b !important;
}

.dwco-help-coming-soon-badge {
	display: inline-block;
	font-size: 10px;
	font-weight: 700;
	color: #92400e;
	background: #fef3c7;
	border: 1px solid #fde68a;
	padding: 2px 8px;
	border-radius: 10px;
	letter-spacing: .04em;
	text-transform: uppercase;
	margin-top: 20px;
}

.dwco-help-coming-soon-card {
	background: #fffbeb;
	border: 1px solid #fde68a;
	border-top: 3px solid #f59e0b;
	border-radius: 6px;
	padding: 14px 16px;
}

.dwco-help-coming-soon-card strong {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: #1e293b;
	margin-bottom: 4px;
}

.dwco-help-coming-soon-card p {
	margin: 0;
	font-size: 12px;
	color: #64748b;
	line-height: 1.5;
}

.dwco-help-coming-soon-card .dwco-help-icon-wrap .dashicons {
	color: #d97706;
}

/* ── Fix Modal ──────────────────────────────────────── */

.dwco-modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 100100;
	background: rgba(0, 0, 0, 0.45);
	display: flex;
	align-items: center;
	justify-content: center;
}

.dwco-modal {
	background: #fff;
	border-radius: var(--dwco-radius);
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
	width: 480px;
	max-width: calc(100vw - 40px);
	max-height: calc(100vh - 80px);
	display: flex;
	flex-direction: column;
	animation: dwcoModalIn 0.15s ease-out;
}

@keyframes dwcoModalIn {
	from {
		opacity: 0;
		transform: translateY(-12px) scale(0.97);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.dwco-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	border-bottom: 1px solid #e2e8f0;
}

.dwco-modal-header h2 {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	color: #1e293b;
}

.dwco-modal-close {
	background: none;
	border: none;
	cursor: pointer;
	font-size: 22px;
	line-height: 1;
	color: #64748b;
	padding: 0 4px;
	transition: color 0.15s;
}

.dwco-modal-close:hover {
	color: #1e293b;
}

.dwco-modal-body {
	padding: 20px;
	overflow-y: auto;
}

.dwco-modal-product-name {
	font-size: 13px;
	color: #64748b;
	margin: 0 0 16px;
}

.dwco-modal-body label {
	display: block;
	font-weight: 500;
	font-size: 13px;
	color: #1e293b;
	margin-bottom: 6px;
}

.dwco-modal-body input[type="text"],
.dwco-modal-body input[type="number"],
.dwco-modal-body textarea {
	width: 100%;
	box-sizing: border-box;
	border: 1px solid #e2e8f0;
	border-radius: 6px;
	padding: 8px 10px;
	font-size: 13px;
	transition: border-color 0.15s;
}

.dwco-modal-body input:focus,
.dwco-modal-body textarea:focus {
	border-color: var(--dwco-brand);
	box-shadow: 0 0 0 1px var(--dwco-brand);
	outline: none;
}

.dwco-image-preview {
	margin-bottom: 10px;
	min-height: 20px;
}

.dwco-image-preview img {
	border: 1px solid #e2e8f0;
	border-radius: 6px;
}

.dwco-remove-image-btn {
	margin-left: 8px !important;
	color: #b91c1c !important;
}

.dwco-fix-error {
	margin-top: 12px;
	padding: 8px 12px;
	background: #fef2f2;
	color: #b91c1c;
	border: 1px solid #fecaca;
	border-radius: 6px;
	font-size: 13px;
}

.dwco-modal-footer {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
	padding: 14px 20px;
	border-top: 1px solid #e2e8f0;
}

.dwco-modal-footer .button-primary {
	background: var(--dwco-brand) !important;
	border-color: var(--dwco-brand-dark) !important;
	color: #fff !important;
}

.dwco-modal-footer .button-primary:hover {
	background: var(--dwco-brand-dark) !important;
}

.dwco-modal-footer .button-primary:disabled {
	opacity: 0.65;
}

.dwco-fix-btn.button-primary {
	background: var(--dwco-brand) !important;
	border-color: var(--dwco-brand-dark) !important;
	color: #fff !important;
	font-weight: 500;
}

.dwco-fix-btn.button-primary:hover {
	background: var(--dwco-brand-dark) !important;
}

@media screen and (max-width: 480px) {
	.dwco-modal {
		width: 100%;
		margin: 12px;
	}
}
