/* =====================================================
   Left Sidebar - Desktop (960px+)
   ===================================================== */
@media (min-width: 960px) {
	#leftpanelcanvas .left-content-box,
	#leftpanelcanvas .left-nav-wrap,
	#leftpanelcanvas .bar-bottom {
		border-right: none;
	}

	#leftpanelcanvas ul.uk-nav-default>li>a {
		padding: 10px 20px;
		border-left: 0;
		border-radius: 8px;
		color: var(--text-secondary);
		transition: all 0.15s ease;
		font-weight: 500;
	}

	#leftpanelcanvas ul.uk-nav-default li.uk-nav-header {
		padding: 16px 20px 8px 20px;
		font-size: 0.7rem;
		text-transform: uppercase;
		letter-spacing: 0.05em;
		color: var(--text-muted);
		font-weight: 600;
	}

	#leftpanelcanvas ul.uk-nav-default>li>a:hover,
	#leftpanelcanvas ul.uk-nav-default>li.uk-open>a,
	#leftpanelcanvas ul.uk-nav-default>li.uk-active>a {
		border-radius: 8px;
		color: var(--text-primary);
		background:
			linear-gradient(var(--maincolor, #3b82f6), var(--maincolor, #3b82f6)) left / 3px 100% no-repeat,
			var(--sidebar-hover);
		font-weight: 600;
	}


	#leftpanelcanvas .uk-dropdown.user-drop {
		min-width: 180px;
		max-width: 200px;
		padding: 8px;
		border-radius: 8px;
		background: var(--bg-primary);
		border: 1px solid var(--border-color);
		box-shadow: var(--shadow-lg);
	}

	#leftpanelcanvas .uk-dropdown.user-drop:after {
		display: none;
	}

	#leftpanelcanvas ul.uk-nav-default>li>a>i,
	.uk-nav-sub i {
		width: 20px;
		height: auto;
		text-align: center;
		margin-right: 10px;
	}

	/* Menu item link - uniform spacing */
	#leftpanelcanvas ul.uk-nav-default .menu-item-link {
		display: inline-flex;
		align-items: center;
		gap: 10px;
	}

	/* Menu icon - uniform size for all icons */
	#leftpanelcanvas ul.uk-nav-default .menu-icon {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 20px;
		min-width: 20px;
	}

	#leftpanelcanvas ul.uk-nav-default .menu-icon i {
		width: 20px;
		height: auto;
		margin-right: 0;
	}

	/* Submenu items - additional left indent */
	#leftpanelcanvas ul.uk-nav-default li .uk-nav-sub {
		padding-left: 44px;
	}
}

/* Common styles for all screen sizes */
.left-content-box {
	padding: 16px 20px;
	border-top: 1px solid var(--border-light);
	margin-bottom: -1px;
	background: var(--sidebar-bg);
}

.left-nav-wrap {
	padding-bottom: 80px;
}

.content-box-dark {
	background-color: var(--bg-tertiary);
}

.text-light {
	font-weight: 300;
	font-size: 1.25rem;
}

/* Bar bottom - desktop only */
@media (min-width: 960px) {
	.bar-bottom {
		border-top: 1px solid var(--border-light);
		padding: 12px 0;
		background-color: var(--sidebar-bg);
		position: fixed;
		left: 0;
		z-index: 3;
		bottom: 0;
		width: var(--sidebar-width);
	}
}

.left-logo {
	height: var(--navbar-height);
	line-height: var(--navbar-height);
	padding: 0 20px;
	background-color: var(--maincolor, #3b82f6);
}

.custom-logo {
	height: 32px;
}

.profile-img {
	width: 56px;
	margin: 0 auto 8px auto;
	display: block;
	border: none;
}

.navbar-logo {
	background-color: transparent;
	margin-left: 0;
}

/* =====================================================
   Main Content Area
   ===================================================== */
#tm-content {
	padding: 0;
	margin-left: 0;
	margin-top: var(--navbar-height);
	min-height: calc(100vh - var(--navbar-height));
	background-color: var(--bg-primary);
	transition: margin 0.25s ease;
}

/* =====================================================
   Page Top Bar (Sticky Header for Page)
   ===================================================== */
#tm-page-top-bar.tm-top-bar {
	background: var(--bg-primary);
	box-sizing: border-box;
	position: sticky !important;
	top: var(--navbar-height);
	font-size: 0.875rem;
	display: flex;
	height: var(--page-header-height);
	z-index: 200;
	flex-shrink: 0;
	border-bottom: 1px solid var(--border-light);
}

/* Fix sticky header in report container */
.report-container #tm-page-top-bar.tm-top-bar,
.report-container ~ #tm-page-top-bar.tm-top-bar,
#tm-content:has(.report-container) #tm-page-top-bar.tm-top-bar {
	position: sticky !important;
	top: var(--navbar-height);
	z-index: 200;
}

#tm-page-top-bar .tm-top-bar-content {
	display: flex;
	height: var(--page-header-height);
	align-items: center;
	padding: 8px 24px;
	box-sizing: border-box;
	z-index: 1010;
	position: relative;
	background: var(--bg-primary);
}

#tm-page-top-bar .tm-top-bar-title {
	margin: 0;
	font-size: 1rem;
	font-weight: 600;
	color: var(--text-primary);
}

#tm-page-top-bar .tm-top-bar-subtitle {
	margin: 0;
	line-height: 1.3;
	color: var(--text-muted);
	font-size: 0.8rem;
}

#tm-page-top-bar.uk-sticky-fixed {
	z-index: 1250;
	box-shadow: var(--shadow-sm);
}

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

.tm-actions-icon {
	width: 36px;
	height: 36px;
	font-size: 1.25rem;
	text-align: center;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--text-secondary);
	transition: all 0.15s ease;
	border-radius: 8px;
	text-decoration: none;
}

.tm-actions-icon:hover {
	color: var(--text-primary);
	background-color: var(--bg-hover);
}

/* =====================================================
   Offcanvas Animation Fix - Prevent scroll lock issues
   ===================================================== */
body.uk-offcanvas-page {
	overflow-x: hidden !important;
}

/* =====================================================
   Quick Action Panel - Button Grid Layout
   ===================================================== */
#rightpanelcontent {
	padding: 0;
	background: var(--bg-primary);
}

#rightpanelcontent .quickaction-panel-loading {
	min-height: calc(100vh - var(--navbar-height));
}

#rightpanelcontent .quickaction-loading {
	flex: 1;
	min-height: calc(100vh - var(--navbar-height));
}

/* Keep UIkit offcanvas for right panel but disable slide animation */
#rightpanelcanvas .uk-offcanvas-bar {
	transition: none !important;
	transform: none !important;
}

.quickaction-panel {
	display: flex;
	flex-direction: column;
	height: 100%;
	min-height: calc(100vh - var(--navbar-height));
}

.quickaction-content {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
}

.quickaction-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 10px;
}

.quickaction-btn {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 16px 12px;
	background-color: var(--bg-secondary);
	border-radius: 12px;
	color: var(--text-secondary) !important;
	text-decoration: none;
	transition: all 0.2s ease;
	position: relative;
	min-height: 80px;
}

.quickaction-btn:hover {
	background-color: var(--bg-hover) !important;
	color: var(--text-primary) !important;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.quickaction-btn i {
	font-size: 1.5rem;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.quickaction-btn span {
	font-size: 0.8125rem;
	font-weight: 500;
	text-align: center;
	line-height: 1.2;
}

.quickaction-badge {
	position: absolute;
	top: 8px;
	right: 8px;
	background-color: var(--color-danger);
	color: var(--text-on-primary);
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 10px;
	font-size: 0.6875rem;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
}

.quickaction-badge-danger {
	background-color: var(--color-danger);
}

.quickaction-divider {
	height: 1px;
	background-color: var(--border-light);
	margin: 16px 0;
}

.quickaction-footer {
	padding: 12px 16px;
	border-top: 1px solid var(--border-light);
	background: var(--bg-primary);
	position: sticky;
	bottom: 0;
}

.quickaction-signout {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 14px 16px;
	color: var(--color-danger) !important;
	font-weight: 600;
	font-size: 0.9375rem;
	text-decoration: none;
	transition: all 0.2s ease;
	border-radius: 10px;
	background-color: var(--bg-secondary) !important;
}

.quickaction-signout:hover {
	background-color: var(--bg-danger) !important;
	color: var(--text-on-danger) !important;
}

.quickaction-signout i {
	font-size: 1.125rem;
}

/* =====================================================
   Form Container - Sticky Toolbar & Scrollable Content
   ===================================================== */
.hippo-form-container {
	display: flex;
	flex-direction: column;
	height: calc(100vh - var(--page-header-height, 60px) - var(--navbar-height, 56px));
	min-height: 0;
}

.hippo-form-content {
	flex: 1;
	overflow-y: auto;
	overflow-x: hidden;
	padding: 16px;
	-webkit-overflow-scrolling: touch;
}

.hippo-form-toolbar {
	display: flex;
	flex-shrink: 0;
	padding: 12px 16px;
	background: var(--bg-primary);
	border-top: 1px solid var(--border-color);
	position: sticky;
	bottom: 0;
	z-index: 10;
}
