/* ============================================================
   LOGIN
   ============================================================ */

.community-login-body {
	min-height: 100vh;
	display: grid;
	place-items: center;
	padding: 24px;
	background: #f3f6fa;
}

.community-login-shell {
	width: min(460px, 100%);
}

.community-login-card {
	background: #fff;
	border: 1px solid #dfe5ec;
	border-radius: 18px;
	padding: 32px;
	box-shadow: 0 18px 50px rgba(15, 23, 42, .08);
}

.community-brand-mark {
	width: 52px;
	height: 52px;
	display: grid;
	place-items: center;
	border-radius: 14px;
	background: #172033;
	color: #fff;
	font-weight: 800;
	margin-bottom: 18px;
}

.community-login-form {
	margin-top: 22px;
}


/* ============================================================
   APP LAYOUT
   ============================================================ */

.community-layout {
	min-height: 100vh;
	display: grid;
	grid-template-columns: 284px minmax(0, 1fr);
	background: #f4f7fb;
}

.community-sidebar {
	position: sticky;
	top: 0;
	height: 100vh;
	background: #111827;
	color: #fff;
	overflow-y: auto;
	border-right: 1px solid rgba(255, 255, 255, .06);
	z-index: 40;
}

.community-sidebar-inner {
	min-height: 100%;
	display: flex;
	flex-direction: column;
	padding: 22px 16px 16px;
}


/* ============================================================
   BRAND
   ============================================================ */

.community-brand {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 2px 8px 22px;
	border-bottom: 1px solid rgba(255, 255, 255, .08);
	margin-bottom: 20px;
}

.community-brand-logo {
	width: 42px;
	height: 42px;
	flex: 0 0 42px;
	display: grid;
	place-items: center;
	border-radius: 12px;
	background: #2563eb;
	color: #fff;
	font-size: 14px;
	font-weight: 800;
	letter-spacing: .04em;
	box-shadow: 0 8px 20px rgba(37, 99, 235, .22);
}

.community-brand-copy {
	min-width: 0;
}

.community-brand-copy h1 {
	margin: 0;
	font-size: 15px;
	line-height: 1.25;
	color: #f8fafc;
	font-weight: 700;
}

.community-brand-copy p {
	margin: 4px 0 0;
	font-size: 12px;
	color: #94a3b8;
}


/* ============================================================
   NAVIGATION
   ============================================================ */

.community-navigation {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.community-nav-section {
	display: grid;
	gap: 4px;
}

.community-nav-label {
	padding: 0 10px 7px;
	font-size: 10px;
	font-weight: 800;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: #64748b;
}

.community-nav-subheading {
	padding: 10px 10px 5px 48px;
	font-size: 11px;
	font-weight: 700;
	color: #94a3b8;
}

.community-nav-item {
	position: relative;
	width: 100%;
	min-height: 50px;

	display: flex;
	align-items: center;
	gap: 11px;

	padding: 8px 10px;

	border: 0;
	border-radius: 10px;

	background: transparent;
	color: #cbd5e1;

	text-align: left;
	cursor: pointer;

	transition:
		background-color .15s ease,
		color .15s ease,
		transform .15s ease;
}

.community-nav-item:hover {
	background: rgba(255, 255, 255, .06);
	color: #fff;
	transform: translateX(1px);
}

.community-nav-item.is-active {
	background: rgba(37, 99, 235, .16);
	color: #fff;
}

.community-nav-item.is-active::before {
	content: "";
	position: absolute;
	left: -16px;
	top: 10px;
	bottom: 10px;
	width: 3px;
	border-radius: 0 3px 3px 0;
	background: #60a5fa;
}

.community-nav-icon {
	width: 30px;
	height: 30px;
	flex: 0 0 30px;

	display: grid;
	place-items: center;

	border-radius: 8px;

	background: rgba(255, 255, 255, .06);
	color: #94a3b8;

	font-size: 10px;
	font-weight: 800;
	letter-spacing: .02em;
}

.community-nav-item:hover .community-nav-icon,
.community-nav-item.is-active .community-nav-icon {
	background: rgba(96, 165, 250, .14);
	color: #bfdbfe;
}

.community-nav-text {
	min-width: 0;
	display: grid;
	gap: 2px;
}

.community-nav-text strong {
	font-size: 13px;
	line-height: 1.25;
	font-weight: 650;
	color: inherit;
}

.community-nav-text small {
	font-size: 11px;
	line-height: 1.25;
	font-weight: 400;
	color: #64748b;
}

.community-nav-item:hover .community-nav-text small,
.community-nav-item.is-active .community-nav-text small {
	color: #94a3b8;
}

.community-nav-subitem {
	min-height: 43px;
	padding-left: 18px;
}


/* ============================================================
   SESSION / USER
   ============================================================ */

.community-user-panel {
	margin-top: auto;
	padding: 16px 8px 4px;

	display: grid;
	grid-template-columns: 36px minmax(0, 1fr) auto;
	align-items: center;
	gap: 9px;

	border-top: 1px solid rgba(255, 255, 255, .08);
}

.community-user-avatar {
	width: 36px;
	height: 36px;

	display: grid;
	place-items: center;

	border-radius: 50%;

	background: #334155;
	color: #fff;

	font-size: 13px;
	font-weight: 800;
}

.community-user-info {
	min-width: 0;
	display: grid;
	gap: 2px;
}

.community-user-info strong {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;

	font-size: 12px;
	color: #f8fafc;
}

.community-user-info span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;

	font-size: 10px;
	color: #64748b;
}

.community-logout-button {
	padding: 6px 8px;
	border: 0;
	border-radius: 7px;
	background: transparent;
	color: #94a3b8;
	font-size: 11px;
	cursor: pointer;
}

.community-logout-button:hover {
	background: rgba(255, 255, 255, .06);
	color: #fff;
}


/* ============================================================
   MAIN CONTENT
   ============================================================ */

.community-main {
	min-width: 0;
	padding: 34px 38px;
}

.community-page-head {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 20px;
	margin-bottom: 24px;
}

.community-page-eyebrow {
	margin-bottom: 7px;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: .11em;
	text-transform: uppercase;
	color: #2563eb;
}

.community-page-head h2 {
	margin: 0;
	color: #0f172a;
	font-size: 28px;
	line-height: 1.2;
}

.community-page-head p {
	max-width: 720px;
	margin: 8px 0 0;
	color: #64748b;
	font-size: 14px;
	line-height: 1.55;
}

.community-protected-badge {
	display: inline-flex;
	align-items: center;
	white-space: nowrap;

	padding: 7px 11px;

	border: 1px solid #dbe4ef;
	border-radius: 999px;

	background: #fff;
	color: #475569;

	font-size: 11px;
	font-weight: 700;
}

.community-welcome-panel {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	padding: 28px;
	box-shadow: 0 5px 18px rgba(15, 23, 42, .035);
}

.community-welcome-panel h3 {
	margin: 0 0 8px;
	color: #0f172a;
	font-size: 18px;
}

.community-welcome-panel p {
	max-width: 680px;
	margin: 0;
	color: #64748b;
	font-size: 14px;
	line-height: 1.6;
}

#data-panel {
	min-width: 0;
}

.community-scada-frame {
	margin-top: 18px;
}

.community-quality-section {
	margin-top: 22px;
}


/* ============================================================
   MOBILE MENU
   ============================================================ */

.community-menu-toggle {
	display: none;
}

.community-sidebar-backdrop {
	display: none;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1000px) {

	.community-layout {
		display: block;
	}

	.community-main {
		padding: 78px 20px 24px;
	}

	.community-sidebar {
		position: fixed;
		top: 0;
		left: 0;

		width: min(300px, 88vw);
		height: 100vh;

		transform: translateX(-105%);
		transition: transform .22s ease;

		box-shadow: 18px 0 45px rgba(15, 23, 42, .24);
	}

	.community-sidebar.is-open {
		transform: translateX(0);
	}

	.community-menu-toggle {
		position: fixed;
		top: 16px;
		left: 16px;
		z-index: 60;

		width: 42px;
		height: 42px;

		display: grid;
		align-content: center;
		justify-content: center;
		gap: 4px;

		padding: 0;

		border: 1px solid #dbe4ef;
		border-radius: 10px;

		background: #fff;

		box-shadow: 0 5px 18px rgba(15, 23, 42, .10);

		cursor: pointer;
	}

	.community-menu-toggle span {
		display: block;
		width: 18px;
		height: 2px;
		border-radius: 1px;
		background: #172033;
	}

	.community-sidebar-backdrop {
		position: fixed;
		inset: 0;
		z-index: 30;

		display: block;

		background: rgba(15, 23, 42, .46);

		opacity: 0;
		pointer-events: none;

		transition: opacity .2s ease;
	}

	.community-sidebar-backdrop.is-visible {
		opacity: 1;
		pointer-events: auto;
	}
}

/* ============================================================
   COLLAPSIBLE / ACCORDION NAVIGATION
   ============================================================ */

.community-nav-group {
	display: grid;
	gap: 4px;
}

.community-nav-group + .community-nav-group {
	margin-top: 10px;
}

.community-nav-group-toggle {
	width: 100%;

	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;

	padding: 9px 10px;

	border: 0;
	border-radius: 8px;

	background: transparent;
	color: #64748b;

	font-size: 10px;
	font-weight: 800;
	letter-spacing: .12em;
	text-transform: uppercase;

	text-align: left;
	cursor: pointer;
}

.community-nav-group-toggle:hover {
	background: rgba(255, 255, 255, .04);
	color: #94a3b8;
}

.community-nav-chevron {
	display: inline-grid;
	place-items: center;

	width: 20px;
	height: 20px;

	font-size: 15px;
	font-weight: 700;

	transform: rotate(-90deg);
	transition: transform .18s ease;
}

.community-nav-group.is-open
	> .community-nav-group-toggle
	.community-nav-chevron {
	transform: rotate(0deg);
}

.community-nav-group-content {
	display: none;
	gap: 4px;
}

.community-nav-group.is-open
	> .community-nav-group-content {
	display: grid;
}


/* ============================================================
   NESTED GROUP
   ============================================================ */

.community-nav-nested-group {
	display: grid;
	gap: 3px;
}

.community-nav-nested-toggle {
	width: 100%;
	min-height: 48px;

	display: grid;
	grid-template-columns: 30px minmax(0, 1fr) 20px;
	align-items: center;
	gap: 11px;

	padding: 8px 10px;

	border: 0;
	border-radius: 10px;

	background: transparent;
	color: #cbd5e1;

	text-align: left;
	cursor: pointer;
}

.community-nav-nested-toggle:hover {
	background: rgba(255, 255, 255, .06);
	color: #fff;
}

.community-nav-nested-toggle
	.community-nav-chevron {
	justify-self: end;
}

.community-nav-nested-group.is-open
	> .community-nav-nested-toggle
	.community-nav-chevron {
	transform: rotate(0deg);
}

.community-nav-nested-content {
	display: none;
	gap: 3px;
	margin-left: 20px;
	padding-left: 12px;

	border-left: 1px solid rgba(148, 163, 184, .16);
}

.community-nav-nested-group.is-open
	> .community-nav-nested-content {
	display: grid;
}


/* ============================================================
   SUBITEMS
   ============================================================ */

.community-nav-subitem {
	min-height: 39px;
	padding: 7px 10px 7px 14px;
}

.community-nav-subitem .community-nav-text strong {
	font-size: 12px;
}


/* Active stavka unutar zatvorene grupe mora da bude čitljiva
   čim se roditelj automatski otvori. */

.community-nav-group:has(.community-nav-item.is-active)
	> .community-nav-group-toggle {
	color: #94a3b8;
}

.community-nav-nested-group:has(.community-nav-item.is-active)
	> .community-nav-nested-toggle {
	background: rgba(255, 255, 255, .04);
	color: #fff;
}


.community-energy-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 20px;
	margin-bottom: 22px;
}

.community-energy-head h3 {
	margin: 0;
	font-size: 24px;
	color: #0f172a;
}

.community-energy-filters {
	display: grid;
	grid-template-columns:
		minmax(240px, 1fr)
		minmax(240px, 1fr);
	gap: 14px;
	margin-bottom: 22px;
	padding: 18px;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
}

.community-energy-kpis {
	display: grid;
	grid-template-columns:
		repeat(4, minmax(0, 1fr));
	gap: 12px;
}

.community-energy-kpi {
	display: grid;
	gap: 7px;
	min-height: 105px;
	padding: 17px;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 13px;
}

.community-energy-kpi > span {
	color: #64748b;
	font-size: 12px;
	font-weight: 600;
}

.community-energy-kpi strong {
	color: #0f172a;
	font-size: 21px;
	line-height: 1.15;
}

.community-energy-kpi strong small {
	color: #64748b;
	font-size: 11px;
	font-weight: 500;
}

.community-energy-kpi > small {
	color: #64748b;
	font-size: 11px;
}

.community-energy-table-card {
	margin-top: 18px;
	padding: 18px;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
}

.community-energy-table-head {
	margin-bottom: 14px;
}

.community-energy-table-head h4 {
	margin: 0 0 4px;
	color: #0f172a;
}

@media (max-width: 1250px) {
	.community-energy-kpis {
		grid-template-columns:
			repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 700px) {
	.community-energy-filters,
	.community-energy-kpis {
		grid-template-columns: 1fr;
	}

	.community-energy-head {
		display: grid;
	}
}


@media (max-width: 640px) {

	.community-main {
		padding:
			72px
			14px
			20px;
	}

	.community-page-head {
		display: grid;
		gap: 14px;
	}

	.community-page-head h2 {
		font-size: 23px;
	}

	.community-protected-badge {
		width: fit-content;
	}

	.community-welcome-panel {
		padding: 20px;
	}
}

/* ============================================================
   ENERGY COMMUNITY - PLANT HEALTH
   ============================================================ */

.community-health-row {
	transition:
		background-color .15s ease,
		box-shadow .15s ease;
}

.community-health-row.health-green td {
	background: #f0fdf4;
}

.community-health-row.health-yellow td {
	background: #fffbeb;
}

.community-health-row.health-orange td {
	background: #fff7ed;
}

.community-health-row.health-red td {
	background: #fef2f2;
}

.community-health-row.health-unknown td {
	background: #f8fafc;
}

.community-health-row.health-green td:first-child {
	border-left: 4px solid #22c55e;
}

.community-health-row.health-yellow td:first-child {
	border-left: 4px solid #eab308;
}

.community-health-row.health-orange td:first-child {
	border-left: 4px solid #f97316;
}

.community-health-row.health-red td:first-child {
	border-left: 4px solid #ef4444;
}

.community-health-row.health-unknown td:first-child {
	border-left: 4px solid #94a3b8;
}

.community-health-row:hover td {
	filter: brightness(.985);
}

.community-health-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 9px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	white-space: nowrap;
}

.community-health-pill.health-green {
	background: #dcfce7;
	color: #166534;
}

.community-health-pill.health-yellow {
	background: #fef3c7;
	color: #92400e;
}

.community-health-pill.health-orange {
	background: #ffedd5;
	color: #9a3412;
}

.community-health-pill.health-red {
	background: #fee2e2;
	color: #991b1b;
}

.community-health-pill.health-unknown {
	background: #e2e8f0;
	color: #475569;
}

.community-health-dot {
	width: 7px;
	height: 7px;
	flex: 0 0 7px;
	border-radius: 50%;
	background: currentColor;
}
