: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;
}

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

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

#sidebar .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;
}

main {
	margin-left: 260px;
	padding: 2rem;
	flex: 1;
}

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;
	position: fixed;
	top: 0.5rem;
	left: 0.5rem;
	background: none;
	border: none;
	font-size: 2rem;
	color: var(--text);
	z-index: 1000;
}

.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-line-top,
.item-entry {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin-bottom: 0.5rem;
	flex-wrap: wrap;
}

.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;
}

@media (max-width: 768px) {
	body {
		flex-direction: column;
	}
	main {
		margin-left: 0 !important;
		padding: 1rem;
	}
	#sidebar {
		position: fixed;
		height: 100%;
		transform: translateX(-100%);
	}
	#sidebar .logo {
		margin-left: 2rem;
	}
	#sidebar.active {
		transform: translateX(0);
	}
	#menu-toggle {
		display: block;
	}
	form {
		grid-template-columns: 1fr !important;
	}

	form small,
	form button {
		grid-column: 1 !important;
	}

	form > span {
		margin-top: 1rem;
	}
	form > div {
		width: 100%;
	}
	form .slider-wrapper {
		flex-direction: column;
		align-items: start;
		gap: 0.5rem;
	}
}

.sidebar-content {
	background: #2a2a2a;
	border-radius: 8px;
	padding: 1rem;
	box-shadow: 0 0 10px rgba(0,0,0,0.4);
	display: flex;
	flex-direction: column;
	gap: 1.2rem;
}
.lang-switch {
	display: flex;
	gap: 0.5rem;
	justify-content: center;
	margin-top: auto;
	padding: 2rem 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);
}
