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

html,
html, body {
	margin: 0;
	padding: 0;
	background-color: #2c3035;
	overflow-x: hidden;
	width: 100%;
	height: 100%;
}


.mapboxgl-ctrl-group {
	background: #2c3035;
	border-radius: 0.5em;
}

.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon {
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E");
}

.mapboxgl-ctrl-asset-track {
	background-image: url("media/button-asset.svg");
	background-size: cover;
}

.mapboxgl-ctrl-asset-track.searching {
	background-image: url("media/button-asset-searching.svg");
}

.mapboxgl-ctrl-asset-track.locked {
	background-image: url("media/button-asset-track.svg");
}

.mapboxgl-ctrl-asset-track.locked.focused {
	background-image: url("media/button-asset-track-focus.svg") !important;
}

/* ---- Dot marker (original style — element is the circle) ---- */
.asset-marker-element {
	z-index: 100;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid #666;
	border-radius: 50%;
	padding: 0;
	background-color: #808080;
	height: 26px;
	width: 26px;
	cursor: pointer;
	font-size: 11px;
	font-weight: bold;
	color: white;
	text-shadow: 0 0 2px rgba(0,0,0,0.5);
	box-shadow: 0 2px 4px rgba(0,0,0,0.3);
	transition: background-color 0.3s ease, border-color 0.3s ease;
	pointer-events: auto;
}

.asset-marker-element.selected {
	z-index: 200;
	border-color: #FFD700;
	border-width: 2px;
	box-shadow: 0 0 8px rgba(255,215,0,0.6);
}
.asset-marker-element.live     { z-index: 150; }
.asset-marker-element.live.selected { z-index: 250; }

.asset-marker-element.live {
	background-color: #05cb63;
	border-color: #04a850;
	animation: pulse-dot 2s infinite;
}

.asset-marker-element .marker-text {
	position: relative;
	z-index: 2;
}

@media (hover: hover) and (pointer: fine) {
	.asset-marker-element:hover {
		transform: scale(1.2);
		box-shadow: 0 3px 6px rgba(0,0,0,0.4);
		z-index: 300 !important;
	}
}

/* ---- Vehicle icon markers — wrapper overrides dot circle style ---- */
.asset-marker-element.marker-type-car,
.asset-marker-element.marker-type-speedboat,
.asset-marker-element.marker-type-bicycle {
	background: none;
	border: none;
	border-radius: 0;
	box-shadow: none;
	width: auto;
	height: auto;
	overflow: visible;
	position: relative;
}

.asset-marker-element .marker-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	filter: drop-shadow(0 2px 3px rgba(0,0,0,0.4));
	transition: filter 0.3s ease, transform 0.3s ease;
}

.asset-marker-element.live.marker-type-car .marker-icon,
.asset-marker-element.live.marker-type-speedboat .marker-icon,
.asset-marker-element.live.marker-type-bicycle .marker-icon {
	filter: drop-shadow(0 0 5px rgba(5,203,99,0.9)) drop-shadow(0 2px 3px rgba(0,0,0,0.4));
	animation: pulse-icon 2s infinite;
}

.asset-marker-element.selected.marker-type-car .marker-icon,
.asset-marker-element.selected.marker-type-speedboat .marker-icon,
.asset-marker-element.selected.marker-type-bicycle .marker-icon {
	filter: drop-shadow(0 0 5px rgba(255,215,0,0.8)) drop-shadow(0 2px 3px rgba(0,0,0,0.4));
}

/* External label bubble for vehicle icons */
.asset-marker-element .marker-label {
	position: absolute;
	bottom: calc(100% + 4px);
	left: 50%;
	transform: translateX(-50%);
	white-space: nowrap;
	background: rgba(20,20,20,0.82);
	color: #fff;
	font-size: 10px;
	font-weight: 600;
	padding: 2px 5px;
	border-radius: 4px;
	pointer-events: none;
	box-shadow: 0 1px 3px rgba(0,0,0,0.5);
	letter-spacing: 0.02em;
}
.asset-marker-element .marker-label::after {
	content: '';
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	width: 1px;
	height: 4px;
	background: rgba(255,255,255,0.5);
}
.asset-marker-element.selected .marker-label {
	background: rgba(180,140,0,0.9);
}

/* ---- Direction arrow (dot markers only) ---- */
.asset-marker-element .direction-arrow {
	position: absolute;
	top: -10px;
	left: 50%;
	transform: translateX(-50%);
	width: 0;
	height: 0;
	border-left: 6px solid transparent;
	border-right: 6px solid transparent;
	border-bottom: 10px solid #333;
	filter: drop-shadow(0 -1px 0 #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(1px 0 0 #fff);
	opacity: 0;
	transition: opacity 0.3s ease, transform 0.3s ease;
	pointer-events: none;
	z-index: 1;
	transform-origin: 50% calc(100% + 13px);
}

.asset-marker-element.moving .direction-arrow {
	opacity: 1;
}

#map[data-style="satellite"] .asset-marker-element .direction-arrow {
	border-bottom-color: #ffffff;
	filter: drop-shadow(0 -1px 0 #333) drop-shadow(0 1px 0 #333) drop-shadow(-1px 0 0 #333) drop-shadow(1px 0 0 #333);
}

/* ---- External label bubble ---- */
.asset-marker-element .marker-label {
	position: absolute;
	bottom: calc(100% + 2px); /* sits just above the icon */
	left: 50%;
	transform: translateX(-50%);
	white-space: nowrap;
	background: rgba(20,20,20,0.82);
	color: #fff;
	font-size: 10px;
	font-weight: 600;
	padding: 2px 5px;
	border-radius: 4px;
	pointer-events: none;
	box-shadow: 0 1px 3px rgba(0,0,0,0.5);
	letter-spacing: 0.02em;
}

/* Connector line from label to icon */
.asset-marker-element .marker-label::after {
	content: '';
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	width: 1px;
	height: 4px;
	background: rgba(255,255,255,0.5);
}

/* Selected label gets gold tint */
.asset-marker-element.selected .marker-label {
	background: rgba(180,140,0,0.9);
}

@keyframes pulse-dot {
	0%, 100% { box-shadow: 0 0 8px rgba(5,203,99,0.8); }
	50%       { box-shadow: 0 0 20px rgba(5,203,99,1), 0 0 30px rgba(5,203,99,0.6); }
}

@keyframes pulse-icon {
	0%, 100% { filter: drop-shadow(0 0 3px rgba(5,203,99,0.7)) drop-shadow(0 2px 3px rgba(0,0,0,0.4)); }
	50%       { filter: drop-shadow(0 0 8px rgba(5,203,99,1))   drop-shadow(0 2px 3px rgba(0,0,0,0.4)); }
}

.gw-marker-element {
	background-color: rgba(200, 220, 255, 0.92);
	border: 1px solid #7a9cc4;
	border-radius: 6px;
	color: #1a2a3a;
	font-size: 10px;
	font-weight: 600;
	padding: 2px 5px;
	white-space: nowrap;
	pointer-events: none;
	user-select: none;
}


.mapboxgl-popup {
	z-index: 1000 !important;
	max-width: none !important;
}

.mapboxgl-popup-content {
	background: rgba(20, 20, 30, 0.92);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	color: #e0e0e0;
	border-radius: 12px;
	padding: 14px 18px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.08);
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-size: 13px;
	line-height: 1.5;
	min-width: 280px;
	max-width: 360px;
}

.mapboxgl-popup-content h3 {
	margin: 0 0 8px 0;
	font-size: 15px;
	font-weight: 600;
	color: #ffffff;
	letter-spacing: 0.3px;
	text-transform: uppercase;
	border-bottom: 1px solid rgba(255, 255, 255, 0.12);
	padding-bottom: 8px;
	display: flex;
	align-items: center;
	gap: 8px;
}

.device-type-badge {
	font-size: 10px;
	font-weight: 500;
	letter-spacing: 0.5px;
	text-transform: none;
	padding: 2px 7px;
	border-radius: 4px;
	background: rgba(255, 255, 255, 0.1);
	color: #aaa;
}

.copy-coords-btn {
	background: none;
	border: none;
	outline: none;
	cursor: pointer;
	padding: 0 2px;
	margin-left: 4px;
	vertical-align: middle;
	color: #aaa;
	opacity: 0.6;
	transition: opacity 0.2s;
	line-height: 1;
}

@media (hover: hover) and (pointer: fine) {
	.copy-coords-btn:hover {
		opacity: 1;
	}
}

.copy-coords-btn svg {
	vertical-align: middle;
}

.mapboxgl-popup-content p {
	margin: 4px 0;
	color: #c0c0c0;
}

.mapboxgl-popup-content p strong {
	color: #e0e0e0;
}

.mapboxgl-popup-content em {
	color: #999;
}

.mapboxgl-popup-content hr {
	border: 0;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	margin: 10px 0;
}

.mapboxgl-popup-tip {
	border-top-color: rgba(20, 20, 30, 0.92) !important;
}

.mapboxgl-popup-anchor-top .mapboxgl-popup-tip {
	border-bottom-color: rgba(20, 20, 30, 0.92) !important;
	border-top-color: transparent !important;
}

.mapboxgl-popup-anchor-left .mapboxgl-popup-tip {
	border-right-color: rgba(20, 20, 30, 0.92) !important;
	border-top-color: transparent !important;
}

.mapboxgl-popup-anchor-right .mapboxgl-popup-tip {
	border-left-color: rgba(20, 20, 30, 0.92) !important;
	border-top-color: transparent !important;
}

.mapboxgl-user-location {
	z-index: 2;
}

.mapboxgl-ctrl-group button {
	height: 50px;
	width: 50px;
}

.mapboxgl-ctrl-attrib.mapboxgl-compact {
	min-width: 50px;
	min-height: 50px;
}
.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon {
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg width='50' height='50' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E%3C/svg%3E");
}

#asset-menu-button a {
	font-size: large;
	font-weight: bold;
	color: white;
}

@media only screen and (max-width: 640px) {
	.mapboxgl-ctrl-attrib-button {
		display: none !important;
	}
	.mapboxgl-ctrl-attrib.mapboxgl-compact {
		display: none !important;
	}
	.mapboxgl-ctrl-attrib.mapboxgl-compact-show {
		padding-right: 58px;
	}
	body:not(.admin-body):not(.login-body) {
		display: flex;
		align-items: center;
		justify-content: center;
	}
	#menu {
		display: none;
		top: 20%;
		height: auto;
		width: 90%;
	}
}


/* State 0: Searching (Red) - No asset data */
.mapboxgl-ctrl-asset-track.searching {
	background-color: #ff4444;
	border: 2px solid #cc0000;
}

.mapboxgl-ctrl-asset-track.inactive {
	cursor: default;
	pointer-events: none;
}

/* State 1: Unlocked (Green outline) - Asset found but not tracking */
.mapboxgl-ctrl-asset-track:not(.searching):not(.locked) {
	background-color: transparent;
	border: 2px solid #05cb63;
}

/* State 2/3: Locked (Solid green) - Tracking enabled */
.mapboxgl-ctrl-asset-track.locked {
	background-color: #05cb63;
	border: 2px solid #04a850;
}

/* State 2: Locked & Focused (Bright green) - Actively centering */
.mapboxgl-ctrl-asset-track.locked.focused {
	background-color: #06e070;
	border: 2px solid #05cb63;
	box-shadow: 0 0 8px #05cb63;
}
/* Remove SVG backgrounds and use pure color coding */
.mapboxgl-ctrl-asset-track {
	width: 29px;
	height: 29px;
	background-size: cover;
	border-radius: 4px;
	position: relative;
}

/* Add location pin icon using CSS */
.mapboxgl-ctrl-asset-track::before {
	content: '📍';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	font-size: 16px;
}

/* State 0: Searching (Red) - No data */
.mapboxgl-ctrl-asset-track.searching {
	background-color: #ff4444 !important;
	border: 2px solid #cc0000 !important;
	background-image: none !important;
}

.mapboxgl-ctrl-asset-track.inactive {
	cursor: default !important;
	pointer-events: none !important;
}

/* State 1: Unlocked (Green outline) - Found but not tracking */
.mapboxgl-ctrl-asset-track:not(.searching):not(.locked) {
	background-color: transparent !important;
	border: 2px solid #05cb63 !important;
	background-image: none !important;
}

/* State 2/3: Locked (Solid green) - Tracking enabled */
.mapboxgl-ctrl-asset-track.locked {
	background-color: #05cb63 !important;
	border: 2px solid #04a850 !important;
	background-image: none !important;
}

/* State 2: Locked & Focused (Bright green) - Actively centering */
.mapboxgl-ctrl-asset-track.locked.focused {
	background-color: #06e070 !important;
	border: 2px solid #05cb63 !important;
	box-shadow: 0 0 8px #05cb63 !important;
	background-image: none !important;
}

/* Checkbox styling for visibility controls */
.submenu-item input[type="checkbox"] {
	margin-right: 4px;
	width: 16px;
	height: 16px;
	cursor: pointer;
	accent-color: #4CAF50;
}

.submenu-item input[type="checkbox"]:not(.hidden-radio) {
	display: inline-block;
}

/* Disabled checkbox styling */
.submenu-item input[type="checkbox"]:disabled {
	cursor: not-allowed;
	opacity: 0.4;
}

/* Disabled checkbox items - visual indication */
#visibility .submenu-item:has(input[type="checkbox"]:disabled) {
	opacity: 0.5;
	cursor: not-allowed;
}

@media (hover: hover) and (pointer: fine) {
	#visibility .submenu-item:has(input[type="checkbox"]:disabled):hover {
		background: #3d434d !important;
		box-shadow: none;
		transform: none;
	}
}

/* Compact grid layout for visibility — fixed 4-column grid */
#visibility.submenu {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	grid-gap: 6px;
	padding: 8px;
}

/* Compact grid layout for tracking — fixed 4-column grid */
#tracking.submenu {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	grid-gap: 6px;
	padding: 8px;
}

/* None option spans 1 column */
#track-none-item {
	grid-column: span 1;
}

#visibility .submenu-item,
#tracking .submenu-item {
	padding: 5px 2px;
	text-align: center;
	font-size: 13px;
	min-width: 0; /* Allow items to shrink below content size */
}

#visibility .submenu-label,
#tracking .submenu-label {
	display: flex;
	align-items: center;
	justify-content: center;
	white-space: nowrap;
	font-weight: 500;
}

/* Tracking section highlighting */
#tracking .submenu-item-selected {
	background-color: #FFD700;
	color: #000;
}

/* Asset freshness indicators - colorblind friendly */
#visibility .submenu-item.asset-fresh {
	background: #2a5a2a !important; /* Dark green background - fresh data */
	border: 2px solid #4CAF50;
}

#visibility .submenu-item.asset-stale {
	background: #5a4a2a !important; /* Dark amber background - stale data */
	border: 2px solid #FFA726;
}

#visibility .submenu-item.asset-none {
	background: #3d434d !important; /* Default gray - no data yet */
	border: 2px solid #666;
}

/* Hover states for fresh/stale */
@media (hover: hover) and (pointer: fine) {
	#visibility .submenu-item.asset-fresh:hover {
		background: #357a35 !important;
	}

	#visibility .submenu-item.asset-stale:hover {
		background: #6a5a3a !important;
	}
}

/* Stale cutoff dropdown */
#stale-cutoff {
	cursor: pointer;
	margin-top: 2px;
}

@media (hover: hover) and (pointer: fine) {
	#stale-cutoff:hover {
		background: #454a52;
	}
}

/* Make sections more distinct */
#menu h3 {
	margin-top: 10px;
	margin-bottom: 6px;
	border-bottom: 2px solid #444;
	padding-bottom: 4px;
	font-size: 15px;
}

#menu h3:first-of-type {
	margin-top: 0;
}

/* Toggle all button */
.toggle-all-btn {
	background-color: #444;
	color: white;
	border: 1px solid #666;
	padding: 6px 12px;
	border-radius: 4px;
	cursor: pointer;
	font-size: 12px;
	font-weight: 500;
	transition: background-color 0.2s;
}

@media (hover: hover) and (pointer: fine) {
	.toggle-all-btn:hover {
		background-color: #555;
	}
}

.toggle-all-btn:active {
	background-color: #333;
}

.toggle-all-btn.active {
	background-color: #2a5a3a;
	border-color: #4a9a6a;
	color: #90ffb0;
}

/* Make menu more compact, offset below toolbar + asset menu button */
#menu {
	width: calc(100vw - 20px);
	padding: 14px;
	max-height: calc(90vh - 110px);
	top: 110px !important;
	overflow-y: auto;
}

/* Responsive - fewer columns on very small screens */
@media only screen and (max-width: 640px) {
	#visibility.submenu,
	#tracking.submenu {
		grid-template-columns: repeat(4, 1fr);
	}
	
	#track-none-item {
		grid-column: span 1;
	}
	
	#menu {
		width: 92vw;
		max-height: 80vh;
		padding: 8px;
		top: 5%;
		left: 50%;
		transform: translateX(-50%);
		margin: 0;
		box-sizing: border-box;
	}
	
	#menu h3 {
		font-size: 14px;
		margin-top: 6px;
		margin-bottom: 4px;
	}
	
	#visibility .submenu-item,
	#tracking .submenu-item {
		padding: 8px 4px;
		font-size: 13px;
	}
	
	#visibility.submenu,
	#tracking.submenu {
		grid-gap: 5px;
		padding: 5px;
	}
}
/* Scale control - positioned to the right of the Mapbox logo */
.mapboxgl-ctrl-scale {
	background-color: rgba(44, 48, 53, 0.85);
	border: 2px solid #aaa;
	border-top: none;
	color: #fff;
	font-size: 11px;
	padding: 2px 5px;
	font-family: "Open Sans", sans-serif;
	position: fixed !important;
	bottom: 4px;
	left: 50%;
	transform: translateX(-50%);
}


/* Zoom +/- buttons - white icons on dark background */
.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon,
button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon,
.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon {
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff'%3E%3Cpath d='M14.5 8.5a1 1 0 0 1 1 1v4h4a1 1 0 0 1 0 2h-4v4a1 1 0 0 1-2 0v-4h-4a1 1 0 0 1 0-2h4v-4a1 1 0 0 1 1-1z'/%3E%3C/svg%3E") !important;
}

.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon,
button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon,
.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon {
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff'%3E%3Cpath d='M9.5 13.5a1 1 0 0 0 0 2h10a1 1 0 0 0 0-2h-10z'/%3E%3C/svg%3E") !important;
}

/* Navigate-to-asset button */
.mapboxgl-ctrl-navigate {
	position: relative;
	background: none !important;
	background-image: none !important;
}

.mapboxgl-ctrl-navigate::before {
	content: '🧭';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	font-size: 20px;
}

.mapboxgl-ctrl-navigate.active {
	background-color: #06e070 !important;
	border: 2px solid #05cb63 !important;
	box-shadow: 0 0 8px #05cb63 !important;
	background-image: none !important;
}

/* Compass indicator */
.compass-indicator {
	pointer-events: none;
}

.compass-indicator svg {
	display: block;
}

/* Heading-up mode button */
.mapboxgl-ctrl-heading-up {
	position: relative;
	background: none !important;
	background-image: none !important;
}

.mapboxgl-ctrl-heading-up::before {
	content: '⬆';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	font-size: 20px;
	color: white;
}

.mapboxgl-ctrl-heading-up.active {
	background-color: #06e070 !important;
	border: 2px solid #05cb63 !important;
	box-shadow: 0 0 8px #05cb63 !important;
	background-image: none !important;
}

/* Allow Mapbox markers to overlap */
.mapboxgl-marker {
	pointer-events: auto !important;
	transform-style: preserve-3d;
}

/* Ensure marker elements can overlap */
.mapboxgl-marker .asset-marker-element {
	pointer-events: auto !important;
}

/* ============================================================
   MAP TOOLBAR (v2 additions)
   ============================================================ */

.map-toolbar {
	position: fixed;
	top: 0;
	right: 0;
	left: 0;
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
	padding: 8px 12px;
	background: #2c3035;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	pointer-events: none; /* let map clicks through except on buttons */
}

.map-toolbar a,
.map-toolbar button {
	pointer-events: auto;
}

.toolbar-btn {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 5px 12px;
	border-radius: 6px;
	border: 1px solid transparent;
	font-size: 13px;
	font-weight: 500;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	cursor: pointer;
	text-decoration: none;
	transition: background 0.15s;
}

.toolbar-btn.admin-btn {
	background: rgba(5, 203, 99, 0.12);
	color: #05cb63;
	border-color: rgba(5, 203, 99, 0.3);
}

@media (hover: hover) and (pointer: fine) {
	.toolbar-btn.admin-btn:hover {
		background: rgba(5, 203, 99, 0.22);
	}
}

.toolbar-btn.logout-btn,
.toolbar-btn.home-btn {
	background: rgba(255, 80, 80, 0.12);
	color: #ff6b6b;
	border-color: rgba(255, 80, 80, 0.3);
}

@media (hover: hover) and (pointer: fine) {
	.toolbar-btn.logout-btn:hover,
	.toolbar-btn.home-btn:hover {
		background: rgba(255, 80, 80, 0.22);
	}
}

/* Offset map controls down so they don't overlap toolbar */
.mapboxgl-ctrl-top-left,
.mapboxgl-ctrl-top-right {
	top: 46px !important;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */

html:has(.login-body), html:has(.login-body) body {
	height: 100%;
	overflow: hidden;
	overscroll-behavior: none;
	-webkit-overflow-scrolling: auto;
	position: fixed;
	width: 100%;
}

.login-body {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
	min-height: 100dvh;
	height: 100dvh;
	overflow: hidden;
	overscroll-behavior: none;
	background: #1a1a2e;
}

.login-container {
	width: 100%;
	max-width: 360px;
	padding: 40px 32px;
	background: #2c3035;
	border-radius: 16px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
	margin: 16px;
}

.login-logo {
	text-align: center;
	margin-bottom: 16px;
}

.login-title {
	text-align: center;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-size: 22px;
	font-weight: 600;
	color: #ffffff;
	margin-bottom: 28px;
}

.login-form {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.login-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.login-field label {
	font-size: 13px;
	color: #aaa;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.login-field input {
	padding: 10px 14px;
	background: #3a3f47;
	border: 1px solid #555;
	border-radius: 8px;
	color: #ffffff;
	font-size: 15px;
	outline: none;
	transition: border-color 0.2s;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.login-field input:focus {
	border-color: #05cb63;
}

.login-error {
	padding: 10px 14px;
	background: rgba(255, 80, 80, 0.12);
	border: 1px solid rgba(255, 80, 80, 0.4);
	border-radius: 8px;
	color: #ff6b6b;
	font-size: 13px;
	text-align: center;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.login-btn {
	padding: 12px;
	width: 100%;
	background: #05cb63;
	border: none;
	border-radius: 8px;
	color: #000;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

@media (hover: hover) and (pointer: fine) {
	.login-btn:hover {
		background: #06e070;
	}
}

.login-btn:disabled {
	background: #444;
	color: #888;
	cursor: not-allowed;
}

.login-btn-secondary {
	background: #3a3f47;
	border: 1px solid #555;
	color: #ffffff;
	width: 100%;
}

@media (hover: hover) and (pointer: fine) {
	.login-btn-secondary:hover {
		background: #484e57;
	}
}

.login-btn-link {
	background: none;
	border: none;
	color: #888;
	font-size: 13px;
	cursor: pointer;
	padding: 4px 0;
	text-decoration: underline;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	text-align: center;
}

@media (hover: hover) and (pointer: fine) {
	.login-btn-link:hover { color: #aaa; }
}

.login-hidden { display: none; }
#login-build-id { text-align: center; font-size: 10px; color: rgba(255,255,255,0.2); font-family: monospace; margin-top: 16px; }
.login-contact-link { color: rgba(255,255,255,0.2); text-decoration: none; }
@media (hover: hover) and (pointer: fine) {
	.login-contact-link:hover { color: rgba(255,255,255,0.45); }
}
.login-field-nomargin { margin-bottom: 0; }
.login-btn-top { margin-top: 12px; }

/* ============================================================
   HOME / LANDING PAGE
   ============================================================ */

.home-actions {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.home-btn {
	text-align: center;
	text-decoration: none;
}

.home-btn-secondary {
	background: rgba(255, 255, 255, 0.08);
	color: #e0e0e0;
	border: 1px solid rgba(255, 255, 255, 0.15);
}

@media (hover: hover) and (pointer: fine) {
	.home-btn-secondary:hover {
		background: rgba(255, 255, 255, 0.14);
	}
}

.home-logout-btn {
	margin-top: 20px;
	width: 100%;
	padding: 10px;
	background: none;
	border: none;
	color: #666;
	font-size: 13px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	cursor: pointer;
	transition: color 0.2s;
}

@media (hover: hover) and (pointer: fine) {
	.home-logout-btn:hover {
		color: #ff6b6b;
	}
}

/* ============================================================
   ADMIN PAGE
   ============================================================ */

.admin-body {
	background: #1a1a2e;
	min-height: 100vh;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	color: #e0e0e0;
}

.admin-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 12px;
	background: #2c3035;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	position: sticky;
	top: 0;
	z-index: 10;
}

.admin-header h1 {
	font-size: 18px;
	font-weight: 600;
	color: #fff;
	margin: 0;
}

.admin-header-actions {
	display: flex;
	gap: 8px;
}

.admin-content {
	max-width: 1000px;
	margin: 0 auto;
	padding: 24px 16px;
}

.admin-section {
	margin-bottom: 40px;
}

.admin-section-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}

.admin-section-header h2 {
	font-size: 16px;
	font-weight: 600;
	color: #fff;
}

.admin-section-desc {
	color: #aaa;
	font-size: 13px;
	margin: 0 0 12px;
}

.settings-msg-hidden { display: none; }

.admin-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.admin-table th {
	text-align: left;
	padding: 10px 12px;
	background: #2c3035;
	color: #aaa;
	font-weight: 500;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-table td {
	padding: 10px 12px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
	vertical-align: middle;
}

@media (hover: hover) and (pointer: fine) {
	.admin-table tr:hover td {
		background: rgba(255, 255, 255, 0.03);
	}
}

.admin-table .color-swatch {
	display: inline-block;
	width: 14px;
	height: 14px;
	border-radius: 3px;
	border: 1px solid rgba(255,255,255,0.2);
	vertical-align: middle;
	margin-right: 4px;
}

.admin-table .actions {
	white-space: nowrap;
	display: flex;
	gap: 6px;
}

.btn {
	display: inline-flex;
	align-items: center;
	padding: 5px 12px;
	border-radius: 6px;
	border: 1px solid transparent;
	font-size: 13px;
	font-weight: 500;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	cursor: pointer;
	text-decoration: none;
	transition: background 0.15s;
	background: rgba(255,255,255,0.08);
	color: #e0e0e0;
	border-color: rgba(255,255,255,0.12);
}

@media (hover: hover) and (pointer: fine) {
	.btn:hover {
		background: rgba(255,255,255,0.14);
	}
}

.btn-primary {
	background: #05cb63;
	color: #000;
	border-color: #04a850;
}

@media (hover: hover) and (pointer: fine) {
	.btn-primary:hover {
		background: #06e070;
	}
}

.btn-danger {
	background: rgba(255, 80, 80, 0.12);
	color: #ff6b6b;
	border-color: rgba(255, 80, 80, 0.3);
}

@media (hover: hover) and (pointer: fine) {
	.btn-danger:hover {
		background: rgba(255, 80, 80, 0.22);
	}
}

.btn-warning {
	background: rgba(240, 165, 0, 0.12);
	color: #f0a500;
	border-color: rgba(240, 165, 0, 0.3);
}

@media (hover: hover) and (pointer: fine) {
	.btn-warning:hover {
		background: rgba(240, 165, 0, 0.22);
	}
}

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

/* Modal */
.modal-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.6);
	z-index: 100;
	align-items: center;
	justify-content: center;
}

.modal-overlay.open {
	display: flex;
}

.modal {
	background: #2c3035;
	border-radius: 12px;
	padding: 28px 24px;
	width: 100%;
	max-width: 440px;
	margin: 16px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.modal h3 {
	font-size: 17px;
	font-weight: 600;
	color: #fff;
	margin: 0 0 20px 0;
}

.form-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-bottom: 14px;
}

.form-field label {
	font-size: 13px;
	color: #aaa;
}

.form-hint {
	color: #777;
	font-size: 12px;
}

.form-field input,
.form-field select {
	padding: 8px 12px;
	background: #3a3f47;
	border: 1px solid #555;
	border-radius: 6px;
	color: #fff;
	font-size: 14px;
	outline: none;
	transition: border-color 0.2s;
}

.form-field input:focus,
.form-field select:focus {
	border-color: #05cb63;
}

.form-field .color-row {
	display: flex;
	gap: 8px;
	align-items: center;
}

.form-field .color-row input[type="color"] {
	width: 44px;
	height: 36px;
	padding: 2px;
	cursor: pointer;
	border-radius: 6px;
}

.form-field .color-row input[type="text"] {
	flex: 1;
}

.form-actions {
	display: flex;
	gap: 8px;
	justify-content: flex-end;
	margin-top: 20px;
}

.modal-error {
	padding: 8px 12px;
	background: rgba(255, 80, 80, 0.12);
	border: 1px solid rgba(255, 80, 80, 0.4);
	border-radius: 6px;
	color: #ff6b6b;
	font-size: 13px;
	margin-bottom: 14px;
	display: none;
}

.modal-success {
	padding: 8px 12px;
	background: rgba(5, 203, 99, 0.1);
	border: 1px solid rgba(5, 203, 99, 0.3);
	border-radius: 6px;
	color: #05cb63;
	font-size: 13px;
	margin-bottom: 14px;
}

/* Assignment modal checkboxes */
.assign-list {
	max-height: 260px;
	overflow-y: auto;
	border: 1px solid #444;
	border-radius: 6px;
	padding: 8px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-bottom: 14px;
}

.assign-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 8px;
	border-radius: 5px;
	background: #3a3f47;
	cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
	.assign-item:hover {
		background: #454a52;
	}
}

.assign-item label {
	cursor: pointer;
	flex: 1;
	font-size: 14px;
}

.admin-empty {
	color: #666;
	font-style: italic;
	font-size: 14px;
	padding: 12px;
}

#build-id-footer {
	text-align: center;
	font-family: monospace;
	font-size: 12px;
	color: rgba(255,255,255,0.3);
	padding: 24px 16px;
}

.setting-row-standalone {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 10px 12px;
	background: rgba(255,255,255,0.03);
	border-radius: 6px;
	margin-top: 12px;
	max-width: 400px;
}
.setting-row-standalone label {
	font-size: 13px;
	color: rgba(255,255,255,0.7);
}
.setting-row-standalone select {
	background: #1e2228;
	color: #d6dbe1;
	border: 1px solid rgba(255,255,255,0.1);
	border-radius: 4px;
	padding: 6px 8px;
	font-size: 14px;
}

.settings-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 8px;
	margin-top: 12px;
}
@media (min-width: 720px) {
	.settings-grid { grid-template-columns: 1fr 1fr; }
}

.settings-col {
	background: rgba(255,255,255,0.03);
	border-radius: 8px;
	padding: 4px 12px;
}

.setting-toggle {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 0;
	border-bottom: 1px solid rgba(255,255,255,0.06);
	cursor: pointer;
	user-select: none;
}
.setting-toggle:last-child { border-bottom: none; }
@media (hover: hover) and (pointer: fine) {
	.setting-toggle:hover span { color: #fff; }
}
.setting-toggle input[type="checkbox"] {
	width: 16px;
	height: 16px;
	accent-color: #05cb63;
	flex-shrink: 0;
}
.setting-toggle span {
	color: #d6dbe1;
	font-size: 14px;
}

.password-form {
	display: flex;
	flex-direction: column;
	gap: 12px;
	max-width: 400px;
	margin-top: 12px;
}
.password-form .form-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.password-form label {
	font-size: 13px;
	color: rgba(255,255,255,0.7);
}
.password-form input[type="password"] {
	background: #1e2228;
	color: #d6dbe1;
	border: 1px solid rgba(255,255,255,0.1);
	border-radius: 4px;
	padding: 8px 10px;
	font-size: 14px;
}
.password-form input[type="password"]:focus {
	outline: none;
	border-color: rgba(5, 203, 99, 0.5);
}
.password-form button {
	align-self: flex-start;
}

.badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 4px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.5px;
	text-transform: uppercase;
}

.badge-admin {
	background: rgba(5, 203, 99, 0.15);
	color: #05cb63;
	border: 1px solid rgba(5, 203, 99, 0.3);
}

.badge-user {
	background: rgba(255, 255, 255, 0.08);
	color: #aaa;
	border: 1px solid rgba(255,255,255,0.1);
}

@media (max-width: 640px) {
	.admin-content {
		padding: 16px 8px;
	}

	/* Scrollable compact table on mobile — one row per asset/user */
	.admin-section {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}
	.admin-table {
		min-width: 360px;
		font-size: 13px;
	}
	.admin-table th,
	.admin-table td {
		padding: 8px 10px;
		white-space: nowrap;
	}
	.admin-table td[data-label]::before {
		display: none;
	}
	/* Hide Colors and Created columns on mobile — accessible via Edit modal */
	.admin-table td.col-colors,
	.admin-table td.col-created,
	.admin-table th.col-colors,
	.admin-table th.col-created {
		display: none;
	}
	.admin-table .actions {
		flex-wrap: wrap;
		gap: 6px;
	}
}