:root {
	color-scheme: light dark;
	--bg: #121212;
	--text: #eee;
	--sidebar-bg: #1e1e1e;
	--sidebar-text: #ccc;
	--table-bg: rgba(255, 255, 255, 0.03);
	--table-header-bg: rgba(255, 255, 255, 0.06);
	--table-border: #ccc;
	--table-hover: rgba(255, 255, 255, 0.05);
}

body {
	margin: 0;
	font-family: sans-serif;
	background: var(--bg);
	color: var(--text);
	display: flex;
}

* {
	-webkit-tap-highlight-color: transparent;
}

#sidebar {
	width: 260px;
	background: var(--sidebar-bg);
	padding: 1rem;
	height: 100vh;
	position: fixed;
	top: 0;
	left: 0;
	z-index: 999999;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	transition: transform 0.3s ease-in-out;
}

.sidebar-content {
	background-color: #2a2a2a;
	background-image: url('/assets/img/separator.png');
	background-position: 0 45px;
	background-repeat: no-repeat;
	background-size: 100% auto;
	border-radius: 8px;
	padding: 1rem;
	box-shadow: 0 0 10px rgba(0,0,0,0.4);
	display: flex;
	flex-direction: column;
	gap: 1.2rem;
	overflow-y: auto;
}

.sidebar-content .logo {
	font-size: 1.5em;
	font-weight: bold;
	margin-bottom: 1em;
	display: flex;
	align-items: center;
	gap: 10px;
}

.sidebar-content .logo img {
	max-width: 3rem;
	height: auto;
}

#sidebar ul {
	list-style: none;
	padding: 0;
	margin: 0;
}

#sidebar li {
	margin: 0.8em 0;
}

#sidebar li>ul>li {
	margin: 0.4em 0 0 0.8em;
	font-size: 0.9em;
}

#sidebar a {
	text-decoration: none;
	color: var(--sidebar-text);
	width: 100%;
	display: block;
	padding: 3px;
	border-radius: 3px;
}

#sidebar a:hover {
	background-color: #d6a329;
	color: #000;
}

.lang-switch {
	display: flex;
	gap: 10px;
	justify-content: center;
	margin-top: auto;
	padding-top: 15px;
	flex-shrink: 0;
}

.lang-switch button {
	background: none;
	border: none;
	padding: 4px;
	border-radius: 6px;
	cursor: pointer;
	transition: transform 0.1s ease;
}

.lang-switch button img {
	width: 32px;
	height: 24px;
	display: block;
}

.lang-switch button:hover {
	transform: scale(1.1);
}

.lang-switch button.selected {
	background: #333;
	border: 1px solid #aaa;
	box-shadow: 0 0 4px rgba(255,255,255,0.2);
}

main {
/*	background-image: url('/assets/img/mainbg.png');*/
	margin-left: 260px;
	padding: 2rem;
	flex: 1;
	min-height: 100vh;
	box-sizing: border-box;
}

main a, main a:visited, main a:link, main a:active {
	color: #d6a329;
	text-decoration:none;
}
main a:hover {
	text-decoration:underline;
}

#menu-toggle {
	display: none;
}

.group-box {
	margin-bottom: 1.5rem;
	border: 1px solid #444;
	border-radius: 8px;
	padding: 1rem;
	background: rgba(255,255,255,0.03);
	overflow: hidden;
}

.group-line-top {
	display: flex;
	align-items: center;
	gap: 0.8rem;
	flex-wrap: wrap;
}

.group-header > div {
	display: flex;
	align-items: center;
	gap: 0.8rem;
	flex-wrap: wrap;
}

.item-box {
	margin-top: 0.5rem;
}

.item-entry {
	display: flex;
	align-items: center;
	gap: 0.8rem;
	margin-bottom: 0.5rem;
	flex-wrap: wrap;
}

.icon {
	width: 64px;
	height: 64px;
	flex-shrink: 0;
}

.group-name,
.item-name {
	font-weight: bold;
}

.status-dot {
	width: 16px;
	height: 16px;
	border-radius: 50%;
	box-shadow: 0 0 6px;
	flex-shrink: 0;
}

.status-dot.online {
	background: #0f0;
	box-shadow: 0 0 8px #0f0;
}

.status-dot.offline {
	background: #f00;
	box-shadow: 0 0 8px #f00;
}

.entry-text {
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.subheader {
	font-size: 0.9em;
	color: #aaa;
	margin-top: 0.25rem;
}

.group-name, .item-name {
	font-weight: bold;
	flex-grow: 1;
}

.group-header hr {
	width: 100%;
	border: 0;
	border-top: 1px solid #555;
	margin: 0.5rem 0 0 0;
}

.hidden {
	display: none;
}

table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 1rem;
	background: var(--table-bg);
	border: 1px solid var(--table-border);
}

th, td {
	padding: 0.6rem 1rem;
	text-align: left;
	border-bottom: 1px solid var(--table-border);
}

th {
	background: var(--table-header-bg);
	color: var(--text);
}

tr:hover {
	background: var(--table-hover);
}

.event-log img.thumb {
	width: 200px;
	height: 200px;
	object-fit: cover;
	border-radius: 6px;
	box-shadow: 0 0 5px rgba(0,0,0,0.4);
}

form {
	display: grid;
	grid-template-columns: 200px 1fr;
	gap: 1rem 1.5rem;
	align-items: center;
	max-width: 800px;
}

form h2 {
	grid-column: 1 / -1;
	margin-top: 2rem;
}

form label {
	display: contents;
}

form input[type="text"],
form input[type="password"],
form input[type="file"],
form select {
	width: 100%;
	padding: 0.4rem;
	background: var(--bg);
	color: var(--text);
	border: 1px solid #666;
	border-radius: 4px;
}

form input[type="checkbox"] {
	margin-right: 0.5rem;
	transform: scale(1.2);
	justify-self: start;
}

form input[type="range"] {
	width: 100%;
}

form .slider-wrapper {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

form .slider-wrapper span {
	white-space: nowrap;
}

form small {
	grid-column: 2;
	color: #aaa;
	font-size: 0.85em;
	margin-top: -0.5rem;
}

#loaderOverlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(128, 128, 128, 0.5);
	display: flex;
	justify-content: center;
	align-items: center;
	flex-direction: column;
	z-index: 1000;
}

#progressBarContainer {
	width: 50%;
	background: #ddd;
	border-radius: 10px;
	overflow: hidden;
}

#progressBar {
	height: 30px;
	background: #007bff;
	width: 0%;
	transition: width 0.3s ease-in-out;
}

td img.usr {
	width: 80px;
	height: 80px;
	object-fit: cover;
}

form button {
	grid-column: 2;
	width: auto;
	padding: 0.5rem 1.2rem;
	cursor: pointer;
	background: transparent;
	color: var(--text);
	border: 1px solid var(--text);
	border-radius: 4px;
}

#mobile-top-bar {
	display: none;
}

@media (max-width: 768px) {
	#mobile-top-bar {
		display: flex;
		justify-content: space-between;
		align-items: center;
		background: var(--sidebar-bg);
		padding: 0 15px;
		height: 60px;
		position: fixed;
		top: 0; left: 0; right: 0;
		z-index: 2000;
		max-width: 100vw;
		box-sizing: border-box;
		box-shadow: 0 2px 5px rgba(0,0,0,0.5);
	}

	.mobile-logo img { height: 32px; width: auto; vertical-align: middle; }

	main {
		margin-left: 0 !important;
		padding: 1rem;
		padding-top: 80px;
	}

	#sidebar {
		position: fixed;
		top: 60px;
		left: 0;
		height: calc(100vh - 60px);
		width: 100%;
		max-width: 300px;
		transform: translateX(-100%);
		padding: 0;
		background: var(--sidebar-bg);
		z-index: 1999;
	}
	
	#sidebar.active { transform: translateX(0); }
	#sidebar .logo { display: none; }

	.sidebar-content {
		border-radius: 0;
		box-shadow: none;
		background: transparent;
		flex: 1;
		padding: 20px;
	}

	.lang-switch {
		background: #1e1e1e;
		padding: 20px 0;
		width: 100%;
		border-top: 1px solid #333;
		margin-bottom: 70px;
	}

	#menu-toggle {
		display: block;
		width: 30px;
		height: 24px;
		position: relative;
		margin: 0;
		padding: 0;
		background: transparent;
		border: none;
		cursor: pointer;
		z-index: 2002;
	}

	#menu-toggle span {
		display: block;
		position: absolute;
		height: 3px;
		width: 100%;
		background: var(--text);
		border-radius: 9px;
		left: 0;
		transition: .25s ease-in-out;
	}

	#menu-toggle span:nth-child(1) { top: 0px; }
	#menu-toggle span:nth-child(2) { top: 10px; }
	#menu-toggle span:nth-child(3) { top: 20px; }

	#menu-toggle.open span:nth-child(1) { top: 10px; transform: rotate(135deg); }
	#menu-toggle.open span:nth-child(2) { opacity: 0; left: -60px; }
	#menu-toggle.open span:nth-child(3) { top: 10px; transform: rotate(-135deg); }
	
	form { grid-template-columns: 1fr !important; }
	form small, form button { grid-column: 1 !important; }
	form .slider-wrapper { flex-direction: column; align-items: start; }
}
