:root {
	--topbar-height: 64px;
}

body {
	padding-top: var(--topbar-height);
}

.topbar {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 5000;
	height: var(--topbar-height);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 18px;
	background: rgba(255, 255, 255, 0.98);
	backdrop-filter: none;
	-webkit-backdrop-filter: none;
	transform: translate3d(0, 0, 0);
	-webkit-transform: translate3d(0, 0, 0);
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.brand {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}

.brand .logo {
	height: 36px;
	width: auto;
	display: block;
}

.nav-toggle {
	display: none;
	border: 0;
	background: transparent;
	color: var(--text-primary, #2c3e50);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}

.nav {
	display: flex;
	align-items: center;
	gap: 8px;
}

.nav-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 38px;
	padding: 8px 12px;
	border-radius: 10px;
	text-decoration: none;
	color: var(--text-secondary, #7f8c8d);
	font-weight: 600;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-link:hover {
	background: rgba(0, 0, 0, 0.06);
	color: var(--text-primary, #2c3e50);
}

.nav-link.active {
	background: rgba(255, 0, 0, 0.12);
	color: var(--primary, #ff0000);
}

.nav-link.auth {
	border: 1px solid rgba(0, 0, 0, 0.12);
}

.profile-dropdown {
	position: relative;
}

.profile-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 38px;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 10px;
	background: #fff;
	color: var(--text-primary, #2c3e50);
	padding: 8px 10px;
	cursor: pointer;
}

.profile-name {
	max-width: 180px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.profile-arrow {
	font-size: 12px;
}

.profile-menu {
	display: none;
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	min-width: 260px;
	padding: 12px;
	border-radius: 12px;
	border: 1px solid rgba(0, 0, 0, 0.1);
	background: #fff;
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.profile-dropdown.open .profile-menu {
	display: block;
}

.profile-info {
	display: grid;
	gap: 4px;
	margin-bottom: 10px;
}

.profile-username {
	font-weight: 700;
	color: var(--text-primary, #2c3e50);
}

.profile-role,
.profile-club {
	font-size: 13px;
	color: var(--text-secondary, #7f8c8d);
}

.btn-logout {
	width: 100%;
	min-height: 38px;
	border: 0;
	border-radius: 10px;
	background: var(--primary, #ff0000);
	color: #fff;
	font-weight: 700;
	cursor: pointer;
}

@media (max-width: 900px) {
	:root {
		--topbar-height: 60px;
	}

	.topbar {
		padding: 8px 12px;
	}

	body {
		padding-top: var(--topbar-height);
	}

	.brand .logo {
		height: 32px;
	}

	.nav-toggle {
		display: block;
	}

	.nav {
		display: none;
		position: absolute;
		top: calc(100% + 8px);
		left: 10px;
		right: 10px;
		width: auto;
		max-width: calc(100vw - 20px);
		max-height: calc(100vh - 84px);
		overflow-y: auto;
		flex-direction: column;
		align-items: stretch;
		gap: 6px;
		padding: 12px;
		border-radius: 12px;
		border: 1px solid rgba(0, 0, 0, 0.1);
		background: rgba(255, 255, 255, 0.98);
		box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
	}

	.nav.active {
		display: flex;
	}

	.nav-link,
	.profile-btn {
		width: 100%;
		justify-content: flex-start;
	}

	.profile-dropdown {
		width: 100%;
	}

	.profile-menu {
		position: static;
		display: none;
		margin-top: 8px;
		min-width: 0;
		width: 100%;
		box-shadow: none;
	}
}
