/**
 * Authority Mailer Admin Design System
 *
 * Complete design system with design tokens, components, and utilities.
 *
 * @package Authority_Mailer
 * @since   1.0.0
 */

/* ===================================================================
   CSS Variables / Design Tokens
   =================================================================== */

:root {
	/* Brand Colors - Premium Palette */
	--am-primary: #6366F1;          /* Rich indigo - Primary brand color */
	--am-primary-hover: #4F46E5;    /* Darker indigo for hover states */
	--am-primary-light: #818CF8;    /* Lighter indigo */
	--am-accent: #8B5CF6;           /* Purple accent */

	/* Semantic Colors */
	--am-success: #10B981;          /* Green */
	--am-success-light: #D1FAE5;    /* Light green background */
	--am-warning: #F59E0B;          /* Amber */
	--am-warning-light: #FEF3C7;    /* Light amber background */
	--am-error: #EF4444;            /* Red */
	--am-error-light: #FEE2E2;      /* Light red background */
	--am-info: #3B82F6;             /* Blue */
	--am-info-light: #DBEAFE;       /* Light blue background */

	/* Blue Scale (for template editor) */
	--am-blue-50: #EFF6FF;          /* Lightest blue */
	--am-blue-100: #DBEAFE;         /* Very light blue */
	--am-blue-200: #BFDBFE;         /* Light blue */
	--am-blue-800: #1E40AF;         /* Dark blue */
	--am-blue-900: #1E3A8A;         /* Darkest blue */

	/* Gray Scale */
	--am-gray-50: #F9FAFB;
	--am-gray-100: #F3F4F6;
	--am-gray-200: #E5E7EB;
	--am-gray-300: #D1D5DB;
	--am-gray-border: #D1D5DB;      /* Visible borders */
	--am-gray-400: #9CA3AF;
	--am-gray-500: #6B7280;
	--am-gray-600: #4B5563;
	--am-gray-700: #374151;
	--am-gray-800: #1F2937;
	--am-gray-900: #111827;

	/* Spacing Scale (4px base) */
	--am-space-1: 0.25rem;   /* 4px */
	--am-space-2: 0.5rem;    /* 8px */
	--am-space-3: 0.75rem;   /* 12px */
	--am-space-4: 1rem;      /* 16px */
	--am-space-5: 1.25rem;   /* 20px */
	--am-space-6: 1.5rem;    /* 24px */
	--am-space-8: 2rem;      /* 32px */
	--am-space-10: 2.5rem;   /* 40px */
	--am-space-12: 3rem;     /* 48px */
	--am-space-16: 4rem;     /* 64px */

	/* Border Radius */
	--am-radius-sm: 0.375rem;   /* 6px */
	--am-radius-md: 0.5rem;     /* 8px */
	--am-radius-lg: 0.75rem;    /* 12px */
	--am-radius-xl: 1rem;       /* 16px */
	--am-radius-full: 9999px;   /* Pill shape */

	/* Typography */
	--am-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--am-font-mono: "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

	/* Font Sizes */
	--am-text-xs: 0.75rem;      /* 12px */
	--am-text-sm: 0.875rem;     /* 14px */
	--am-text-base: 1rem;       /* 16px */
	--am-text-lg: 1.125rem;     /* 18px */
	--am-text-xl: 1.25rem;      /* 20px */
	--am-text-2xl: 1.5rem;      /* 24px */
	--am-text-3xl: 1.875rem;    /* 30px */

	/* Font Weights */
	--am-weight-normal: 400;
	--am-weight-medium: 500;
	--am-weight-semibold: 600;
	--am-weight-bold: 700;

	/* Shadows */
	--am-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
	--am-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
	--am-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
	--am-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

	/* Transitions */
	--am-transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
	--am-transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
	--am-transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

	/* Z-index Scale */
	--am-z-base: 0;
	--am-z-dropdown: 1000;
	--am-z-sticky: 1020;
	--am-z-fixed: 1030;
	--am-z-modal-backdrop: 1040;
	--am-z-modal: 1050;
	--am-z-popover: 1060;
	--am-z-tooltip: 1070;
}

/* ===================================================================
   Grid System
   =================================================================== */

.am-grid {
	display: grid;
	gap: var(--am-space-6);
}

.am-grid-cols-1 {
	grid-template-columns: repeat(1, minmax(0, 1fr));
}

.am-grid-cols-2 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.am-grid-cols-3 {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.am-grid-cols-4 {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Responsive grid */
@media (min-width: 768px) {
	.am-grid-md-2 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.am-grid-md-3 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (min-width: 1024px) {
	.am-grid-lg-3 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.am-grid-lg-4 {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

/* ===================================================================
   Card Component
   =================================================================== */

.am-card {
	background: #fff;
	border: 2px solid var(--am-gray-300);
	border-radius: var(--am-radius-lg);
	padding: var(--am-space-6);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	margin-bottom: 10px;
}

.am-card-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: var(--am-space-4);
	padding-bottom: var(--am-space-4);
	border-bottom: 1px solid var(--am-gray-200);
}

.am-card-title {
	font-size: var(--am-text-lg);
	font-weight: var(--am-weight-semibold);
	color: var(--am-gray-900);
	margin: 0;
}

.am-card-body {
	color: var(--am-gray-700);
}

.am-card-footer {
	margin-top: var(--am-space-4);
	padding-top: var(--am-space-4);
	border-top: 1px solid var(--am-gray-200);
}

/* Stat Card with Gradient Border */
.am-stat-card {
	background: #fff;
	border: 2px solid var(--am-gray-300);
	border-radius: var(--am-radius-lg);
	padding: var(--am-space-4);
	position: relative;
	overflow: hidden;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.am-stat-card::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 5px;
	background: linear-gradient(90deg, var(--am-primary) 0%, var(--am-accent) 100%);
	border-radius: var(--am-radius-lg) var(--am-radius-lg) 0 0;
}

/* Stat Card Variants with Colored Backgrounds */
.am-stat-card:nth-child(1) {
	background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
	border-color: rgba(102, 126, 234, 0.2);
}

.am-stat-card.am-stat-success {
	border-color: rgba(16, 185, 129, 0.2);
	background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(5, 150, 105, 0.08) 100%);
}

.am-stat-card.am-stat-success::before {
	background: linear-gradient(90deg, var(--am-success) 0%, #059669 100%);
}

.am-stat-card.am-stat-danger {
	border-color: rgba(239, 68, 68, 0.2);
	background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(220, 38, 38, 0.08) 100%);
}

.am-stat-card.am-stat-danger::before {
	background: linear-gradient(90deg, var(--am-error) 0%, #DC2626 100%);
}

.am-stat-card.am-stat-warning {
	border-color: rgba(245, 158, 11, 0.2);
	background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(217, 119, 6, 0.08) 100%);
}

.am-stat-card.am-stat-warning::before {
	background: linear-gradient(90deg, var(--am-warning) 0%, #D97706 100%);
}

.am-stat-label {
	display: block;
	font-size: 13px;
	font-weight: var(--am-weight-medium);
	color: var(--am-gray-600);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin-bottom: var(--am-space-2);
}

.am-stat-value {
	display: block;
	font-size: 28px;
	font-weight: var(--am-weight-bold);
	color: var(--am-gray-900);
	line-height: 1.2;
	margin: var(--am-space-2) 0;
}

.am-stat-trend {
	display: inline-flex;
	align-items: center;
	font-size: var(--am-text-sm);
	font-weight: var(--am-weight-medium);
	margin-top: var(--am-space-2);
}

.am-stat-trend.up {
	color: var(--am-success);
}

.am-stat-trend.down {
	color: var(--am-error);
}

/* Ensure equal height for all stat cards */
.am-dashboard-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: var(--am-space-4);
	align-items: stretch; /* Ensure all cards stretch to equal height */
}

.am-stat-card {
	display: flex;
	flex-direction: column;
	min-height: 160px; /* Minimum height for consistency */
}

/* Helper text for stat cards */
.am-stat-helper {
	display: block;
	font-size: 12px;
	color: var(--am-gray-500);
	margin-top: var(--am-space-2);
	font-style: italic;
}

/* Lighter provider connected banner */
.am-provider-connected-lighter {
	background: linear-gradient(135deg, rgba(99, 102, 241, 0.03) 0%, rgba(139, 92, 246, 0.03) 100%);
}

.am-provider-icon-lighter {
	background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
}

.am-provider-icon-lighter svg {
	stroke: var(--am-primary);
}

.am-badge-success-light {
	background-color: rgba(16, 185, 129, 0.1);
	color: var(--am-success);
	border: 1px solid rgba(16, 185, 129, 0.2);
}

.am-last-email-time {
	font-weight: var(--am-weight-semibold);
	color: var(--am-gray-700);
}

/* Non-blocking pro feature overlay for stat cards */
.am-stat-lock-nonblocking {
	position: static;
	background: none;
	padding: 0;
	display: flex;
	justify-content: flex-end;
	margin-bottom: var(--am-space-2);
}

.am-stat-lock-text-inline {
	display: inline-block;
	font-size: 11px;
	font-weight: var(--am-weight-semibold);
	padding: 2px 8px;
	background-color: var(--am-warning-light);
	color: var(--am-warning);
	border-radius: 4px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.am-stat-pro-feature {
	opacity: 0.95;
}

/* ===================================================================
   Button Component
   =================================================================== */

.am-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--am-space-2);
	padding: var(--am-space-2) var(--am-space-4);
	font-size: var(--am-text-sm);
	font-weight: var(--am-weight-medium);
	line-height: 1.5;
	text-decoration: none;
	border: 1px solid transparent;
	border-radius: var(--am-radius-md);
	cursor: pointer;
	transition: all var(--am-transition-fast);
}

.am-btn:focus {
	outline: 2px solid var(--am-primary);
	outline-offset: 2px;
}

.am-btn-primary {
	background: var(--am-primary);
	color: #fff;
	border-color: var(--am-primary);
}

.am-btn-primary:hover {
	background: var(--am-primary-hover);
	border-color: var(--am-primary-hover);
	color: #fff;
}

.am-btn-secondary {
	background: #fff;
	color: var(--am-gray-700);
	border-color: var(--am-gray-300);
}

.am-btn-secondary:hover {
	background: var(--am-gray-50);
	border-color: var(--am-gray-400);
	color: var(--am-gray-900);
}

.am-btn-success {
	background: var(--am-success);
	color: #fff;
	border-color: var(--am-success);
}

.am-btn-success:hover {
	background: #059669;
	color: #fff;
}

.am-btn-danger {
	background: var(--am-error);
	color: #fff;
	border-color: var(--am-error);
}

.am-btn-danger:hover {
	background: #DC2626;
	color: #fff;
}

.am-btn-sm {
	padding: var(--am-space-1) var(--am-space-3);
	font-size: var(--am-text-xs);
}

.am-btn-lg {
	padding: var(--am-space-3) var(--am-space-6);
	font-size: var(--am-text-base);
}

.am-btn:disabled,
.am-btn[disabled] {
	opacity: 0.5;
	cursor: not-allowed;
}

/* ===================================================================
   Badge Component
   =================================================================== */

.am-badge {
	display: inline-flex;
	align-items: center;
	gap: var(--am-space-1);
	padding: var(--am-space-1) var(--am-space-2);
	font-size: var(--am-text-xs);
	font-weight: var(--am-weight-medium);
	line-height: 1;
	border-radius: var(--am-radius-full);
	white-space: nowrap;
}

.am-badge-success {
	background: var(--am-success-light);
	color: #065F46;
}

.am-badge-warning {
	background: var(--am-warning-light);
	color: #92400E;
}

.am-badge-error {
	background: var(--am-error-light);
	color: #991B1B;
}

.am-badge-info {
	background: var(--am-info-light);
	color: #1E40AF;
}

.am-badge-gray {
	background: var(--am-gray-100);
	color: var(--am-gray-700);
}

/* Status indicators with dots */
.am-badge-dot::before {
	content: "";
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: currentColor;
}

/* ===================================================================
   Table Component
   =================================================================== */

.am-table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	background: #fff;
	border: 1px solid var(--am-gray-200);
	border-radius: var(--am-radius-lg);
	overflow: hidden;
}

.am-table thead {
	background: var(--am-gray-50);
}

.am-table th {
	padding: var(--am-space-3) var(--am-space-4);
	text-align: left;
	font-size: var(--am-text-xs);
	font-weight: var(--am-weight-semibold);
	color: var(--am-gray-700);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	border-bottom: 1px solid var(--am-gray-200);
}

.am-table td {
	padding: var(--am-space-4);
	font-size: var(--am-text-sm);
	color: var(--am-gray-900);
	border-bottom: 1px solid var(--am-gray-200);
}

.am-table tbody tr:last-child td {
	border-bottom: none;
}

.am-table tbody tr:hover {
	background: var(--am-gray-50);
}

/* ===================================================================
   Modal Component
   =================================================================== */

.am-modal-backdrop {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
	z-index: var(--am-z-modal-backdrop);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--am-space-4);
	animation: am-fade-in var(--am-transition-base);
}

.am-modal {
	background: #fff;
	border-radius: var(--am-radius-xl);
	max-width: 640px;
	width: 100%;
	max-height: 90vh;
	overflow: hidden;
	box-shadow: var(--am-shadow-xl);
	z-index: var(--am-z-modal);
	animation: am-scale-up var(--am-transition-base);
}

.am-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: var(--am-space-6);
	border-bottom: 1px solid var(--am-gray-200);
}

.am-modal-title {
	font-size: var(--am-text-xl);
	font-weight: var(--am-weight-semibold);
	color: var(--am-gray-900);
	margin: 0;
}

.am-modal-body {
	padding: var(--am-space-6);
	overflow-y: auto;
	max-height: calc(90vh - 140px);
}

.am-modal-footer {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: var(--am-space-3);
	padding: var(--am-space-6);
	border-top: 1px solid var(--am-gray-200);
	background: var(--am-gray-50);
}

/* ===================================================================
   Loading States
   =================================================================== */

.am-loading {
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 2px solid var(--am-gray-200);
	border-top-color: var(--am-primary);
	border-radius: 50%;
	animation: am-spin 0.6s linear infinite;
}

.am-loading-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(255, 255, 255, 0.8);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: var(--am-z-fixed);
}

/* ===================================================================
   Form Components
   =================================================================== */

.am-form-group {
	margin-bottom: var(--am-space-4);
}

.am-label {
	display: block;
	font-size: var(--am-text-sm);
	font-weight: var(--am-weight-medium);
	color: var(--am-gray-700);
	margin-bottom: var(--am-space-2);
}

.am-input,
.am-textarea,
.am-select {
	display: block;
	width: 100%;
	padding: var(--am-space-2) var(--am-space-3);
	font-size: var(--am-text-sm);
	line-height: 1.5;
	color: var(--am-gray-900);
	background: #fff;
	border: 1px solid var(--am-gray-300);
	border-radius: var(--am-radius-md);
	transition: all var(--am-transition-fast);
}

.am-input:focus,
.am-textarea:focus,
.am-select:focus {
	outline: none;
	border-color: var(--am-primary);
	box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.am-textarea {
	resize: vertical;
	min-height: 100px;
}

.am-help-text {
	display: block;
	font-size: var(--am-text-xs);
	color: var(--am-gray-500);
	margin-top: var(--am-space-1);
}

/* Template Form Specific Styles */
.am-form-label {
	display: block;
	font-size: 14px;
	font-weight: 600;
	color: var(--am-gray-700);
	margin-bottom: 8px;
}

.am-form-input {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid var(--am-gray-300);
	border-radius: var(--am-radius-sm);
	font-size: 14px;
	color: var(--am-gray-900);
	background: #fff;
	transition: all 0.2s ease;
}

.am-form-input:focus {
	outline: none;
	border-color: var(--am-primary);
	box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ===================================================================
   Utility Classes
   =================================================================== */

/* Spacing */
.am-mt-0 { margin-top: 0 !important; }
.am-mt-4 { margin-top: var(--am-space-4) !important; }
.am-mt-6 { margin-top: var(--am-space-6) !important; }
.am-mb-4 { margin-bottom: var(--am-space-4) !important; }
.am-mb-6 { margin-bottom: var(--am-space-6) !important; }

/* Text Alignment */
.am-text-left { text-align: left !important; }
.am-text-center { text-align: center !important; }
.am-text-right { text-align: right !important; }

/* Colors */
.am-text-gray { color: var(--am-gray-600) !important; }
.am-text-primary { color: var(--am-primary) !important; }
.am-text-success { color: var(--am-success) !important; }
.am-text-error { color: var(--am-error) !important; }

/* Display */
.am-flex { display: flex !important; }
.am-inline-flex { display: inline-flex !important; }
.am-grid { display: grid !important; }
.am-hidden { display: none !important; }

/* Flexbox Utilities */
.am-items-center { align-items: center !important; }
.am-justify-between { justify-content: space-between !important; }
.am-justify-center { justify-content: center !important; }
.am-gap-2 { gap: var(--am-space-2) !important; }
.am-gap-4 { gap: var(--am-space-4) !important; }

/* ===================================================================
   Animations
   =================================================================== */

@keyframes am-spin {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(360deg);
	}
}

@keyframes am-fade-in {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

@keyframes am-scale-up {
	from {
		opacity: 0;
		transform: scale(0.95);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

@keyframes am-slide-down {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ===================================================================
   Responsive Breakpoints
   =================================================================== */

/* Mobile: < 480px (default styles) */

/* Tablet: 480px - 768px */
@media (min-width: 480px) {
	.am-grid-sm-2 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Desktop: 768px - 1024px */
@media (min-width: 768px) {
	.am-hidden-md {
		display: none !important;
	}

	.am-flex-md {
		display: flex !important;
	}
}

/* Large: > 1024px */
@media (min-width: 1024px) {
	.am-hidden-lg {
		display: none !important;
	}
}

/* ===================================================================
   Print Styles
   =================================================================== */

@media print {
	.am-no-print {
		display: none !important;
	}

	.am-card,
	.am-stat-card {
		break-inside: avoid;
	}
}

/* ===================================================================
   Width Utilities
   =================================================================== */

.am-w-full { width: 100% !important; }
.am-max-w-40 { max-width: 40px !important; }
.am-max-w-120 { max-width: 120px !important; }
.am-max-w-130 { max-width: 130px !important; }
.am-max-w-140 { max-width: 140px !important; }
.am-max-w-150 { max-width: 150px !important; }
.am-max-w-180 { max-width: 180px !important; }
.am-max-w-200 { max-width: 200px !important; }

/* ===================================================================
   Text Utilities
   =================================================================== */

.am-text-ellipsis {
overflow: hidden !important;
text-overflow: ellipsis !important;
white-space: nowrap !important;
display: block !important;
}

.am-text-bold { font-weight: var(--am-weight-semibold) !important; }
.am-text-medium { font-weight: var(--am-weight-medium) !important; }

/* ===================================================================
   Display None (for modals)
   =================================================================== */

.am-modal-hidden {
display: none;
}

/* ===================================================================
   Email Log Detail View
   =================================================================== */

.am-detail-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: var(--am-space-6);
margin-bottom: var(--am-space-6);
}

@media (max-width: 768px) {
.am-detail-grid {
grid-template-columns: 1fr;
}
}

.am-detail-field {
display: flex;
flex-direction: column;
gap: var(--am-space-2);
}

.am-detail-label {
display: block;
font-size: var(--am-text-xs);
font-weight: var(--am-weight-semibold);
color: var(--am-gray-500);
text-transform: uppercase;
letter-spacing: 0.05em;
}

.am-detail-value {
font-size: var(--am-text-sm);
color: var(--am-gray-900);
}

/* ===================================================================
   Code Block Styles
   =================================================================== */

.am-code-block {
background: var(--am-gray-900);
color: #10B981;
border-radius: var(--am-radius-md);
padding: var(--am-space-4);
font-family: var(--am-font-mono);
font-size: var(--am-text-xs);
line-height: 1.6;
overflow: auto;
word-wrap: break-word;
overflow-wrap: break-word;
}

.am-code-block pre {
margin: 0;
white-space: pre-wrap;
word-break: break-word;
color: #10B981;
}

.am-email-body-preview {
background: var(--am-gray-50);
border: 1px solid var(--am-gray-200);
border-radius: var(--am-radius-md);
padding: var(--am-space-4);
overflow: auto;
word-wrap: break-word;
overflow-wrap: break-word;
}

.am-error-block {
background: var(--am-error-light);
border: 1px solid var(--am-error);
border-radius: var(--am-radius-md);
padding: var(--am-space-4);
margin-top: var(--am-space-6);
}

.am-error-block pre {
margin: 0;
white-space: pre-wrap;
word-break: break-word;
color: #991B1B;
font-size: var(--am-text-sm);
}

.am-error-label {
display: block;
font-size: var(--am-text-xs);
font-weight: var(--am-weight-semibold);
color: #991B1B;
text-transform: uppercase;
letter-spacing: 0.05em;
margin-bottom: var(--am-space-2);
}

/* ===================================================================
   Dashboard Stats Grid
   =================================================================== */

.am-dashboard-stats {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 20px;
margin: 10px 0;
}

@media (max-width: 1200px) {
.am-dashboard-stats {
grid-template-columns: repeat(2, 1fr);
}
}

@media (max-width: 768px) {
.am-dashboard-stats {
grid-template-columns: 1fr;
}
}

/* ===================================================================
   Chart Components
   =================================================================== */

.am-chart-container {
background: white;
border: 2px solid var(--am-gray-300);
border-radius: var(--am-radius-lg);
padding: var(--am-space-6);
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
margin-bottom: var(--am-space-6);
}

.am-chart-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: var(--am-space-6);
padding-bottom: var(--am-space-4);
border-bottom: 1px solid var(--am-gray-200);
}

.am-chart-title {
font-size: var(--am-text-xl);
font-weight: var(--am-weight-semibold);
color: var(--am-gray-900);
margin: 0;
}

.am-chart-filters {
display: flex;
gap: var(--am-space-3);
align-items: center;
}

.am-chart-wrapper {
min-height: 300px;
position: relative;
}

/* ===================================================================
   Empty State
   =================================================================== */

.am-empty-state {
text-align: center;
padding: var(--am-space-12);
color: var(--am-gray-500);
}

.am-empty-state-icon {
width: 64px;
height: 64px;
margin: 0 auto var(--am-space-6);
opacity: 0.3;
}

.am-empty-state-title {
font-size: var(--am-text-xl);
font-weight: var(--am-weight-semibold);
color: var(--am-gray-700);
margin: 0 0 var(--am-space-3);
}

.am-empty-state-description {
font-size: var(--am-text-base);
color: var(--am-gray-500);
margin: 0;
}

/* ===================================================================
   Loading States
   =================================================================== */

.am-loading-spinner {
width: 40px;
height: 40px;
border: 4px solid var(--am-gray-200);
border-top-color: var(--am-primary);
border-radius: 50%;
animation: spin 1s linear infinite;
}

/* ===================================================================
   Animations
   =================================================================== */

.am-animate-in {
animation: slideInUp 0.4s ease-out;
}

.am-fade-in {
animation: fadeIn 0.3s ease-in;
}

.am-pulse {
animation: pulse 2s ease-in-out infinite;
}

.am-spin {
animation: spin 1s linear infinite;
}

@keyframes slideInUp {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}

@keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}

@keyframes pulse {
0%, 100% {
opacity: 1;
}
50% {
opacity: 0.5;
}
}

@keyframes spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}

/* ===================================================================
   Additional Spacing Utilities
   =================================================================== */

.am-mt-lg { margin-top: var(--am-space-8) !important; }
.am-mt-md { margin-top: var(--am-space-6) !important; }
.am-mt-sm { margin-top: var(--am-space-4) !important; }

.am-mb-lg { margin-bottom: var(--am-space-8) !important; }
.am-mb-md { margin-bottom: var(--am-space-6) !important; }
.am-mb-sm { margin-bottom: var(--am-space-4) !important; }

/* ===================================================================
   Additional Flexbox Utilities
   =================================================================== */

.am-flex-center {
display: flex;
align-items: center;
justify-content: center;
}

.am-gap-lg { gap: var(--am-space-6) !important; }
.am-gap-md { gap: var(--am-space-4) !important; }
.am-gap-sm { gap: var(--am-space-2) !important; }

/* ===================================================================
   Badge Danger Variant (was missing)
   =================================================================== */

.am-badge-danger {
background: var(--am-error-light);
color: var(--am-error);
}

/* ===================================================================
   Stat Icon (for dashboard stats)
   =================================================================== */

.am-stat-icon {
width: 40px;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
background: linear-gradient(135deg, var(--am-primary), var(--am-accent));
border-radius: var(--am-radius-md);
margin-bottom: var(--am-space-3);
font-size: 24px;
color: #fff;
box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.am-stat-icon svg {
width: 24px;
height: 24px;
}

.am-stat-card.am-stat-success .am-stat-icon {
background: linear-gradient(135deg, var(--am-success), #059669);
box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.am-stat-card.am-stat-danger .am-stat-icon {
background: linear-gradient(135deg, var(--am-error), #DC2626);
box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.am-stat-card.am-stat-warning .am-stat-icon {
background: linear-gradient(135deg, var(--am-warning), #D97706);
box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}
