:root {
	--bg-deep: #000000;
	--bg-sidebar: #000000;
	--bg-surface: #050505;
	--bg-elevated: #080808;
	--accent: #ffffff;
	--accent-hover: #f4f4f5;
	--accent-glow: rgba(59, 130, 246, 0.3); /* Subtle blue tint for optimism */
	--text-primary: #ffffff;
	--text-secondary: #a1a1aa;
	--text-muted: #71717a;
	--border: rgba(255, 255, 255, 0.08);
	--border-focus: #ffffff;
	--danger: #f87171;
	--success: #10b981;
	--warning: #f59e0b;
	--font-main: 'JetBrains Mono', 'Inter', monospace;
	--font-mono: 'JetBrains Mono', monospace;
	--radius-sm: 8px;
	--radius-md: 12px;
	--radius-lg: 24px;
	--shadow-sm: 0 2px 4px 0 rgba(0, 0, 0, 0.5);
	--shadow-md: 0 8px 16px -4px rgba(0, 0, 0, 0.7);
	--shadow-lg: 0 20px 40px -12px rgba(0, 0, 0, 0.8);
	--glass-bg: rgba(5, 5, 5, 0.6);
	--glass-border: rgba(255, 255, 255, 0.05);
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

h1 { font-size: 20px; font-weight: 900; letter-spacing: -0.04em; }
h2 { font-size: 16px; font-weight: 800; letter-spacing: -0.03em; }
h3 { font-size: 13px; font-weight: 800; }
h4 { font-size: 11px; font-weight: 700; }

body {
	background: #000000;
	background-image:
		radial-gradient(at 50% 0%, rgba(255, 255, 255, 0.03) 0px, transparent 50%),
		radial-gradient(circle at center, #050505 0%, #000 100%);
	background-attachment: fixed;
	color: var(--text-primary);
	font-family: var(--font-main);
	line-height: 1.5;
	font-size: 12px; /* Decreased further */
	-webkit-font-smoothing: antialiased;
	height: 100dvh;
	display: flex;
	overflow: hidden;
}

/* Glassmorphism & Sci-Fi Depth */
.glass {
	background: rgba(10, 10, 10, 0.4);
	backdrop-filter: blur(40px);
	-webkit-backdrop-filter: blur(40px);
	border: 1px solid rgba(255, 255, 255, 0.03);
	box-shadow: 0 20px 80px 0 rgba(0, 0, 0, 0.8), inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

body::before {
	content: "";
	position: fixed;
	inset: 0;
	background-image:
		linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
	background-size: 40px 40px;
	pointer-events: none;
	z-index: -1;
	animation: grid-drift 120s linear infinite;
}

@keyframes grid-drift {
	from { background-position: 0 0; }
	to { background-position: 60px 60px; }
}

/* Buttons */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 10px 24px;
	font-size: 12px; /* Decreased */
	font-weight: 700;
	border-radius: 99px;
	cursor: pointer;
	transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
	border: 1px solid transparent;
	text-decoration: none;
	letter-spacing: -0.01em;
}

.btn-primary {
	background-color: #ffffff;
	color: #000000;
	box-shadow: 0 0 0 rgba(255, 255, 255, 0);
	position: relative;
	overflow: hidden;
}

.btn-primary:hover {
	background-color: #f4f4f5;
	transform: translateY(-2px);
	box-shadow: 0 10px 30px -10px rgba(255, 255, 255, 0.6);
}

.btn-primary::after {
	content: '';
	position: absolute;
	top: -50%;
	left: -60%;
	width: 20%;
	height: 200%;
	background: linear-gradient(
		to right,
		transparent,
		rgba(255, 255, 255, 0.8),
		transparent
	);
	transform: rotate(30deg);
	transition: none;
}

.btn-primary:hover::after {
	left: 120%;
	transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.btn-secondary {
	background-color: rgba(255, 255, 255, 0.05);
	color: var(--text-primary);
	border-color: rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
	background-color: rgba(255, 255, 255, 0.1);
	border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
	background-color: rgba(248, 113, 113, 0.1);
	color: var(--danger);
	border-color: rgba(248, 113, 113, 0.2);
}

.btn-danger:hover {
	background-color: rgba(248, 113, 113, 0.2);
	border-color: var(--danger);
}

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

.btn-ghost:hover {
	background: rgba(255, 255, 255, 0.05);
	color: var(--text-primary);
}

.btn-icon {
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 8px;
	border-radius: var(--radius-sm);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s;
	color: var(--text-muted);
}

.btn-icon:hover {
	background: rgba(255, 255, 255, 0.05);
	color: white;
}

/* Inputs */
.input {
	width: 100%;
	background-color: #0a0a0a;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 10px 14px;
	color: var(--text-primary);
	font-size: 12px; /* Decreased */
	outline: none;
	transition: all 0.2s ease;
}

.input:focus {
	border-color: #ffffff;
	background-color: #0f0f0f;
}

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

/* Cards */
.card {
	background: rgba(5, 5, 5, 0.8);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 4px;
	padding: 24px;
	box-shadow: none;
	position: relative;
	overflow: hidden;
	transition: all 0.3s ease;
}

@media (max-width: 480px) {
	.card {
		padding: 24px;
	}
}

@media (max-width: 360px) {
	main {
		padding: 8px;
	}
	.card {
		padding: 16px;
	}
}

.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);
}

.card:hover {
	border-color: #ffffff;
	background: rgba(10, 10, 10, 0.9);
	transform: translateY(-2px);
}

/* Grid Layouts */
.grid-2 {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 24px;
}

.grid-3 {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
}

.grid-responsive {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 24px;
}

.flex-between-responsive {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
}

.admin-row {
	display: grid;
	grid-template-columns: 200px 1fr;
	align-items: center;
	gap: 16px;
}

@media (max-width: 768px) {
	.grid-2, .grid-3 {
		grid-template-columns: 1fr;
	}

	.grid-responsive {
		grid-template-columns: 1fr;
	}

	.flex-between-responsive {
		flex-direction: column;
		align-items: flex-start;
	}

	.admin-row {
		grid-template-columns: 1fr;
		gap: 4px;
	}
}

/* Badges */
.badge {
	display: inline-flex;
	align-items: center;
	padding: 6px 14px;
	border-radius: 9999px;
	font-size: 10px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	background: rgba(10, 10, 10, 0.6);
	border: 1px solid rgba(59, 130, 246, 0.2);
	color: #fff;
	transition: all 0.3s;
	animation: breathing-glow 4s infinite ease-in-out;
}

.badge:hover {
	background: rgba(59, 130, 246, 0.15);
	border-color: rgba(59, 130, 246, 0.5);
	box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

@keyframes breathing-glow {
	0%, 100% { border-color: rgba(59, 130, 246, 0.2); box-shadow: 0 0 5px rgba(59, 130, 246, 0.1); }
	50% { border-color: rgba(59, 130, 246, 0.5); box-shadow: 0 0 15px rgba(59, 130, 246, 0.2); }
}

.badge-primary {
	background-color: rgba(255, 255, 255, 0.1);
	color: #ffffff;
	border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Glow Utilities */
.glow-text {
	text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.glow-bg {
	position: absolute;
	filter: blur(100px);
	z-index: -1;
	pointer-events: none;
	opacity: 0.15;
}

/* Sidebar & Layout */
.sidebar {
	width: 260px;
	background: var(--bg-sidebar);
	border-right: 1px solid var(--border);
	display: flex;
	flex-direction: column;
	height: 100dvh;
	flex-shrink: 0;
	z-index: 100;
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-wrapper {
	flex: 1;
	display: flex;
	flex-direction: column;
	height: 100dvh;
	overflow: hidden;
	position: relative;
}

header {
	height: 60px;
	border-bottom: 1px solid var(--border);
	background: rgba(0, 0, 0, 0.8);
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 20px;
	gap: 12px;
	position: relative;
	z-index: 90;
}

main {
	flex: 1;
	overflow-y: auto;
	padding: 20px;
	background: transparent;
}

.table-container {
	width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.table-container table {
	min-width: 600px;
}

.menu-toggle {
	display: none;
	background: transparent;
	border: none;
	color: white;
	cursor: pointer;
	padding: 8px;
	border-radius: var(--radius-sm);
}

.menu-toggle:hover {
	background: rgba(255, 255, 255, 0.05);
}

@media (max-width: 768px) {
	.sidebar {
		position: fixed;
		transform: translateX(-100%);
	}

	.sidebar.open {
		transform: translateX(0);
		box-shadow: 20px 0 50px rgba(0,0,0,0.8);
	}

	.menu-toggle {
		display: flex;
		align-items: center;
		justify-content: center;
	}

	header {
		padding: 0 12px;
		gap: 8px;
	}

	main {
		padding: 8px;
	}

	.search-container {
		max-width: none;
		flex: 1;
		justify-content: flex-end;
	}

	.search-mobile-toggle {
		display: flex !important;
	}

	.search-input-wrapper {
		display: none !important;
		position: absolute;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		background: var(--bg-deep);
		z-index: 10;
		align-items: center;
	}

	.search-input-wrapper.active {
		display: flex !important;
	}

	.search-container input {
		padding: 8px 10px 8px 36px;
		font-size: 12px;
	}

	.user-profile-compact {
		display: flex !important;
	}

	.user-profile-compact div:first-child {
		display: none;
	}
}

.nav-link {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 24px;
	color: var(--text-secondary);
	text-decoration: none;
	font-size: 12px; /* Decreased */
	font-weight: 500;
	transition: all 0.2s;
}

.nav-link:hover {
	color: var(--text-primary);
	background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
	color: #ffffff;
	background: rgba(255, 255, 255, 0.05);
	border-right: 2px solid #ffffff;
}

/* Search Bar */
.search-container {
	position: relative;
	max-width: 400px;
	width: 100%;
	display: flex;
	align-items: center;
}

.search-mobile-toggle {
	display: none;
	background: transparent;
	border: none;
	color: var(--text-muted);
	cursor: pointer;
	padding: 8px;
	border-radius: var(--radius-sm);
}

.search-mobile-toggle svg {
	width: 20px;
	height: 20px;
	fill: currentColor;
}

.search-input-wrapper {
	position: relative;
	width: 100%;
}

.search-input-wrapper svg {
	position: absolute;
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
	width: 16px;
	height: 16px;
	fill: var(--text-muted);
}

.search-container input {
	width: 100%;
	background: var(--bg-surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	padding: 10px 12px 10px 40px;
	color: white;
	font-size: 13px;
	outline: none;
	transition: border-color 0.2s;
}

.search-container input:focus {
	border-color: #ffffff;
}

/* Alerts & Errors */
.error-msg {
	background: rgba(248, 113, 113, 0.1);
	color: var(--danger);
	border: 1px solid rgba(248, 113, 113, 0.2);
	padding: 12px;
	border-radius: var(--radius-md);
	margin-bottom: 24px;
	font-size: 13px;
	text-align: center;
}

.success-msg {
	background: rgba(16, 185, 129, 0.1);
	color: var(--success);
	border: 1px solid rgba(16, 185, 129, 0.2);
	padding: 12px;
	border-radius: var(--radius-md);
	margin-bottom: 24px;
	font-size: 13px;
	text-align: center;
}

/* Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInLeft {
	from { opacity: 0; transform: translateX(-40px); }
	to { opacity: 1; transform: translateX(0); }
}
@keyframes pulse { 0% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.1); opacity: 0.7; } 100% { transform: scale(1); opacity: 1; } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

.animate-fade-in { animation: fadeIn 0.6s ease-out forwards; }
.animate-slide-up { animation: slideUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
@media (min-width: 769px) {
	.animate-boot-sidebar { animation: slideInLeft 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
}

/* Iframe Content Utility */
body.iframe-content {
	height: auto !important;
	min-height: 100% !important;
	display: block !important;
	overflow-y: auto !important;
	background: transparent !important;
}

/* Skeleton Loader */
.skeleton {
	background: linear-gradient(90deg, #0a0a0a 25%, #18181b 50%, #0a0a0a 75%);
	background-size: 200% 100%;
	animation: shimmer 1.5s infinite linear;
	border-radius: var(--radius-sm);
}

.skeleton-text { height: 16px; width: 100%; margin-bottom: 8px; }
.skeleton-title { height: 24px; width: 60%; margin-bottom: 16px; }
.skeleton-avatar { width: 48px; height: 48px; border-radius: 50%; }
.skeleton-card { height: 120px; width: 100%; border-radius: var(--radius-lg); }

.skeleton-overlay {
	position: fixed;
	inset: 0;
	z-index: 1000;
	background: #000;
	padding: 20px;
}

/* Status Dot Animation */
.status-dot {
	width: 8px; height: 8px; border-radius: 50%; background: var(--success); display: inline-block; position: relative; margin-right: 8px;
}
.status-dot::after {
	content: ''; position: absolute; inset: -2px; border-radius: 50%; border: 1px solid var(--success); animation: pulse 2s infinite;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb {
	background: #18181b;
	border-radius: 10px;
	border: 2px solid var(--bg-deep);
}
::-webkit-scrollbar-thumb:hover { background: #ffffff; }
