:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --border: #e5ecf4;
  --text: #142033;
  --muted: #6b7a90;
  --primary: #2563eb;
  --primary-2: #1d4ed8;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  background: linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
  color: var(--text);
}

.layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #0f172a;
  color: #fff;
  padding: 24px;
  border-right: 1px solid rgba(255,255,255,0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.brand-badge {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, #22c55e, #2563eb);
  display: grid;
  place-items: center;
  font-size: 22px;
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.35);
}
.brand h1 { font-size: 20px; margin: 0; }
.brand p { margin: 4px 0 0; color: #94a3b8; font-size: 13px; }

.side-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 16px;
}
.side-card h3 {
  margin: 0 0 12px;
  font-size: 14px;
  color: #e2e8f0;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.main {
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.topbar h2 { margin: 0; font-size: 28px; }
.topbar p { margin: 6px 0 0; color: var(--muted); }

.main-card, .data-card, .filter-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.main-card { padding: 22px; margin-bottom: 20px; }
.filter-card { padding: 18px; margin-bottom: 20px; }
.data-card { padding: 20px; }

.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 2fr 1.2fr; gap: 18px; }
.grid-2-even { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

input, select, button, .button-link {
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 12px 14px;
  font-size: 14px;
}
select, input {
  width: 100%;
  background: #fff;
}
button, .button-link {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
}
button.secondary, .button-link.secondary {
  background: #eff6ff;
  color: var(--primary-2);
  border: 1px solid #bfdbfe;
}
button.ghost, .button-link.ghost {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
}
button:hover, .button-link:hover { filter: brightness(0.98); }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.section-title h3 { margin: 0; font-size: 18px; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}
.kpi-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 18px;
  min-height: 116px;
}
.kpi-label { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.kpi-value { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; }
.kpi-unit { font-size: 14px; color: var(--muted); margin-left: 6px; }
.kpi-foot { margin-top: 10px; color: #0f766e; font-size: 12px; }

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.portfolio-card {
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 18px;
  background: linear-gradient(180deg, #fff, #f8fbff);
}
.portfolio-card h4 { margin: 0 0 8px; font-size: 16px; }

.energy-flow {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 80px 1fr 80px 1fr;
  align-items: center;
  gap: 8px;
  padding: 12px 0 4px;
}
.flow-box {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 22px 16px;
  min-height: 122px;
  text-align: center;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}
.flow-icon {
  width: 52px; height: 52px; border-radius: 16px;
  display: grid; place-items: center; margin: 0 auto 12px;
  font-size: 26px;
}
.flow-solar .flow-icon { background: rgba(245, 158, 11, 0.12); }
.flow-load .flow-icon { background: rgba(37, 99, 235, 0.12); }
.flow-grid .flow-icon { background: rgba(16, 185, 129, 0.12); }
.flow-label { color: var(--muted); font-size: 13px; }
.flow-value { font-size: 28px; font-weight: 800; margin-top: 8px; }
.flow-sub { color: var(--muted); font-size: 12px; margin-top: 6px; }
.flow-arrow {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(37,99,235,0.15), rgba(37,99,235,0.5), rgba(16,185,129,0.25));
  overflow: hidden;
}
.flow-arrow::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
  transform: translateX(-120%);
  animation: flowPulse 2.2s linear infinite;
}
.flow-arrow::after {
  content: "➜";
  position: absolute;
  right: 6px;
  top: -12px;
  font-size: 22px;
  color: var(--primary);
}
@keyframes flowPulse {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}

.metrics-list { display: grid; gap: 10px; }
.metric-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; border-radius: 14px; background: #f8fbff; border: 1px solid var(--border);
}

.chart-wrap {
  background: linear-gradient(180deg, #fff, #f8fbff);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 18px;
}
.chart-wrap canvas { width: 100%; height: 320px; }

.filters-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.inline-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

.table-scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--border); text-align: left; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
tr:hover td { background: #fafcff; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 700;
  background: #eef2ff; color: #4338ca;
}

@media (max-width: 1180px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
  .kpi-grid, .filters-grid, .grid-2, .grid-2-even { grid-template-columns: 1fr; }
  .energy-flow { grid-template-columns: 1fr; }
  .flow-arrow { height: 34px; }
  .flow-arrow::after { top: 2px; left: calc(50% - 10px); right: auto; transform: rotate(90deg); }
}

.hidden-loader {
	display: none;
}

.topbar {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 18px;
}

.badge {
	display: inline-flex;
	align-items: center;
	padding: 6px 12px;
	border-radius: 999px;
	background: #eef2ff;
	color: #3730a3;
	font-size: 12px;
	font-weight: 700;
}

.kpi-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 16px;
	margin-bottom: 20px;
}

.kpi-card {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 18px;
	padding: 18px;
	box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

.kpi-title {
	color: #64748b;
	font-size: 13px;
	margin-bottom: 10px;
}

.kpi-value {
	font-size: 30px;
	font-weight: 800;
	line-height: 1.1;
	color: #0f172a;
}

.kpi-unit {
	margin-top: 6px;
	color: #94a3b8;
	font-size: 13px;
}

.energy-flow-card {
	background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
	border: 1px solid #e2e8f0;
	border-radius: 22px;
	padding: 16px;
	box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.energy-flow-svg {
	width: 100%;
	height: auto;
	display: block;
}

.flow-node {
	stroke: #cbd5e1;
	stroke-width: 1.5;
}

.flow-solar {
	fill: #fff7ed;
}

.flow-load {
	fill: #eff6ff;
}

.flow-grid {
	fill: #ecfdf5;
}

.flow-label {
	font-size: 16px;
	font-weight: 700;
	fill: #475569;
}

.flow-value {
	font-size: 24px;
	font-weight: 800;
	fill: #0f172a;
}

.flow-line {
	stroke: url(#flowGradient);
	stroke-width: 8;
	stroke-linecap: round;
}

.flow-dot {
	fill: #22c55e;
	filter: drop-shadow(0 0 8px rgba(34, 197, 94, 0.55));
	animation: pulseFlow 2.2s infinite ease-in-out;
}

.flow-dot-2 {
	animation-delay: 0.35s;
}

.flow-dot-3 {
	animation-delay: 0.7s;
}

.flow-dot-4 {
	animation-delay: 1.05s;
}

@keyframes pulseFlow {
	0% {
		transform: scale(0.8);
		opacity: 0.45;
	}
	50% {
		transform: scale(1.35);
		opacity: 1;
	}
	100% {
		transform: scale(0.8);
		opacity: 0.45;
	}
}

.plants-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 18px;
}

.plant-mini-card {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 20px;
	padding: 18px;
	box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

.plant-mini-head h3 {
	margin: 0 0 4px 0;
}

.plant-mini-head p {
	margin: 0 0 14px 0;
	color: #64748b;
	font-size: 14px;
}

.mini-kpis {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 12px;
	margin-bottom: 16px;
}

.mini-kpis div {
	background: #f8fafc;
	border-radius: 14px;
	padding: 12px;
	border: 1px solid #e2e8f0;
}

.mini-kpis span {
	display: block;
	color: #64748b;
	font-size: 12px;
	margin-bottom: 6px;
}

.mini-kpis strong {
	font-size: 16px;
	color: #0f172a;
}

.mini-flow {
	display: grid;
	grid-template-columns: 1fr 40px 1fr 40px 1fr;
	align-items: center;
	gap: 8px;
}

.mini-node {
	text-align: center;
	padding: 10px 6px;
	border-radius: 14px;
	font-size: 13px;
	font-weight: 700;
	border: 1px solid #e2e8f0;
}

.mini-node.solar {
	background: #fff7ed;
}

.mini-node.load {
	background: #eff6ff;
}

.mini-node.grid {
	background: #ecfdf5;
}

.mini-arrow {
	height: 4px;
	border-radius: 999px;
	background: linear-gradient(90deg, #f59e0b 0%, #22c55e 100%);
	position: relative;
	overflow: hidden;
}

.mini-arrow::after {
	content: "";
	position: absolute;
	top: -4px;
	left: -14px;
	width: 12px;
	height: 12px;
	border-radius: 999px;
	background: #22c55e;
	box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
	animation: travelDot 1.8s infinite linear;
}

@keyframes travelDot {
	from {
		left: -14px;
	}
	to {
		left: calc(100% + 14px);
	}
}

.empty-state {
	padding: 28px;
	text-align: center;
	color: #64748b;
	background: #fff;
	border: 1px dashed #cbd5e1;
	border-radius: 18px;
}

.hidden-loader {
	display: none;
}

.topbar {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 14px;
}

.badge {
	display: inline-flex;
	align-items: center;
	padding: 6px 12px;
	border-radius: 999px;
	background: #eef2ff;
	color: #3730a3;
	font-size: 12px;
	font-weight: 700;
}

.section-title {
	font-size: 15px;
	font-weight: 700;
	color: #334155;
	margin: 10px 0 12px 0;
}

.kpi-grid.compact {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
	gap: 12px;
	margin-bottom: 16px;
}

.kpi-card {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 16px;
	padding: 14px;
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.kpi-title {
	color: #64748b;
	font-size: 12px;
	margin-bottom: 8px;
}

.kpi-value {
	font-size: 24px;
	font-weight: 800;
	line-height: 1.05;
	color: #0f172a;
}

.kpi-unit {
	margin-top: 4px;
	color: #94a3b8;
	font-size: 12px;
}

.energy-flow-card {
	background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
	border: 1px solid #e2e8f0;
	border-radius: 18px;
	padding: 12px;
	box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
	margin-bottom: 16px;
}

.energy-flow-svg {
	width: 100%;
	height: auto;
	display: block;
}

.flow-node {
	stroke: #cbd5e1;
	stroke-width: 1.5;
}

.flow-solar {
	fill: #fff7ed;
}

.flow-load {
	fill: #eff6ff;
}

.flow-grid {
	fill: #ecfdf5;
}

.flow-label {
	font-size: 16px;
	font-weight: 700;
	fill: #475569;
}

.flow-value {
	font-size: 24px;
	font-weight: 800;
	fill: #0f172a;
}

.flow-line {
	stroke: url(#flowGradient);
	stroke-width: 8;
	stroke-linecap: round;
}

.flow-dot {
	fill: #22c55e;
	filter: drop-shadow(0 0 8px rgba(34, 197, 94, 0.55));
	animation: pulseFlow 2.2s infinite ease-in-out;
}

.flow-dot-2 {
	animation-delay: 0.35s;
}

.flow-dot-3 {
	animation-delay: 0.7s;
}

.flow-dot-4 {
	animation-delay: 1.05s;
}

@keyframes pulseFlow {
	0% {
		transform: scale(0.8);
		opacity: 0.45;
	}
	50% {
		transform: scale(1.35);
		opacity: 1;
	}
	100% {
		transform: scale(0.8);
		opacity: 0.45;
	}
}

.overview-lower-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	margin-top: 14px;
}

.info-panel {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 16px;
	padding: 14px;
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.plants-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
	gap: 18px;
}

.plant-mini-card {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 18px;
	padding: 16px;
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.plant-mini-head h3 {
	margin: 0 0 4px 0;
}

.plant-mini-head p {
	margin: 0 0 14px 0;
	color: #64748b;
	font-size: 14px;
}

.mini-kpis {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 10px;
	margin-bottom: 14px;
}

.mini-kpis div {
	background: #f8fafc;
	border-radius: 12px;
	padding: 10px;
	border: 1px solid #e2e8f0;
}

.mini-kpis span {
	display: block;
	color: #64748b;
	font-size: 12px;
	margin-bottom: 6px;
}

.mini-kpis strong {
	font-size: 15px;
	color: #0f172a;
}

.mini-flow {
	display: grid;
	grid-template-columns: 1fr 34px 1fr 34px 1fr;
	align-items: center;
	gap: 8px;
}

.mini-node {
	text-align: center;
	padding: 10px 6px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 700;
	border: 1px solid #e2e8f0;
}

.mini-node.solar {
	background: #fff7ed;
}

.mini-node.load {
	background: #eff6ff;
}

.mini-node.grid {
	background: #ecfdf5;
}

.mini-arrow {
	height: 4px;
	border-radius: 999px;
	background: linear-gradient(90deg, #f59e0b 0%, #22c55e 100%);
	position: relative;
	overflow: hidden;
}

.mini-arrow::after {
	content: "";
	position: absolute;
	top: -4px;
	left: -14px;
	width: 12px;
	height: 12px;
	border-radius: 999px;
	background: #22c55e;
	box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
	animation: travelDot 1.8s infinite linear;
}

@keyframes travelDot {
	from {
		left: -14px;
	}
	to {
		left: calc(100% + 14px);
	}
}

.table-panel {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 16px;
	padding: 14px;
}

.table-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 12px;
}

.chart-box {
	height: 320px;
	margin-bottom: 16px;
}

.data-table {
	width: 100%;
	border-collapse: collapse;
}

.data-table th,
.data-table td {
	padding: 10px;
	border-bottom: 1px solid #e5e7eb;
	text-align: left;
	font-size: 14px;
}

.data-table th {
	background: #f8fafc;
	color: #334155;
}

.quality-warning td {
	background: #fffbeb;
}

.quality-error td {
	background: #fef2f2;
}

.quality-pill {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 76px;
	border-radius: 999px;
	padding: 6px 10px;
	font-size: 12px;
	font-weight: 800;
}

.quality-pill.ok {
	background: #dcfce7;
	color: #166534;
}

.quality-pill.warning {
	background: #fef3c7;
	color: #92400e;
}

.quality-pill.danger {
	background: #fee2e2;
	color: #991b1b;
}

.empty-state {
	padding: 28px;
	text-align: center;
	color: #64748b;
	background: #fff;
	border: 1px dashed #cbd5e1;
	border-radius: 18px;
}

@media (max-width: 980px) {
	.overview-lower-grid {
		grid-template-columns: 1fr;
	}
}

.energy-flow-card-premium {
	position: relative;
	overflow: hidden;
	padding: 22px;
	background:
		radial-gradient(circle at top left, rgba(245, 158, 11, 0.12), transparent 28%),
		radial-gradient(circle at top right, rgba(16, 185, 129, 0.12), transparent 30%),
		linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.energy-flow-card-premium::before {
	content: "";
	position: absolute;
	inset: -30% auto auto -10%;
	width: 320px;
	height: 320px;
	border-radius: 999px;
	background: rgba(37, 99, 235, 0.06);
	filter: blur(24px);
	pointer-events: none;
}

.energy-flow-head {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 18px;
	margin-bottom: 14px;
	position: relative;
	z-index: 1;
}

.energy-flow-title {
	font-size: 20px;
	font-weight: 800;
	margin-bottom: 6px;
}

.energy-flow-subtitle {
	margin: 0;
	font-size: 14px;
	color: #64748b;
}

.energy-flow-statuses {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	justify-content: flex-end;
}

.flow-status {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 14px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 700;
	border: 1px solid transparent;
	white-space: nowrap;
}
.flow-status::before {
	content: "";
	width: 8px;
	height: 8px;
	border-radius: 999px;
	background: currentColor;
	box-shadow: 0 0 10px currentColor;
}
.flow-status.solar { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.flow-status.load { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.flow-status.grid.export { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.flow-status.grid.import { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }

.energy-flow-hero {
	display: grid;
	grid-template-columns: 250px 1fr 250px;
	gap: 18px;
	align-items: center;
	position: relative;
	z-index: 1;
}

.flow-side-card {
	position: relative;
	border-radius: 26px;
	padding: 22px;
	min-height: 240px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: flex-start;
	border: 1px solid #e5e7eb;
	box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
	backdrop-filter: blur(6px);
}
.flow-side-card.solar {
	background: linear-gradient(180deg, rgba(255,247,237,0.96), rgba(255,255,255,0.96));
}
.flow-side-card.grid {
	background: linear-gradient(180deg, rgba(236,253,245,0.96), rgba(255,255,255,0.96));
}
.flow-side-icon {
	width: 62px;
	height: 62px;
	border-radius: 20px;
	display: grid;
	place-items: center;
	font-size: 28px;
	margin-bottom: 16px;
	box-shadow: inset 0 1px 0 rgba(255,255,255,0.6), 0 10px 24px rgba(15, 23, 42, 0.10);
}
.flow-side-card.solar .flow-side-icon { background: rgba(245, 158, 11, 0.18); }
.flow-side-card.grid .flow-side-icon { background: rgba(16, 185, 129, 0.18); }
.flow-side-label {
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	font-weight: 800;
	color: #64748b;
	margin-bottom: 10px;
}
.flow-side-value {
	font-size: 38px;
	font-weight: 900;
	line-height: 1;
	color: #0f172a;
	letter-spacing: -0.04em;
}
.flow-side-value span {
	font-size: 16px;
	font-weight: 700;
	color: #64748b;
	margin-left: 6px;
}
.flow-side-foot {
	margin-top: 12px;
	font-size: 14px;
	color: #64748b;
}

.flow-center-wrap {
	position: relative;
	min-height: 320px;
	border-radius: 30px;
	padding: 8px;
	background: linear-gradient(180deg, rgba(255,255,255,0.75), rgba(241,245,249,0.88));
	border: 1px solid rgba(226,232,240,0.9);
	box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 18px 38px rgba(15, 23, 42, 0.08);
}

.energy-flow-svg.premium {
	width: 100%;
	height: 320px;
	display: block;
}

.flow-center-orbit {
	fill: rgba(59, 130, 246, 0.04);
	stroke: rgba(59, 130, 246, 0.10);
	stroke-width: 1.5;
}
.flow-line {
	stroke-width: 11;
	stroke-linecap: round;
	filter: url(#softGlow);
}
.flow-line.solar-line { stroke: url(#solarToLoad); }
.flow-line.grid-line { stroke: url(#gridToLoad); }
.flow-arrow-head.solar-arrow { fill: #2563eb; }
.flow-arrow-head.grid-arrow { fill: #10b981; }
.flow-arrow-head.grid-arrow.reverse { fill: #ef4444; }

.flow-dot {
	filter: url(#softGlow);
	animation: premiumPulse 2.1s infinite ease-in-out;
}
.flow-dot.solar-dot { fill: #f59e0b; }
.flow-dot.grid-dot { fill: #10b981; }
.flow-dot.d2 { animation-delay: 0.35s; }
.flow-dot.d3 { animation-delay: 0.6s; }
.flow-dot.d4 { animation-delay: 0.95s; }

.flow-core {
	fill: rgba(37, 99, 235, 0.12);
	stroke: rgba(37, 99, 235, 0.18);
	stroke-width: 2;
}
.flow-core-inner {
	fill: #ffffff;
	stroke: rgba(148, 163, 184, 0.25);
	stroke-width: 1.5;
}
.flow-core-label {
	font-size: 22px;
	font-weight: 800;
	letter-spacing: 0.16em;
	fill: #64748b;
}
.flow-core-value {
	font-size: 34px;
	font-weight: 900;
	fill: #0f172a;
}
.flow-core-sub {
	font-size: 14px;
	fill: #64748b;
}

.energy-flow-metrics {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 14px;
	margin-top: 18px;
	position: relative;
	z-index: 1;
}
.flow-metric {
	padding: 16px 18px;
	border-radius: 18px;
	border: 1px solid #e2e8f0;
	background: rgba(255,255,255,0.78);
	backdrop-filter: blur(6px);
}
.flow-metric span {
	display: block;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #64748b;
	margin-bottom: 8px;
}
.flow-metric strong {
	font-size: 22px;
	font-weight: 900;
	color: #0f172a;
}
.flow-metric.solar { box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.14); }
.flow-metric.load { box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.14); }
.flow-metric.grid { box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.14); }

@keyframes premiumPulse {
	0% { transform: scale(0.85); opacity: 0.35; }
	50% { transform: scale(1.25); opacity: 1; }
	100% { transform: scale(0.85); opacity: 0.35; }
}

@media (max-width: 1180px) {
	.energy-flow-head {
		flex-direction: column;
		align-items: stretch;
	}
	.energy-flow-statuses {
		justify-content: flex-start;
	}
	.energy-flow-hero {
		grid-template-columns: 1fr;
	}
	.flow-side-card {
		min-height: auto;
		align-items: center;
		text-align: center;
	}
	.energy-flow-metrics {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 720px) {
	.energy-flow-card-premium {
		padding: 16px;
	}
	.flow-center-wrap {
		padding: 4px;
		min-height: 250px;
	}
	.energy-flow-svg.premium {
		height: 240px;
	}
	.flow-side-value {
		font-size: 30px;
	}
}


.locked-field {
	display: grid;
	gap: 6px;
}

.locked-field label {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--muted);
}

.locked-value {
	padding: 12px 14px;
	border-radius: 12px;
	border: 1px solid rgba(37, 99, 235, 0.14);
	background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
	font-weight: 700;
	color: var(--text);
	box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}


.section-title-split {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.predictions-panel {
	margin-top: 22px;
	padding: 22px;
	border-radius: 24px;
	border: 1px solid #e2e8f0;
	background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
	box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
}

.prediction-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 16px;
}

.prediction-card {
	padding: 18px;
	border-radius: 20px;
	border: 1px solid #dbeafe;
	background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
	box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
}

.prediction-head {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 12px;
	margin-bottom: 14px;
}

.prediction-head h3 {
	margin: 0;
	font-size: 18px;
	line-height: 1.2;
}

.prediction-main {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
	margin-bottom: 14px;
}

.prediction-main div,
.prediction-stats div {
	display: grid;
	gap: 4px;
}

.prediction-main span,
.prediction-stats span {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: #64748b;
}

.prediction-main strong {
	font-size: 24px;
	font-weight: 900;
	color: #0f172a;
}

.prediction-stats {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px 14px;
	padding-top: 14px;
	border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.prediction-stats strong {
	font-size: 16px;
	font-weight: 800;
	color: #0f172a;
}

@media (max-width: 720px) {
	.predictions-panel {
		padding: 16px;
	}
	.prediction-main,
	.prediction-stats {
		grid-template-columns: 1fr;
	}
}

.modal-container:empty {
	display: none;
}

.modal-backdrop {
	position: fixed;
	inset: 0;
	z-index: 1000;

	display: flex;
	align-items: center;
	justify-content: center;

	padding: 24px;

	background: rgba(0, 0, 0, 0.55);
	overflow-y: auto;
}

.modal-dialog {
	width: min(760px, 100%);
	max-height: calc(100vh - 48px);

	background: var(--card-background, #ffffff);
	border-radius: 14px;
	box-shadow:
		0 24px 60px rgba(0, 0, 0, 0.3);

	overflow-y: auto;
}

.modal-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 20px;

	padding: 20px 24px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.modal-header h3 {
	margin: 0;
}

.modal-body {
	padding: 24px;
}

.modal-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;

	width: 36px;
	height: 36px;

	padding: 0;
	border: 0;
	border-radius: 8px;

	background: transparent;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}

.modal-close:hover {
	background: rgba(0, 0, 0, 0.07);
}

.modal-actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;

	margin-top: 20px;
}
/* Administracija solarnih elektrana */
.panel-header-row {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 18px;
}

.filter-grid {
	display: grid;
	grid-template-columns: minmax(220px, 360px) auto;
	align-items: end;
	gap: 16px;
	margin-bottom: 18px;
}

.inline-check {
	margin-bottom: 8px;
}

.table-wrap {
	overflow-x: auto;
}

.action-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

button.compact {
	padding: 7px 10px;
	font-size: 0.88rem;
}

button.danger,
.danger {
	background: var(--danger);
	color: #fff;
	border-color: var(--danger);
}

.modal-dialog.modal-wide {
	width: min(980px, calc(100vw - 32px));
}

.form-grid-3 {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.alert.warning {
	background: #fff7d6;
	border: 1px solid #e5c75b;
	color: #5f4b00;
}

@media (max-width: 800px) {
	.panel-header-row,
	.filter-grid {
		display: grid;
		grid-template-columns: 1fr;
	}

	.form-grid-3 {
		grid-template-columns: 1fr;
	}
}

.document-preview-card {
    width: min(1100px, 94vw);
    max-width: 1100px;
}

.document-preview-container {
    width: 100%;
    min-height: 65vh;
    margin: 16px 0;
    overflow: auto;
    background: #f4f4f4;
    border: 1px solid #d8d8d8;
    border-radius: 8px;
}

.document-pdf-preview {
    display: block;
    width: 100%;
    height: 70vh;
    border: 0;
}

.document-image-preview {
    display: block;
    max-width: 100%;
    max-height: 70vh;
    margin: 0 auto;
    object-fit: contain;
}

.document-version-history-card {
    width: min(1200px, 96vw);
    max-width: 1200px;
}

.table-responsive {
    width: 100%;
    margin: 1rem 0;
    overflow-x: auto;
}

.pagination-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
}

.empty-state {
    margin: 1rem 0;
    padding: 1.5rem;
    text-align: center;
    border: 1px dashed #c8c8c8;
    border-radius: 8px;
}


.document-version-details-card {
    width: min(1000px, 94vw);
    max-width: 1000px;
}

.document-version-comment {
    margin-top: 0.5rem;
    padding: 0.75rem;
    border: 1px solid #d8d8d8;
    border-radius: 8px;
    white-space: pre-wrap;
}

.break-all {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* ==========================
   Portal modali
   ========================== */

.modal-card {
    width: min(760px, calc(100vw - 40px));
    max-height: calc(100vh - 40px);

    background: #fff;

    border-radius: 16px;

    box-shadow:
        0 24px 60px rgba(0,0,0,.25);

    overflow-y: auto;

    padding: 24px;
}

.panel-header-row{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:18px;

    margin-bottom:24px;
}

.panel-header-row h3{
    margin:0 0 6px;
}

.stack{
    display:flex;
    flex-direction:column;
    gap:18px;
}

.stack label{
    display:block;

    margin-bottom:6px;

    font-weight:600;
}

.stack textarea{
    width:100%;
    min-height:90px;
}

.info-box{
    margin-bottom:18px;

    padding:12px 16px;

    border-radius:10px;

    background:#eef6ff;

    border:1px solid #bfdcff;
}

.detail-grid{
    display:grid;

    grid-template-columns:repeat(2,1fr);

    gap:16px;

    margin:20px 0;
}

.detail-grid strong{
    display:block;

    margin-bottom:4px;
}

.form-warning{
    padding:14px;

    border-radius:10px;

    background:#fff6dc;

    border:1px solid #efd27d;

    color:#725400;
}

.action-row{
    display:flex;

    justify-content:flex-end;

    gap:12px;

    margin-top:24px;
}

.form-errors{
    margin-bottom:18px;

    padding:14px;

    border-radius:10px;

    background:#fee;

    border:1px solid #e88;
}

.form-errors p{
    margin:4px 0;
}

/* DMS — završno usaglašavanje prikaza */

.document-filter-grid {
    grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.modal-card {
    width: min(760px, calc(100vw - 40px));
    max-height: calc(100vh - 40px);
    padding: 24px;
    overflow-y: auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}

.document-details-card {
    width: min(900px, calc(100vw - 40px));
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.detail-grid > div {
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f8fbff;
}

.detail-grid strong {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.info-box,
.form-warning,
.form-errors {
    margin: 16px 0;
    padding: 14px 16px;
    border-radius: 12px;
}

.info-box {
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1e3a8a;
}

.form-warning {
    border: 1px solid #fcd34d;
    background: #fffbeb;
    color: #78350f;
}

.form-errors {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.form-errors p {
    margin: 4px 0;
}

.document-description {
    margin-top: 16px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
}

.document-description p {
    margin: 8px 0 0;
    white-space: pre-wrap;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.status-badge.success {
    background: #dcfce7;
    color: #166534;
}

.status-badge.muted {
    background: #e2e8f0;
    color: #475569;
}

.status-badge.danger {
    background: #fee2e2;
    color: #991b1b;
}

.action-row .compact,
.action-row a.compact {
    white-space: nowrap;
}

.table-wrap td {
    vertical-align: top;
}

@media (max-width: 900px) {
    .document-filter-grid,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .modal-card {
        width: min(100%, calc(100vw - 24px));
        padding: 18px;
    }
}

/* -------------------------------------------------------------------------
   Semantičko bojenje SCADA pokazatelja
   Boja označava vrstu informacije, ne kvalitet/rang elektrane.
   ------------------------------------------------------------------------- */
.metric-solar {
	background: #fff7ed !important;
	border-color: #fed7aa !important;
}
.metric-solar .kpi-title,
.metric-solar span { color: #9a3412 !important; }
.metric-solar .kpi-value,
.metric-solar strong { color: #c2410c !important; }

.metric-load {
	background: #eff6ff !important;
	border-color: #bfdbfe !important;
}
.metric-load .kpi-title,
.metric-load span { color: #1e40af !important; }
.metric-load .kpi-value,
.metric-load strong { color: #1d4ed8 !important; }

.metric-grid-export {
	background: #ecfdf5 !important;
	border-color: #a7f3d0 !important;
}
.metric-grid-export .kpi-title,
.metric-grid-export span { color: #065f46 !important; }
.metric-grid-export .kpi-value,
.metric-grid-export strong { color: #047857 !important; }

.metric-grid-import {
	background: #fef2f2 !important;
	border-color: #fecaca !important;
}
.metric-grid-import .kpi-title,
.metric-grid-import span { color: #991b1b !important; }
.metric-grid-import .kpi-value,
.metric-grid-import strong { color: #b91c1c !important; }

.metric-self {
	background: #f0fdfa !important;
	border-color: #99f6e4 !important;
}
.metric-self .kpi-title,
.metric-self span { color: #115e59 !important; }
.metric-self .kpi-value,
.metric-self strong { color: #0f766e !important; }

.metric-weather {
	background: #f5f3ff !important;
	border-color: #ddd6fe !important;
}
.metric-weather .kpi-title,
.metric-weather span { color: #5b21b6 !important; }
.metric-weather .kpi-value,
.metric-weather strong { color: #6d28d9 !important; }

.metric-eco {
	background: #f0fdf4 !important;
	border-color: #bbf7d0 !important;
}
.metric-eco .kpi-title,
.metric-eco span { color: #166534 !important; }
.metric-eco .kpi-value,
.metric-eco strong { color: #15803d !important; }

.info-panel-weather { border-top: 3px solid #8b5cf6; }
.info-panel-eco { border-top: 3px solid #22c55e; }

.plants-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 16px 0;
}
.legend-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 9px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 800;
	border: 1px solid transparent;
}
.legend-item::before {
	content: "";
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: currentColor;
}
.legend-item.solar { color: #c2410c; background: #fff7ed; border-color: #fed7aa; }
.legend-item.load { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; }
.legend-item.export { color: #047857; background: #ecfdf5; border-color: #a7f3d0; }
.legend-item.import { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.legend-item.self { color: #0f766e; background: #f0fdfa; border-color: #99f6e4; }
.legend-item.weather { color: #6d28d9; background: #f5f3ff; border-color: #ddd6fe; }
.legend-item.eco { color: #15803d; background: #f0fdf4; border-color: #bbf7d0; }

.plant-mini-card {
	border-top: 4px solid #cbd5e1;
}
.plant-metrics > div {
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.plant-metrics > div:hover {
	transform: translateY(-1px);
	box-shadow: 0 7px 18px rgba(15, 23, 42, 0.07);
}
.mini-node.grid.export {
	background: #ecfdf5;
	border-color: #a7f3d0;
	color: #047857;
}
.mini-node.grid.import {
	background: #fef2f2;
	border-color: #fecaca;
	color: #b91c1c;
}

.energy-flow-metrics {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}
.flow-metric.grid.export {
	box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.20);
	background: #ecfdf5;
}
.flow-metric.grid.import {
	box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.18);
	background: #fef2f2;
}
.flow-side-card.grid.export {
	border-color: #a7f3d0;
	background: #ecfdf5;
}
.flow-side-card.grid.import {
	border-color: #fecaca;
	background: #fef2f2;
}

/* Javni prikaz procene + detalji samo za prijavljene/ovlašćene korisnike. */
.prediction-title-block {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 16px;
	margin-bottom: 12px;
}
.prediction-title {
	font-size: 17px;
	font-weight: 800;
	color: #334155;
}
.prediction-public-note {
	margin: 6px 0 0 0;
	max-width: 850px;
	font-size: 13px;
	line-height: 1.5;
	color: #64748b;
}
.prediction-access-badge {
	flex: 0 0 auto;
	padding: 6px 10px;
	border-radius: 999px;
	background: #f8fafc;
	border: 1px solid #cbd5e1;
	color: #475569;
	font-size: 11px;
	font-weight: 800;
}
.prediction-restricted-note {
	margin: 0 0 16px 0;
	padding: 10px 12px;
	border-radius: 12px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	color: #475569;
	font-size: 12px;
}
.prediction-methodology {
	margin: 0 0 16px 0;
	border: 1px solid #c7d2fe;
	border-radius: 14px;
	background: #eef2ff;
	overflow: hidden;
}
.prediction-methodology summary {
	cursor: pointer;
	padding: 11px 13px;
	font-size: 12px;
	font-weight: 800;
	color: #3730a3;
}
.prediction-methodology-body {
	padding: 0 13px 12px 13px;
	font-size: 12px;
	line-height: 1.55;
	color: #475569;
}
.prediction-methodology-body p { margin: 7px 0 0 0; }
.prediction-kind {
	display: inline-block;
	margin-top: 5px;
	font-size: 11px;
	font-weight: 800;
	color: #64748b;
}
.prediction-card.short-term { border-top: 4px solid #2563eb; }
.prediction-card.orientation { border-top: 4px solid #6366f1; }
.prediction-card.projection { border-top: 4px solid #8b5cf6; }
.prediction-metric {
	padding: 9px 10px;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
}
.prediction-technical-note {
	margin-top: 12px;
	padding-top: 10px;
	border-top: 1px dashed #cbd5e1;
	font-size: 11px;
	line-height: 1.45;
	color: #64748b;
}

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

@media (max-width: 720px) {
	.prediction-title-block { flex-direction: column; }
	.energy-flow-metrics { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------
   Monitoring health bojenje elektrana
   Boja kartice dolazi iz monitoring_health.overall_status.
   Detaljni reason/message ostaju u RBAC monitoring prikazu.
   --------------------------------------------------------- */
.legend-groups {
	display: grid;
	grid-template-columns: 1fr;
	gap: 10px;
	margin-bottom: 14px;
}
.legend-title {
	font-size: 11px;
	font-weight: 800;
	color: #64748b;
	margin-bottom: 6px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}
.health-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.health-legend-item,
.plant-health-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 9px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 800;
	border: 1px solid currentColor;
	white-space: nowrap;
}
.plant-health-dot {
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: currentColor;
	box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.75);
}
.health-green { --health-color: #16a34a; --health-bg: #f0fdf4; --health-border: #86efac; }
.health-yellow { --health-color: #ca8a04; --health-bg: #fefce8; --health-border: #fde047; }
.health-orange { --health-color: #ea580c; --health-bg: #fff7ed; --health-border: #fdba74; }
.health-red { --health-color: #dc2626; --health-bg: #fef2f2; --health-border: #fca5a5; }
.health-unknown { --health-color: #64748b; --health-bg: #f8fafc; --health-border: #cbd5e1; }

.health-legend-item.health-green,
.health-legend-item.health-yellow,
.health-legend-item.health-orange,
.health-legend-item.health-red,
.health-legend-item.health-unknown,
.plant-health-pill.health-green,
.plant-health-pill.health-yellow,
.plant-health-pill.health-orange,
.plant-health-pill.health-red,
.plant-health-pill.health-unknown {
	color: var(--health-color);
	background: var(--health-bg);
	border-color: var(--health-border);
}

.plant-mini-card.health-green,
.plant-mini-card.health-yellow,
.plant-mini-card.health-orange,
.plant-mini-card.health-red,
.plant-mini-card.health-unknown {
	border: 2px solid var(--health-border);
	border-top: 6px solid var(--health-color);
	background: linear-gradient(180deg, var(--health-bg) 0, #ffffff 118px);
	box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.plant-mini-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 10px;
}
.plant-mini-head > div:first-child {
	min-width: 0;
}

.plant-status-public {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	justify-content: flex-end;
}
.plant-health-header.health-green,
.plant-health-header.health-yellow,
.plant-health-header.health-orange,
.plant-health-header.health-red,
.plant-health-header.health-unknown {
	border-left: 5px solid var(--health-color);
	padding-left: 12px;
}

@media (max-width: 900px) {
	.plant-mini-head {
		flex-direction: column;
	}
	.plant-status-public {
		justify-content: flex-start;
	}
}

/* Public health explanation: short cause only; diagnostics remain protected. */
.plant-health-public-summary {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 4px;
	min-width: 0;
}
.plant-health-reason {
	max-width: 220px;
	font-size: 11px;
	line-height: 1.25;
	color: #64748b;
	text-align: right;
}
.health-legend-note {
	margin-top: 6px;
	font-size: 11px;
	line-height: 1.35;
	color: #64748b;
}
@media (max-width: 900px) {
	.plant-health-public-summary {
		align-items: flex-start;
	}
	.plant-health-reason {
		text-align: left;
	}
}

/* K1 - administracija članova Energetske zajednice */
.member-filter-grid {
	display: grid;
	grid-template-columns: minmax(260px, 2fr) repeat(5, minmax(150px, 1fr));
	align-items: end;
	gap: 12px;
	margin-bottom: 16px;
}

.member-filter-grid label {
	display: block;
	margin-bottom: 6px;
}

.member-filter-grid input,
.member-filter-grid select {
	width: 100%;
}

.member-filter-search {
	min-width: 0;
}

.member-filter-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	grid-column: 1 / -1;
}

.member-list-summary {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 12px;
	margin: 0 0 10px;
}

.member-group-row td {
	background: rgba(0, 0, 0, 0.035);
	border-top: 2px solid var(--border);
}

@media (max-width: 1200px) {
	.member-filter-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.member-filter-search {
		grid-column: span 2;
	}
}

@media (max-width: 800px) {
	.member-filter-grid {
		grid-template-columns: 1fr;
	}

	.member-filter-search,
	.member-filter-actions {
		grid-column: auto;
	}
}
