:root {
				--font-body: 'Space Grotesk', 'Segoe UI', Arial, sans-serif;
				--font-display: 'Space Grotesk', 'Segoe UI', Arial, sans-serif;
				--font-mono: 'IBM Plex Mono', 'SF Mono', Menlo, monospace;
				--bg-primary: #f7f4ef;
				--bg-secondary: #ffffff;
				--bg-card: rgba(255, 255, 255, 0.82);
				--bg-card-solid: #ffffff;
				--bg-hover: rgba(0, 0, 0, 0.04);
				--bg-input: rgba(0, 0, 0, 0.04);
				--text-primary: #0b1016;
				--text-secondary: #374151;
				--text-muted: #6b7280;
				--border: rgba(12, 16, 22, 0.12);
				--border-subtle: rgba(12, 16, 22, 0.06);
				--border-focus: rgba(0, 184, 148, 0.45);
				--accent: #00b894;
				--accent-hover: #00d1a7;
				--accent-muted: #009b7f;
				--accent-glow: rgba(0, 184, 148, 0.35);
				--accent-secondary: #ff8a00;
				--accent-gradient: linear-gradient(135deg, #00b894 0%, #2d67ff 100%);
				--success: #16a34a;
				--success-bg: rgba(22, 163, 74, 0.12);
				--success-border: rgba(22, 163, 74, 0.25);
				--warning: #f59e0b;
				--warning-bg: rgba(245, 158, 11, 0.12);
				--warning-border: rgba(245, 158, 11, 0.25);
				--danger: #ef4444;
				--danger-bg: rgba(239, 68, 68, 0.12);
				--danger-border: rgba(239, 68, 68, 0.25);
				--radius: 10px;
				--radius-lg: 14px;
				--radius-xl: 20px;
				--transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
				--transition-slow: 250ms cubic-bezier(0.4, 0, 0.2, 1);
				--shadow-sm: 0 1px 2px rgba(12, 16, 22, 0.08);
				--shadow-md: 0 8px 22px rgba(12, 16, 22, 0.12);
				--shadow-lg: 0 18px 60px rgba(12, 16, 22, 0.16);
				--shadow-glow: 0 0 30px -5px var(--accent);
			}

			[data-theme='dark'] {
				--bg-primary: #0b1016;
				--bg-secondary: #111a22;
				--bg-card: rgba(16, 24, 32, 0.75);
				--bg-card-solid: #101820;
				--bg-hover: rgba(255, 255, 255, 0.05);
				--bg-input: rgba(0, 0, 0, 0.35);
				--text-primary: #f5f7fb;
				--text-secondary: #b3c0d1;
				--text-muted: #6f7b8b;
				--border: rgba(255, 255, 255, 0.08);
				--border-subtle: rgba(255, 255, 255, 0.04);
				--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
				--shadow-md: 0 10px 26px rgba(0, 0, 0, 0.5);
				--shadow-lg: 0 20px 70px rgba(0, 0, 0, 0.55);
			}

			*,
			*::before,
			*::after {
				box-sizing: border-box;
			}

			body {
				font-family: var(--font-body);
				font-size: 14px;
				line-height: 1.6;
				margin: 0;
				padding: 0;
				background: var(--bg-primary);
				color: var(--text-primary);
				-webkit-font-smoothing: antialiased;
				-moz-osx-font-smoothing: grayscale;
				min-height: 100vh;
				position: relative;
				overflow-x: hidden;
			}

			/* Animated gradient mesh background */
			body::before {
				content: '';
				position: fixed;
				top: 0;
				left: 0;
				right: 0;
				bottom: 0;
				background:
					radial-gradient(ellipse 80% 60% at 10% -30%, rgba(0, 184, 148, 0.18), transparent 50%),
					radial-gradient(ellipse 60% 50% at 90% 10%, rgba(45, 103, 255, 0.12), transparent 50%),
					radial-gradient(ellipse 50% 40% at 50% 100%, rgba(255, 138, 0, 0.12), transparent 50%);
				pointer-events: none;
				z-index: 0;
				/*
				 * Was: infinite alternate -- caused permanent GPU compositor
				 * repaints on a full-viewport layer.  One-shot fill gives the
				 * same visual on load without the ongoing cost.
				 */
				animation: gradientPulse 15s ease-in-out 1 both;
			}

			@keyframes gradientPulse {
				0% {
					opacity: 1;
					transform: scale(1);
				}
				100% {
					opacity: 0.7;
					transform: scale(1.05);
				}
			}

			/* Subtle noise texture */
			body::after {
				content: '';
				position: fixed;
				top: 0;
				left: 0;
				right: 0;
				bottom: 0;
				background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
				opacity: 0.015;
				pointer-events: none;
				z-index: 0;
			}

			[data-theme='dark'] body::before {
				background:
					radial-gradient(ellipse 80% 60% at 10% -30%, rgba(0, 184, 148, 0.12), transparent 50%),
					radial-gradient(ellipse 60% 50% at 90% 10%, rgba(45, 103, 255, 0.1), transparent 50%);
			}

			[data-theme='dark'] body::after {
				opacity: 0.03;
			}

			/* Header */
			.header {
				position: sticky;
				top: 0;
				z-index: 100;
				display: flex;
				align-items: center;
				justify-content: space-between;
				padding: 0 20px;
				height: 52px;
				background: rgba(255, 255, 255, 0.8);
				border-bottom: 1px solid var(--border);
				backdrop-filter: blur(20px) saturate(180%);
				-webkit-backdrop-filter: blur(20px) saturate(180%);
			}

			[data-theme='dark'] .header {
				background: rgba(11, 16, 22, 0.85);
			}

			.header-left {
				display: flex;
				align-items: center;
				gap: 20px;
			}

			.logo {
				display: flex;
				align-items: center;
				gap: 12px;
				font-weight: 600;
				font-size: 17px;
				color: var(--text-primary);
				text-decoration: none;
				transition: all var(--transition);
			}

			.logo:hover {
				opacity: 0.9;
			}

			.logo-icon {
				width: 32px;
				height: 32px;
				background: var(--accent-gradient);
				border-radius: 8px;
				display: flex;
				align-items: center;
				justify-content: center;
				box-shadow: 0 6px 16px rgba(0, 184, 148, 0.25);
				transition: all var(--transition);
			}

			.logo:hover .logo-icon {
				box-shadow: 0 8px 20px rgba(0, 184, 148, 0.35);
				transform: translateY(-1px);
			}

			.logo-icon svg {
				width: 18px;
				height: 18px;
				fill: white;
			}

			.version-badge {
				display: inline-flex;
				align-items: center;
				gap: 6px;
				padding: 5px 12px;
				background: var(--bg-card);
				border: 1px solid var(--border);
				border-radius: 999px;
				font-size: 12px;
				font-weight: 500;
				color: var(--text-secondary);
			}

			.version-badge svg {
				width: 14px;
				height: 14px;
				opacity: 0.6;
			}

			.header-right {
				display: flex;
				align-items: center;
				gap: 6px;
			}

			.icon-btn {
				display: flex;
				align-items: center;
				justify-content: center;
				width: 38px;
				height: 38px;
				background: transparent;
				border: none;
				border-radius: var(--radius);
				color: var(--text-muted);
				cursor: pointer;
				transition: all var(--transition);
			}

			.icon-btn:hover {
				background: var(--bg-hover);
				color: var(--text-primary);
				transform: translateY(-1px);
			}

			.icon-btn:active {
				transform: translateY(0) scale(0.96);
			}

			.icon-btn svg {
				width: 18px;
				height: 18px;
			}

			/* Main Content */
			.main {
				position: relative;
				max-width: 1920px;
				margin: 0 auto;
				padding: 20px 24px;
			}

			.page-header {
				margin-bottom: 20px;
			}

			.page-title {
				font-family: var(--font-display);
				font-size: 28px;
				font-weight: 700;
				margin: 0 0 4px 0;
				color: var(--text-primary);
				letter-spacing: -0.02em;
			}

			.page-subtitle {
				font-size: 14px;
				color: var(--text-muted);
				margin: 0;
			}

			.hero {
				display: flex;
				align-items: center;
				justify-content: space-between;
				gap: 20px;
				padding: 18px 24px;
				border-radius: var(--radius-lg);
				background: linear-gradient(120deg, rgba(0, 184, 148, 0.12), rgba(45, 103, 255, 0.12));
				border: 1px solid var(--border);
				box-shadow: var(--shadow-sm);
				position: relative;
				overflow: hidden;
			}

			.hero::after {
				content: '';
				position: absolute;
				right: -80px;
				top: -60px;
				width: 240px;
				height: 240px;
				background: radial-gradient(circle, rgba(255, 138, 0, 0.25), transparent 60%);
				opacity: 0.9;
				pointer-events: none;
			}

			.hero-title {
				font-family: var(--font-display);
				font-size: 24px;
				font-weight: 700;
				margin: 0 0 4px 0;
				letter-spacing: -0.02em;
			}

			.hero-subtitle {
				font-size: 14px;
				color: var(--text-secondary);
				margin: 0;
			}

			.hero-actions {
				display: flex;
				gap: 12px;
				flex-wrap: wrap;
			}

			.kpi-grid {
				display: grid;
				grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
				gap: 12px;
				margin-bottom: 20px;
			}

			.kpi-card {
				background: var(--bg-card);
				border: 1px solid var(--border);
				border-radius: var(--radius);
				padding: 14px 16px;
				box-shadow: var(--shadow-sm);
			}

			.kpi-label {
				font-size: 11px;
				text-transform: uppercase;
				letter-spacing: 0.12em;
				color: var(--text-muted);
				margin-bottom: 8px;
			}

			.kpi-value {
				font-size: 28px;
				font-weight: 700;
				color: var(--text-primary);
			}

			/* Cards - Glassmorphism */
			.card {
				background: var(--bg-card);
				border: 1px solid var(--border);
				border-radius: var(--radius-lg);
				padding: 20px;
				margin-bottom: 16px;
				/* backdrop-filter removed: blur(16px) on every card (5-8
				   per dashboard) causes O(n) real-time Gaussian-blur
				   composites that pin the GPU.  The semi-transparent
				   bg-card still layers over the gradient mesh. */
				box-shadow: var(--shadow-md);
				transition: all var(--transition-slow);
				position: relative;
				overflow: hidden;
				animation: rise 0.6s ease both;
				animation-delay: var(--delay, 0s);
			}

			.card::before {
				content: '';
				position: absolute;
				top: 0;
				left: 0;
				right: 0;
				height: 1px;
				background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
				opacity: 0;
				transition: opacity var(--transition);
			}

			.card:hover::before {
				opacity: 1;
			}

			.card:hover {
				border-color: rgba(0, 0, 0, 0.15);
				box-shadow: var(--shadow-lg);
			}

			[data-theme='dark'] .card:hover {
				border-color: rgba(255, 255, 255, 0.15);
			}

			.card-header {
				display: flex;
				align-items: center;
				justify-content: space-between;
				margin-bottom: 16px;
			}

			.card-title {
				font-size: 16px;
				font-weight: 600;
				margin: 0;
				color: var(--text-primary);
				letter-spacing: -0.01em;
			}

			.card-subtitle {
				font-size: 13px;
				color: var(--text-muted);
				margin: 5px 0 0 0;
			}

			@keyframes rise {
				from {
					opacity: 0;
					transform: translateY(8px);
				}
				to {
					opacity: 1;
					transform: translateY(0);
				}
			}

			/* Tables */
			.table-container {
				overflow-x: auto;
				margin: 0 -20px;
				padding: 0 20px;
			}

			table {
				width: 100%;
				border-collapse: collapse;
				font-size: 13px;
				table-layout: auto;
			}

			th {
				text-align: left;
				padding: 10px 12px;
				font-weight: 500;
				font-size: 11px;
				text-transform: uppercase;
				letter-spacing: 0.05em;
				color: var(--text-muted);
				border-bottom: 1px solid var(--border);
				white-space: nowrap;
			}

			/* Sortable column headers */
			th[data-sort] {
				cursor: pointer;
				user-select: none;
				-webkit-user-select: none;
				position: relative;
				padding-right: 22px;
				transition: color var(--transition);
			}
			th[data-sort]:hover {
				color: var(--text-primary);
			}
			th[data-sort]::after {
				content: '\2195';
				position: absolute;
				right: 6px;
				top: 50%;
				transform: translateY(-50%);
				font-size: 10px;
				opacity: 0.35;
				transition: opacity var(--transition);
			}
			th[data-sort]:hover::after {
				opacity: 0.6;
			}
			th[data-sort].sort-asc::after {
				content: '\2191';
				opacity: 0.9;
				color: var(--accent);
			}
			th[data-sort].sort-desc::after {
				content: '\2193';
				opacity: 0.9;
				color: var(--accent);
			}
			th[data-sort].sort-asc,
			th[data-sort].sort-desc {
				color: var(--text-primary);
			}

			td {
				padding: 10px 12px;
				border-bottom: 1px solid var(--border-subtle);
				color: var(--text-secondary);
				transition: background var(--transition);
				vertical-align: top;
			}

			tr:last-child td {
				border-bottom: none;
			}

			tr:hover td {
				background: var(--bg-hover);
			}

			/* Buttons - Premium style */
			.btn {
				display: inline-flex;
				align-items: center;
				justify-content: center;
				gap: 8px;
				padding: 9px 18px;
				font-size: 13px;
				font-weight: 500;
				border-radius: var(--radius);
				border: none;
				cursor: pointer;
				transition: all var(--transition);
				text-decoration: none;
				white-space: nowrap;
				position: relative;
				overflow: hidden;
			}

			.btn svg {
				width: 16px;
				height: 16px;
			}

			.btn-primary {
				background: var(--accent-gradient);
				color: white;
				box-shadow: 0 6px 16px rgba(0, 184, 148, 0.25);
			}

			.btn-primary::before {
				content: '';
				position: absolute;
				top: 0;
				left: -100%;
				width: 100%;
				height: 100%;
				background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
				transition: left 0.5s ease;
			}

			.btn-primary:hover::before {
				left: 100%;
			}

			.btn-primary:hover {
				box-shadow:
					0 8px 22px rgba(0, 184, 148, 0.35),
					0 0 40px -10px var(--accent);
				transform: translateY(-1px);
			}

			.btn-primary:active {
				transform: translateY(0) scale(0.98);
			}

			.btn-secondary {
				background: rgba(0, 0, 0, 0.04);
				color: var(--text-primary);
				border: 1px solid var(--border);
			}

			.btn-secondary:hover {
				background: var(--bg-hover);
				border-color: rgba(0, 0, 0, 0.2);
				transform: translateY(-1px);
			}

			[data-theme='dark'] .btn-secondary {
				background: rgba(255, 255, 255, 0.04);
			}

			[data-theme='dark'] .btn-secondary:hover {
				border-color: rgba(255, 255, 255, 0.2);
			}

			.btn-ghost {
				background: transparent;
				color: var(--text-secondary);
				padding: 7px 12px;
			}

			.btn-ghost:hover {
				background: var(--bg-hover);
				color: var(--text-primary);
				transform: translateY(-1px);
			}

			.btn-danger {
				background: var(--danger-bg);
				color: var(--danger);
				border: 1px solid var(--danger-border);
			}

			.btn-danger:hover {
				background: var(--danger);
				color: white;
				box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
				transform: translateY(-1px);
			}

			.btn-sm {
				padding: 6px 12px;
				font-size: 12px;
			}

			.btn:disabled {
				opacity: 0.4;
				cursor: not-allowed;
				transform: none !important;
			}

			/* Forms - Premium inputs */
			.form-group {
				margin-bottom: 20px;
			}

			.form-label {
				display: block;
				font-size: 13px;
				font-weight: 500;
				color: var(--text-secondary);
				margin-bottom: 8px;
			}

			.form-input,
			.form-select {
				width: 100%;
				padding: 12px 14px;
				font-size: 14px;
				background: var(--bg-input);
				border: 1px solid var(--border);
				border-radius: var(--radius);
				color: var(--text-primary);
				transition: all var(--transition);
			}

			/* Premium select styling - force override native appearance */
			.form-select {
				appearance: none !important;
				-webkit-appearance: none !important;
				-moz-appearance: none !important;
				background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2300b894' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
				background-repeat: no-repeat;
				background-position: right 14px center;
				background-size: 12px;
				padding-right: 40px;
				cursor: pointer;
				font-family: inherit;
				line-height: 1.5;
			}

			.form-select:hover {
				border-color: var(--accent);
				background-color: rgba(0, 184, 148, 0.08);
			}

			/* Style the dropdown options */
			.form-select option {
				background: var(--bg-card);
				color: var(--text-primary);
				padding: 12px 14px;
				font-size: 14px;
				border: none;
			}

			.form-select option:hover,
			.form-select option:focus,
			.form-select option:checked {
				background: linear-gradient(90deg, rgba(0, 184, 148, 0.3), rgba(0, 184, 148, 0.1));
				color: white;
			}

			/* Custom select wrapper for even better styling */
			.select-wrapper {
				position: relative;
				display: inline-block;
				width: 100%;
			}

			.select-wrapper::after {
				content: '';
				position: absolute;
				right: 14px;
				top: 50%;
				transform: translateY(-50%);
				width: 0;
				height: 0;
				border-left: 5px solid transparent;
				border-right: 5px solid transparent;
				border-top: 6px solid var(--accent);
				pointer-events: none;
			}

			.select-wrapper .form-select {
				background-image: none;
			}

			/* Light theme adjustments */
			[data-theme='light'] .form-select option {
				background: #ffffff;
				color: #1a1a2e;
			}

			[data-theme='light'] .form-select option:hover,
			[data-theme='light'] .form-select option:checked {
				background: linear-gradient(90deg, rgba(0, 184, 148, 0.2), rgba(0, 184, 148, 0.05));
			}

			.form-input:focus,
			.form-select:focus {
				outline: none;
				border-color: var(--accent);
				box-shadow:
					0 0 0 4px var(--accent-glow),
					0 0 20px -5px var(--accent);
			}

			.form-input::placeholder {
				color: var(--text-muted);
			}

			/* Action buttons with labels */
			.action-btn {
				display: inline-flex;
				align-items: center;
				gap: 6px;
				padding: 6px 12px;
				font-size: 12px;
				font-weight: 500;
				color: var(--text-secondary);
				background: rgba(255, 255, 255, 0.03);
				border: 1px solid var(--border);
				border-radius: 6px;
				cursor: pointer;
				transition: all var(--transition);
				white-space: nowrap;
			}

			.action-btn:hover {
				color: var(--text-primary);
				background: rgba(255, 255, 255, 0.08);
				border-color: var(--accent);
				transform: translateY(-1px);
			}

			.action-btn svg {
				width: 14px;
				height: 14px;
				flex-shrink: 0;
			}

			.action-btn.action-btn-primary {
				color: var(--accent);
				border-color: rgba(0, 184, 148, 0.3);
				background: rgba(0, 184, 148, 0.1);
			}

			.action-btn.action-btn-primary:hover {
				background: rgba(0, 184, 148, 0.2);
				border-color: var(--accent);
				box-shadow: 0 0 12px -3px var(--accent);
			}

			.action-btn.action-btn-warning {
				color: var(--warning);
				border-color: rgba(245, 158, 11, 0.3);
				background: rgba(245, 158, 11, 0.1);
			}

			.action-btn.action-btn-warning:hover {
				background: rgba(245, 158, 11, 0.2);
				border-color: var(--warning);
			}

			.action-btn.action-btn-danger {
				color: var(--danger);
				border-color: rgba(239, 68, 68, 0.3);
				background: rgba(239, 68, 68, 0.1);
			}

			.action-btn.action-btn-danger:hover {
				background: rgba(239, 68, 68, 0.2);
				border-color: var(--danger);
			}

			.action-btn:disabled {
				opacity: 0.5;
				cursor: not-allowed;
				transform: none;
			}

			/* Tabs - Premium segmented control */
			.tabs {
				display: inline-flex;
				gap: 2px;
				padding: 3px;
				background: rgba(0, 0, 0, 0.05);
				border: 1px solid var(--border);
				border-radius: var(--radius);
				margin-bottom: 16px;
			}

			[data-theme='dark'] .tabs {
				background: rgba(255, 255, 255, 0.05);
			}

			.tab {
				padding: 8px 16px;
				font-size: 13px;
				font-weight: 500;
				color: var(--text-muted);
				background: transparent;
				border: none;
				border-radius: 6px;
				cursor: pointer;
				transition: all var(--transition);
			}

			.tab:hover {
				color: var(--text-primary);
				background: rgba(0, 0, 0, 0.05);
			}

			.tab.active {
				background: var(--accent-gradient);
				color: white;
				box-shadow: 0 4px 12px rgba(0, 184, 148, 0.3);
			}

			/* Status Badges - Glowing */
			.badge {
				display: inline-flex;
				align-items: center;
				gap: 6px;
				padding: 5px 12px;
				font-size: 12px;
				font-weight: 500;
				border-radius: 999px;
				background: rgba(255, 255, 255, 0.03);
				color: var(--text-secondary);
				border: 1px solid var(--border);
				transition: all var(--transition);
			}

			.badge-success {
				background: var(--success-bg);
				color: var(--success);
				border-color: var(--success-border);
				box-shadow: 0 0 12px -3px var(--success);
			}
			.badge-warning {
				background: var(--warning-bg);
				color: var(--warning);
				border-color: var(--warning-border);
				box-shadow: 0 0 12px -3px var(--warning);
			}
			.badge-danger {
				background: var(--danger-bg);
				color: var(--danger);
				border-color: var(--danger-border);
				box-shadow: 0 0 12px -3px var(--danger);
			}
			.badge-info {
				background: rgba(45, 103, 255, 0.12);
				color: #2d67ff;
				border-color: rgba(45, 103, 255, 0.3);
				box-shadow: 0 0 12px -3px rgba(45, 103, 255, 0.55);
			}
			.badge-muted {
				background: rgba(100, 100, 100, 0.15);
				color: var(--text-muted);
				border-color: rgba(100, 100, 100, 0.3);
			}

			.badge-dot {
				width: 6px;
				height: 6px;
				border-radius: 50%;
				background: currentColor;
				animation: pulse 2s ease-in-out 3;
			}

			@keyframes pulse {
				0%,
				100% {
					opacity: 1;
					transform: scale(1);
				}
				50% {
					opacity: 0.6;
					transform: scale(0.9);
				}
			}

			/* Progress Bar - Animated gradient */
			.progress {
				height: 6px;
				background: rgba(0, 0, 0, 0.3);
				border-radius: 999px;
				overflow: hidden;
				position: relative;
			}

			.progress-bar {
				height: 100%;
				background: var(--accent-gradient);
				border-radius: 999px;
				transition: width 400ms cubic-bezier(0.4, 0, 0.2, 1);
				position: relative;
				overflow: hidden;
			}

			.progress-bar::after {
				content: '';
				position: absolute;
				top: 0;
				left: 0;
				right: 0;
				bottom: 0;
				background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
				animation: shimmer 2s 3;
			}

			@keyframes shimmer {
				0% {
					transform: translateX(-100%);
				}
				100% {
					transform: translateX(100%);
				}
			}

			.progress-text {
				font-size: 12px;
				color: var(--text-muted);
				margin-top: 6px;
			}

			/* Toast Notifications - Premium style */
			.toast-container {
				position: fixed;
				bottom: 28px;
				right: 28px;
				z-index: 1000;
				display: flex;
				flex-direction: column;
				gap: 12px;
			}

			.toast {
				display: flex;
				align-items: flex-start;
				gap: 14px;
				padding: 16px 18px;
				background: var(--bg-card-solid);
				border: 1px solid var(--border);
				border-radius: var(--radius-lg);
				box-shadow: var(--shadow-lg);
				min-width: 320px;
				max-width: 420px;
				animation: toastSlideIn 300ms cubic-bezier(0.4, 0, 0.2, 1);
				backdrop-filter: blur(16px);
			}

			@keyframes toastSlideIn {
				from {
					transform: translateX(120%);
					opacity: 0;
				}
				to {
					transform: translateX(0);
					opacity: 1;
				}
			}

			.toast-icon {
				flex-shrink: 0;
				width: 22px;
				height: 22px;
			}
			.toast-success .toast-icon {
				color: var(--success);
				filter: drop-shadow(0 0 8px var(--success));
			}
			.toast-error .toast-icon {
				color: var(--danger);
				filter: drop-shadow(0 0 8px var(--danger));
			}
			.toast-warning .toast-icon {
				color: var(--warning);
				filter: drop-shadow(0 0 8px var(--warning));
			}

			.toast-content {
				flex: 1;
			}
			.toast-title {
				font-weight: 600;
				color: var(--text-primary);
				margin-bottom: 3px;
			}
			.toast-message {
				font-size: 13px;
				color: var(--text-secondary);
				line-height: 1.5;
			}

			.toast-close {
				background: none;
				border: none;
				color: var(--text-muted);
				cursor: pointer;
				padding: 4px;
				border-radius: 6px;
				transition: all var(--transition);
			}

			.toast-close:hover {
				color: var(--text-primary);
				background: var(--bg-hover);
			}

			/* Modal - Premium glassmorphism */
			.modal-overlay {
				position: fixed;
				inset: 0;
				background: rgba(0, 0, 0, 0.75);
				backdrop-filter: blur(8px);
				-webkit-backdrop-filter: blur(8px);
				z-index: 1000;
				display: flex;
				align-items: center;
				justify-content: center;
				opacity: 0;
				visibility: hidden;
				transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
			}

			.modal-overlay.active {
				opacity: 1;
				visibility: visible;
			}

			.modal {
				background: var(--bg-card-solid);
				border: 1px solid var(--border);
				border-radius: var(--radius-xl);
				padding: 28px;
				width: 100%;
				max-width: 440px;
				margin: 24px;
				transform: scale(0.92) translateY(10px);
				transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
				box-shadow: var(--shadow-lg);
			}

			.modal-overlay.active .modal {
				transform: scale(1) translateY(0);
			}

			.modal-title {
				font-size: 20px;
				font-weight: 600;
				margin: 0 0 10px 0;
				letter-spacing: -0.01em;
			}
			.modal-message {
				color: var(--text-secondary);
				margin: 0 0 28px 0;
				line-height: 1.6;
			}
			.modal-actions {
				display: flex;
				justify-content: flex-end;
				gap: 12px;
			}

			/* Loading Spinner - Premium gradient */
			.spinner {
				width: 22px;
				height: 22px;
				border: 2px solid transparent;
				border-top-color: var(--accent);
				border-right-color: var(--accent-secondary);
				border-radius: 50%;
				animation: spinGlow 800ms linear infinite;
			}

			@keyframes spinGlow {
				to {
					transform: rotate(360deg);
				}
			}

			.loading-overlay {
				position: absolute;
				inset: 0;
				background: var(--loading-overlay-bg, rgba(9, 9, 11, 0.85));
				backdrop-filter: blur(4px);
				display: flex;
				align-items: center;
				justify-content: center;
				border-radius: var(--radius-lg);
				z-index: 10;
			}

			/* Utilities */
			.flex {
				display: flex;
			}
			.items-center {
				align-items: center;
			}
			.justify-between {
				justify-content: space-between;
			}
			.gap-2 {
				gap: 8px;
			}
			.gap-3 {
				gap: 12px;
			}
			.gap-4 {
				gap: 16px;
			}
			.text-muted {
				color: var(--text-muted);
			}
			.text-sm {
				font-size: 12px;
			}
			.text-success {
				color: var(--success);
			}
			.text-warning {
				color: var(--warning);
			}
			.text-danger {
				color: var(--danger);
			}
			.kicker {
				font-size: 11px;
				letter-spacing: 0.2em;
				text-transform: uppercase;
				color: var(--text-muted);
			}
			.font-mono {
				font-family: var(--font-mono);
				font-size: 12px;
			}
			.truncate {
				overflow: hidden;
				text-overflow: ellipsis;
				white-space: nowrap;
				max-width: 200px;
			}
			.relative {
				position: relative;
			}
			.inline-form {
				display: inline;
			}

			/* Action buttons in tables */
			.action-group {
				display: flex;
				gap: 8px;
				align-items: center;
			}

			/* Footer */
			.footer {
				position: relative;
				z-index: 1;
				text-align: center;
				padding: 32px 24px;
				color: var(--text-muted);
				font-size: 12px;
				letter-spacing: 0.02em;
			}

			/* Scrollbar styling */
			::-webkit-scrollbar {
				width: 10px;
				height: 10px;
			}

			::-webkit-scrollbar-track {
				background: transparent;
			}

			::-webkit-scrollbar-thumb {
				background: rgba(255, 255, 255, 0.1);
				border-radius: 5px;
			}

			::-webkit-scrollbar-thumb:hover {
				background: rgba(255, 255, 255, 0.15);
			}

			[data-theme='light'] ::-webkit-scrollbar-thumb {
				background: rgba(0, 0, 0, 0.15);
			}

			[data-theme='light'] ::-webkit-scrollbar-thumb:hover {
				background: rgba(0, 0, 0, 0.25);
			}

			[data-theme='light'] .loading-overlay {
				--loading-overlay-bg: rgba(255, 255, 255, 0.85);
			}

			/* Responsive */
			@media (max-width: 768px) {
				.header {
					padding: 0 12px;
					height: 48px;
				}
				.header-right .btn-ghost {
					display: none;
				}
				.header-right #logout-form .btn-ghost {
					display: inline-flex;
				}
				.main {
					padding: 12px 10px;
				}
				.card {
					padding: 14px;
					border-radius: var(--radius);
				}
				.card-header {
					margin-bottom: 12px;
				}
				.card-title {
					font-size: 15px;
				}
				.page-title {
					font-size: 18px;
				}
				.btn {
					padding: 7px 10px;
					font-size: 12px;
				}
				.hide-mobile {
					display: none;
				}
				/* Tabs: horizontal scroll on mobile, no wrapping */
				.tabs {
					flex-wrap: nowrap;
					overflow-x: auto;
					-webkit-overflow-scrolling: touch;
					scrollbar-width: none;
					width: 100%;
				}
				.tabs::-webkit-scrollbar {
					display: none;
				}
				.tab {
					flex: 0 0 auto;
					white-space: nowrap;
					padding: 7px 12px;
					font-size: 12px;
				}
				/* Hero: stack vertically on mobile */
				.hero, .hero-compact {
					flex-direction: column;
					align-items: flex-start;
					padding: 14px 16px;
					gap: 12px;
				}
				.hero-title {
					font-size: 18px;
				}
				.hero-actions {
					flex-wrap: wrap;
					gap: 6px;
				}
				/* KPI grid: 3-col on mobile */
				.kpi-grid, .kpi-grid-6 {
					grid-template-columns: repeat(3, 1fr);
					gap: 6px;
				}
				.kpi-card {
					padding: 8px 10px;
				}
				.kpi-value {
					font-size: 18px;
				}
				.kpi-label {
					font-size: 9px;
					margin-bottom: 2px;
					letter-spacing: 0.08em;
				}
				/* Cards: tighter on mobile */
				.card {
					margin-bottom: 8px;
				}
				/* Page hero: stack on mobile */
				.page-hero {
					flex-direction: column !important;
					align-items: flex-start !important;
					margin-bottom: 8px !important;
					gap: 6px !important;
				}
				.page-title {
					font-size: 16px;
				}
				/* Tables */
				.table-container {
					margin: 0 -14px;
					padding: 0 14px;
				}
				th, td {
					padding: 8px 8px;
					font-size: 12px;
				}
				/* Tier cards */
				.tier-cards {
					grid-template-columns: repeat(3, 1fr);
					gap: 8px;
				}
				.tier-card {
					padding: 10px;
				}
				.tier-card .tier-value {
					font-size: 20px;
				}
				.tier-card .tier-icon {
					display: none;
				}
				/* Dashboard grid: single column on mobile */
				.dashboard-grid {
					grid-template-columns: 1fr;
				}
				/* Footer */
				.footer {
					padding: 16px 12px;
				}
				/* Version badge hidden on mobile */
				.version-badge {
					display: none;
				}
			}

			/* Selection styling */
			::selection {
				background: rgba(0, 184, 148, 0.3);
				color: var(--text-primary);
			}

/* ===== Command Palette ===== */
.cmd-palette-overlay {
				position: fixed;
				inset: 0;
				background: rgba(0, 0, 0, 0.5);
				backdrop-filter: blur(4px);
				z-index: 9999;
				display: none;
				align-items: flex-start;
				justify-content: center;
				padding-top: 12vh;
			}
			.cmd-palette-overlay.active {
				display: flex;
			}
			.cmd-palette {
				width: 100%;
				max-width: 580px;
				background: var(--bg-card-solid);
				border: 1px solid var(--border);
				border-radius: var(--radius-lg);
				box-shadow: var(--shadow-lg);
				overflow: hidden;
				animation: cmdScaleIn 0.12s ease;
			}
			.cmd-header {
				display: flex;
				align-items: center;
				border-bottom: 1px solid var(--border);
			}
			.cmd-input {
				flex: 1;
				padding: 16px 20px;
				border: none;
				background: transparent;
				color: var(--text-primary);
				font-size: 16px;
				font-family: inherit;
			}
			.cmd-input:focus {
				outline: none;
			}
			.cmd-input::placeholder {
				color: var(--text-muted);
			}
			.cmd-kbd {
				padding: 4px 8px;
				margin-right: 12px;
				font-size: 11px;
				background: var(--bg-hover);
				border: 1px solid var(--border);
				border-radius: 4px;
				color: var(--text-muted);
				font-family: var(--font-mono);
			}
			.cmd-results {
				max-height: 340px;
				overflow-y: auto;
			}
			.cmd-section {
				padding: 8px 12px;
				font-size: 11px;
				text-transform: uppercase;
				letter-spacing: 0.5px;
				color: var(--text-muted);
				background: var(--bg-hover);
			}
			.cmd-item {
				display: flex;
				align-items: center;
				gap: 12px;
				padding: 10px 16px;
				cursor: pointer;
				transition: background 0.08s;
				text-decoration: none;
				color: inherit;
			}
			.cmd-item:hover,
			.cmd-item.selected {
				background: var(--bg-hover);
			}
			.cmd-item-icon {
				width: 28px;
				height: 28px;
				display: flex;
				align-items: center;
				justify-content: center;
				background: var(--bg-input);
				border-radius: 6px;
				color: var(--text-muted);
				flex-shrink: 0;
			}
			.cmd-item-icon svg {
				width: 14px;
				height: 14px;
			}
			.cmd-item-text {
				flex: 1;
				min-width: 0;
			}
			.cmd-item-title {
				font-weight: 500;
				color: var(--text-primary);
				white-space: nowrap;
				overflow: hidden;
				text-overflow: ellipsis;
			}
			.cmd-item-sub {
				font-size: 12px;
				color: var(--text-muted);
				white-space: nowrap;
				overflow: hidden;
				text-overflow: ellipsis;
			}
			.cmd-item-badge {
				flex-shrink: 0;
			}
			.cmd-empty {
				padding: 40px 20px;
				text-align: center;
				color: var(--text-muted);
			}
			.cmd-footer {
				padding: 8px 16px;
				border-top: 1px solid var(--border);
				display: flex;
				gap: 16px;
				font-size: 11px;
				color: var(--text-muted);
			}
			.cmd-footer kbd {
				padding: 2px 6px;
				background: var(--bg-hover);
				border: 1px solid var(--border);
				border-radius: 3px;
				font-family: var(--font-mono);
			}
			@keyframes cmdScaleIn {
				from {
					opacity: 0;
					transform: scale(0.96) translateY(-8px);
				}
				to {
					opacity: 1;
					transform: scale(1) translateY(0);
				}
			}

/* ===== Firefox scrollbar ===== */
* {
	scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
	scrollbar-width: thin;
}
[data-theme='light'] * {
	scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

/* ===== JS hydration cloak ===== */
/* When the head <script> adds .js to <html>, hide elements that will be
   hydrated by shared.js boot(). Each hydrator adds .hydrated to reveal.
   A 3-second safety animation guarantees content shows even if JS stalls. */
html.js [data-timestamp]:not(.hydrated),
html.js [data-uuid]:not(.hydrated),
html.js [data-action*="."]:not(.hydrated) {
	opacity: 0;
	transition: opacity 0.15s ease;
}
html.js [data-timestamp].hydrated,
html.js [data-uuid].hydrated,
html.js [data-action].hydrated {
	opacity: 1;
}
/* Safety net: reveal after 3s even if JS fails to hydrate */
@keyframes hydrateReveal {
	to { opacity: 1; }
}
html.js [data-timestamp]:not(.hydrated),
html.js [data-uuid]:not(.hydrated),
html.js [data-action*="."]:not(.hydrated) {
	animation: hydrateReveal 0s 3s forwards;
}
/* Reserve space for Lucide icon placeholders before createIcons() runs */
html.js [data-lucide]:not(svg) {
	display: inline-block;
	width: 1em;
	height: 1em;
	vertical-align: middle;
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* ===== Accessibility ===== */
.skip-to-content {
	position: absolute;
	left: -9999px;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
	z-index: 10000;
	padding: 12px 24px;
	background: var(--accent);
	color: white;
	font-weight: 600;
	font-size: 14px;
	border-radius: 0 0 var(--radius) var(--radius);
	text-decoration: none;
}
.skip-to-content:focus {
	position: fixed;
	top: 0;
	left: 50%;
	transform: translateX(-50%);
	width: auto;
	height: auto;
}

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ===== Button loading state ===== */
.btn-loading {
	pointer-events: none;
	opacity: 0.7;
	position: relative;
}
.btn-loading::after {
	content: '';
	position: absolute;
	width: 16px;
	height: 16px;
	border: 2px solid transparent;
	border-top-color: currentColor;
	border-radius: 50%;
	animation: spinGlow 600ms linear infinite;
	right: 12px;
	top: 50%;
	margin-top: -8px;
}

/* ===== Mobile: 480px breakpoint ===== */
@media (max-width: 480px) {
	.main {
		padding: 8px 6px;
	}
	.card {
		padding: 10px;
		border-radius: var(--radius);
		margin-bottom: 6px;
	}
	.page-title {
		font-size: 15px;
	}
	.hero-title {
		font-size: 15px;
	}
	.kpi-grid, .kpi-grid-6 {
		grid-template-columns: repeat(3, 1fr);
		gap: 4px;
	}
	.kpi-card {
		padding: 6px 8px;
	}
	.kpi-value {
		font-size: 15px;
	}
	.kpi-label {
		font-size: 8px;
		margin-bottom: 1px;
	}
	.card-title {
		font-size: 13px;
	}
	.card-header {
		margin-bottom: 6px;
	}
	.table-container {
		margin: 0 -12px;
		padding: 0 12px;
	}
	.modal {
		margin: 12px;
		padding: 16px;
	}
	.toast-container {
		left: 8px;
		right: 8px;
		bottom: 8px;
	}
	.toast {
		min-width: auto;
	}
	.header {
		padding: 0 8px;
		height: 44px;
	}
	.logo {
		font-size: 14px;
		gap: 8px;
	}
	.logo-icon {
		width: 28px;
		height: 28px;
		border-radius: 6px;
	}
	.logo-icon svg {
		width: 14px;
		height: 14px;
	}
	.tier-cards {
		grid-template-columns: repeat(2, 1fr);
	}
	.tier-card .tier-label {
		font-size: 10px;
	}
	.service-grid {
		grid-template-columns: 1fr;
	}
}

/* --- GROUP 1: Dashboard Grid Layout --- */
.dashboard-grid {
	display: grid;
	grid-template-columns: 1.5fr 1fr;
	gap: 16px;
}
@media (max-width: 1024px) {
	.dashboard-grid {
		grid-template-columns: 1fr;
	}
}

/* --- GROUP 2: Hero Compact --- */
.hero-compact {
	padding: 16px 20px;
	margin-bottom: 20px;
}

/* --- GROUP 3: KPI Grid 6 --- */
.kpi-grid-6 {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 12px;
	margin-bottom: 20px;
}

/* --- GROUP 4: Platform Modal (header/body/footer extensions) --- */
.modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	border-bottom: 1px solid var(--border);
}
.modal-close {
	width: 32px;
	height: 32px;
	border: none;
	background: transparent;
	color: var(--text-muted);
	cursor: pointer;
	border-radius: var(--radius);
	display: flex;
	align-items: center;
	justify-content: center;
}
.modal-close:hover {
	background: var(--bg-hover);
	color: var(--text-primary);
}
.modal-body {
	padding: 20px;
}
.modal-footer {
	padding: 16px 20px;
	border-top: 1px solid var(--border);
	display: flex;
	gap: 8px;
	justify-content: flex-end;
}

/* --- GROUP 5: Form Hint --- */
.form-hint {
	font-size: 12px;
	color: var(--text-muted);
	margin-top: 4px;
}

/* --- GROUP 6: Platform Toolbar --- */
.toolbar {
	display: flex;
	gap: 12px;
	align-items: center;
	flex-wrap: wrap;
	margin-bottom: 16px;
}
.search-box {
	position: relative;
	flex: 1;
	min-width: 240px;
	max-width: 400px;
}
.search-box input {
	width: 100%;
	padding: 10px 12px 10px 38px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--bg-input);
	color: var(--text-primary);
	font-size: 14px;
	transition: border-color 0.15s, box-shadow 0.15s;
}
.search-box input:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px var(--accent-glow);
}
.search-box input::placeholder {
	color: var(--text-muted);
}
.search-box svg {
	position: absolute;
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--text-muted);
	pointer-events: none;
}
.search-box .kbd {
	position: absolute;
	right: 10px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 11px;
	padding: 2px 6px;
	background: var(--bg-hover);
	border: 1px solid var(--border);
	border-radius: 4px;
	color: var(--text-muted);
	font-family: var(--font-mono);
}

/* --- GROUP 7: Filter Pills --- */
.filter-pills {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}
.filter-pill {
	padding: 6px 12px;
	border: 1px solid var(--border);
	border-radius: 20px;
	background: transparent;
	color: var(--text-secondary);
	font-size: 13px;
	cursor: pointer;
	transition: all 0.15s;
	display: flex;
	align-items: center;
	gap: 6px;
}
.filter-pill:hover {
	border-color: var(--accent);
	color: var(--accent);
}
.filter-pill.active {
	background: var(--accent);
	border-color: var(--accent);
	color: white;
}
.filter-pill .count {
	font-size: 11px;
	padding: 1px 6px;
	background: rgba(255,255,255,0.2);
	border-radius: 10px;
}
.filter-pill.active .count {
	background: rgba(255,255,255,0.3);
}

/* --- GROUP 8: Bulk Operations --- */
.bulk-bar {
	display: none;
	align-items: center;
	gap: 12px;
	padding: 12px 16px;
	background: var(--accent);
	border-radius: var(--radius);
	margin-bottom: 16px;
	color: white;
	animation: slideDown 0.2s ease;
}
.bulk-bar.active {
	display: flex;
}
.bulk-bar .count {
	font-weight: 600;
}
.bulk-bar .bulk-actions {
	display: flex;
	gap: 8px;
	margin-left: auto;
}
.bulk-btn {
	padding: 6px 12px;
	border: 1px solid rgba(255,255,255,0.3);
	border-radius: var(--radius);
	background: transparent;
	color: white;
	cursor: pointer;
	font-size: 13px;
	transition: all 0.15s;
}
.bulk-btn:hover {
	background: rgba(255,255,255,0.15);
}
.bulk-btn.danger {
	border-color: rgba(239,68,68,0.5);
	color: #fca5a5;
}
.bulk-btn.danger:hover {
	background: rgba(239,68,68,0.2);
}
@keyframes slideDown {
	from {
		opacity: 0;
		transform: translateY(-8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* --- GROUP 9: Pagination --- */
.pagination {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid var(--border);
}
.pagination-info {
	color: var(--text-muted);
	font-size: 13px;
}
.pagination-controls {
	display: flex;
	gap: 4px;
}
.page-btn {
	padding: 8px 14px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: transparent;
	color: var(--text-secondary);
	cursor: pointer;
	font-size: 13px;
	transition: all 0.15s;
}
.page-btn:hover:not(:disabled) {
	border-color: var(--accent);
	color: var(--accent);
}
.page-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}
.page-btn.active {
	background: var(--accent);
	border-color: var(--accent);
	color: white;
}

/* --- GROUP 10: Row UI --- */
.row-actions {
	display: flex;
	gap: 4px;
	align-items: center;
}
.row-checkbox {
	width: 18px;
	height: 18px;
	cursor: pointer;
	accent-color: var(--accent);
}
.select-all-checkbox {
	width: 18px;
	height: 18px;
	cursor: pointer;
	accent-color: var(--accent);
}
tr.alert-row {
	background: var(--warning-bg);
}
tr.alert-row td:first-child {
	border-left: 3px solid var(--warning);
}

/* --- GROUP 11: Action Button Icon --- */
.action-btn-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: transparent;
	color: var(--text-muted);
	cursor: pointer;
	transition: all 0.15s;
	text-decoration: none;
}
.action-btn-icon:hover {
	border-color: var(--accent);
	color: var(--accent);
	background: var(--bg-hover);
}
.action-btn-icon.action-btn-success {
	border-color: rgba(34,197,94,0.3);
	color: #22c55e;
}
.action-btn-icon.action-btn-success:hover {
	border-color: #22c55e;
	background: rgba(34,197,94,0.1);
}
.action-btn-icon.action-btn-warning {
	border-color: rgba(234,179,8,0.3);
	color: #eab308;
}
.action-btn-icon.action-btn-warning:hover {
	border-color: #eab308;
	background: rgba(234,179,8,0.1);
}
.action-btn-icon.action-btn-danger {
	border-color: rgba(239,68,68,0.3);
	color: #ef4444;
}
.action-btn-icon.action-btn-danger:hover {
	border-color: #ef4444;
	background: rgba(239,68,68,0.1);
}

/* --- GROUP 12: Tier Cards --- */
.tier-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 10px;
	margin-bottom: 16px;
}
.tier-card {
	padding: 12px 14px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--bg-card);
	cursor: pointer;
	transition: all 0.15s;
	position: relative;
	overflow: hidden;
}
.tier-card:hover {
	border-color: var(--accent);
	transform: translateY(-2px);
}
.tier-card.active {
	border-color: var(--accent);
	background: var(--accent);
	color: white;
}
.tier-card.active .tier-label {
	color: rgba(255,255,255,0.8);
}
.tier-card .tier-value {
	font-size: 28px;
	font-weight: 700;
	line-height: 1;
}
.tier-card .tier-label {
	font-size: 12px;
	color: var(--text-muted);
	margin-top: 4px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}
.tier-card .tier-icon {
	position: absolute;
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
	opacity: 0.25;
	color: var(--text-muted);
}

/* --- GROUP 13: Usage Bar --- */
.usage-bar {
	width: 80px;
	height: 6px;
	background: var(--bg-input);
	border-radius: 3px;
	overflow: hidden;
}
.usage-bar-fill {
	height: 100%;
	border-radius: 3px;
	transition: width 0.3s;
}
.usage-low {
	background: var(--success);
}
.usage-medium {
	background: var(--warning);
}
.usage-high {
	background: linear-gradient(90deg, var(--warning), var(--danger));
}

/* --- GROUP 14: Alert Dot --- */
.alert-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--danger);
	display: inline-block;
	margin-right: 6px;
	animation: pulse 1.5s 3;
}
/* pulse keyframes defined earlier in this file */

/* --- GROUP 15: Quick Stats --- */
.quick-stats {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}
.quick-stat {
	display: flex;
	align-items: center;
	gap: 4px;
	font-size: 12px;
	color: var(--text-muted);
}
.quick-stat svg {
	width: 12px;
	height: 12px;
}

/* --- GROUP 16: Donut Chart --- */
.donut-chart {
	width: 160px;
	height: 160px;
	border-radius: 50%;
	margin: 0 auto;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.5s ease;
	background: conic-gradient(
		var(--text-secondary) 0% var(--p-team, 33%),
		var(--success) var(--p-team, 33%) var(--p-org, 66%),
		var(--warning) var(--p-org, 66%) 100%
	);
}
.donut-hole {
	width: 110px;
	height: 110px;
	background: var(--bg-card);
	border-radius: 50%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}
.donut-total {
	font-size: 24px;
	font-weight: 700;
	color: var(--text-primary);
}
.donut-label {
	font-size: 11px;
	color: var(--text-muted);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

/* --- GROUP 17: Horizontal Bars and Legend --- */
.h-bar-row {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 12px;
}
.h-bar-label {
	width: 140px;
	font-size: 12px;
	color: var(--text-secondary);
	text-align: right;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.h-bar-track {
	flex: 1;
	height: 8px;
	background: var(--bg-hover);
	border-radius: 4px;
	overflow: hidden;
}
.h-bar-fill {
	height: 100%;
	border-radius: 4px;
	background: var(--accent);
	opacity: 0.8;
	transition: width 1s ease-out;
}
.h-bar-count {
	width: 40px;
	font-size: 12px;
	font-family: var(--font-mono);
	color: var(--text-muted);
	text-align: right;
}

.legend {
	display: flex;
	justify-content: center;
	gap: 16px;
	margin-top: 20px;
	flex-wrap: wrap;
}
.legend-item {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	color: var(--text-secondary);
}
.legend-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
}

/* --- GROUP 18: Bar Charts --- */
.chart-container {
	height: 200px;
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding-top: 20px;
}
.bar-col {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
}
.bar {
	width: 100%;
	background: var(--accent-gradient);
	border-radius: 4px 4px 0 0;
	transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
	min-height: 4px;
	opacity: 0.8;
	position: relative;
}
.bar:hover {
	opacity: 1;
	transform: scaleY(1.05);
}
.bar-label {
	font-size: 10px;
	color: var(--text-muted);
	font-family: var(--font-mono);
}

/* --- GROUP 19: Spark Charts --- */
.spark-chart {
	height: 120px;
	display: flex;
	align-items: flex-end;
	gap: 6px;
	padding: 16px 0;
	margin-bottom: 12px;
}
.spark-bar-col {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	height: 100%;
	justify-content: flex-end;
}
.spark-bar {
	width: 100%;
	background: var(--accent-gradient);
	border-radius: 3px 3px 0 0;
	opacity: 0.7;
	transition: all 0.3s ease;
	min-height: 4px;
}
.spark-bar:hover {
	opacity: 1;
	transform: scaleY(1.1);
}
.spark-label {
	font-size: 10px;
	color: var(--text-muted);
	font-family: var(--font-mono);
}

/* --- GROUP 20: Service Health Grid --- */
.service-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}
.service-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px;
	background: var(--bg-hover);
	border-radius: var(--radius);
	border: 1px solid var(--border-subtle);
	transition: transform 0.2s;
}
.service-item:hover {
	transform: translateY(-1px);
	background: rgba(0, 0, 0, 0.06);
}
[data-theme='dark'] .service-item:hover {
	background: rgba(255, 255, 255, 0.08);
}
.status-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	flex-shrink: 0;
}
.status-dot.ok {
	background: var(--success);
	box-shadow: 0 0 8px var(--success);
}
.status-dot.err {
	background: var(--danger);
	box-shadow: 0 0 8px var(--danger);
}
.status-dot.off {
	background: var(--text-muted);
	opacity: 0.5;
}

/* --- GROUP 21: Timeline --- */
.timeline {
	position: relative;
	padding-left: 20px;
	border-left: 2px solid var(--border);
	margin-top: 8px;
}
.timeline-item {
	position: relative;
	margin-bottom: 20px;
	padding-left: 16px;
}
.timeline-item:last-child {
	margin-bottom: 0;
}
.timeline-item::before {
	content: '';
	position: absolute;
	left: -25px;
	top: 4px;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--accent);
	box-shadow: 0 0 0 3px var(--bg-card);
}
.timeline-title {
	font-weight: 500;
	color: var(--text-primary);
	margin-bottom: 4px;
}
.timeline-meta {
	font-size: 12px;
	color: var(--text-muted);
}

/* --- GROUP 22: Activity Feed --- */
.feed-list {
	max-height: 280px;
	overflow-y: auto;
	padding-right: 8px;
}
.feed-item {
	display: flex;
	gap: 12px;
	padding: 12px 0;
	border-bottom: 1px solid var(--border-subtle);
	position: relative;
}
.feed-item:last-child {
	border-bottom: none;
}
.feed-line {
	position: absolute;
	left: 6px;
	top: 28px;
	bottom: -14px;
	width: 2px;
	background: var(--border-subtle);
	z-index: 0;
}
.feed-item:last-child .feed-line {
	display: none;
}
.feed-dot {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--bg-card);
	border: 2px solid var(--accent);
	flex-shrink: 0;
	z-index: 1;
	margin-top: 4px;
}
.feed-content {
	flex: 1;
	min-width: 0;
}
.feed-title {
	font-weight: 500;
	color: var(--text-primary);
	margin-bottom: 2px;
}
.feed-meta {
	font-size: 12px;
	color: var(--text-muted);
}

/* --- GROUP 23: Ring/Meter Chart --- */
.ring-chart {
	position: relative;
	width: 120px;
	height: 120px;
}
.ring-chart svg {
	transform: rotate(-90deg);
}
.ring-bg {
	fill: none;
	stroke: var(--bg-hover);
	stroke-width: 8;
}
.ring-fill {
	fill: none;
	stroke: var(--accent);
	stroke-width: 8;
	stroke-linecap: round;
	transition: stroke-dashoffset 1s ease;
}
.ring-center {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	text-align: center;
}
.ring-value {
	font-size: 24px;
	font-weight: 700;
	color: var(--text-primary);
}
.ring-label {
	font-size: 11px;
	color: var(--text-muted);
	text-transform: uppercase;
}

/* --- GROUP 24: Mini Stat Cards --- */
.stat-mini {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 16px;
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
}
.stat-mini-icon {
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--accent-gradient);
	border-radius: var(--radius);
	color: white;
}
.stat-mini-icon svg {
	width: 20px;
	height: 20px;
}
.stat-mini-value {
	font-size: 20px;
	font-weight: 700;
	color: var(--text-primary);
}
.stat-mini-label {
	font-size: 12px;
	color: var(--text-muted);
}

/* --- GROUP 25: Empty States --- */
.empty-state {
	text-align: center;
	padding: 48px 24px;
	color: var(--text-muted);
}
.empty-state-icon {
	width: 64px;
	height: 64px;
	margin: 0 auto 16px;
	opacity: 0.4;
}
.empty-state-title {
	font-size: 16px;
	font-weight: 600;
	color: var(--text-secondary);
	margin-bottom: 8px;
}
.empty-state-text {
	font-size: 14px;
	max-width: 320px;
	margin: 0 auto;
}

/* --- GROUP 26: Inline Code --- */
code {
	font-family: var(--font-mono);
	font-size: 0.9em;
	padding: 2px 6px;
	background: var(--bg-hover);
	border: 1px solid var(--border);
	border-radius: 4px;
	color: var(--accent);
}
pre {
	font-family: var(--font-mono);
	font-size: 13px;
	padding: 16px;
	background: var(--bg-input);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	overflow-x: auto;
	margin: 16px 0;
}
pre code {
	padding: 0;
	background: none;
	border: none;
	color: var(--text-primary);
}

/* --- GROUP 27: Timeline Content --- */
.timeline-content {
	font-size: 13px;
	color: var(--text-primary);
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

/* --- GROUP 28: System Info Strip --- */
.sys-strip {
	display: flex;
	justify-content: space-between;
	padding: 10px 16px;
	background: var(--bg-secondary);
	border-radius: var(--radius);
	border: 1px solid var(--border);
	font-family: var(--font-mono);
	font-size: 11px;
	color: var(--text-muted);
	margin-bottom: 24px;
	box-shadow: var(--shadow-sm);
}

/* --- GROUP 29: Final Mobile Overrides ---
 * MUST be last in the file so these beat the GROUP base definitions
 * by CSS source order (same specificity, later wins).
 */
@media (max-width: 768px) {
	/* === Prevent ALL horizontal overflow on mobile === */
	body, .main {
		overflow-x: hidden;
		max-width: 100vw;
	}
	.card {
		overflow-x: auto;
		max-width: 100%;
	}

	/* Table: remove negative margins that break out of cards */
	.table-container {
		margin: 0;
		padding: 0;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		max-width: 100%;
	}
	table {
		min-width: 0;
		font-size: 12px;
	}
	/* Truncate long cell text */
	td, th {
		padding: 6px 6px;
		font-size: 11px;
		max-width: 120px;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
	/* First column (Name) — allow wrapping */
	td:first-child {
		max-width: 140px;
		white-space: normal;
		word-break: break-word;
	}

	/* KPI grid */
	.kpi-grid-6 {
		grid-template-columns: repeat(3, 1fr);
		gap: 6px;
		margin-bottom: 12px;
	}
	.kpi-grid {
		grid-template-columns: repeat(3, 1fr);
		gap: 6px;
	}
	.kpi-card {
		padding: 8px 10px;
	}
	.kpi-value {
		font-size: 18px;
	}
	.kpi-label {
		font-size: 9px;
		margin-bottom: 2px;
		letter-spacing: 0.08em;
	}

	/* Charts — constrain to card width */
	.chart-container {
		height: 120px;
		gap: 4px;
		padding-top: 10px;
		max-width: 100%;
		overflow: hidden;
	}
	.bar-col {
		gap: 4px;
	}
	.spark-chart {
		height: 80px;
		padding: 8px 0;
		margin-bottom: 8px;
	}

	/* Horizontal bars — must stay inside card */
	.h-bar-row {
		gap: 6px;
		margin-bottom: 8px;
		max-width: 100%;
		overflow: hidden;
	}
	.h-bar-label {
		width: 70px;
		min-width: 70px;
		font-size: 10px;
	}
	.h-bar-track {
		min-width: 0;
		flex: 1;
	}
	.h-bar-count {
		width: 28px;
		min-width: 28px;
		font-size: 11px;
	}

	/* Donut */
	.donut-chart {
		width: 120px;
		height: 120px;
	}
	.donut-hole {
		width: 80px;
		height: 80px;
	}
	.donut-total {
		font-size: 18px;
	}
	.donut-label {
		font-size: 9px;
	}

	/* Legend */
	.legend {
		gap: 8px;
		margin-top: 12px;
	}
	.legend-item {
		font-size: 11px;
	}

	/* Service health */
	.service-grid {
		grid-template-columns: 1fr 1fr;
		gap: 8px;
	}
	.service-item {
		padding: 8px;
		gap: 8px;
	}

	/* Tier cards */
	.tier-cards {
		grid-template-columns: repeat(3, 1fr);
		gap: 8px;
	}
	.tier-card {
		padding: 10px;
	}
	.tier-card .tier-value {
		font-size: 18px;
	}
	.tier-card .tier-icon {
		display: none;
	}

	/* Dashboard grid */
	.dashboard-grid {
		grid-template-columns: 1fr;
	}

	/* Sys strip */
	.sys-strip {
		display: none;
	}

	/* Timeline / feed */
	.feed-list {
		max-height: 200px;
	}
	.timeline-item {
		margin-bottom: 12px;
	}
}

@media (max-width: 480px) {
	td, th {
		max-width: 100px;
		font-size: 10px;
		padding: 5px 4px;
	}
	td:first-child {
		max-width: 110px;
	}
	.kpi-grid-6,
	.kpi-grid {
		grid-template-columns: repeat(3, 1fr);
		gap: 4px;
	}
	.kpi-card {
		padding: 6px 8px;
	}
	.kpi-value {
		font-size: 15px;
	}
	.kpi-label {
		font-size: 8px;
		margin-bottom: 1px;
	}
	.chart-container {
		height: 100px;
		gap: 2px;
	}
	.donut-chart {
		width: 100px;
		height: 100px;
	}
	.donut-hole {
		width: 66px;
		height: 66px;
	}
	.donut-total {
		font-size: 16px;
	}
	.service-grid {
		grid-template-columns: 1fr;
		gap: 6px;
	}
	.tier-cards {
		grid-template-columns: repeat(2, 1fr);
	}
	.h-bar-label {
		width: 55px;
		min-width: 55px;
		font-size: 9px;
	}
	.h-bar-count {
		width: 24px;
		min-width: 24px;
		font-size: 10px;
	}
}

@media (max-width: 640px) {
	.service-grid {
		grid-template-columns: 1fr;
	}
	.chart-container {
		height: 110px;
	}
	.spark-chart {
		height: 70px;
	}
}
