/* Zala Mladost dashboard — palette & type taken from zalamladost.bg */
:root {
	--primary: #273882;      /* navy */
	--secondary: #1CA08F;    /* teal */
	--white: #FFFFFF;
	--light: #F1F5FA;
	--dark: #101010;
	--panel: rgba(21, 31, 76, 0.55);
	--panel-border: rgba(255, 255, 255, 0.14);
	--muted: rgba(255, 255, 255, 0.68);
	--font-title: "Moderustic", Arial, sans-serif;
	--font-body: "Inter", Arial, sans-serif;
	--gutter: clamp(16px, 3vw, 30px);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
	margin: 0;
	min-height: 100vh;
	font-family: var(--font-body);
	font-size: 18px;
	line-height: 1.5;
	color: var(--white);
	background: var(--primary);
	overflow-x: hidden;
}

/* ---------- Background video ---------- */
.bg-video {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	z-index: -2;
}
.bg-overlay {
	position: fixed;
	inset: 0;
	z-index: -1;
	background:
		linear-gradient(180deg, rgba(39, 56, 130, 0.72) 0%, rgba(39, 56, 130, 0.30) 45%, rgba(16, 20, 50, 0.75) 100%);
}

/* ---------- Typography ---------- */
.g-title { font-family: var(--font-title); font-weight: 700; margin: 0; line-height: 1.1; }
.g-title--xl { font-size: clamp(40px, 6vw, 76.8px); line-height: 1.2; }
.g-title--md { font-size: clamp(20px, 1.6vw, 24px); line-height: 1.2; }
.muted { color: var(--muted); font-size: 14px; }
.eyebrow {
	margin: 0 0 12px;
	font-size: 14px;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--secondary);
	font-weight: 600;
}

/* ---------- Header ---------- */
.header {
	position: sticky;
	top: 0;
	z-index: 10;
	display: flex;
	align-items: center;
	gap: 32px;
	padding: 24px var(--gutter);
	background: linear-gradient(180deg, rgba(39, 56, 130, .9), rgba(39, 56, 130, .6));
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--panel-border);
}
.header__logo img { display: block; height: 44px; width: auto; }
.header__nav { display: flex; gap: 28px; margin-left: auto; }
.header__nav a {
	position: relative;
	color: var(--white);
	text-decoration: none;
	font-size: 16px;
	padding: 4px 0;
}
.header__nav a::after {
	content: "";
	position: absolute;
	left: 0; bottom: -2px;
	width: 100%; height: 2px;
	background: var(--secondary);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform .3s ease;
}
.header__nav a:hover::after,
.header__nav a.is-active::after { transform: scaleX(1); }
.header__meta {
	display: flex; align-items: center; gap: 10px;
	font-family: var(--font-title);
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	font-size: 18px;
}
.live-dot {
	width: 10px; height: 10px; border-radius: 50%;
	background: var(--secondary);
	box-shadow: 0 0 0 0 rgba(28, 160, 143, .7);
	animation: pulse 2s infinite;
}
.live-dot.is-stale {
	background: rgba(255, 255, 255, .45);
	box-shadow: none;
	animation: none;
}
.data-status { margin: 14px 0 0; font-size: 13px; }
.data-status.is-error { color: #FFB4A8; }
@keyframes pulse {
	70% { box-shadow: 0 0 0 10px rgba(28, 160, 143, 0); }
	100% { box-shadow: 0 0 0 0 rgba(28, 160, 143, 0); }
}
.header__burger { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.header__burger span { display: block; width: 24px; height: 2px; margin: 5px 0; background: var(--white); }

/* ---------- Layout ---------- */
.wrap { max-width: 1440px; margin: 0 auto; padding: 0 var(--gutter); }

.intro { padding: clamp(40px, 8vh, 90px) 0 clamp(30px, 5vh, 50px); max-width: 1200px; }
.intro .g-title--xl { font-size: clamp(36px, 4.6vw, 64px); }
.intro__lead { max-width: 900px; }
.intro__lead { margin: 18px 0 0; font-family: var(--font-title); font-weight: 300; font-size: clamp(18px, 1.6vw, 22px); color: var(--muted); }

/* ---------- KPI (stats) ---------- */
.stats {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 1px;
	background: var(--panel-border);
	border: 1px solid var(--panel-border);
	margin-bottom: 24px;
}
.stats__item {
	padding: 28px 26px;
	background: var(--panel);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border-top: 3px solid var(--secondary);
}
.stats__value {
	margin: 0;
	font-family: var(--font-title);
	font-weight: 700;
	font-size: clamp(28px, 2.6vw, 38.4px);
	line-height: 1;
	font-variant-numeric: tabular-nums;
}
.stats__tag {
	display: inline-block;
	margin-top: 12px;
	font-size: 12px;
	letter-spacing: .04em;
	color: var(--muted);
	opacity: .8;
}
.stats__tag--live { color: var(--secondary); opacity: 1; }
.stats__tag--live::before {
	content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
	background: var(--secondary); margin-right: 6px; vertical-align: 1px;
}
.stats__label {
	margin: 10px 0 0;
	font-family: var(--font-title);
	font-weight: 300;
	font-size: 16px;
	color: var(--muted);
}

/* ---------- Panels ---------- */
.grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
}
.panel {
	display: flex;
	flex-direction: column;
	padding: 26px;
	background: var(--panel);
	border: 1px solid var(--panel-border);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	opacity: 0;
	transform: translateY(30px);
	transition: opacity .8s ease, transform .8s ease;
}
.panel.is-in { opacity: 1; transform: none; }
.panel--wide { grid-column: span 2; }
.panel__head {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
	margin-bottom: 20px;
}
.panel__foot {
	display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px;
	margin-top: 20px; padding-top: 18px;
	border-top: 1px solid var(--panel-border);
}
.panel__foot span { display: block; }
.panel__foot strong { font-family: var(--font-title); font-size: 24px; font-variant-numeric: tabular-nums; }

.legend { display: flex; gap: 18px; font-size: 14px; color: var(--muted); }
.sw { display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px; }
.sw--teal { background: var(--secondary); }
.sw--white { background: var(--white); }

.chart-box { position: relative; height: 320px; }

/* toolbar: период, донгъли, експорт */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: -6px 0 12px; }
.toolbar__group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chip {
	font: 500 13px/1 var(--font-body);
	color: var(--white);
	background: rgba(255, 255, 255, .06);
	border: 1px solid var(--panel-border);
	padding: 8px 12px;
	cursor: pointer;
	transition: background .2s, border-color .2s;
}
.chip:hover { border-color: var(--secondary); }
.chip.is-active, .chip--solid { background: var(--secondary); border-color: var(--secondary); }
.field { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.field input, .field select {
	font: 13px var(--font-body);
	color: var(--white);
	background: rgba(255, 255, 255, .06);
	border: 1px solid var(--panel-border);
	padding: 6px 8px;
	color-scheme: dark;
}
.field select option { background: var(--primary); }
.dongle-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; min-height: 0; }
.dongle-legend:empty { display: none; }
.dongle-chip {
	display: inline-flex; align-items: center; gap: 8px;
	font: 13px var(--font-body); color: var(--white);
	background: transparent; border: 1px solid var(--panel-border);
	padding: 5px 10px; cursor: pointer;
}
.dongle-chip i { width: 14px; height: 0; border-top: 2px dashed currentColor; }
.dongle-chip small { color: var(--muted); }
.dongle-chip.is-off { opacity: .4; }
.dongle-chip.is-offline small::after { content: " · офлайн"; color: #FFB4A8; }
.chart-box canvas { width: 100%; height: 100%; display: block; }

/* donut */
.donut { position: relative; width: 220px; height: 220px; margin: 0 auto 20px; }
.donut canvas { width: 220px; height: 220px; }
.donut__center {
	position: absolute; inset: 0;
	display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.donut__center strong { font-family: var(--font-title); font-size: 38px; line-height: 1; }
.donut__center span { font-size: 14px; color: var(--muted); margin-top: 4px; }

/* bullet list (site uses square bullets) */
.bullets { list-style: none; margin: 0; padding: 0; }
.bullets li {
	display: flex; justify-content: space-between; gap: 12px;
	padding: 8px 0; font-size: 15px;
	border-bottom: 1px solid var(--panel-border);
}
.bullets li:last-child { border-bottom: 0; }
.bullets i { display: inline-block; width: 10px; height: 10px; margin-right: 10px; }
.bullets strong { white-space: nowrap; }

/* bars */
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.bars__row { display: flex; justify-content: space-between; font-size: 15px; margin-bottom: 6px; }
.bars__track { height: 6px; background: rgba(255, 255, 255, .12); }
.bars__fill { height: 100%; background: var(--secondary); width: 0; transition: width 1s ease; }
.bars__fill.is-high { background: var(--white); }

/* посетители (броячи на камерите) */
.panel--full { grid-column: 1 / -1; }
.visitors { display: grid; grid-template-columns: minmax(260px, 1fr) 2.2fr; gap: 26px; align-items: start; }
.visitors__tiles { flex: none; margin-bottom: 18px; }
.visitors__cams { margin-bottom: 0; }
.visitors__chart { position: relative; height: 300px; }
.visitors__chart canvas { width: 100%; height: 100%; display: block; }
.tile--wide { grid-column: 1 / -1; }

/* микроклимат: списък с помещенията */
.rooms { list-style: none; margin: 0; padding: 0; }
.rooms li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--panel-border); font-size: 15px; }
.rooms li:last-child { border-bottom: 0; }
.rooms i { display: inline-block; width: 10px; height: 10px; margin-right: 8px; vertical-align: 0; }
.rooms strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.rooms .is-offline { color: #FFB4A8; font-size: 12px; margin-left: 6px; }
.rooms li.is-off { opacity: .55; }
@media (max-width: 860px) {
	.visitors { grid-template-columns: 1fr; }
	.visitors__chart { height: 240px; }
}
.bars__row .is-offline { color: #FFB4A8; font-size: 12px; margin-left: 6px; }

/* climate tiles */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--panel-border); flex: 1; }
.tile { background: rgba(21, 31, 76, .6); padding: 18px; }
.tile span { display: block; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.tile strong { display: block; margin-top: 8px; font-family: var(--font-title); font-size: 30px; line-height: 1; font-variant-numeric: tabular-nums; }
.tile em { display: block; margin-top: 6px; font-style: normal; font-size: 13px; color: var(--secondary); }

/* events */
.events { list-style: none; margin: 0; padding: 0; }
.events li {
	display: grid; grid-template-columns: 64px 1fr; gap: 12px;
	padding: 12px 0; border-bottom: 1px solid var(--panel-border);
}
.events li:last-child { border-bottom: 0; }
.events time { font-family: var(--font-title); font-weight: 700; color: var(--secondary); }
.events p { margin: 0; font-size: 15px; line-height: 1.35; }
.events small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.events li.is-past { opacity: .5; }
.events a { color: var(--white); text-decoration: none; border-bottom: 1px solid rgba(255, 255, 255, .25); }
.events a:hover { color: var(--secondary); border-bottom-color: var(--secondary); }
.events small a { color: var(--muted); border-bottom: 0; }
.events small a:hover { color: var(--secondary); }
.events time small { display: block; margin: 0 0 2px; font-family: var(--font-body); font-weight: 400; font-size: 12px; color: var(--muted); }
.events time { white-space: nowrap; }
.events .all-day { font-size: 14px; }
.events .is-empty { display: block; padding: 12px 0; color: var(--muted); }

/* ---------- Footer / button ---------- */
.footer {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
	padding: 40px 0; font-size: 14px; color: var(--muted);
}
.btn {
	font-family: var(--font-body);
	font-size: 14px;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: var(--white);
	background: var(--primary);
	border: 1px solid var(--white);
	padding: 12px 22px;
	cursor: pointer;
	transition: background .3s, border-color .3s;
}
.btn:hover { background: var(--secondary); border-color: var(--secondary); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
	.stats { grid-template-columns: repeat(2, 1fr); }
	.grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
	.header { gap: 16px; padding: 16px var(--gutter); }
	.header__logo img { height: 34px; }
	.header__meta { margin-left: auto; font-size: 16px; }
	.header__burger { display: block; }
	.header__nav {
		display: none;
		position: absolute; top: 100%; left: 0; right: 0;
		flex-direction: column; gap: 0;
		background: rgba(39, 56, 130, .97);
		border-bottom: 1px solid var(--panel-border);
	}
	.header__nav.is-open { display: flex; }
	.header__nav a { padding: 14px var(--gutter); }
	.header__nav a::after { display: none; }
	.grid { grid-template-columns: 1fr; }
	.panel--wide { grid-column: auto; }
	.chart-box { height: 220px; }
}
@media (max-width: 520px) {
	.stats { grid-template-columns: 1fr; }
	.panel { padding: 20px 16px; }
	.panel__foot { grid-template-columns: 1fr; gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
	.panel { opacity: 1; transform: none; transition: none; }
	.live-dot { animation: none; }
}
#climate .visitors__chart { height: 400px; }
@media (max-width: 860px) { #climate .visitors__chart { height: 260px; } }

/* 3D модел на сградата */
.b3d { position: relative; height: clamp(560px, 78vh, 940px); background: radial-gradient(ellipse at 50% 40%, rgba(80, 110, 200, .18), rgba(10, 20, 60, .35)); border: 1px solid var(--panel-border); overflow: hidden; }
.b3d canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.b3d canvas:active { cursor: grabbing; }
.b3d-labels { position: absolute; inset: 0; pointer-events: none; }
.b3d-label { position: absolute; transform: translate(-50%, -100%); background: rgba(21, 31, 76, .88); border: 1px solid var(--panel-border);
	padding: 5px 9px; font-size: 12px; line-height: 1.35; white-space: nowrap; text-align: center; }
.b3d-label b { display: block; font-weight: 600; }
.b3d-label span { color: var(--secondary); font-variant-numeric: tabular-nums; }
.b3d-label.is-off span { color: #FFB4A8; }
.b3d-info { position: absolute; right: 14px; bottom: 14px; width: 340px; max-width: calc(100% - 28px); max-height: calc(100% - 28px); overflow: auto;
	background: rgba(21, 31, 76, .95); border: 1px solid var(--panel-border); border-top: 3px solid #ffd166; padding: 12px 14px; font-size: 14px; }
.b3d-info > b { display: block; margin: 0 28px 4px 0; font-size: 16px; }
.b3d-info > span { display: block; color: var(--muted); }
.b3d-info__sensor { color: var(--secondary) !important; margin-top: 2px; }
.b3d-info__close { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border: 0; background: transparent; color: var(--white);
	font-size: 22px; line-height: 1; cursor: pointer; opacity: .7; }
.b3d-info__close:hover { opacity: 1; }
.b3d-info dl { display: grid; grid-template-columns: auto 1fr; gap: 5px 14px; margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--panel-border); }
.b3d-info dt { color: var(--muted); }
.b3d-info dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.b3d-open { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--panel-border); }
.b3d-open h4 { margin: 0 0 4px; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.b3d-open h4 i { width: 10px; height: 10px; display: inline-block; }
.b3d-open ul { margin: 0; padding: 0; list-style: none; font-size: 13px; }
.b3d-open li { padding: 2px 0; color: var(--muted); }
.b3d-open li b { color: var(--white); font-weight: 600; }
.b3d-info details { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--panel-border); font-size: 12px; }
.b3d-info summary { cursor: pointer; color: var(--secondary); font-size: 13px; }
.b3d-info table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.b3d-info th, .b3d-info td { padding: 3px 0; border-bottom: 1px solid rgba(255, 255, 255, .07); vertical-align: top; }
.b3d-info th { text-align: left; font-weight: 400; color: var(--muted); padding-right: 10px; }
.b3d-info td { text-align: right; word-break: break-word; }
.b3d-rooms { position: absolute; left: 14px; top: 14px; bottom: 14px; width: 300px; max-width: calc(100% - 28px); display: flex; flex-direction: column;
	background: rgba(21, 31, 76, .95); border: 1px solid var(--panel-border); font-size: 13px; }
.b3d-rooms[hidden] { display: none; }
.b3d-rooms__head { position: relative; padding: 10px 40px 8px 12px; display: flex; align-items: baseline; gap: 8px; }
.b3d-rooms__head small { color: var(--muted); }
.b3d-rooms input { margin: 0 10px 8px; padding: 7px 9px; font: 13px var(--font-body); color: var(--white); background: rgba(255, 255, 255, .06);
	border: 1px solid var(--panel-border); outline: none; }
.b3d-rooms input:focus { border-color: var(--secondary); }
.b3d-rooms ul { list-style: none; margin: 0; padding: 0 0 6px; overflow-y: auto; flex: 1; }
.b3d-rooms__storey { position: sticky; top: 0; padding: 6px 12px; font-size: 12px; font-weight: 600; color: var(--secondary); background: #1a2660; }
.b3d-rooms__empty { padding: 10px 12px; }
.b3d-rooms button { width: 100%; display: grid; grid-template-columns: 44px 1fr auto; gap: 8px; align-items: baseline; padding: 6px 12px; border: 0;
	background: transparent; color: var(--white); font: 13px var(--font-body); text-align: left; cursor: pointer; }
.b3d-rooms button:hover { background: rgba(255, 255, 255, .07); }
.b3d-rooms button.is-sel { background: rgba(255, 209, 102, .2); box-shadow: inset 3px 0 0 #ffd166; }
.b3d-rooms .num { color: var(--muted); font-variant-numeric: tabular-nums; }
.b3d-rooms .ar { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.b3d-rooms .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--secondary); vertical-align: 1px; }
@media (max-width: 860px) { .b3d-info { left: 14px; right: 14px; width: auto; max-height: 60%; } }
.b3d-scale { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.b3d-scale i { width: 140px; height: 8px; background: linear-gradient(90deg, #296AF2, #1CA08F, #F2C24F, #E04A40); }
@media (max-width: 860px) { .b3d { height: 70vh; min-height: 380px; } }

/* 3D на цял екран: целият панел (с бутоните) заема екрана, моделът — останалото място */
#building3d:fullscreen, #building3d.is-max {
	position: fixed; inset: 0; z-index: 1000; margin: 0; max-width: none; width: 100vw; height: 100vh;
	display: flex; flex-direction: column; background: #16225a; opacity: 1; transform: none; overflow: hidden;
}
#building3d:fullscreen .b3d, #building3d.is-max .b3d { flex: 1; height: auto; min-height: 0; }
#building3d:fullscreen .data-status, #building3d.is-max .data-status { margin-bottom: 0; }
body.b3d-max-open { overflow: hidden; }
.b3d-rooms .b3d-info__close { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; display: block; padding: 0; text-align: center; font-size: 22px; }

/* 3D: зареждане в самия панел */
.b3d-loader { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
	background: rgba(16, 26, 70, .55); transition: opacity .4s ease; }
.b3d-loader.is-done { opacity: 0; pointer-events: none; }
.b3d-loader__pct { font-family: var(--font-title); font-size: clamp(40px, 5vw, 64px); line-height: 1; font-variant-numeric: tabular-nums; }
.b3d-loader__track { width: min(360px, 70%); height: 8px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.b3d-loader__track i { display: block; height: 100%; width: 0; background: var(--secondary); transition: width .25s ease; }
.b3d-loader span { color: var(--muted); font-size: 14px; }
.b3d-loader.is-error .b3d-loader__pct { color: #FFB4A8; }
/* бутон „Цял екран“ — вдясно и подчертан */
.toolbar__group--end { margin-left: auto; }
.chip--accent { background: var(--secondary); border-color: var(--secondary); font-weight: 600; padding-left: 14px; padding-right: 16px; }
.chip--accent::before { content: "⛶"; margin-right: 7px; font-size: 15px; vertical-align: -1px; }
.chip--accent:hover { filter: brightness(1.12); }
.chip--accent.is-active { background: transparent; color: var(--white); border-color: var(--secondary); }
/* няколко избрани помещения */
.b3d-rooms__multi { display: flex; align-items: center; gap: 7px; margin: -2px 12px 8px; color: var(--muted); font-size: 12px; cursor: pointer; }
.b3d-rooms__multi input { margin: 0; accent-color: var(--secondary); }
.b3d-sum { list-style: none; margin: 10px 0 0; padding: 8px 0 0; border-top: 1px solid var(--panel-border); max-height: 220px; overflow-y: auto; font-size: 13px; }
.b3d-sum li { display: grid; grid-template-columns: 22px 40px 1fr auto; gap: 6px; align-items: baseline; padding: 2px 0; }
.b3d-sum .num, .b3d-sum .ar { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.b3d-sum__rm { width: 20px; height: 20px; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; }
.b3d-sum__rm:hover { color: #FFB4A8; }
.b3d-sum__clear { margin-top: 10px; }

/* 3D: слоеве с данни */
.toolbar--layers { margin-top: -4px; }
.chip--layer { display: inline-flex; align-items: center; gap: 7px; opacity: .55; }
.chip--layer i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.chip--layer.is-active { opacity: 1; background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .45); }
.b3d-label small { display: block; color: var(--muted); font-size: 11px; margin: 1px 0 2px; }
.b3d-label span { line-height: 1.35; }
.b3d-label--climate { border-left: 3px solid var(--secondary); }
.b3d-label--energy { border-left: 3px solid #ffb703; }
.b3d-label--energy span { color: #ffd166; }
.b3d-label--people { border-left: 3px solid #b388ff; }
.b3d-label--people span { color: #d4bfff; }
.b3d-layers { position: absolute; right: 14px; top: 14px; width: 300px; max-width: calc(100% - 28px); max-height: calc(100% - 28px); overflow-y: auto;
	background: rgba(21, 31, 76, .96); border: 1px solid var(--panel-border); font-size: 13px; z-index: 2; }
.b3d-layers[hidden] { display: none; }
.b3d-layers .b3d-info__close { position: absolute; top: 4px; right: 4px; }
.b3d-layers__list { padding: 0 12px 10px; }
.b3d-layers h4 { margin: 10px 0 4px; font-size: 12px; font-weight: 600; color: var(--secondary); }
.b3d-layers h4.is-off { color: var(--muted); }
.b3d-layers label { display: flex; align-items: baseline; gap: 7px; padding: 3px 0; cursor: pointer; }
.b3d-layers label small { color: var(--muted); }
.b3d-layers input { accent-color: var(--secondary); }
.b3d:focus { outline: none; }
.b3d:focus-visible, .b3d:focus { box-shadow: inset 0 0 0 2px rgba(28, 160, 143, .55); }

/* етикетите в 3D са връзки към панелите */
.b3d-label { pointer-events: auto; cursor: pointer; color: var(--white); text-decoration: none; transition: border-color .15s, background .15s; }
.b3d-label:hover, .b3d-label:focus-visible { background: rgba(32, 46, 108, .97); border-color: rgba(255, 255, 255, .55); z-index: 1; outline: none; }
.b3d-label:hover b::after, .b3d-label:focus-visible b::after { content: " →"; }
.panel { scroll-margin-top: 96px; }
@keyframes panelFlash { 0%, 60% { box-shadow: 0 0 0 2px var(--secondary), 0 0 28px rgba(28, 160, 143, .45); } 100% { box-shadow: none; } }
.panel.is-flash { animation: panelFlash 1.8s ease-out; }

/* дясна колона в 3D: карта на артикула над картата на помещението */
.b3d-side { position: absolute; right: 14px; top: 14px; bottom: 14px; width: 340px; max-width: calc(100% - 28px);
	display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; pointer-events: none; z-index: 1; }
.b3d-side .b3d-info { position: static; width: auto; max-width: none; max-height: none; min-height: 0; flex: 0 1 auto; pointer-events: auto; }
.b3d-side .b3d-info[hidden] { display: none; }
.b3d-side .b3d-item { border-top-color: #4cc9f0; flex: 0 0 auto; max-height: 58%; overflow: auto; }
.b3d-inv { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--panel-border); }
.b3d-inv h4 { margin: 0 0 4px; font-size: 13px; font-weight: 600; }
.b3d-inv h4 small { color: var(--muted); font-weight: 400; margin-left: 6px; }
.b3d-inv__grp { margin: 6px 0 2px; font-size: 11px; color: var(--secondary); text-transform: uppercase; letter-spacing: .04em; }
.b3d-inv ul { list-style: none; margin: 0; padding: 0; }
.b3d-inv li button { width: 100%; display: flex; justify-content: space-between; gap: 10px; padding: 4px 6px; margin: 0 -6px; border: 0; background: transparent;
	color: #9fd8ff; font: 13px var(--font-body); text-align: left; cursor: pointer; text-decoration: underline; text-decoration-color: rgba(159, 216, 255, .35); text-underline-offset: 3px; }
.b3d-inv li button b { color: var(--white); font-weight: 600; text-decoration: none; white-space: nowrap; }
.b3d-inv li button:hover, .b3d-inv li button.is-open { background: rgba(76, 201, 240, .14); text-decoration-color: currentColor; }
.b3d-inv li button.is-open { box-shadow: inset 3px 0 0 #4cc9f0; }
.b3d-inv__live { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 6px #4ade80; vertical-align: 1px; margin-right: 4px; }
.b3d-inv__livebox { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--panel-border); }
.b3d-inv__livebox h4 { margin: 0; font-size: 13px; font-weight: 600; }
.b3d-inv__livebox h4 small { color: var(--muted); font-weight: 400; margin-left: 6px; }
.b3d-inv__livebox dl { border-top: 0; margin-top: 4px; padding-top: 0; }
.b3d-inv__livebox > small { display: block; margin-top: 6px; word-break: break-all; }
.b3d-inv__notes { margin: 10px 0 0; padding-top: 8px; border-top: 1px solid var(--panel-border); color: var(--muted); font-size: 13px; }
.b3d-item dd a, .b3d-inv__livebox a { color: #9fd8ff; }
.b3d-tag { font-style: normal; font-size: 11px; font-weight: 600; padding: 1px 6px; margin-left: 4px; border-radius: 3px; }
.b3d-tag.is-ok { background: rgba(74, 222, 128, .16); color: #86efac; }
.b3d-tag.is-warn { background: rgba(255, 183, 3, .18); color: #ffd166; }
.b3d-tag.is-bad { background: rgba(255, 99, 99, .18); color: #FFB4A8; }
.b3d-rooms .inv { font-style: normal; font-size: 10px; padding: 0 5px; border-radius: 8px; background: rgba(76, 201, 240, .2); color: #9fd8ff; }
@media (max-width: 860px) { .b3d-side { left: 14px; width: auto; top: 30%; } }
.b3d-inv h4 { display: flex; align-items: baseline; gap: 4px; }
.b3d-inv__adm { margin-left: auto; font-size: 11px; font-weight: 400; color: var(--muted); text-decoration: none; }
.b3d-inv__adm:hover { color: #9fd8ff; text-decoration: underline; }

/* заглавие на платформата горе вляво */
.header__brand { display: flex; align-items: center; gap: 12px; color: var(--white); text-decoration: none; min-width: 0; }
.header__brand-icon { width: 40px; height: 40px; flex: none; color: var(--white); }
.header__brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.header__brand-text strong { font-family: var(--font-title); font-size: 18px; font-weight: 700; letter-spacing: .01em; white-space: nowrap; }
.header__brand-text small { font-size: 13px; color: var(--secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.about:empty::before { content: "Информацията за проекта ще бъде добавена скоро."; color: var(--muted); }
@media (max-width: 1280px) { .header__nav { gap: 20px; } .header__nav a { font-size: 15px; } }
@media (max-width: 1100px) { .header__brand-text strong { font-size: 16px; } }
@media (max-width: 860px) {
	.header__brand-icon { width: 32px; height: 32px; }
	.header__brand-text strong { font-size: 14px; white-space: normal; }
	.header__brand-text small { font-size: 12px; }
}
@media (max-width: 520px) { .header__meta { display: none; } }
