:root {
	color-scheme: dark;
	--bg-primary: #0a0e17;
	--bg-secondary: #111726;
	--bg-tertiary: #182236;
	--bg-card: rgba(18, 26, 43, 0.85);
	--bg-card-hover: rgba(26, 38, 62, 0.95);
	--border-color: #23314d;
	--border-light: #324367;
	--accent-orange: #ff5e00;
	--accent-orange-glow: rgba(255, 94, 0, 0.35);
	--accent-cyan: #00d2ff;
	--accent-cyan-glow: rgba(0, 210, 255, 0.3);
	--accent-emerald: #10b981;
	--accent-purple: #a855f7;
	--accent-rose: #f43f5e;
	--text-main: #f1f5f9;
	--text-muted: #94a3b8;
	--text-dim: #64748b;
	--font-heading: 'Chakra Petch', sans-serif;
	--font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
	--font-mono: 'JetBrains Mono', monospace;
	--radius-sm: 6px;
	--radius-md: 10px;
	--radius-lg: 16px;
	--radius-full: 9999px;
	--space: 1rem;
	--transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
	--shadow-glow: 0 0 25px rgba(255, 94, 0, 0.18);
	--shadow-box: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	padding: 0;
	background-color: var(--bg-primary);
	background-image: 
		radial-gradient(circle at 15% 15%, rgba(255, 94, 0, 0.08) 0%, transparent 40%),
		radial-gradient(circle at 85% 85%, rgba(0, 210, 255, 0.06) 0%, transparent 40%),
		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: 100% 100%, 100% 100%, 32px 32px, 32px 32px;
	color: var(--text-main);
	font-family: var(--font-sans);
	line-height: 1.5;
	min-height: 100vh;
	-webkit-font-smoothing: antialiased;
}

/* Base Utility & Typography */
h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-heading);
	letter-spacing: 0.02em;
	margin-top: 0;
	color: #fff;
	text-transform: uppercase;
}

.mono {
	font-family: var(--font-mono);
}

.shell {
	max-width: 1400px;
	margin: 0 auto;
	padding: 1.25rem 1rem;
}

/* Header & Nav */
.header-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.85rem 1.25rem;
	background: rgba(17, 23, 38, 0.85);
	backdrop-filter: blur(12px);
	border: 1px solid var(--border-color);
	border-radius: var(--radius-lg);
	margin-bottom: 1.5rem;
	box-shadow: var(--shadow-box);
}

.brand-wrap {
	display: flex;
	align-items: center;
	gap: 0.85rem;
}

.brand-logo {
	width: 42px;
	height: 42px;
	background: linear-gradient(135deg, var(--accent-orange), #b33900);
	border-radius: var(--radius-md);
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-family: var(--font-heading);
	font-weight: 700;
	font-size: 1.4rem;
	box-shadow: 0 0 15px var(--accent-orange-glow);
	border: 1px solid rgba(255, 255, 255, 0.2);
}

.brand-title {
	font-size: 1.35rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0;
}

.brand-tag {
	font-size: 0.65rem;
	font-family: var(--font-mono);
	background: rgba(255, 94, 0, 0.15);
	color: var(--accent-orange);
	border: 1px solid rgba(255, 94, 0, 0.3);
	padding: 0.15rem 0.45rem;
	border-radius: var(--radius-sm);
	text-transform: uppercase;
	font-weight: 600;
}

.nav-tabs {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	overflow-x: auto;
	padding-bottom: 2px;
	scrollbar-width: thin;
}

.nav-tab-btn {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	padding: 0.55rem 0.85rem;
	background: transparent;
	border: 1px solid transparent;
	border-radius: var(--radius-md);
	color: var(--text-muted);
	font-family: var(--font-sans);
	font-size: 0.875rem;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
	transition: var(--transition);
}

.nav-tab-btn:hover {
	color: #fff;
	background: rgba(255, 255, 255, 0.05);
}

.nav-tab-btn.active {
	background: var(--bg-tertiary);
	color: #fff;
	border-color: var(--border-light);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.nav-tab-btn.active .tab-icon {
	color: var(--accent-orange);
}

/* Quick Action Buttons */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.6rem 1rem;
	border-radius: var(--radius-md);
	font-family: var(--font-sans);
	font-size: 0.875rem;
	font-weight: 600;
	cursor: pointer;
	transition: var(--transition);
	border: 1px solid transparent;
	text-decoration: none;
}

.btn-primary {
	background: linear-gradient(135deg, var(--accent-orange), #d44900);
	color: #ffffff;
	border-color: rgba(255, 255, 255, 0.15);
	box-shadow: 0 4px 14px var(--accent-orange-glow);
}

.btn-primary:hover {
	background: linear-gradient(135deg, #ff6e1a, #e65100);
	transform: translateY(-1px);
	box-shadow: 0 6px 20px var(--accent-orange-glow);
}

.btn-secondary {
	background: var(--bg-tertiary);
	color: var(--text-main);
	border-color: var(--border-color);
}

.btn-secondary:hover {
	background: rgba(38, 52, 80, 0.9);
	border-color: var(--border-light);
	color: #fff;
}

.btn-cyan {
	background: linear-gradient(135deg, #00b4d8, #0077b6);
	color: #fff;
	box-shadow: 0 4px 14px var(--accent-cyan-glow);
}

.btn-cyan:hover {
	filter: brightness(1.1);
	transform: translateY(-1px);
}

.btn-sm {
	padding: 0.35rem 0.65rem;
	font-size: 0.775rem;
	border-radius: var(--radius-sm);
}

.btn-icon-only {
	padding: 0.5rem;
	border-radius: var(--radius-sm);
	aspect-ratio: 1;
}

/* Card layout & Glass */
.card {
	background: var(--bg-card);
	border: 1px solid var(--border-color);
	border-radius: var(--radius-lg);
	padding: 1.25rem;
	backdrop-filter: blur(16px);
	box-shadow: var(--shadow-box);
	position: relative;
	overflow: hidden;
}

.card-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	margin-bottom: 1.2rem;
	padding-bottom: 0.85rem;
	border-bottom: 1px solid var(--border-color);
}

.card-title-group {
	display: flex;
	align-items: center;
	gap: 0.65rem;
}

.card-title {
	font-size: 1.1rem;
	font-weight: 700;
	margin: 0;
	color: #fff;
}

.card-subtitle {
	font-size: 0.8rem;
	color: var(--text-muted);
	margin-top: 0.15rem;
}

/* Forms & Inputs */
.field {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	margin-bottom: 1rem;
}

.field label {
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--text-muted);
	text-transform: uppercase;
	letter-spacing: 0.03em;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.field label .helper-tip {
	font-size: 0.7rem;
	color: var(--accent-cyan);
	text-transform: none;
	font-family: var(--font-mono);
}

.input, .select, .textarea {
	width: 100%;
	background: #0d1422;
	border: 1px solid var(--border-color);
	border-radius: var(--radius-md);
	color: var(--text-main);
	padding: 0.65rem 0.85rem;
	font-family: var(--font-sans);
	font-size: 0.875rem;
	transition: var(--transition);
}

.input:focus, .select:focus, .textarea:focus {
	border-color: var(--accent-orange);
	outline: none;
	box-shadow: 0 0 0 3px rgba(255, 94, 0, 0.2);
	background: #111a2d;
}

.input-mono {
	font-family: var(--font-mono);
	font-size: 0.825rem;
}

.textarea {
	min-height: 120px;
	resize: vertical;
}

/* Grids & Layouts */
.studio-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1.25rem;
}

@media (max-width: 1024px) {
	.studio-grid {
		grid-template-columns: 1fr;
	}
}

.grid-3 {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
	gap: 1rem;
}

.grid-4 {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
	gap: 0.85rem;
}

.row {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex-wrap: wrap;
}

.row-between {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	flex-wrap: wrap;
}

.stack {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

/* Framework Select Cards */
.framework-card {
	background: #0e1524;
	border: 1px solid var(--border-color);
	border-radius: var(--radius-md);
	padding: 0.85rem;
	cursor: pointer;
	transition: var(--transition);
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	position: relative;
}

.framework-card:hover {
	border-color: var(--border-light);
	background: #131c30;
	transform: translateY(-2px);
}

.framework-card.selected {
	border-color: var(--accent-orange);
	background: rgba(255, 94, 0, 0.08);
	box-shadow: 0 0 16px rgba(255, 94, 0, 0.15);
}

.framework-badge {
	width: 32px;
	height: 32px;
	border-radius: var(--radius-sm);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 0.85rem;
	font-family: var(--font-heading);
	flex-shrink: 0;
}

.badge-qb { background: #3b82f6; color: #fff; }
.badge-esx { background: #10b981; color: #fff; }
.badge-qbox { background: #8b5cf6; color: #fff; }
.badge-vrp { background: #f59e0b; color: #fff; }
.badge-std { background: #64748b; color: #fff; }

/* Code Display & Terminal Output */
.code-box {
	background: #080c14;
	border: 1px solid var(--border-color);
	border-radius: var(--radius-md);
	overflow: hidden;
	position: relative;
}

.code-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.5rem 0.85rem;
	background: #0d1320;
	border-bottom: 1px solid var(--border-color);
}

.code-title {
	font-family: var(--font-mono);
	font-size: 0.75rem;
	color: var(--text-muted);
	display: flex;
	align-items: center;
	gap: 0.4rem;
}

.code-dots {
	display: flex;
	gap: 4px;
}

.code-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
}
.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: #10b981; }

.code-pre {
	margin: 0;
	padding: 1rem;
	overflow-x: auto;
	font-family: var(--font-mono);
	font-size: 0.8rem;
	line-height: 1.6;
	color: #e2e8f0;
	max-height: 520px;
	scrollbar-width: thin;
}

/* Map Studio & Canvas */
.map-canvas-container {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 10;
	min-height: 380px;
	background: #090e18;
	border: 1px solid var(--border-color);
	border-radius: var(--radius-md);
	overflow: hidden;
	box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.8);
	cursor: crosshair;
}

.map-svg-grid {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.map-marker {
	position: absolute;
	transform: translate(-50%, -50%);
	cursor: pointer;
	transition: transform 0.15s ease;
	z-index: 10;
}

.map-marker:hover {
	transform: translate(-50%, -50%) scale(1.25);
	z-index: 20;
}

.marker-pin {
	width: 22px;
	height: 22px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 0 10px rgba(0, 0, 0, 0.7);
	border: 2px solid #fff;
	font-size: 0.65rem;
	color: #fff;
	font-weight: bold;
}

.marker-police { background: #3b82f6; box-shadow: 0 0 12px #3b82f6; }
.marker-ems { background: #ef4444; box-shadow: 0 0 12px #ef4444; }
.marker-casino { background: #a855f7; box-shadow: 0 0 12px #a855f7; }
.marker-mechanic { background: #f59e0b; box-shadow: 0 0 12px #f59e0b; }
.marker-custom { background: var(--accent-orange); box-shadow: 0 0 12px var(--accent-orange); }

.map-tooltip {
	position: absolute;
	bottom: calc(100% + 6px);
	left: 50%;
	transform: translateX(-50%);
	background: rgba(10, 14, 23, 0.95);
	border: 1px solid var(--border-light);
	border-radius: var(--radius-sm);
	padding: 0.25rem 0.55rem;
	font-size: 0.7rem;
	font-family: var(--font-mono);
	white-space: nowrap;
	pointer-events: none;
	color: #fff;
	box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.map-hud-overlay {
	position: absolute;
	top: 12px;
	left: 12px;
	background: rgba(13, 19, 32, 0.85);
	backdrop-filter: blur(8px);
	border: 1px solid var(--border-color);
	border-radius: var(--radius-md);
	padding: 0.5rem 0.85rem;
	font-family: var(--font-mono);
	font-size: 0.75rem;
	color: var(--text-muted);
	pointer-events: none;
	z-index: 15;
}

.map-hud-coords {
	color: var(--accent-cyan);
	font-weight: 700;
}

/* Vehicle Tuning Sliders */
.slider-group {
	display: grid;
	gap: 0.35rem;
	background: #0d1422;
	border: 1px solid var(--border-color);
	border-radius: var(--radius-md);
	padding: 0.75rem;
	margin-bottom: 0.65rem;
}

.slider-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 0.8rem;
}

.slider-name {
	font-weight: 600;
	color: var(--text-main);
}

.slider-val {
	font-family: var(--font-mono);
	font-size: 0.8rem;
	color: var(--accent-orange);
	font-weight: 700;
}

.custom-range {
	-webkit-appearance: none;
	appearance: none;
	width: 100%;
	height: 6px;
	background: var(--bg-tertiary);
	border-radius: 4px;
	outline: none;
}

.custom-range::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: var(--accent-orange);
	cursor: pointer;
	box-shadow: 0 0 8px var(--accent-orange-glow);
	border: 2px solid #fff;
	transition: transform 0.1s ease;
}

.custom-range::-webkit-slider-thumb:hover {
	transform: scale(1.2);
}

/* Meter Gauge */
.perf-meter {
	height: 6px;
	background: rgba(255, 255, 255, 0.1);
	border-radius: 4px;
	overflow: hidden;
	margin-top: 0.35rem;
}

.perf-fill {
	height: 100%;
	background: linear-gradient(90deg, #00d2ff, #ff5e00);
	border-radius: 4px;
	transition: width 0.3s ease;
}

/* Item & Weapon Cards */
.item-card {
	background: #0e1524;
	border: 1px solid var(--border-color);
	border-radius: var(--radius-md);
	padding: 0.85rem;
	display: flex;
	align-items: center;
	gap: 0.85rem;
	transition: var(--transition);
}

.item-card:hover {
	border-color: var(--accent-cyan);
	background: #131c30;
}

.item-icon-box {
	width: 44px;
	height: 44px;
	border-radius: var(--radius-md);
	background: #182236;
	border: 1px solid var(--border-light);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.3rem;
	flex-shrink: 0;
	box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.4);
}

/* Badge System */
.badge {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	padding: 0.2rem 0.55rem;
	border-radius: var(--radius-full);
	font-size: 0.725rem;
	font-weight: 600;
	border: 1px solid var(--border-color);
	color: var(--text-muted);
}

.badge-orange {
	background: rgba(255, 94, 0, 0.12);
	color: var(--accent-orange);
	border-color: rgba(255, 94, 0, 0.3);
}

.badge-cyan {
	background: rgba(0, 210, 255, 0.12);
	color: var(--accent-cyan);
	border-color: rgba(0, 210, 255, 0.3);
}

.badge-emerald {
	background: rgba(16, 185, 129, 0.12);
	color: var(--accent-emerald);
	border-color: rgba(16, 185, 129, 0.3);
}

.badge-purple {
	background: rgba(168, 85, 247, 0.12);
	color: var(--accent-purple);
	border-color: rgba(168, 85, 247, 0.3);
}

/* Seeded Primitives & States */
.empty {
	padding: 2.5rem 1rem;
	text-align: center;
	color: var(--text-muted);
}

.empty-title {
	font-family: var(--font-heading);
	font-size: 1.15rem;
	color: #fff;
	margin-bottom: 0.35rem;
}

.loading {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	padding: 2rem;
	color: var(--text-muted);
	font-family: var(--font-mono);
	font-size: 0.85rem;
}

.spinner {
	width: 1.25rem;
	height: 1.25rem;
	border: 2px solid var(--border-color);
	border-top-color: var(--accent-orange);
	border-radius: 50%;
	animation: spin 0.75s linear infinite;
}

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

.alert {
	padding: 0.75rem 1rem;
	border-radius: var(--radius-md);
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid var(--border-color);
	border-left: 4px solid var(--accent-cyan);
	font-size: 0.85rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
}

.alert-error {
	background: rgba(244, 63, 94, 0.1);
	border-color: rgba(244, 63, 94, 0.3);
	border-left-color: var(--accent-rose);
	color: #fecdd3;
}

.alert-success {
	background: rgba(16, 185, 129, 0.1);
	border-color: rgba(16, 185, 129, 0.3);
	border-left-color: var(--accent-emerald);
	color: #a7f3d0;
}

/* Toast notification */
.toast-notice {
	position: fixed;
	bottom: 24px;
	right: 24px;
	background: #121c2e;
	border: 1px solid var(--accent-orange);
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6), 0 0 20px var(--accent-orange-glow);
	border-radius: var(--radius-md);
	padding: 0.75rem 1.2rem;
	color: #fff;
	font-size: 0.875rem;
	font-weight: 600;
	z-index: 1000;
	display: flex;
	align-items: center;
	gap: 0.6rem;
	animation: slideUp 0.25s ease-out;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
	.header-bar {
		flex-direction: column;
		align-items: stretch;
		gap: 0.75rem;
	}
	.brand-wrap {
		justify-content: space-between;
	}
	.nav-tabs {
		justify-content: flex-start;
	}
	.shell {
		padding: 0.75rem;
	}
}
