/* 360 Analytics for WooCommerce - Professional Modern Design System */
:root {
	/* Primary Brand Colors */
	--anfowo-primary: #4f46e5;
	--anfowo-primary-light: #eef2ff;
	--anfowo-primary-dark: #3730a3;

	/* Functional Colors */
	--anfowo-success: #10b981;
	--anfowo-success-light: #ecfdf5;
	--anfowo-warning: #f59e0b;
	--anfowo-warning-light: #fff7ed;
	--anfowo-danger: #ef4444;
	--anfowo-danger-light: #fef2f2;

	/* Layout & Neutrals */
	--anfowo-bg: #f3f4f6;
	--anfowo-header-bg: #1e293b;
	--anfowo-card-bg: #ffffff;
	--anfowo-border: #e5e7eb;
	--anfowo-border-hover: #d1d5db;

	/* Typography */
	--anfowo-text-main: #111827;
	--anfowo-text-muted: #6b7280;
	--anfowo-text-inverse: #ffffff;

	/* Shadows & Depth */
	--anfowo-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
	--anfowo-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
	--anfowo-shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
	--anfowo-radius: 12px;
	--anfowo-radius-lg: 16px;
}

/* Notices anchor: collapses to zero when WordPress injects no notices */
.anfowo-notices-wrap {
	margin: 0;
	padding: 0;
	min-height: 0;
}

.anfowo-notices-wrap:empty,
.anfowo-notices-wrap h2:only-child {
	display: none;
}

.anfowo-wrap {
	margin: 20px 20px 20px 0;
	font-family: 'Inter', -apple-system, system-ui, sans-serif;
	color: var(--anfowo-text-main);
	background-color: var(--anfowo-bg);
	border-radius: var(--anfowo-radius);
	padding: 0;
	/* overflow: hidden removed — it was clipping WordPress admin notices */
	-webkit-font-smoothing: antialiased;
}

/* Header Section Refined */
.anfowo-header {
	background: #1e1b2e;
	padding: 24px 32px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	color: white;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.anfowo-header h1 {
	margin: 0;
	color: white;
	font-size: 24px;
	font-weight: 700;
	letter-spacing: -0.01em;
}

.anfowo-controls {
	display: flex;
	gap: 12px;
	align-items: center;
}

/* Elite Inputs */
.anfowo-header select,
.anfowo-header input[type="date"] {
	background: white;
	border: 1px solid #d1d5db;
	color: #374151;
	padding: 8px 12px;
	border-radius: 6px;
	outline: none;
	font-size: 14px;
	cursor: pointer;
}

.anfowo-btn-export-alt {
	background: #4f46e5;
	color: white;
	border: none;
	padding: 10px 20px;
	border-radius: 6px;
	font-weight: 600;
	font-size: 14px;
	cursor: pointer;
	transition: background 0.2s;
}

.anfowo-btn-export-alt:hover {
	background: #4338ca;
}

/* Navigation */
.anfowo-nav {
	background: white;
	padding: 0 32px;
	border-bottom: 1px solid var(--anfowo-border);
	display: flex;
	gap: 32px;
}

.anfowo-nav-item {
	padding: 16px 0;
	color: #6b7280;
	font-weight: 500;
	font-size: 14px;
	cursor: pointer;
	position: relative;
	transition: color 0.2s;
}

.anfowo-nav-item:hover {
	color: #111827;
}

.anfowo-nav-item.active {
	color: #4f46e5;
}

.anfowo-nav-item.active::after {
	content: '';
	position: absolute;
	bottom: -1px;
	left: 0;
	right: 0;
	height: 2px;
	background: #4f46e5;
}

/* Spinner */
.anfowo-loader-placeholder {
	display: flex;
	justify-content: center;
	align-items: center;
	min-height: 400px;
}

.anfowo-spinner {
	width: 40px;
	height: 40px;
	border: 3px solid #e5e7eb;
	border-top-color: #4f46e5;
	border-radius: 50%;
	animation: anfowo-spin 1s linear infinite;
}

@keyframes anfowo-spin {
	to {
		transform: rotate(360deg);
	}
}

.anfowo-faded {
	opacity: 0.5;
	pointer-events: none;
}

/* KPI Cards - Refined */
.anfowo-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 20px;
	padding: 32px;
}

.anfowo-card {
	background: white;
	padding: 24px;
	border-radius: var(--anfowo-radius-lg);
	border: 1px solid var(--anfowo-border);
	box-shadow: var(--anfowo-shadow-sm);
	transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s;
}

.anfowo-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--anfowo-shadow-lg);
	border-color: var(--anfowo-primary);
}

.anfowo-card-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	margin-bottom: 20px;
}

.anfowo-card-title {
	color: var(--anfowo-text-muted);
	font-size: 14px;
	font-weight: 600;
}

.anfowo-card-icon {
	width: 44px;
	height: 44px;
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 22px;
}

.anfowo-card-value {
	font-size: 30px;
	font-weight: 800;
	color: var(--anfowo-text-main);
	letter-spacing: -0.02em;
	line-height: 1.2;
	word-wrap: break-word;
}

.anfowo-card-trend {
	display: flex;
	align-items: center;
	gap: 4px;
	font-size: 12px;
	font-weight: 600;
	margin-top: 8px;
}

.trend-up {
	color: var(--anfowo-success);
}

.trend-down {
	color: var(--anfowo-danger);
}

/* Chart Section Elite */
.anfowo-chart-section {
	padding: 0 32px 32px 32px;
}

.anfowo-chart-box {
	background: white;
	border-radius: var(--anfowo-radius-lg);
	border: 1px solid var(--anfowo-border);
	padding: 28px;
	box-shadow: var(--anfowo-shadow-sm);
	margin-bottom: 24px;
	margin-top: 30px;
}

.anfowo-chart-box h2 {
	font-size: 18px;
	font-weight: 700;
	margin-top: 0;
	margin-bottom: 24px;
	display: flex;
	align-items: center;
	gap: 10px;
}

.anfowo-chart-container {
	position: relative;
	width: 100%;
	max-width: 100%;
	margin: 0 auto;
}

.anfowo-full-chart {
	height: 350px !important;
}

.anfowo-half-chart {
	height: 260px !important;
}

/* Skeleton Loading State */
.anfowo-skeleton {
	background: #e5e7eb;
	background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
	background-size: 200% 100%;
	animation: anfowo-shimmer 1.5s infinite;
	border-radius: 4px;
}

@keyframes anfowo-shimmer {
	0% {
		background-position: 200% 0;
	}

	100% {
		background-position: -200% 0;
	}
}

/* Table Design - Elite */
.anfowo-content-table {
	background: white;
	border-radius: var(--anfowo-radius-lg);
	border: 1px solid var(--anfowo-border);
	overflow: hidden;
	margin: 0 32px 32px 32px;
}

.anfowo-data-table {
	width: 100%;
	border-collapse: collapse;
}

.anfowo-data-table th {
	background: #f9fafb;
	padding: 14px 20px;
	text-align: left;
	font-weight: 600;
	font-size: 12px;
	color: var(--anfowo-text-muted);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	border-bottom: 1px solid var(--anfowo-border);
}

.anfowo-data-table td {
	padding: 16px 20px;
	border-bottom: 1px solid var(--anfowo-border);
	font-size: 14px;
}

.anfowo-data-table tr:last-child td {
	border-bottom: none;
}

.anfowo-data-table tr:hover {
	background: #fcfdfe;
}

/* Badge System Refined */
.anfowo-badge {
	padding: 4px 10px;
	border-radius: 6px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
}

.badge-completed {
	background: var(--anfowo-success-light);
	color: var(--anfowo-success);
	border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-processing {
	background: var(--anfowo-primary-light);
	color: var(--anfowo-primary);
	border: 1px solid rgba(79, 70, 229, 0.2);
}

.badge-on-hold {
	background: var(--anfowo-warning-light);
	color: var(--anfowo-warning);
	border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-cancelled,
.badge-refunded {
	background: var(--anfowo-danger-light);
	color: var(--anfowo-danger);
	border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Animation Overlay */
.anfowo-container {
	transition: opacity 0.3s ease;
}

.anfowo-faded {
	opacity: 0.4;
	pointer-events: none;
}

/* Orders List View Styles */
.anfowo-orders-list {
	padding: 0 32px 32px 32px;
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.anfowo-order-card {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 4px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	color: #334155;
}

.anfowo-order-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 16px 20px;
	border-bottom: 1px solid #f1f5f9;
}

.anfowo-order-header h2 {
	margin: 0;
	font-size: 20px;
	font-weight: 700;
	color: #0f172a;
}

.anfowo-order-actions {
	display: flex;
	align-items: center;
	gap: 16px;
}

.anfowo-order-status {
	background: #cbd5e1;
	color: #334155;
	padding: 6px 16px;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 500;
}

.anfowo-status-completed {
	background: #dbeafe;
	color: #1e3a8a;
}

.anfowo-status-processing {
	background: #dcfce7;
	color: #166534;
}

.anfowo-status-on-hold {
	background: #fef9c3;
	color: #854d0e;
}

.anfowo-status-cancelled,
.anfowo-status-refunded {
	background: #fee2e2;
	color: #991b1b;
}

.anfowo-order-close {
	background: none;
	border: none;
	font-size: 20px;
	font-weight: bold;
	color: #64748b;
	cursor: pointer;
	padding: 0;
	line-height: 1;
	border-left: 1px solid #e2e8f0;
	padding-left: 16px;
}

.anfowo-order-close:hover {
	color: #0f172a;
}

.anfowo-order-body {
	padding: 24px 20px;
}

.anfowo-order-billing h3 {
	margin: 0 0 12px 0;
	font-size: 18px;
	font-weight: 600;
	color: #0f172a;
}

.anfowo-order-billing p {
	margin: 0 0 24px 0;
	color: #64748b;
	font-size: 15px;
}

.anfowo-order-table {
	width: 100%;
	border-collapse: collapse;
}

.anfowo-order-table th {
	text-align: left;
	padding: 12px 0;
	font-weight: 700;
	color: #334155;
	border-bottom: 1px solid #f1f5f9;
}

.anfowo-order-table th:nth-child(2),
.anfowo-order-table td:nth-child(2) {
	text-align: center;
}

.anfowo-order-table th:nth-child(3),
.anfowo-order-table td:nth-child(3) {
	text-align: right;
}

.anfowo-order-table td {
	padding: 16px 0;
	border-bottom: 1px solid #f1f5f9;
	color: #475569;
}

.anfowo-order-table tbody tr:last-child td {
	border-bottom: none;
}

.anfowo-product-name {
	color: #64748b;
}

.anfowo-order-footer {
	padding: 16px 20px;
	background: #f8fafc;
	border-top: 1px solid #f1f5f9;
	display: flex;
	justify-content: flex-end;
}

.anfowo-btn-edit {
	background: #2563eb;
	color: #ffffff;
	text-decoration: none;
	padding: 8px 24px;
	border-radius: 4px;
	font-weight: 500;
	transition: background 0.2s;
}

.anfowo-btn-edit:hover,
.anfowo-btn-edit:focus {
	background: #1d4ed8;
	color: #ffffff;
}

/* Taxonomy Tab Layout and Styles */
.anfowo-taxonomy-tabs-container {
	margin: 24px 32px 0 32px;
}

.anfowo-tax-nav {
	display: inline-flex;
	background: #f1f5f9;
	padding: 4px;
	border-radius: 8px;
	list-style: none;
	margin: 0;
	border: 1px solid var(--anfowo-border);
}

.anfowo-tax-nav-item {
	text-decoration: none;
	padding: 8px 16px;
	display: block;
	color: var(--anfowo-text-muted) !important;
	font-weight: 600;
	font-size: 13px;
	border-radius: 6px;
	transition: all 0.2s ease-in-out;
}

.anfowo-tax-nav-item:hover {
	color: var(--anfowo-text-main) !important;
	background: rgba(255, 255, 255, 0.5);
}

.anfowo-tax-nav-item.active {
	background: #ffffff;
	color: var(--anfowo-primary) !important;
	box-shadow: var(--anfowo-shadow-sm);
}

/* Taxonomy KPI Sub-Grid */
.anfowo-taxonomy-grid {
	margin-top: 0 !important;
	padding-top: 24px !important;
	padding-bottom: 0 !important;
}

/* Chart and Breakdown Wrapper */
.anfowo-taxonomy-chart-wrapper {
	display: flex;
	gap: 40px;
	align-items: center;
	flex-wrap: wrap;
}

.anfowo-taxonomy-chart-canvas-box {
	flex: 1 1 320px;
	max-width: 420px !important;
	margin: 0 !important;
}

.anfowo-taxonomy-breakdown {
	flex: 1 1 300px;
}

.breakdown-title {
	font-size: 13px;
	font-weight: 700;
	color: var(--anfowo-text-muted);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin-top: 0;
	margin-bottom: 16px;
}

.breakdown-list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.breakdown-info {
	display: flex;
	justify-content: space-between;
	font-size: 13px;
	font-weight: 600;
	margin-bottom: 6px;
}

.breakdown-name {
	color: var(--anfowo-text-main);
}

.breakdown-value {
	color: var(--anfowo-text-muted);
}

.breakdown-percent {
	color: var(--anfowo-text-main);
	font-weight: 700;
}

.breakdown-progress-bg {
	background: #f1f5f9;
	height: 6px;
	border-radius: 3px;
	overflow: hidden;
}

.breakdown-progress-bar {
	height: 100%;
	border-radius: 3px;
	transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}