/* =============================================================
 * gpscom — header.css   (v2 — fully self-contained redesign)
 * All classes are prefixed `gh-` so legacy `style.css` /
 * `style.custom.php` rules cannot reach this header. Loaded LAST.
 * Targets `#gh-header` only — old `#top_panel` selectors stay
 * isolated to legacy pages.
 * ============================================================= */

/* Hide the original legacy top panel — replaced by #gh-header */
#top_panel.panel_not_cpanel { display: none !important; }
body.cpanel #top_panel,
#cpanel #top_panel { display: none !important; }

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

/* ---------- root bar ---------- */
#gh-header {
	--gh-bg-0: #0B1422;
	--gh-bg-1: #0F1B2B;
	--gh-bg-2: #13253A;
	--gh-bg-3: #1A2D44;
	--gh-line: rgba(255,255,255,0.07);
	--gh-line-2: rgba(255,255,255,0.14);
	--gh-text: #E5EAF0;
	--gh-text-2: #97A4B5;
	--gh-text-3: #6E7E92;
	--gh-accent: #4DA3FF;
	--gh-accent-2: #2D7DD9;
	--gh-warn: #FB9739;
	--gh-warn-2: #E37615;
	--gh-danger: #E21B1B;
	--gh-success: #3AD350;
	--gh-radius: 12px;
	--gh-radius-sm: 9px;
	--gh-shadow: 0 8px 30px rgba(0,0,0,0.55), 0 1px 0 rgba(255,255,255,0.04) inset;

	position: sticky;
	top: 0;
	left: 0;
	right: 0;
	z-index: 10000;
	height: 64px;
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 0 16px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
	font-size: 13px;
	color: var(--gh-text);
	background:
		radial-gradient(120% 200% at 0% 0%, rgba(77,163,255,0.10) 0%, transparent 55%),
		linear-gradient(180deg, rgba(15,27,43,0.96), rgba(11,20,34,0.92));
	border-bottom: 1px solid var(--gh-line);
	box-shadow: var(--gh-shadow);
	-webkit-backdrop-filter: saturate(180%) blur(20px);
	backdrop-filter: saturate(180%) blur(20px);
}
#gh-header a, #gh-header a:hover, #gh-header a:visited {
	color: inherit;
	text-decoration: none;
}
#gh-header button {
	font: inherit;
	color: inherit;
	background: none;
	border: 0;
	padding: 0;
	cursor: pointer;
}

/* ---------- brand block (hamburger + logo) ---------- */
.gh-brand {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 0 0 auto;
}
.gh-burger {
	width: 40px;
	height: 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--gh-radius-sm);
	background: rgba(255,255,255,0.04);
	border: 1px solid var(--gh-line);
	color: var(--gh-text);
	transition: background .15s, border-color .15s, transform .08s;
}
.gh-burger:hover { background: rgba(255,255,255,0.10); border-color: var(--gh-line-2); }
.gh-burger:active { transform: scale(0.97); }
.gh-burger svg { width: 18px; height: 18px; fill: currentColor; }
.gh-logo {
	display: inline-flex;
	align-items: center;
	height: 48px;
	padding: 0 6px;
}
.gh-logo img {
	height: 42px;
	width: auto;
	filter: drop-shadow(0 3px 8px rgba(0,0,0,0.55));
	transition: transform .15s;
}
.gh-logo:hover img { transform: scale(1.04); }

/* ---------- divider between brand and nav ---------- */
.gh-divider {
	width: 1px;
	height: 28px;
	background: var(--gh-line-2);
	margin: 0 4px;
	flex: 0 0 auto;
}

/* ---------- main nav (left side) ---------- */
.gh-nav {
	display: flex;
	align-items: center;
	gap: 2px;
	flex: 1 1 auto;
	min-width: 0;
	overflow: visible;
}
.gh-nav-item {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 40px;
	padding: 0 12px;
	border-radius: var(--gh-radius-sm);
	color: var(--gh-text-2);
	font-weight: 500;
	letter-spacing: 0.1px;
	white-space: nowrap;
	border: 1px solid transparent;
	transition: background .15s, color .15s, border-color .15s;
	cursor: pointer;
	position: relative;
}
.gh-nav-item:hover {
	color: #fff;
	background: rgba(255,255,255,0.06);
}
.gh-nav-item.is-active {
	color: #fff;
	background: rgba(77,163,255,0.14);
	border-color: rgba(77,163,255,0.32);
}
.gh-nav-item.is-active::after {
	content: "";
	position: absolute;
	left: 12px;
	right: 12px;
	bottom: -1px;
	height: 2px;
	border-radius: 2px;
	background: linear-gradient(90deg, var(--gh-accent), var(--gh-accent-2));
}
.gh-nav-item .gh-nav-ico {
	width: 18px;
	height: 18px;
	flex: 0 0 auto;
	color: currentColor;
}
.gh-nav-item .gh-nav-ico svg {
	width: 100%; height: 100%;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	display: block;
}
.gh-nav-item .gh-nav-label {
	font-size: 13px;
	line-height: 1;
}
.gh-nav-item .gh-pill-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 999px;
	font-size: 10px;
	font-weight: 700;
	line-height: 1;
	color: #fff;
	background: linear-gradient(180deg, #FF6B6B, var(--gh-danger));
	box-shadow: 0 2px 6px rgba(226,27,27,0.45);
	border: 2px solid var(--gh-bg-1);
}

/* ---------- More menu (left overflow) ---------- */
.gh-more { position: relative; }
.gh-more-trigger { padding-right: 8px; }
.gh-more-trigger .gh-caret {
	width: 14px; height: 14px;
	transition: transform .18s;
	stroke: currentColor;
	fill: none;
	stroke-width: 2.5;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.gh-more.is-open .gh-more-trigger { background: rgba(255,255,255,0.10); color: #fff; }
.gh-more.is-open .gh-more-trigger .gh-caret { transform: rotate(180deg); }
.gh-menu {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	min-width: 260px;
	background: rgba(15,27,43,0.96);
	border: 1px solid var(--gh-line);
	border-radius: var(--gh-radius);
	box-shadow: 0 18px 50px rgba(0,0,0,0.55);
	-webkit-backdrop-filter: saturate(180%) blur(22px);
	backdrop-filter: saturate(180%) blur(22px);
	padding: 6px;
	opacity: 0;
	transform: translateY(-6px) scale(0.985);
	pointer-events: none;
	transition: opacity .14s, transform .14s;
	z-index: 10010;
}
.gh-menu.is-open {
	opacity: 1;
	transform: none;
	pointer-events: auto;
}
.gh-menu-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 10px;
	border-radius: 8px;
	color: var(--gh-text);
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	white-space: nowrap;
	transition: background .12s, color .12s;
}
.gh-menu-item:hover { background: rgba(255,255,255,0.07); color: #fff; }
.gh-menu-item .gh-menu-ico {
	width: 28px;
	height: 28px;
	border-radius: 8px;
	background: rgba(255,255,255,0.05);
	color: var(--gh-text-2);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
}
.gh-menu-item .gh-menu-ico svg {
	width: 16px; height: 16px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.gh-menu-item:hover .gh-menu-ico {
	background: rgba(77,163,255,0.18);
	color: var(--gh-accent);
}

/* ---------- right cluster ---------- */
.gh-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 0 0 auto;
}

/* ---------- account button (avatar pill, also dropdown trigger) ---------- */
.gh-account { position: relative; }
.gh-account-btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	height: 40px;
	padding: 4px 12px 4px 4px;
	border-radius: 999px;
	background: rgba(255,255,255,0.04);
	border: 1px solid var(--gh-line);
	color: var(--gh-text);
	transition: background .15s, border-color .15s;
}
.gh-account-btn:hover { background: rgba(255,255,255,0.10); border-color: var(--gh-line-2); }
.gh-account.is-open .gh-account-btn { background: rgba(77,163,255,0.16); border-color: rgba(77,163,255,0.40); }
.gh-account-avatar {
	width: 32px; height: 32px;
	border-radius: 999px;
	background: linear-gradient(135deg, var(--gh-accent), var(--gh-accent-2));
	color: #fff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 13px;
	letter-spacing: 0.4px;
	flex: 0 0 auto;
	box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 4px 10px rgba(77,163,255,0.32);
	overflow: hidden;
}
.gh-account-avatar img {
	width: 100%; height: 100%;
	object-fit: cover;
	display: block;
}
.gh-account-name {
	display: inline-block;
	font-size: 13px;
	font-weight: 600;
	color: var(--gh-text);
	max-width: 130px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	line-height: 1;
}
.gh-account-caret {
	width: 14px; height: 14px;
	color: var(--gh-text-2);
	stroke: currentColor;
	fill: none;
	stroke-width: 2.5;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: transform .18s;
}
.gh-account.is-open .gh-account-caret {
	transform: rotate(180deg);
	color: #fff;
}
.gh-account-btn .gh-pill-count {
	margin-left: -4px;
}

/* ---------- account dropdown ---------- */
.gh-dropdown {
	position: absolute;
	top: calc(100% + 10px);
	right: 0;
	width: 300px;
	background: rgba(11,20,34,0.97);
	border: 1px solid var(--gh-line);
	border-radius: var(--gh-radius);
	box-shadow: 0 22px 60px rgba(0,0,0,0.6);
	-webkit-backdrop-filter: saturate(180%) blur(24px);
	backdrop-filter: saturate(180%) blur(24px);
	padding: 8px;
	opacity: 0;
	transform: translateY(-8px) scale(0.98);
	pointer-events: none;
	transition: opacity .16s, transform .16s;
	z-index: 10010;
}
.gh-account.is-open .gh-dropdown {
	opacity: 1;
	transform: none;
	pointer-events: auto;
}
.gh-dropdown::before {
	content: "";
	position: absolute;
	top: -6px;
	right: 22px;
	width: 12px; height: 12px;
	background: rgba(11,20,34,0.97);
	border-left: 1px solid var(--gh-line);
	border-top: 1px solid var(--gh-line);
	transform: rotate(45deg);
}
.gh-dd-head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px;
	border-radius: 10px;
	background: linear-gradient(135deg, rgba(77,163,255,0.18), rgba(77,163,255,0.04));
	margin-bottom: 6px;
}
.gh-dd-avatar {
	width: 44px; height: 44px;
	border-radius: 999px;
	background: linear-gradient(135deg, var(--gh-accent), var(--gh-accent-2));
	color: #fff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 16px;
	flex: 0 0 auto;
	overflow: hidden;
	box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, 0 6px 14px rgba(77,163,255,0.32);
}
.gh-dd-avatar img { width: 100%; height: 100%; object-fit: cover; }
.gh-dd-meta { min-width: 0; flex: 1 1 auto; }
.gh-dd-name {
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.gh-dd-sub {
	color: var(--gh-text-2);
	font-size: 11px;
	margin-top: 2px;
}
.gh-dd-section {
	padding: 4px 0;
	border-top: 1px solid var(--gh-line);
	margin-top: 4px;
}
.gh-dd-section:first-of-type { border-top: 0; margin-top: 0; }
.gh-dd-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 10px;
	border-radius: 8px;
	color: var(--gh-text);
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: background .12s, color .12s;
}
.gh-dd-item:hover { background: rgba(255,255,255,0.07); color: #fff; }
.gh-dd-item .gh-dd-ico {
	width: 30px; height: 30px;
	border-radius: 8px;
	background: rgba(255,255,255,0.05);
	color: var(--gh-text-2);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
}
.gh-dd-item .gh-dd-ico svg {
	width: 16px; height: 16px;
	fill: none; stroke: currentColor; stroke-width: 2;
	stroke-linecap: round; stroke-linejoin: round;
}
.gh-dd-item:hover .gh-dd-ico {
	background: rgba(77,163,255,0.18);
	color: var(--gh-accent);
}
.gh-dd-item .gh-dd-text { flex: 1 1 auto; }
.gh-dd-item .gh-dd-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 999px;
	font-size: 10px;
	font-weight: 700;
	line-height: 1;
	color: #fff;
	background: linear-gradient(180deg, #FF6B6B, var(--gh-danger));
	box-shadow: 0 2px 6px rgba(226,27,27,0.4);
}
.gh-dd-item--danger { color: #FF8B8B; }
.gh-dd-item--danger:hover { background: rgba(226,27,27,0.16); color: #fff; }
.gh-dd-item--danger:hover .gh-dd-ico {
	background: rgba(226,27,27,0.24);
	color: #fff;
}

.gh-dd-lang { padding: 4px 6px 6px; }
.gh-dd-lang-label {
	display: block;
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	color: var(--gh-text-3);
	margin: 0 4px 6px;
}
.gh-dd-select {
	width: 100% !important;
	height: 36px !important;
	background: rgba(255,255,255,0.04) !important;
	border: 1px solid var(--gh-line) !important;
	border-radius: 8px !important;
	color: var(--gh-text) !important;
	padding: 0 30px 0 10px !important;
	font-size: 13px !important;
	-webkit-appearance: none !important;
	appearance: none !important;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2397A4B5' stroke-width='2.5'><polyline points='6 9 12 15 18 9'/></svg>") !important;
	background-repeat: no-repeat !important;
	background-position: right 10px center !important;
	box-shadow: none !important;
}
.gh-dd-select:focus {
	border-color: var(--gh-accent) !important;
	box-shadow: 0 0 0 3px rgba(77,163,255,0.18) !important;
	outline: none !important;
}

/* dropdown CTA buttons (cpanel/billing variants) */
.gh-dd-item--cta {
	background: linear-gradient(180deg, var(--gh-warn), var(--gh-warn-2));
	color: #0F1B2B !important;
	font-weight: 700;
	box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 4px 12px rgba(251,151,57,0.25);
}
.gh-dd-item--cta:hover { filter: brightness(1.06); color: #0F1B2B !important; }
.gh-dd-item--cta .gh-dd-ico { background: rgba(0,0,0,0.18); color: #0F1B2B; }
.gh-dd-item--cta:hover .gh-dd-ico { background: rgba(0,0,0,0.22); color: #0F1B2B; }

.gh-dd-item--blue {
	background: linear-gradient(180deg, var(--gh-accent), var(--gh-accent-2));
	color: #fff !important;
	font-weight: 700;
	box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 4px 12px rgba(77,163,255,0.32);
}
.gh-dd-item--blue:hover { filter: brightness(1.06); color: black !important; }
.gh-dd-item--blue .gh-dd-ico { background: rgba(0,0,0,0.18); color: #fff; }
.gh-dd-item--blue:hover .gh-dd-ico { background: rgba(0,0,0,0.24); color: #fff; }

/* ---------- legacy escape: hide any remnant of old top_panel inside #gh-header ---------- */
#gh-header .more-btn,
#gh-header .more_buttons_designs,
#gh-header .tp-menu,
#gh-header .left-menu,
#gh-header .right-menu { all: unset; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
	.gh-nav-item .gh-nav-label { font-size: 12.5px; }
}
@media (max-width: 1100px) {
	#gh-header { gap: 8px; padding: 0 12px; }
	.gh-nav-item.is-collapsible .gh-nav-label { display: none; }
	.gh-nav-item.is-collapsible { padding: 0 10px; }
	.gh-account-name { max-width: 90px; }
}
@media (max-width: 900px) {
	.gh-logo { display: none; }
	.gh-divider { display: none; }
	.gh-nav-item.is-collapsible:not(.is-essential) { display: none; }
}
@media (max-width: 720px) {
	#gh-header { height: 56px; padding: 0 10px; }
	.gh-nav-item:not(.is-essential):not(.gh-more-trigger) { display: none; }
	.gh-account-name { display: none; }
	.gh-account-btn { padding: 4px; }
}
@media (max-width: 560px) {
	.gh-dropdown {
		position: fixed;
		top: 60px;
		right: 8px;
		left: 8px;
		width: auto;
	}
	.gh-dropdown::before { display: none; }
	.gh-menu {
		position: fixed;
		top: 60px;
		left: 8px;
		right: 8px;
		min-width: 0;
	}
}

/* ---------- cpanel: no More menu — labels visible in full,
 *           tight spacing, counter stacked BELOW label. ---------- */
#gh-header.gh-on-cpanel .gh-nav {
	flex-wrap: nowrap;
	overflow: hidden;
	min-width: 0;
	gap: 0;
}
#gh-header.gh-on-cpanel .gh-nav-item {
	flex: 0 0 auto;
	gap: 6px;
	padding: 0 7px;
	letter-spacing: 0;
	line-height: 1.1;
}
/* Label becomes a 2-row stack: title on top, counter under it. */
#gh-header.gh-on-cpanel .gh-nav-item .gh-nav-label {
	display: inline-flex;
	flex-direction: row;
	align-items: flex-start;
	justify-content: center;
	white-space: nowrap;
	overflow: visible;
	text-overflow: clip;
	font-size: 12.5px;
	line-height: 1.15;
}
#gh-header.gh-on-cpanel .gh-nav-item .gh-nav-stat {
	margin: 1px 0 0 0;
	padding: 0 6px;
	font-size: 10px;
	line-height: 14px;
	min-width: 14px;
	text-align: center;
	align-self: flex-start;
}
#gh-header.gh-on-cpanel .gh-nav-item .gh-nav-stat:empty { display: none; }

@media (max-width: 1500px) {
	#gh-header.gh-on-cpanel .gh-nav-item { padding: 0 6px; gap: 5px; }
	#gh-header.gh-on-cpanel .gh-nav-item .gh-nav-label { font-size: 12px; }
}
@media (max-width: 1360px) {
	#gh-header.gh-on-cpanel .gh-nav-item { padding: 0 5px; gap: 4px; }
	#gh-header.gh-on-cpanel .gh-nav-item .gh-nav-label { font-size: 11.5px; }
	#gh-header.gh-on-cpanel .gh-nav-item .gh-nav-stat { font-size: 9.5px; padding: 0 5px; }
}
@media (max-width: 1240px) {
	#gh-header.gh-on-cpanel .gh-nav-item { padding: 0 4px; gap: 3px; }
	#gh-header.gh-on-cpanel .gh-nav-item .gh-nav-label { font-size: 11px; }
}
/* Very narrow: icons-only (counter still visible as tiny pill on icon). */
@media (max-width: 1100px) {
	#gh-header.gh-on-cpanel .gh-nav-item .gh-nav-label { display: none !important; }
	#gh-header.gh-on-cpanel .gh-nav-item.is-collapsible {
		display: inline-flex !important;
		padding: 0 8px;
		gap: 0;
		position: relative;
	}
	#gh-header.gh-on-cpanel .gh-nav-item .gh-nav-ico { display: inline-flex !important; }
}
@media (max-width: 720px) {
	#gh-header.gh-on-cpanel .gh-nav-item { padding: 0 6px; }
}

@media (prefers-reduced-motion: reduce) {
	#gh-header *,
	.gh-dropdown,
	.gh-menu,
	.gh-account-caret,
	.gh-caret { transition: none !important; }
}

/* ---------- light theme overrides ---------- */
#gh-header {
	--gh-bg-0: #F6F9FE;
	--gh-bg-1: #FFFFFF;
	--gh-bg-2: #F1F6FF;
	--gh-bg-3: #E7F0FF;
	--gh-line: rgba(26, 42, 70, 0.12);
	--gh-line-2: rgba(26, 42, 70, 0.2);
	--gh-text: #14233B;
	--gh-text-2: #445D7F;
	--gh-text-3: #6B82A0;
	--gh-accent: #2F80ED;
	--gh-accent-2: #1F6BD3;
	--gh-shadow: 0 8px 26px rgba(20,35,59,0.12), 0 1px 0 rgba(255,255,255,0.9) inset;

	background:
		radial-gradient(95% 170% at 0% 0%, rgba(47,128,237,0.09) 0%, transparent 52%),
		linear-gradient(180deg, rgba(255,255,255,0.96), rgba(246,249,254,0.95));
	border-bottom: 1px solid var(--gh-line);
	color: var(--gh-text);
}

.gh-burger,
.gh-account-btn,
.gh-nav-item,
.gh-menu-item .gh-menu-ico,
.gh-dd-item .gh-dd-ico {
	background: rgba(47,128,237,0.05);
	border-color: var(--gh-line);
}

.gh-burger:hover,
.gh-account-btn:hover,
.gh-nav-item:hover {
	background: rgba(47,128,237,0.12);
	border-color: rgba(47,128,237,0.26);
	color: #0E1F3B;
}

.gh-nav-item { color: var(--gh-text-2); }
.gh-nav-item.is-active {
	color: #0E1F3B;
	background: rgba(47,128,237,0.16);
	border-color: rgba(47,128,237,0.28);
}

.gh-menu {
	background: rgba(255,255,255,0.98);
	border-color: var(--gh-line);
	box-shadow: 0 16px 44px rgba(20,35,59,0.18);
}
.gh-menu-item { color: var(--gh-text); }
.gh-menu-item:hover { background: rgba(47,128,237,0.11); color: #0E1F3B; }
.gh-menu-item:hover .gh-menu-ico,
.gh-dd-item:hover .gh-dd-ico {
	background: rgba(47,128,237,0.16);
	color: var(--gh-accent-2);
}

.gh-dropdown {
	background: rgba(255,255,255,0.99);
	border-color: var(--gh-line);
	box-shadow: 0 18px 46px rgba(20,35,59,0.2);
}
.gh-dropdown::before {
	background: rgba(255,255,255,0.99);
	border-left: 1px solid var(--gh-line);
	border-top: 1px solid var(--gh-line);
}

.gh-dd-name { color: #0E1F3B; }
.gh-dd-item { color: var(--gh-text); }
.gh-dd-item:hover { background: rgba(47,128,237,0.1); color: #0E1F3B; }

.gh-dd-select {
	background-color: rgba(47,128,237,0.05) !important;
	border-color: var(--gh-line) !important;
	color: var(--gh-text) !important;
}

/* hide collapsed nav items (moved into More via JS) */
.gh-nav-item.is-overflowed { display: none !important; }
.gh-overflow-separator {
	height: 1px;
	background: var(--gh-line);
	margin: 4px 6px;
}

/* rely on JS overflow, do not hard-hide desktop items */
@media (max-width: 1100px) {
	#gh-header { gap: 10px; padding: 0 12px; }
	.gh-nav-item.is-collapsible .gh-nav-label { display: inline-block; }
	.gh-nav-item.is-collapsible { padding: 0 12px; }
	.gh-account-name { max-width: 110px; }
}
@media (max-width: 900px) {
	.gh-logo { display: inline-flex; }
	.gh-divider { display: block; }
	.gh-nav-item.is-collapsible:not(.is-essential) { display: inline-flex; }
}

/* very small screens: appbar icon opens drawer menu */
@media (max-width: 700px) {
	#gh-header {
		height: 56px;
		padding: 0 10px;
	}
	.gh-nav,
	.gh-actions,
	.gh-divider { display: none !important; }
	.gh-logo img { height: 34px; }
	.gh-burger {
		width: 38px;
		height: 38px;
	}
}

/* mobile sidebar menu */
#gh-mobile-overlay {
	position: fixed;
	inset: 0;
	background: rgba(7, 16, 30, 0.42);
	opacity: 0;
	pointer-events: none;
	transition: opacity .2s;
	z-index: 11000;
}
#gh-mobile-overlay.is-open {
	opacity: 1;
	pointer-events: auto;
}

#gh-mobile-drawer {
	position: fixed;
	top: 0;
	left: 0;
	bottom: 0;
	width: min(86vw, 320px);
	background: #FFFFFF;
	border-right: 1px solid var(--gh-line);
	box-shadow: 12px 0 30px rgba(20,35,59,0.18);
	transform: translateX(-102%);
	transition: transform .2s;
	z-index: 11010;
	display: flex;
	flex-direction: column;
}
#gh-mobile-drawer.is-open { transform: translateX(0); }
.gh-mobile-drawer-head {
	height: 56px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 12px;
	border-bottom: 1px solid var(--gh-line);
	font-size: 14px;
	font-weight: 700;
	color: #112139;
}
.gh-mobile-close {
	width: 34px;
	height: 34px;
	border-radius: 8px;
	background: rgba(47,128,237,0.08);
	border: 1px solid var(--gh-line);
	font-size: 21px;
	line-height: 1;
	color: #1D3557;
}
.gh-mobile-drawer-items {
	padding: 8px;
	overflow: auto;
	flex: 1 1 auto;
}
.gh-mobile-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px;
	border-radius: 10px;
	color: #1A2D46;
	text-decoration: none;
	font-size: 13px;
	font-weight: 600;
}
.gh-mobile-item:hover { background: rgba(47,128,237,0.1); }
.gh-mobile-item-ico {
	width: 28px;
	height: 28px;
	border-radius: 8px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: rgba(47,128,237,0.1);
	color: #2F80ED;
	flex: 0 0 auto;
}
.gh-mobile-item-ico svg {
	width: 16px;
	height: 16px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* map color reset: ensure default leaflet colors, no filters */
#map,
#map .leaflet-tile-pane,
#map .leaflet-tile,
#map .leaflet-pane,
#map .leaflet-pane img.leaflet-tile,
#trip_modal_map .leaflet-tile-pane,
#trip_modal_map .leaflet-tile,
.event-map-modal .leaflet-tile-pane,
.event-map-modal .leaflet-tile {
	filter: none !important;
	-webkit-filter: none !important;
	mix-blend-mode: normal !important;
	background: transparent !important;
}
/* leaflet controls back to defaults — strip any inherited filters */
.leaflet-bar,
.leaflet-bar a,
.leaflet-control,
.leaflet-control a,
.leaflet-control a span,
.leaflet-control-zoom-in,
.leaflet-control-zoom-out,
.leaflet-control-zoom-in span,
.leaflet-control-zoom-out span,
.icon-clusters, .icon-traffic, .icon-fit-objects,
.icon-ruler, .icon-measure, .icon-objects, .icon-text,
.icon-route-route, .icon-route-snap, .icon-route-arrow,
.icon-route-data-point, .icon-route-event, .icon-route-stop {
	filter: none !important;
	-webkit-filter: none !important;
}

/* =============================================================
 *  FINAL HEADER POLISH (overrides above)
 *  - flat nav items (no per-item button bg/border)
 *  - hide burger on desktop, show on mobile
 *  - keep My Account visible at every breakpoint
 * ============================================================= */

/* flat nav items: no background, no border, no button look */
#gh-header .gh-nav-item {
	background: transparent !important;
	border: 1px solid transparent !important;
	box-shadow: none !important;
	color: var(--gh-text-2);
}
#gh-header .gh-nav-item:hover {
	background: transparent !important;
	border-color: transparent !important;
	color: var(--gh-accent-2);
}
#gh-header .gh-nav-item.is-active {
	background: transparent !important;
	border-color: transparent !important;
	color: var(--gh-accent-2);
	font-weight: 600;
}
#gh-header .gh-nav-item.is-active::after {
	left: 10px;
	right: 10px;
	bottom: -2px;
	height: 2px;
	background: linear-gradient(90deg, var(--gh-accent), var(--gh-accent-2));
}
/* the More trigger is a real button, give it the same flat look */
#gh-header .gh-more-trigger {
	background: transparent !important;
	border-color: transparent !important;
}
#gh-header .gh-more.is-open .gh-more-trigger {
	background: rgba(47,128,237,0.08) !important;
	color: var(--gh-accent-2);
}

/* burger: hidden on desktop, visible on tablet+mobile */
#gh-header .gh-burger { display: none; }
@media (max-width: 900px) {
	#gh-header .gh-burger { display: inline-flex; }
}

/* Keep account button always visible, just collapse to avatar on small */
@media (max-width: 700px) {
	#gh-header .gh-actions {
		display: flex !important;
		margin-left: auto !important;
		align-items: center;
		gap: 6px;
	}
	#gh-header .gh-account,
	#gh-header .gh-account-btn { display: inline-flex !important; }
	#gh-header .gh-account-name { display: none; }
	#gh-header .gh-account-caret { display: none; }
	#gh-header .gh-account-btn {
		padding: 4px;
		background: rgba(47,128,237,0.06) !important;
		border: 1px solid var(--gh-line) !important;
		border-radius: 999px;
	}
	#gh-header .gh-account-btn:hover {
		background: rgba(47,128,237,0.12) !important;
		border-color: rgba(47,128,237,0.26) !important;
	}
}

/* Loading panel gpscom logo size (kept inside header.css per requirement
   that only the header stylesheet diverges from the server). */
#loading_panel .logo,
#loading_panel_text .logo {
	height: 45px;
	width: auto;
	max-width: 40%;
	display: block;
	margin: 0 auto 10px auto;
}

/* ============================================================
 * Events / Alerts dialog: 60% of viewport, centered, scrollable,
 * resizable. We avoid `display: flex !important` because jQuery UI
 * relies on toggling inline `display:none` to close the dialog;
 * an `!important` flex would keep the dialog visible after close.
 * ============================================================ */
/* ============================================================
 * Events / Alerts dialog: sizing/centering is driven from JS
 * (see js/header.js `ghSizeEventsDialog`). CSS here only:
 *   - caps with max-width/max-height so it never exceeds viewport
 *   - forces the inner content area to scroll instead of growing
 *   - styles the resize handle
 * NO `!important` on width/height — jQuery UI's `resizable` writes
 * inline styles that must be free to win, otherwise drag-resize
 * appears to do nothing.
 * ============================================================ */
.ui-dialog.events-dialog {
	max-width: calc(100vw - 24px) !important;
	max-height: calc(100vh - 24px) !important;
	min-width: 360px;
	min-height: 320px;
	overflow: hidden;
	box-sizing: border-box;
	padding: 0;
	/* sits at the shared dialog stack (10100); newer dialogs (event
	 * map etc.) opened on top win via DOM order. */
}
body.events-dialog-open .ui-widget-overlay,
.ui-widget-overlay.events-dialog-overlay { z-index: 10090 !important; }
.ui-dialog.events-dialog .ui-dialog-titlebar { flex: 0 0 auto; }
.ui-dialog.events-dialog .ui-dialog-buttonpane { flex: 0 0 auto; }
/* jQuery UI sizes .ui-dialog-content automatically; we just need
 * the inner application markup to not push past it. The inline
 * `height: 802px` set by gs.main.js on #dialog_events_management
 * is overridden here so the dialog body scrolls within its box. */
.ui-dialog.events-dialog #dialog_events_management {
	width: 100% !important;
	height: 100% !important;
	min-height: 0 !important;
	max-height: 100% !important;
	overflow: auto !important;
	box-sizing: border-box;
}
.ui-dialog.events-dialog .ui-dialog-content {
	overflow: hidden !important;
	padding: 0 !important;
	box-sizing: border-box;
}
/* Visible bottom-right resize handle. jQuery UI provides
 * .ui-resizable-handle.ui-resizable-{n,e,s,w,ne,se,sw,nw}; we
 * brighten the SE corner so users can find the drag target. */
.ui-dialog.events-dialog .ui-resizable-se {
	width: 18px; height: 18px;
	right: 2px; bottom: 2px;
	z-index: 100;
	background: linear-gradient(135deg, transparent 50%, rgba(0,0,0,0.25) 50%, rgba(0,0,0,0.25) 60%, transparent 60%, transparent 70%, rgba(0,0,0,0.25) 70%, rgba(0,0,0,0.25) 80%, transparent 80%);
	cursor: se-resize;
}

/* ============================================================
 * Header on cpanel: small extras for cpanel-only items
 * ============================================================ */
#gh-header .gh-nav-stat {
	display: inline-block;
	margin-left: 6px;
	padding: 1px 6px;
	border-radius: 10px;
	background: rgba(47,128,237,0.12);
	color: var(--gh-accent-2);
	font-size: 11px;
	font-weight: 700;
	line-height: 1.4;
}
#gh-header .gh-cpanel-manager-wrap { padding: 0 8px !important; cursor: default; }
#gh-header .gh-cpanel-manager-wrap:hover { background: transparent !important; color: inherit !important; }
#gh-header .gh-cpanel-manager {
	height: 30px;
	min-width: 160px;
	border-radius: 8px;
	border: 1px solid var(--gh-line);
	background: rgba(47,128,237,0.05);
	color: var(--gh-text);
	padding: 0 8px;
	font-size: 13px;
}
#gh-header.gh-on-cpanel .gh-more { display: none; }
/* hide the "Administrator" / cpanel manager dropdown from header */
#gh-header .gh-cpanel-manager-wrap,
#gh-header #cpanel_manager_list { display: none !important; }

/* ============================================================
 * Map control buttons (leaflet-bar) — restore the seamless
 * stacked look that the removed dark.css used to give.
 * The legacy theme/style.css applies per-button border-radius
 * making each button look detached. Re-attach them here.
 * ============================================================ */
.leaflet-bar {
	border: 1px solid rgba(0,0,0,0.18) !important;
	border-radius: 6px !important;
	/* NOTE: do NOT set overflow:hidden here — the map-switcher
	 * dropdown (#map_control_switch) is a child of .leaflet-bar
	 * and is positioned absolutely; clipping hides it entirely. */
	background-clip: padding-box !important;
	box-shadow: 0 1px 5px rgba(0,0,0,0.25);
}
.leaflet-bar a,
.leaflet-bar a:hover,
.leaflet-bar a:focus {
	border-radius: 0 !important;
	border-bottom: 1px solid rgba(0,0,0,0.12) !important;
	border-top: none !important;
	background-color: #fff !important;
	margin: 0 !important;
}
.leaflet-bar a:last-child {
	border-bottom: none !important;
	border-radius: 0 !important;
}
.leaflet-bar a:first-child { border-radius: 0 !important; }
.leaflet-bar a.leaflet-disabled { background-color: #f5f5f5 !important; color: #bbb !important; }

/* ============================================================
 * Mobile: pull the drag-handle pseudo-element inward only when
 * the sidebar is OPEN (gs.main.js writes inline `left: 380px` on
 * #side_panel_dragbar in that state). When closed, defaults stay.
 * ============================================================ */
@media (max-width: 700px) {
	#side_panel_dragbar[style*="left: 380px"]:after { left: -42px !important; }
}

/* ============================================================
 * All jQuery UI dialogs must sit above #gh-header (z-index 10000)
 * so their title bar / close button are clickable, and above the
 * events (alerts) dialog so child dialogs (e.g. event map) are
 * visible. DOM order then decides stacking between same-z dialogs.
 * ============================================================ */
.ui-dialog { z-index: 10100 !important; }
.ui-widget-overlay { z-index: 10090 !important; }

/* The event-map modal (#event-map-modal) is a plain DIV (not a
 * jQuery UI dialog) opened from the alerts grid; it ships with
 * inline z-index:10000 which now sits below .ui-dialog (10100).
 * Lift it above all dialogs. */
#event-map-modal { z-index: 10200 !important; }


/* ============================================================
 * Object status filter tabs (side panel objects grid caption).
 * Five tabs (All/Offline/Moving/Idle/Stopped) each with a count
 * badge — must fit within the side panel (≤380px) without wrapping
 * or pushing the search/buttons row. Count is rendered as a tight
 * superscript right after the status text.
 * ============================================================ */
.ui-jqgrid .tabs-container,
#side_panel .tabs-container {
	display: flex !important;
	flex-wrap: nowrap;
	gap: 0;
	width: 100%;
	margin: 4px 0 8px 0;
	overflow: hidden;
	box-sizing: border-box;
	border: 1px solid #d4d8de;
	border-radius: 6px;
	background: #f6f7f9;
}
.ui-jqgrid .tabs-container .tab,
#side_panel .tabs-container .tab {
	flex: 1 1 0;
	min-width: 0;
	padding: 5px 0px !important;
	border: 0 !important;
	border-right: 1px solid #d4d8de !important;
	border-radius: 0 !important;
	background: transparent !important;
	color: #4a5160 !important;
	font-size: 10.5px !important;
	font-weight: 500;
	line-height: 1.25;
	text-align: center;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	margin: 0 !important;
	cursor: pointer;
	transition: background .15s, color .15s;
}
.ui-jqgrid .tabs-container .tab:last-child,
#side_panel .tabs-container .tab:last-child { border-right: 0 !important; }
.ui-jqgrid .tabs-container .tab:hover,
#side_panel .tabs-container .tab:hover {
	background: #eef0f3 !important;
}
.ui-jqgrid .tabs-container .tab.active,
#side_panel .tabs-container .tab.active {
	background: #2b6cff !important;
	color: #fff !important;
	border-right-color: #2b6cff !important;
}
.ui-jqgrid .tabs-container .tab.active + .tab,
#side_panel .tabs-container .tab.active + .tab { /* hide left border of next */ }
/* hide the legacy "(" / ")" parentheses from style.css */
.ui-jqgrid .object_count_data:before,
.ui-jqgrid .object_count_data:after,
#side_panel .object_count_data:before,
#side_panel .object_count_data:after { content: none !important; }
/* render the count as a tight superscript badge after the label */
.ui-jqgrid .object_count_data,
#side_panel .object_count_data {
	display: inline-block;
	vertical-align: super;
	font-size: 8.5px;
	font-weight: 700;
	line-height: 1;
	margin-left: 2px;
	padding: 1px 4px;
	border-radius: 8px;
	background: rgba(0,0,0,0.08);
	color: inherit;
}
.ui-jqgrid .tabs-container .tab.active .object_count_data,
#side_panel .tabs-container .tab.active .object_count_data {
	background: rgba(255,255,255,0.28);
	color: #fff;
}
.ui-jqgrid .tabs-container .tab.active .object_count_data:empty,
#side_panel .tabs-container .tab.active .object_count_data:empty,
.ui-jqgrid .object_count_data:empty,
#side_panel .object_count_data:empty { display: none; }
