@font-face {
	font-family: 'Orbitron';
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url('/static/orbitron-bold.woff2') format('woff2');
}

:root {
	--green: #76C043;
	--green-light: #A8E063;
	--green-dim: #4f8a25;
	--bg: #0F0F0F;
	--bg-2: #1A1A1A;
	--bg-3: #222;
	--fg: #FFFFFF;
	--fg-dim: #B8B8B8;
	--border: #2A2A2A;
	--red: #E04B4B;
	--yellow: #E8C547;
	--blue: #4D8ED9;
	--topbar-h: 56px;
	--sidebar-w: 220px;
	--sidebar-collapsed-w: 56px;
}

* { box-sizing: border-box; }

html, body {
	margin: 0;
	padding: 0;
	background: var(--bg);
	color: var(--fg);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
	font-size: 14px;
	line-height: 1.5;
}

a { color: var(--green-light); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Top bar ---------- */
.topbar {
	position: fixed;
	top: 0; left: 0; right: 0;
	height: var(--topbar-h);
	background: #000;
	border-bottom: 2px solid var(--green);
	display: flex;
	align-items: center;
	padding: 0 16px;
	gap: 16px;
	z-index: 10;
}
.topbar .brand {
	display: inline-flex;
	align-items: center;
	height: 100%;
	padding: 4px 18px;
	background: radial-gradient(ellipse at center,
		#fff 0%,
		#fff 55%,
		rgba(255,255,255,0.85) 70%,
		rgba(255,255,255,0.45) 85%,
		rgba(255,255,255,0) 100%);
	border-radius: 14px;
}
.topbar .logo { height: 40px; width: auto; display: block; }
.topbar-title {
	font-family: 'Orbitron', monospace;
	font-weight: 700;
	font-size: 20px;
	letter-spacing: 3px;
	color: var(--green);
	text-transform: uppercase;
	text-shadow: 0 0 12px rgba(118,192,67,0.6);
	user-select: none;
}
.burger {
	background: transparent;
	border: 1px solid var(--border);
	color: var(--fg);
	width: 36px; height: 36px;
	border-radius: 4px;
	cursor: pointer;
	font-size: 18px;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	flex-shrink: 0;
}
.burger:hover { background: var(--bg-3); border-color: var(--green); }
.year-filter { margin-left: auto; display: flex; align-items: center; }
.year-filter label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 0;
	color: var(--fg-dim);
	font-size: 13px;
	white-space: nowrap;
}
.year-filter select {
	display: inline-block;
	width: auto;
	margin-top: 0;
	background: var(--bg-2);
	color: var(--fg);
	border: 1px solid var(--border);
	padding: 4px 8px;
	border-radius: 4px;
}
.user-menu { display: flex; align-items: center; gap: 12px; }
.user-name { color: var(--fg-dim); font-size: 13px; }
.badge {
	background: var(--green); color: #000; font-size: 11px;
	padding: 1px 6px; border-radius: 3px; font-weight: bold;
}
button.link {
	background: none; border: none; color: var(--green-light); cursor: pointer; padding: 0; font: inherit;
}
button.link:hover { text-decoration: underline; }
button.link-danger { background: none; border: none; color: var(--red); cursor: pointer; padding: 0; font: inherit; margin-left: 8px; }
button.link-danger:hover { text-decoration: underline; }

/* ---------- Sidebar ---------- */
.sidebar {
	position: fixed;
	top: var(--topbar-h);
	bottom: 0;
	left: 0;
	width: var(--sidebar-w);
	background: var(--bg-2);
	border-right: 1px solid var(--border);
	overflow-y: auto;
	transition: width 0.18s ease;
	z-index: 9;
}
.sidebar nav { display: flex; flex-direction: column; padding: 8px 0; }
.sidebar nav a {
	display: flex; align-items: center; gap: 12px;
	padding: 10px 16px;
	color: var(--fg);
	border-left: 3px solid transparent;
	white-space: nowrap;
}
.sidebar nav a:hover { background: var(--bg-3); text-decoration: none; }
.sidebar nav a.active { background: var(--bg-3); border-left-color: var(--green); color: var(--green-light); }
.sidebar nav .icon { width: 20px; text-align: center; flex-shrink: 0; }
.sidebar nav .label { font-size: 14px; }
.sidebar .section-label {
	color: var(--fg-dim);
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 1px;
	padding: 12px 16px 4px;
}

body.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed-w); }
body.sidebar-collapsed .sidebar nav .label,
body.sidebar-collapsed .sidebar .section-label { display: none; }

/* ---------- Main content ---------- */
.content {
	margin-top: var(--topbar-h);
	margin-left: var(--sidebar-w);
	padding: 24px;
	transition: margin-left 0.18s ease;
}
body.sidebar-collapsed .content { margin-left: var(--sidebar-collapsed-w); }

@media (max-width: 768px) {
	.sidebar { width: var(--sidebar-collapsed-w); }
	.sidebar nav .label, .sidebar .section-label { display: none; }
	.content { margin-left: var(--sidebar-collapsed-w); padding: 12px; }
}

/* ---------- Page header & buttons ---------- */
.page-header {
	display: flex; justify-content: space-between; align-items: center;
	margin-bottom: 16px;
	gap: 16px;
}
.page-header h1 { margin: 0; font-size: 22px; }
.page-actions { display: flex; gap: 8px; }

button, .button {
	background: var(--green);
	color: #000;
	border: none;
	padding: 8px 16px;
	border-radius: 4px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	display: inline-block;
	text-decoration: none;
}
button:hover, .button:hover { background: var(--green-light); text-decoration: none; }
.button-secondary { background: var(--bg-3); color: var(--fg); border: 1px solid var(--border); }
.button-secondary:hover { background: var(--border); }
.button-danger { background: var(--red); color: #fff; }
.button-danger:hover { background: #f06b6b; }

/* ---------- Forms ---------- */
form label { display: block; margin-bottom: 12px; color: var(--fg-dim); font-size: 13px; }
form label small { color: var(--fg-dim); font-weight: normal; }
input, select, textarea {
	display: block;
	width: 100%;
	background: var(--bg-2);
	color: var(--fg);
	border: 1px solid var(--border);
	padding: 8px 10px;
	border-radius: 4px;
	font: inherit;
	margin-top: 4px;
}
input:focus, select:focus, textarea:focus {
	outline: none; border-color: var(--green);
}
fieldset {
	border: 1px solid var(--border);
	border-radius: 4px;
	padding: 12px 16px;
	margin: 16px 0;
}
fieldset legend { color: var(--green-light); padding: 0 8px; font-weight: 600; }

.grid { display: grid; gap: 12px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 768px) { .grid-3 { grid-template-columns: 1fr; } }

.form-actions { display: flex; gap: 12px; margin-top: 16px; }
.inline-form {
	display: flex; gap: 8px; margin-bottom: 16px; align-items: end; flex-wrap: wrap;
}
.inline-form input, .inline-form select { width: auto; min-width: 180px; }

.filters {
	display: flex; gap: 16px; align-items: end; flex-wrap: wrap;
	margin-bottom: 16px;
}
.filters label { margin-bottom: 0; }
.filters select { min-width: 180px; }
.filter-reset { display: flex; align-items: flex-end; }

/* ---------- Tables ---------- */
table {
	width: 100%;
	border-collapse: collapse;
	background: var(--bg-2);
	border-radius: 4px;
	overflow: hidden;
}
th, td {
	padding: 8px 10px;
	border-bottom: 1px solid var(--border);
	text-align: left;
	vertical-align: middle;
}
th {
	background: var(--bg-3);
	color: var(--green-light);
	font-weight: 600;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}
.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { text-align: center; color: var(--fg-dim); padding: 24px; }

/* Column header tooltips & sorting */
th[data-tooltip] { cursor: help; }
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: var(--fg); background: #2a2a2a; }
th.sort-asc, th.sort-desc { color: var(--green-light); }
.sort-arrow {
	display: inline-block;
	margin-left: 4px;
	font-size: 9px;
	vertical-align: middle;
	line-height: 1;
	color: var(--green);
}
.th-tooltip {
	display: none;
	position: fixed;
	background: var(--bg-3);
	color: var(--fg);
	border: 1px solid var(--border);
	border-radius: 4px;
	padding: 6px 10px;
	font-size: 12px;
	font-weight: normal;
	text-transform: none;
	letter-spacing: 0;
	white-space: nowrap;
	pointer-events: none;
	z-index: 1000;
	box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

/* Status row colors (subtle background tint) */
.row-rot    { background: rgba(224,75,75,0.08); }
.row-blau   { background: rgba(77,142,217,0.08); }
.row-gelb   { background: rgba(232,197,71,0.08); }
.row-schwarz{ background: rgba(255,255,255,0.02); }
.row-grün   { background: rgba(118,192,67,0.08); }

/* Status dot in first column */
.dot {
	display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; margin-right: 6px;
}
.dot-rot { background: var(--red); }
.dot-blau { background: var(--blue); }
.dot-gelb { background: var(--yellow); }
.dot-schwarz { background: #000; border: 1px solid var(--fg-dim); }
.dot-grün { background: var(--green); }

/* Column accents when value > 0 */
.col-ordered.has   { color: var(--red); font-weight: bold; }
.col-delivered.has { color: var(--fg); font-weight: bold; }
.col-sold.has      { color: var(--yellow); font-weight: bold; }
.col-demo.has      { color: var(--blue); font-weight: bold; }
.has-warn { color: var(--red); font-weight: bold; }

tr.inactive { opacity: 0.5; }

/* ---------- Cards ---------- */
.cards {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 12px;
	margin-bottom: 24px;
}
@media (max-width: 768px) { .cards { grid-template-columns: repeat(2, 1fr); } }
.card {
	background: var(--bg-2);
	border: 1px solid var(--border);
	border-left: 4px solid var(--green);
	border-radius: 4px;
	padding: 12px 16px;
}
.card.warn { border-left-color: var(--red); }
.card-label { color: var(--fg-dim); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.card-value { font-size: 28px; font-weight: bold; margin-top: 4px; }

/* ---------- Flash ---------- */
.flash {
	padding: 10px 14px;
	border-radius: 4px;
	margin-bottom: 16px;
	border-left: 4px solid var(--green);
	background: var(--bg-2);
}
.flash-error { border-left-color: var(--red); }
.flash-info { border-left-color: var(--blue); }
.flash code { background: var(--bg-3); padding: 2px 6px; border-radius: 3px; font-family: monospace; }

.hint { color: var(--fg-dim); margin: 0 0 12px; }

/* ---------- Login ---------- */
.login-body {
	display: flex; align-items: center; justify-content: center;
	min-height: 100vh;
	background: var(--bg);
}
.login-card {
	background: var(--bg-2);
	border: 1px solid var(--border);
	border-top: 4px solid var(--green);
	padding: 32px;
	border-radius: 6px;
	width: 360px;
	max-width: 90vw;
}
.login-logo-wrap {
	display: flex;
	justify-content: center;
	margin: 0 auto 20px;
	border-radius: 8px;
	filter:
		drop-shadow(0 0 24px rgba(255,255,255,0.9))
		drop-shadow(0 0 60px rgba(255,255,255,0.5))
		drop-shadow(0 0 100px rgba(255,255,255,0.2));
}
.login-card .logo { width: 100%; height: auto; display: block; margin: 0; }
.login-card h1 { text-align: center; margin: 0 0 16px; font-size: 18px; }
.login-card button { width: 100%; padding: 10px; }
.btn-secondary { background: var(--bg-3); border: 1px solid var(--border); color: var(--fg-dim); cursor: pointer; border-radius: 4px; }

h2 { color: var(--green-light); margin: 24px 0 8px; font-size: 16px; }

a.user-name { text-decoration: none; }
a.user-name:hover { text-decoration: underline; }

.muted { color: var(--fg-dim); }

/* ---------- Stacked form (Account / Passwort) ---------- */
.stacked-form {
	display: flex;
	flex-direction: column;
	gap: 12px;
	max-width: 420px;
}
.stacked-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--fg-dim); }
.stacked-form input {
	background: var(--bg-2);
	color: var(--fg);
	border: 1px solid var(--border);
	border-radius: 4px;
	padding: 8px;
	font: inherit;
}
.stacked-form button { align-self: flex-start; }

/* ---------- View tabs ---------- */
.view-tabs {
	display: flex;
	gap: 4px;
	margin-bottom: 16px;
	border-bottom: 1px solid var(--border);
	padding-bottom: 0;
}
.view-tab {
	background: none;
	border: none;
	border-bottom: 2px solid transparent;
	border-radius: 0;
	color: var(--fg-dim);
	padding: 8px 16px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	margin-bottom: -1px;
	transition: color 0.15s, border-color 0.15s;
}
.view-tab:hover { color: var(--fg); background: none; }
.view-tab.active { color: var(--green-light); border-bottom-color: var(--green); }

/* ---------- Vehicle tiles ---------- */
.vehicle-tiles {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 14px;
}
@media (max-width: 768px) { .vehicle-tiles { grid-template-columns: repeat(2, 1fr); } }

.vehicle-tile {
	display: flex;
	flex-direction: column;
	gap: 6px;
	background: var(--bg-2);
	border: 1px solid var(--border);
	border-radius: 12px;
	padding: 14px 16px;
	text-decoration: none;
	color: var(--fg);
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.vehicle-tile:hover {
	background: var(--bg-3);
	border-color: var(--green);
	transform: translateY(-2px);
	box-shadow: 0 4px 16px rgba(118,192,67,0.15);
	text-decoration: none;
	color: var(--fg);
}
.tile-rot    { border-left: 4px solid var(--red); }
.tile-blau   { border-left: 4px solid var(--blue); }
.tile-gelb   { border-left: 4px solid var(--yellow); }
.tile-schwarz{ border-left: 4px solid #555; }
.tile-grün   { border-left: 4px solid var(--green); }

.tile-header {
	display: flex;
	align-items: center;
	gap: 6px;
}
.tile-status { font-size: 11px; color: var(--fg-dim); flex: 1; }
.tile-year { font-size: 11px; color: var(--fg-dim); }
.tile-title { font-weight: 600; font-size: 14px; line-height: 1.3; }
.tile-color { font-size: 12px; color: var(--fg-dim); }
.tile-stats {
	display: flex;
	flex-direction: column;
	gap: 3px;
	margin-top: 6px;
}
.tile-stat {
	display: flex;
	justify-content: space-between;
	gap: 6px;
	font-size: 11px;
	color: var(--fg-dim);
	font-variant-numeric: tabular-nums;
}
.tile-stat-label {
	color: var(--fg-dim);
	font-weight: normal;
}
.tile-stat.col-ordered.has   { color: var(--red); font-weight: bold; }
.tile-stat.col-delivered.has { color: var(--fg); font-weight: bold; }
.tile-stat.col-sold.has      { color: var(--yellow); font-weight: bold; }
.tile-stat.col-demo.has      { color: var(--blue); font-weight: bold; }
.tile-notes {
	font-size: 11px;
	color: var(--fg-dim);
	margin-top: 4px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ---------- Ampel ---------- */
.ampel-scene {
	--ampel-slot-h: 52px;
	--ampel-slot-gap: 10px;
	--ampel-housing-py: 14px;
	--ampel-housing-px: 16px;
	display: flex;
	align-items: flex-start;
	gap: 28px;
	margin: 8px 0 32px;
}

.ampel-figure {
	display: flex;
	flex-direction: column;
	align-items: center;
	flex-shrink: 0;
}

.ampel-housing {
	background: #0c0c0c;
	border: 2px solid #383838;
	border-radius: 20px;
	padding: var(--ampel-housing-py) var(--ampel-housing-px);
	display: flex;
	flex-direction: column;
	gap: var(--ampel-slot-gap);
	box-shadow:
		0 8px 32px rgba(0,0,0,0.75),
		inset 0 1px 0 rgba(255,255,255,0.07),
		inset 0 -2px 0 rgba(0,0,0,0.5),
		inset 2px 0 0 rgba(255,255,255,0.03),
		inset -2px 0 0 rgba(0,0,0,0.3);
}

a.ampel-slot, a.ampel-label-row { text-decoration: none; color: inherit; }
a.ampel-slot:hover .ampel-bulb { filter: brightness(1.25); }
a.ampel-label-row:hover .ampel-label-name { color: var(--fg); }
a.ampel-label-row:hover .ampel-label-count { color: var(--fg); }
.ampel-slot[data-tooltip], .ampel-label-row[data-tooltip] { cursor: pointer; }

.ampel-slot {
	width: var(--ampel-slot-h);
	height: var(--ampel-slot-h);
	background: radial-gradient(circle at center, #030303, #111);
	border-radius: 50%;
	border: 2px solid #1c1c1c;
	box-shadow:
		inset 0 3px 8px rgba(0,0,0,0.9),
		inset 0 1px 3px rgba(0,0,0,0.7);
	display: flex;
	align-items: center;
	justify-content: center;
}

.ampel-bulb {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	transition: background 0.35s ease, box-shadow 0.35s ease;
	position: relative;
	overflow: hidden;
}

.ampel-bulb::after {
	content: '';
	position: absolute;
	top: 5px;
	left: 7px;
	width: 13px;
	height: 8px;
	background: rgba(255,255,255,0.18);
	border-radius: 60%;
	transform: rotate(-30deg);
	pointer-events: none;
}

/* OFF states */
.bulb-rot     { background: radial-gradient(circle at 38% 35%, #3a1010, #180404 70%); }
.bulb-gelb    { background: radial-gradient(circle at 38% 35%, #302508, #140e02 70%); }
.bulb-grün    { background: radial-gradient(circle at 38% 35%, #0e2208, #040c02 70%); }
.bulb-blau    { background: radial-gradient(circle at 38% 35%, #0c1c32, #040a14 70%); }
.bulb-schwarz { background: radial-gradient(circle at 38% 35%, #202020, #0c0c0c 70%); }

/* ON states with incandescent glow */
.bulb-rot.on {
	background: radial-gradient(circle at 35% 30%, #ffcccc 5%, #f07070 28%, #e04b4b 55%, #6a1010 100%);
	box-shadow: 0 0 12px 3px rgba(224,75,75,0.85), 0 0 28px 8px rgba(224,75,75,0.4), 0 0 56px 18px rgba(224,75,75,0.14);
}
.bulb-gelb.on {
	background: radial-gradient(circle at 35% 30%, #fffbc0 5%, #f0dc60 28%, #e8c547 55%, #685000 100%);
	box-shadow: 0 0 12px 3px rgba(232,197,71,0.85), 0 0 28px 8px rgba(232,197,71,0.4), 0 0 56px 18px rgba(232,197,71,0.14);
}
.bulb-grün.on {
	background: radial-gradient(circle at 35% 30%, #d8ffb0 5%, #96de58 28%, #76c043 55%, #1c4806 100%);
	box-shadow: 0 0 12px 3px rgba(118,192,67,0.85), 0 0 28px 8px rgba(118,192,67,0.4), 0 0 56px 18px rgba(118,192,67,0.14);
}
.bulb-blau.on {
	background: radial-gradient(circle at 35% 30%, #d0eaff 5%, #80bef8 28%, #4d8ed9 55%, #082460 100%);
	box-shadow: 0 0 12px 3px rgba(77,142,217,0.85), 0 0 28px 8px rgba(77,142,217,0.4), 0 0 56px 18px rgba(77,142,217,0.14);
}
.bulb-schwarz.on {
	background: radial-gradient(circle at 35% 30%, #f4f4f4 5%, #b8b8b8 28%, #787878 55%, #1e1e1e 100%);
	box-shadow: 0 0 12px 3px rgba(160,160,160,0.65), 0 0 28px 8px rgba(160,160,160,0.28), 0 0 56px 18px rgba(160,160,160,0.1);
}

.ampel-pole {
	width: 14px;
	height: 52px;
	background: linear-gradient(to right, #181818 0%, #484848 40%, #585858 50%, #363636 65%, #181818 100%);
	border-radius: 0 0 3px 3px;
}

.ampel-base {
	width: 76px;
	height: 18px;
	background: linear-gradient(to bottom, #565656 0%, #383838 40%, #202020 100%);
	border-radius: 4px;
	box-shadow: 0 4px 10px rgba(0,0,0,0.55);
}

.ampel-labels {
	display: flex;
	flex-direction: column;
	gap: var(--ampel-slot-gap);
	padding-top: var(--ampel-housing-py);
}

.ampel-label-row {
	height: var(--ampel-slot-h);
	display: flex;
	align-items: center;
	gap: 12px;
}

.ampel-label-row .dot {
	width: 12px;
	height: 12px;
	flex-shrink: 0;
}

.ampel-label-name {
	font-size: 14px;
	color: var(--fg-dim);
	min-width: 220px;
}

.ampel-label-count {
	font-size: 24px;
	font-weight: bold;
	font-variant-numeric: tabular-nums;
	color: #3a3a3a;
	min-width: 40px;
	text-align: right;
}
.ampel-count-rot     { color: var(--red); }
.ampel-count-gelb    { color: var(--yellow); }
.ampel-count-grün    { color: var(--green); }
.ampel-count-blau    { color: var(--blue); }
.ampel-count-schwarz { color: var(--fg-dim); }

/* ---------- Rollen ---------- */
.role-create-bar {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
	margin-bottom: 20px;
}
.role-create-bar .inline-form { margin-bottom: 0; }
.role-create-hint { margin: 0; font-size: 12px; }

.role-card {
	background: var(--bg-2);
	border: 1px solid var(--border);
	border-radius: 8px;
	margin: 12px 0;
	overflow: hidden;
	transition: box-shadow 0.2s;
}
.role-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
.role-card--system { border-top: 2px solid var(--green-dim); }

.role-card-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 16px;
	background: var(--bg-3);
	border-bottom: 1px solid var(--border);
}
.role-card-title {
	display: flex;
	align-items: center;
	gap: 10px;
}
.role-card-title h2 { margin: 0; font-size: 15px; color: var(--fg); }
.role-card-meta {
	display: flex;
	align-items: center;
	gap: 14px;
}
.role-user-count {
	display: flex;
	align-items: center;
	gap: 5px;
	font-size: 12px;
	color: var(--fg-dim);
}

.perm-groups {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1px;
	background: var(--border);
	margin: 0;
}
@media (max-width: 768px) { .perm-groups { grid-template-columns: 1fr; } }

.perm-group {
	background: var(--bg-2);
	padding: 14px 16px;
}
.perm-group-label {
	font-size: 10px;
	text-transform: uppercase;
	letter-spacing: 1.5px;
	color: var(--green-light);
	font-weight: 700;
	margin-bottom: 10px;
	padding-bottom: 8px;
	border-bottom: 1px solid var(--border);
}

.perm-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 6px 4px;
	border-radius: 4px;
	cursor: pointer;
	margin-bottom: 2px;
	transition: background 0.1s;
}
.perm-item:hover { background: var(--bg-3); }
.perm-label { font-size: 13px; color: var(--fg); user-select: none; }

/* Toggle-Switch */
.perm-item input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}
.perm-toggle {
	position: relative;
	display: inline-block;
	width: 34px;
	height: 18px;
	flex-shrink: 0;
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: 9px;
	transition: background 0.2s, border-color 0.2s;
}
.perm-toggle::after {
	content: '';
	position: absolute;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--fg-dim);
	top: 2px;
	left: 2px;
	transition: transform 0.2s, background 0.2s;
}
.perm-item input:checked + .perm-toggle {
	background: var(--green);
	border-color: var(--green);
}
.perm-item input:checked + .perm-toggle::after {
	transform: translateX(16px);
	background: #000;
}
.perm-item input:disabled + .perm-toggle {
	opacity: 0.4;
	cursor: not-allowed;
}
.perm-item:has(input:disabled) { cursor: not-allowed; opacity: 0.6; }

.role-card-footer {
	padding: 12px 16px;
	background: var(--bg-3);
	border-top: 1px solid var(--border);
}
.role-card-footer button { font-size: 13px; padding: 6px 14px; }

.role-admin-note {
	padding: 10px 16px;
	margin: 0;
	font-size: 12px;
	background: var(--bg-3);
	border-top: 1px solid var(--border);
}

/* ---------- Light Mode ---------- */
body.light {
	--bg: #F0F2F5;
	--bg-2: #FFFFFF;
	--bg-3: #E4E6EA;
	--fg: #111111;
	--fg-dim: #555555;
	--border: #CCCCCC;
}
body.light .topbar { background: #FFFFFF; border-bottom-color: var(--green); }
body.light .burger { color: var(--fg); border-color: var(--border); }
body.light .burger:hover { background: var(--bg-3); border-color: var(--green); }
body.light a { color: var(--green-dim); }
body.light .sidebar nav a { color: var(--fg); }
body.light .sidebar nav a.active { color: var(--green-dim); }
body.light .view-tab { color: var(--fg-dim); }
body.light .view-tab:hover { color: var(--fg); }
body.light .view-tab.active { color: var(--green-dim); }
body.light button.link { color: var(--green-dim); }
body.light .login-body { background: var(--bg); }
body.light .login-card { background: var(--bg-2); }
body.light .topbar-title { color: var(--green-dim); text-shadow: none; }
body.light .ampel-label-count { color: #aaaaaa; }
