.global-header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	width: 100%;
	max-width: 100vw;
	min-height: 62px;
	padding: 10px 24px;
	box-sizing: border-box;

	background: linear-gradient(
		135deg,
		var(--accent-dark) 0%,
		var(--accent) 60%,
		var(--accent-light) 100%
	);

	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);

	overflow: hidden;
	z-index: 1000;

	font-family:
		"Segoe UI",
		system-ui,
		-apple-system,
		sans-serif;

	border-radius: 0;
}

/* ---------- Brand ---------- */

.global-header .gh-brand {
	display: flex;
	align-items: center;
	gap: 10px;

	flex-shrink: 0;
	min-width: 0;

	text-decoration: none;
}

.global-header .gh-brand-icon {
	display: flex;
	align-items: center;
	justify-content: center;

	width: 34px;
	height: 34px;

	background: rgba(255, 255, 255, 0.18);
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 8px;

	font-size: 18px;
}

.global-header .gh-brand-name {
	color: var(--surface);

	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.02em;
	line-height: 1.2;
}

.global-header .gh-brand-sub {
	color: rgba(255, 255, 255, 0.72);

	font-size: 10px;
	font-weight: 400;
	letter-spacing: 0.04em;
}

/* ---------- Dividers ---------- */

.global-header .gh-divider {
	width: 1px;
	height: 28px;

	flex-shrink: 0;

	background: rgba(255, 255, 255, 0.22);
}

/* ---------- Back Button ---------- */

.global-header .gh-back-btn {
	display: flex;
	align-items: center;
	gap: 6px;

	flex-shrink: 0;

	padding: 6px 12px;

	background: rgba(255, 255, 255, 0.14);
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 6px;

	color: var(--surface);

	font-size: 12px;
	font-weight: 600;

	cursor: pointer;
	text-decoration: none;
	white-space: nowrap;

	transition:
		background 0.18s,
		border-color 0.18s;
}

.global-header .gh-back-btn:hover {
	background: rgba(255, 255, 255, 0.24);
	border-color: rgba(255, 255, 255, 0.4);
}

/* ---------- Page Title ---------- */

.global-header .gh-page-title {
	flex: 1 1 auto;
	min-width: 0;
}

.global-header .gh-page-title h1 {
	margin: 0;

	color: var(--surface);

	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;

	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.global-header .gh-page-title .gh-subtitle {
	margin: 0;

	color: rgba(255, 255, 255, 0.7);

	font-size: 11px;
	line-height: 1.3;
}

/* ---------- Navigation ---------- */

.global-header .gh-nav {
	display: flex;
	align-items: center;
	gap: 2px;

	flex: 0 1 auto;
	min-width: 0;
	overflow: hidden;
}

.global-header .gh-nav-link {
	display: flex;
	align-items: center;
	gap: 4px;

	padding: 4px 7px;

	background: transparent;
	border: 1px solid transparent;
	border-radius: 6px;

	color: rgba(255, 255, 255, 0.82);

	font-size: 11px;
	font-weight: 500;

	cursor: pointer;
	text-decoration: none;
	white-space: nowrap;

	transition:
		background 0.15s,
		border-color 0.15s,
		color 0.15s;
}

.global-header .gh-nav-link:hover,
.global-header .gh-nav-link.active {
	background: rgba(255, 255, 255, 0.14);
	border-color: rgba(255, 255, 255, 0.22);
	color: var(--surface);
}

.gh-mobile-menu-toggle,
.gh-mobile-nav-popover {
	display: none;
}

/* ---------- User Menu ---------- */

.global-header .gh-user-menu {
	position: relative;

	flex-shrink: 0;
	min-width: 0;
}

.global-header .gh-user-chip {
	display: flex;
	align-items: center;
	gap: 8px;

	padding: 5px 10px 5px 5px;

	background: rgba(255, 255, 255, 0.14);
	border: 1px solid rgba(255, 255, 255, 0.22);
	border-radius: 22px;

	cursor: pointer;
	user-select: none;

	transition: background 0.15s;
}

.global-header .gh-user-chip:hover {
	background: rgba(255, 255, 255, 0.22);
}

.global-header .gh-user-avatar {
	display: flex;
	align-items: center;
	justify-content: center;

	width: 28px;
	height: 28px;

	flex-shrink: 0;

	background: rgba(255, 255, 255, 0.25);
	border: 1.5px solid rgba(255, 255, 255, 0.35);
	border-radius: 50%;

	color: var(--surface);

	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.02em;
}

.global-header .gh-user-name {
	max-width: 110px;

	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;

	color: var(--surface);

	font-size: 12px;
	font-weight: 600;
}

.global-header .gh-user-caret {
	margin-left: 2px;

	color: rgba(255, 255, 255, 0.65);

	font-size: 9px;
}

/* ---------- User Dropdown ---------- */

.global-header .gh-user-dropdown {
	display: none;

	position: absolute;
	top: calc(100% + 8px);
	right: 0;

	min-width: 180px;

	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 10px;

	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);

	overflow: hidden;
	z-index: 2000;
}

.global-header .gh-user-dropdown.open {
	display: block;
	animation: gh-dropdown-in 0.15s ease;
}

@keyframes gh-dropdown-in {
	from {
		opacity: 0;
		transform: translateY(-6px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.global-header .gh-dropdown-user-info {
	padding: 12px 14px 10px;

	background: var(--surface-alt);
	border-bottom: 1px solid var(--border);
}

.global-header .gh-dropdown-user-name {
	color: var(--text);

	font-size: 13px;
	font-weight: 700;
	line-height: 1.3;
}

.global-header .gh-dropdown-user-role {
	margin-top: 2px;

	color: var(--text-muted);

	font-size: 10px;
}

.global-header .gh-dropdown-item {
	display: flex;
	align-items: center;
	gap: 9px;

	width: 100%;
	padding: 10px 14px;

	background: none;
	border: none;

	color: var(--text);

	font-size: 13px;
	font-weight: 500;

	text-align: left;
	text-decoration: none;
	cursor: pointer;

	transition: background 0.13s;
}

.global-header .gh-dropdown-item:hover {
	background: var(--surface-alt);
	color: var(--accent-dark);
}

.global-header .gh-dropdown-item i {
	width: 14px;

	color: var(--accent);

	font-size: 12px;
	text-align: center;
}

.global-header .gh-dropdown-item.logout {
	color: var(--danger);
	border-top: 1px solid var(--border);
}

.global-header .gh-dropdown-item.logout i {
	color: var(--danger);
}

.global-header .gh-dropdown-item.logout:hover {
	background: var(--danger);
	opacity: 0.1;
}

body {
	padding-top: 0;
}

body.gh-page {
	padding-top: 0 !important;
}

body.gh-outside-card {
	padding: 0 !important;
}

body:has(.global-header) .container,
body:has(.global-header) .shell,
body.gh-page .container,
body.gh-page .shell,
body.gh-outside-card .container,
body.gh-outside-card .shell {
	margin: 0 auto 20px !important;
	max-width: 1500px;
	padding-bottom: 90px;
}

body.gh-page .global-footer,
body.gh-outside-card .global-footer {
	margin-top: 0;
}

.gh-user-dropdown.open {
	position: fixed;
}

/* =========================================================
   GLOBAL FOOTER
   ========================================================= */

.global-footer {
	position: fixed;
	bottom: 0;

	width: 100%;
	max-width: 100vw;

	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;

	gap: 16px;
	padding: 14px 24px;

	background: linear-gradient(
		135deg,
		var(--accent-dark) 0%,
		var(--accent) 100%
	);

	margin-top: auto;

	z-index: 10000;

	font-family:
		"Segoe UI",
		system-ui,
		-apple-system,
		sans-serif;
}

.global-footer .gf-copy {
	color: rgba(255, 255, 255, 0.78);
	min-width: 0;
	flex: 1 1 auto;

	font-size: 12px;
	font-weight: 400;
}

.global-footer .gf-copy strong {
	color: var(--surface);
	font-weight: 600;
}

.global-footer .gf-links {
	display: flex;
	align-items: center;
	gap: 16px;
	min-width: 0;
	flex-wrap: wrap;
}

.global-footer .gf-link {
	display: flex;
	align-items: center;
	gap: 5px;

	color: rgba(255, 255, 255, 0.72);

	font-size: 12px;
	text-decoration: none;

	transition: color 0.14s;
}

.global-footer .gf-link:hover {
	color: var(--surface);
}

.global-footer .gf-link i {
	font-size: 11px;
}

.global-footer .gf-sep {
	width: 1px;
	height: 14px;

	background: rgba(255, 255, 255, 0.2);
}

.global-footer .gf-version {
	color: rgba(255, 255, 255, 0.45);

	font-size: 10px;
	letter-spacing: 0.04em;
}

/* =========================================================
   SIDEBAR / LEGACY HEADER STYLING
   ========================================================= */

/* Dashboard header */

.dashboard-header {
	display: flex !important;
	align-items: center !important;
	gap: 16px !important;

	height: 62px !important;
	padding: 0 24px !important;

	background: linear-gradient(
		135deg,
		var(--accent-dark) 0%,
		var(--accent) 60%,
		var(--accent-light) 100%
	) !important;

	border-bottom: none !important;

	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12) !important;
}

.dashboard-header h1,
.dashboard-header .header-title h1 {
	color: var(--surface) !important;

	font-size: 15px !important;
	font-weight: 600 !important;
	letter-spacing: 0.02em !important;
}

.dashboard-header .subtitle,
.dashboard-header .header-title .subtitle {
	margin-top: 0 !important;

	color: rgba(255, 255, 255, 0.7) !important;

	font-size: 11px !important;
}

.dashboard-header .header-title {
	flex: 1 !important;
	min-width: 0 !important;
}

/* Top bar */

.top-bar {
	display: flex !important;
	align-items: center !important;

	height: 62px !important;
	padding: 0 24px !important;

	gap: 16px !important;

	background: linear-gradient(
		135deg,
		var(--accent-dark) 0%,
		var(--accent) 60%,
		var(--accent-light) 100%
	) !important;

	border-bottom: none !important;

	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12) !important;
}

.top-bar h1,
.top-bar-title h1 {
	margin: 0 !important;

	color: var(--surface) !important;

	font-size: 15px !important;
	font-weight: 600 !important;
	letter-spacing: 0.02em !important;
}

.top-bar .subtitle,
.top-bar-title .subtitle {
	margin-top: 0 !important;

	color: rgba(255, 255, 255, 0.7) !important;

	font-size: 11px !important;
}

.top-bar-title {
	flex: 1 !important;
	min-width: 0 !important;
}

/* Sidebar toggle */

.dashboard-header .sidebar-toggle,
.top-bar .sidebar-toggle {
	width: 36px !important;
	height: 36px !important;

	flex-shrink: 0 !important;

	background: rgba(255, 255, 255, 0.16) !important;
	border: 1px solid rgba(255, 255, 255, 0.25) !important;
	border-radius: 8px !important;
}

.dashboard-header .sidebar-toggle .toggle-bar,
.top-bar .sidebar-toggle .bar {
	height: 2px !important;

	background: var(--surface) !important;
}

/* Sidebar user menu */

.dashboard-header .user-menu,
.top-bar .user-menu {
	flex-shrink: 0 !important;
}

.dashboard-header .user-badge,
.top-bar .user-chip {
	padding: 5px 14px !important;

	background: rgba(255, 255, 255, 0.14) !important;
	border: 1px solid rgba(255, 255, 255, 0.22) !important;
	border-radius: 22px !important;

	color: var(--surface) !important;

	font-size: 12px !important;
	font-weight: 600 !important;

	cursor: pointer !important;
}

.dashboard-header .user-dropdown,
.top-bar .user-dropdown {
	min-width: 180px !important;

	background: var(--surface);

	border: 1px solid var(--border) !important;
	border-radius: 10px !important;

	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12) !important;

	overflow: hidden !important;
}

.dashboard-header .dropdown-item,
.top-bar .dd-item {
	display: flex !important;
	align-items: center !important;
	gap: 9px !important;

	padding: 10px 14px !important;

	color: var(--text) !important;

	font-size: 13px !important;
	font-weight: 500 !important;
}

.dashboard-header .dropdown-item:hover,
.top-bar .dd-item:hover {
	background: var(--surface-alt) !important;
	color: var(--accent-dark) !important;
}

.dashboard-header .dropdown-item i,
.top-bar .dd-item i {
	width: 14px !important;

	color: var(--accent) !important;

	text-align: center !important;
}

/* Sidebar footer */

.main-content .global-footer,
.sidebar-footer-global {
	margin-top: auto;
	border-radius: 0 0 17px 0;
}

/* =========================================================
   SIDEBAR NAVIGATION
   ========================================================= */

/* Keep long navigation usable without displaying a scrollbar. */

.sidebar-nav {
	min-height: 0;

	overflow-x: hidden;
	overflow-y: auto;

	scrollbar-width: none;
	-ms-overflow-style: none;
}

.sidebar-nav::-webkit-scrollbar {
	display: none;
}

/* =========================================================
   RESPONSIVE — TABLET
   ========================================================= */

@media (max-width: 1024px) {
	.global-footer {
		padding: 10px 14px;
		gap: 6px;
		justify-content: center;
		flex-direction: column;
		text-align: center;
	}

	.global-footer .gf-copy {
		font-size: 11px;
	}

	.global-footer .gf-links {
		gap: 12px;
	}

	.global-footer .gf-link {
		font-size: 11px;
		gap: 4px;
	}

	.global-footer .gf-link i {
		font-size: 10px;
	}

	.global-footer .gf-sep,
	.global-footer .gf-version {
		display: none;
	}
}

/* =========================================================
   RESPONSIVE — MOBILE
   ========================================================= */

@media (max-width: 640px) {
	html,
	body {
		overflow-x: hidden;
		max-width: 100%;
	}

	body {
		overflow-y: auto;
	}

	.global-header {
		overflow: visible;
		min-height: 56px;
		padding: 0 14px;
		gap: 10px;
	}

	.global-header .gh-back-btn,
	.global-header .gh-divider,
	.global-header .gh-page-title,
	.global-header .gh-nav,
	.global-header .gh-user-menu {
		display: none;
	}

	.global-header .gh-brand {
		flex: 1;
		min-width: 0;
	}

	.global-header .gh-brand-sub {
		display: none;
	}

	.global-header .gh-brand-name {
		font-size: 13px;
		white-space: nowrap;
	}

	.gh-mobile-menu-toggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 36px;
		height: 36px;
		border: 1px solid rgba(255, 255, 255, 0.24);
		background: rgba(255, 255, 255, 0.12);
		border-radius: 10px;
		color: var(--surface);
		cursor: pointer;
		flex-shrink: 0;
		padding: 0;
	}

	.gh-mobile-menu-toggle i {
		font-size: 16px;
	}

	.gh-mobile-menu-toggle.open {
		background: rgba(255, 255, 255, 0.2);
	}

	.gh-mobile-nav-popover {
		position: absolute;
		top: calc(100% + 10px);
		right: 10px;
		left: 10px;
		display: none;
		background: rgba(255, 255, 255, 0.98);
		border: 1px solid rgba(148, 163, 184, 0.22);
		border-radius: 14px;
		box-shadow: 0 18px 42px rgba(15, 23, 42, 0.2);
		overflow: hidden;
		z-index: 2000;
	}

	.gh-mobile-nav-popover.open {
		display: block;
	}

	.gh-mobile-nav-user {
		position: relative;
		padding: 12px 14px 10px;
		background: rgba(248, 250, 252, 0.98);
		border-bottom: 1px solid var(--border);
	}

	.gh-mobile-user-trigger {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 8px;
		width: 100%;
		padding: 0;
		background: transparent;
		border: none;
		text-align: left;
		cursor: pointer;
		color: var(--text);
	}

	.gh-mobile-user-trigger i {
		color: var(--text-muted);
		font-size: 12px;
	}

	.gh-mobile-user-pill {
		display: flex;
		align-items: center;
		gap: 10px;
		flex: 1;
		padding: 8px 10px;
		border-radius: 12px;
		background: rgba(255, 255, 255, 0.9);
		border: 1px solid rgba(148, 163, 184, 0.2);
	}

	.gh-mobile-user-pill .gh-user-avatar {
		width: 34px;
		height: 34px;
		border-radius: 50%;
		font-size: 11px;
		background: linear-gradient(135deg, var(--accent), var(--accent-light));
		border: 1px solid rgba(255, 255, 255, 0.3);
	}

	.gh-mobile-user-text {
		display: flex;
		flex-direction: column;
		min-width: 0;
	}

	.gh-mobile-user-name {
		color: var(--text);
		font-size: 12px;
		font-weight: 700;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.gh-mobile-user-role {
		color: var(--text-muted);
		font-size: 10px;
	}

	.gh-mobile-user-popover {
		display: none;
		position: absolute;
		top: calc(100% - 2px);
		left: 14px;
		right: 14px;
		background: rgba(255, 255, 255, 0.98);
		border: 1px solid rgba(148, 163, 184, 0.24);
		border-radius: 12px;
		box-shadow: 0 14px 34px rgba(15, 23, 42, 0.18);
		overflow: hidden;
		z-index: 2100;
	}

	.gh-mobile-user-popover.open {
		display: flex;
		flex-direction: column;
	}

	.gh-mobile-user-link {
		display: flex;
		align-items: center;
		gap: 10px;
		padding: 11px 12px;
		color: var(--text);
		font-size: 13px;
		font-weight: 600;
		text-decoration: none;
		border-bottom: 1px solid rgba(148, 163, 184, 0.14);
	}

	.gh-mobile-user-link:last-child {
		border-bottom: none;
	}

	.gh-mobile-user-link i {
		width: 14px;
		color: var(--accent);
		font-size: 12px;
		text-align: center;
	}

	.gh-mobile-user-link.logout {
		color: var(--danger);
	}

	.gh-mobile-user-link.logout i {
		color: var(--danger);
	}

	.gh-mobile-nav-links {
		display: flex;
		flex-direction: column;
		padding: 10px 8px 8px;
		gap: 6px;
	}

	.gh-mobile-nav-link {
		display: flex;
		align-items: center;
		gap: 10px;
		padding: 10px 12px;
		border-radius: 10px;
		background: transparent;
		color: var(--text);
		font-size: 13px;
		font-weight: 600;
		text-decoration: none;
	}

	.gh-mobile-nav-link i {
		width: 14px;
		color: var(--accent);
		font-size: 12px;
	}

	.gh-mobile-nav-link.active,
	.gh-mobile-nav-link:hover {
		background: rgba(107, 124, 80, 0.08);
	}

	.gh-mobile-nav-footer {
		padding: 12px 14px 14px;
		background: linear-gradient(
			135deg,
			rgba(7, 37, 53, 0.04),
			rgba(107, 124, 80, 0.08)
		);
		border-top: 1px solid var(--border);
	}

	.gh-mobile-nav-footer-title {
		font-size: 13px;
		font-weight: 800;
		color: var(--accent-dark);
	}

	.gh-mobile-nav-footer-sub {
		margin-top: 2px;
		font-size: 11px;
		color: var(--text-muted);
	}

	.global-footer {
		align-items: flex-start;
		flex-direction: column;

		gap: 8px;
		padding: 12px 14px;
	}
}
