/* Definiti HOME ENERGY — compact customer dashboard */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700;800&display=swap');

.hems-home-dash {
  --df-ink: #10294e;
  --df-muted: #6f84a2;
  --df-line: #e4eef5;
  --df-bg: #f5fafd;
  --df-card: #ffffff;
  --df-teal: #00a9a5;
  --df-cyan: #08c6c3;
  --df-solar: #ffb300;
  --df-load: #1689ff;
  --df-battery: #16c979;
  --df-grid: #7248e8;
  --df-warn: #ff8a00;
  --df-alarm: #ef3d3d;
  --df-sidebar: #062d39;
  --df-gap: 8px;
  font-family: 'Manrope', system-ui, sans-serif;
  color: var(--df-ink);
  background:
    radial-gradient(900px 420px at 12% -8%, rgba(0, 169, 165, 0.08), transparent 55%),
    var(--df-bg) !important;
  padding: 0 0 0.75rem !important;
  min-height: calc(100vh - 52px);
  margin: -4px -6px 0 !important;
}

.hems-home-dash.energy-dashboard-container,
.hems-home-dash .energy-dashboard-container {
  max-width: none;
  padding: 2px 10px 12px !important;
  background: transparent !important;
}

body:has(.hems-home-dash) .content-wrapper {
  padding-top: 0 !important;
}
body:has(.hems-home-dash) .content {
  padding: 4px 6px 10px !important;
  margin: 0 !important;
}

/* Hide duplicate app-header user chrome noise on this page */
body:has(.hems-home-dash) .navbar-custom-menu .user-menu .user-info,
body:has(.hems-home-dash) .main-header .navbar .nav > li > a > span.hidden-xs {
  /* keep bell/fullscreen; densify via content topbar profile instead if needed */
}

.hems-home-dash .scada-dash-header,
.hems-home-dash .scada-tabs-wrap {
  display: none !important;
}

.hems-home-dash .scada-tab-content {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.df-card {
  background: var(--df-card);
  border: 1px solid var(--df-line);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(16, 41, 78, 0.03);
}

/* ——— Topbar ——— */
.df-topbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  padding: 4px 0 6px;
  min-width: 0;
}

.df-topbar-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  flex: 0 1 auto;
  min-width: 0;
  margin-left: auto;
}

.df-greeting {
  flex: 1 1 auto;
  min-width: 120px;
}

.df-greeting-kicker {
  margin: 0;
  font-size: 0.68rem;
  color: var(--df-muted);
  font-weight: 600;
  line-height: 1.15;
}

.df-greeting-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--df-ink);
  line-height: 1.15;
}

.df-greeting-sub {
  display: none; /* density: mock shows title only in tight layouts */
}

.df-site-dd {
  position: relative;
  flex: 0 0 auto;
}

.df-site-card {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  cursor: pointer;
  flex: 0 0 auto;
  max-width: 220px;
  height: 36px;
  width: 100%;
  text-align: left;
  transition: border-color 0.15s ease;
}

.df-site-card:hover {
  border-color: rgba(0, 169, 165, 0.45);
}

.df-site-dd.open .df-site-card {
  border-color: rgba(0, 169, 165, 0.55);
  box-shadow: 0 0 0 3px rgba(0, 169, 165, 0.12);
}

.df-site-caret {
  color: #6f84a2;
  margin-left: auto;
  flex-shrink: 0;
  font-size: 0.7rem;
  transition: transform 0.15s ease;
}

.df-site-dd.open .df-site-caret {
  transform: rotate(180deg);
  color: var(--df-teal);
}

.df-site-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: min(320px, calc(100vw - 24px));
  background: #fff;
  border: 1px solid var(--df-line);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(16, 41, 78, 0.14);
  z-index: 1200;
  padding: 10px;
  animation: dfSitePop 0.14s ease-out;
}

@keyframes dfSitePop {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.df-site-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #eef3f7;
}

.df-site-panel-head strong {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--df-ink);
}

.df-site-close {
  border: none;
  background: #eef5f9;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  color: var(--df-muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.df-site-close:hover {
  color: var(--df-ink);
}

.df-site-section {
  margin-bottom: 8px;
}

.df-site-section:last-child {
  margin-bottom: 0;
}

.df-site-section > label {
  display: block;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--df-muted);
  margin-bottom: 5px;
}

.df-site-plants {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-height: 96px;
  overflow-y: auto;
}

.df-site-plant {
  border: 1px solid var(--df-line);
  background: #f7fbfd;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--df-ink);
  cursor: pointer;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.df-site-plant:hover {
  border-color: rgba(0, 169, 165, 0.4);
}

.df-site-plant.active {
  background: rgba(0, 169, 165, 0.12);
  border-color: rgba(0, 169, 165, 0.45);
  color: #0f766e;
}

.df-site-devices {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 220px;
  overflow-y: auto;
}

.df-site-device {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: #f7fbfd;
  border-radius: 10px;
  padding: 7px 8px;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.df-site-device:hover {
  border-color: rgba(0, 169, 165, 0.35);
  background: #fff;
}

.df-site-device.active {
  border-color: rgba(0, 169, 165, 0.5);
  background: rgba(0, 169, 165, 0.08);
}

.df-site-device-ico {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(0, 169, 165, 0.12);
  color: var(--df-teal);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 0.75rem;
}

.df-site-device-meta {
  min-width: 0;
  flex: 1;
}

.df-site-device-meta strong {
  display: block;
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--df-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.df-site-device-meta span {
  display: block;
  font-size: 0.62rem;
  color: var(--df-muted);
  font-weight: 600;
}

.df-site-check {
  color: var(--df-teal);
  font-size: 0.75rem;
  opacity: 0;
  flex-shrink: 0;
}

.df-site-device.active .df-site-check {
  opacity: 1;
}

.df-site-empty,
.df-site-loading {
  font-size: 0.72rem;
  color: var(--df-muted);
  font-weight: 600;
  padding: 10px 6px;
  text-align: center;
}

.df-site-thumb {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  object-fit: cover;
  background: #dbe8f0;
  flex-shrink: 0;
}

.df-site-meta {
  min-width: 0;
}

.df-site-meta strong {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.15;
}

.df-site-meta span {
  display: block;
  font-size: 0.6rem;
  color: var(--df-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.15;
}

.df-status-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  padding: 4px 10px;
  flex: 0 0 auto;
  height: 36px;
  min-width: 0;
  max-width: 168px;
}

.df-status-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #0f766e;
  white-space: nowrap;
  line-height: 1.1;
}

.df-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16c979;
  box-shadow: 0 0 0 2px rgba(22, 201, 121, 0.18);
  flex-shrink: 0;
}

.df-status-card small {
  color: var(--df-muted);
  font-size: 0.58rem;
  padding-left: 12px;
  white-space: nowrap;
  line-height: 1.1;
}

.df-status-card #lastUpdatedTime {
  color: var(--df-ink);
  font-weight: 700;
}

.df-status-card #lastUpdatedTime.is-stale {
  color: #b45309;
}

.df-status-card #lastUpdatedTime.is-missing {
  color: #b91c1c;
}

.df-refresh-btn {
  border: 1px solid var(--df-line);
  background: #fff;
  border-radius: 9px;
  padding: 0 10px;
  font-weight: 700;
  font-size: 0.72rem;
  color: var(--df-ink);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  white-space: nowrap;
  height: 36px;
}

.df-refresh-btn:hover {
  border-color: var(--df-teal);
  color: var(--df-teal);
}

.df-profile {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  flex: 0 0 auto;
}

.df-bell {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--df-line);
  background: #fff;
  display: grid;
  place-items: center;
  color: var(--df-muted);
  flex-shrink: 0;
  font-size: 0.78rem;
}

.df-bell-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--df-alarm);
  color: #fff;
  font-size: 0.55rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  padding: 0 3px;
}

.df-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1689ff, #00a9a5);
  color: #fff;
  font-weight: 800;
  font-size: 0.65rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.df-profile-meta {
  line-height: 1.1;
}

.df-profile-meta strong {
  display: block;
  font-size: 0.7rem;
  text-transform: capitalize;
  white-space: nowrap;
}

.df-profile-meta span {
  font-size: 0.55rem;
  letter-spacing: 0.05em;
  color: var(--df-muted);
  font-weight: 700;
}

/* ——— KPI row ——— */
.df-kpi-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--df-gap);
  margin: 0 0 8px;
}

.df-kpi {
  padding: 8px 10px 6px;
  position: relative;
  overflow: hidden;
  min-height: 86px;
  border-radius: 12px;
}

.df-kpi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.df-kpi-label {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--df-muted);
  line-height: 1.2;
}

.df-kpi-icon {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
}

.df-kpi-icon.solar { background: rgba(255, 179, 0, 0.14); color: #d97706; }
.df-kpi-icon.load { background: rgba(22, 137, 255, 0.12); color: #1689ff; }
.df-kpi-icon.battery { background: rgba(22, 201, 121, 0.12); color: #059669; }
.df-kpi-icon.grid { background: rgba(114, 72, 232, 0.12); color: #7248e8; }
.df-kpi-icon.inverter { background: rgba(0, 169, 165, 0.12); color: #0f766e; }
.df-kpi-icon.savings { background: rgba(8, 198, 195, 0.14); color: #0f766e; }

.df-kpi-value {
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.df-kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 2px;
  font-size: 0.6rem;
  font-weight: 700;
}

.df-kpi-trend.up { color: #059669; }
.df-kpi-trend.down { color: #1689ff; }
.df-kpi-trend.stale { color: #94a3b8; }

.df-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 6px;
  font-size: 0.58rem;
  font-weight: 800;
  margin-top: 2px;
  height: 16px;
}

.df-chip.charging { background: rgba(22, 201, 121, 0.14); color: #059669; }
.df-chip.exporting { background: rgba(114, 72, 232, 0.12); color: #7248e8; }
.df-chip.importing { background: rgba(22, 137, 255, 0.12); color: #1689ff; }
.df-chip.stale { background: rgba(148, 163, 184, 0.16); color: #64748b; }

.df-kpi-sub {
  display: block;
  margin-top: 1px;
  font-size: 0.6rem;
  color: var(--df-muted);
  font-weight: 600;
}

.df-spark {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 22px;
  opacity: 0.8;
}

/* ——— Hero: flow photo stretches to ROI + Weather + Device Health ——— */
.df-hero-row {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(260px, 0.85fr);
  gap: var(--df-gap);
  align-items: stretch;
  margin-bottom: var(--df-gap);
}

.df-hero-side {
  display: flex;
  flex-direction: column;
  gap: var(--df-gap);
  min-width: 0;
}

.df-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(260px, 0.85fr);
  gap: var(--df-gap);
  align-items: stretch;
}

.df-left-col,
.df-right-col {
  display: flex;
  flex-direction: column;
  gap: var(--df-gap);
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.df-left-col {
  /* charts fill height of Alarms + Telemetry stack */
}

.df-charts-row {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: var(--df-gap);
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  align-items: stretch;
}

.df-chart-card {
  padding: 8px 10px 4px;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.df-chart-card .df-panel-head {
  flex: 0 0 auto;
}

.df-chart-card #powerChart,
.df-chart-card #homeYieldChart {
  flex: 1 1 auto;
  min-height: 160px;
  height: 100%;
}

/* Live energy flow */
.df-flow-card {
  overflow: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.df-flow-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px 4px;
  flex: 0 0 auto;
}

.df-flow-head h3 {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 800;
}

.df-flow-head p {
  margin: 0;
  font-size: 0.68rem;
  color: var(--df-muted);
}

.df-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  font-weight: 700;
  color: #059669;
}

.df-live-pill::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16c979;
  box-shadow: 0 0 0 2px rgba(22, 201, 121, 0.2);
}

.df-flow-scene {
  position: relative;
  margin: 0 8px 8px;
  border-radius: 12px;
  overflow: hidden;
  flex: 1 1 auto;
  min-height: 280px;
  height: auto;
  background: #0b1c24;
}

.df-flow-scene .energy-flow-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  object-fit: cover;
  object-position: center 45%;
  display: block;
  opacity: 1;
  z-index: 1;
  user-select: none;
}

@keyframes hf-flow-dash {
  to { stroke-dashoffset: -36; }
}

.df-flow-scene .ef-card {
  position: absolute;
  z-index: 4;
  min-width: 88px;
  max-width: 118px;
  padding: 6px 9px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(16, 41, 78, 0.08);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
  text-align: center;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.df-flow-scene .ef-card.is-active {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5), 0 8px 22px rgba(0, 0, 0, 0.2);
}

.df-flow-scene .ef-card-label {
  display: block;
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--df-muted);
}

.df-flow-scene .ef-card-value {
  display: block;
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--df-ink);
  margin-top: 1px;
  font-variant-numeric: tabular-nums;
}

.df-flow-scene .ef-card-sub {
  display: block;
  font-size: 0.56rem;
  font-weight: 700;
  margin-top: 1px;
}

.df-flow-scene .ef-solar {
  border-top: 2.5px solid var(--df-solar);
}
.df-flow-scene .ef-solar .ef-card-sub,
.df-flow-scene .ef-solar .ef-card-value { color: #d97706; }

.df-flow-scene .ef-load {
  border-top: 2.5px solid #ff8a00;
}
.df-flow-scene .ef-load .ef-card-sub,
.df-flow-scene .ef-load .ef-card-value { color: #ea580c; }

.df-flow-scene .ef-battery {
  border-top: 2.5px solid var(--df-battery);
}
.df-flow-scene .ef-battery .ef-card-sub,
.df-flow-scene .ef-battery .ef-card-value { color: #059669; }

.df-flow-scene .ef-grid {
  border-top: 2.5px solid var(--df-grid);
}
.df-flow-scene .ef-grid .ef-card-sub,
.df-flow-scene .ef-grid .ef-card-value { color: #7248e8; }

.df-flow-scene .ef-inverter {
  border-top: 2.5px solid var(--df-teal);
}
.df-flow-scene .ef-inverter .ef-card-sub,
.df-flow-scene .ef-inverter .ef-card-value { color: var(--df-teal); }

.df-flow-scene .energy-flow-svg,
.df-flow-scene #energyFlowSVG {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
}

.df-flow-scene .flow-path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity 0.25s ease, stroke-width 0.25s ease;
}

.df-flow-scene .flow-path.is-flowing {
  stroke-dasharray: 8 7;
  animation: hf-flow-dash linear infinite;
}

.df-flow-scene .flow-path.is-idle {
  stroke-dasharray: none;
  animation: none;
  opacity: 0.28;
}

.df-flow-scene .flow-line.flow-inactive {
  opacity: 0.4;
}

.df-flow-scene .ef-anchor {
  position: absolute;
  width: 8px;
  height: 8px;
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
}

.df-flow-footer {
  position: absolute;
  inset: auto 10px 10px 10px;
  z-index: 5;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .df-flow-scene .flow-path.is-flowing {
    animation: none !important;
  }
}

@media (max-width: 1100px) {
  .df-flow-scene {
    min-height: 240px;
  }
  .df-flow-scene .ef-card {
    min-width: 76px;
    padding: 5px 7px;
  }
  .df-flow-scene .ef-card-value { font-size: 0.72rem; }
}

@media (max-width: 560px) {
  .df-flow-scene {
    min-height: 220px;
    height: 260px;
  }
  .df-flow-scene .ef-card {
    min-width: 70px;
    max-width: 96px;
  }
  .df-flow-footer .df-clean-msg span { font-size: 0.6rem; }
}

.df-clean-msg {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #ecfdf5;
  font-size: 0.68rem;
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.df-rings {
  display: flex;
  gap: 6px;
}

.df-ring {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(8, 20, 28, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: grid;
  place-items: center;
  text-align: center;
  color: #fff;
  backdrop-filter: blur(6px);
}

.df-ring strong {
  display: block;
  font-size: 0.85rem;
  font-weight: 800;
}

.df-ring span {
  display: block;
  font-size: 0.5rem;
  opacity: 0.85;
  font-weight: 600;
  max-width: 54px;
  line-height: 1.15;
}

/* Right panels */
.df-panel {
  padding: 8px 10px;
}

.df-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  gap: 6px;
}

.df-panel-head h4 {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
}

.df-panel-head a,
.df-panel-head .df-link {
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--df-teal);
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

.df-tabs {
  display: inline-flex;
  background: #eef5f9;
  border-radius: 999px;
  padding: 2px;
  gap: 1px;
}

.df-tabs button {
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--df-muted);
}

.df-tabs button.active {
  background: var(--df-teal);
  color: #fff;
}

.df-roi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.df-roi-item label {
  display: block;
  font-size: 0.58rem;
  color: var(--df-muted);
  font-weight: 700;
}

.df-roi-item strong {
  display: block;
  margin-top: 1px;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.15;
}

.df-roi-item small {
  color: var(--df-muted);
  font-size: 0.58rem;
}

.df-weather-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
}

.df-weather-location {
  margin: 0 0 10px;
  color: var(--df-muted);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.35;
  word-break: break-word;
}

.df-weather-main {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-width: 0;
}

.df-weather-main i {
  font-size: 1.45rem;
  color: var(--df-solar);
  margin-top: 2px;
  flex: 0 0 auto;
}

.df-weather-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.df-weather-main strong,
.df-weather-copy strong {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--df-ink, #0f172a);
}

.df-weather-main span,
.df-weather-main small,
.df-weather-copy span,
.df-weather-copy small {
  display: block;
  color: var(--df-muted);
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.3;
}

.df-irr {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding-left: 10px;
  border-left: 1px solid #eef3f7;
}

.df-irr label {
  font-size: 0.62rem;
  color: var(--df-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.df-irr strong {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--df-teal);
  line-height: 1.2;
}

.df-irr strong em {
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--df-muted);
}

.df-irr-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
  font-size: 0.62rem;
  color: var(--df-muted);
  font-weight: 600;
  line-height: 1.35;
}

.df-irr-meta b {
  font-weight: 800;
  color: var(--df-ink, #0f172a);
}

.df-panel-body {
  position: relative;
  min-height: 72px;
}

.df-chart-body {
  flex: 1 1 auto;
  min-height: 160px;
  display: flex;
  flex-direction: column;
}

.df-chart-body #powerChart,
.df-chart-body #homeYieldChart {
  flex: 1 1 auto;
  min-height: 160px;
  height: 100%;
}

.df-flow-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

.df-empty-state {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
  padding: 18px 12px;
  min-height: 88px;
  color: var(--df-muted);
}

.df-empty-state:not([hidden]) {
  display: flex;
}

.df-empty-state strong {
  font-size: 0.82rem;
  font-weight: 800;
  color: #475569;
}

.df-empty-state small {
  font-size: 0.68rem;
  font-weight: 600;
  max-width: 16rem;
  line-height: 1.35;
}

.df-empty-state--banner {
  min-height: 64px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  margin-bottom: 8px;
}

.df-kpi-row[data-empty-mode] {
  grid-template-columns: 1fr;
}

.df-kpi-row[data-empty-mode] .df-kpi-row-inner,
[data-empty-host][data-empty-mode] [data-empty-content] {
  display: none !important;
}

[data-empty-host][data-empty-mode] [data-empty-state] {
  display: flex !important;
}

.df-kpi-row {
  position: relative;
}

.df-kpi-row-inner {
  display: contents;
}

@media (max-width: 720px) {
  .df-weather-grid {
    grid-template-columns: 1fr;
  }
  .df-irr {
    padding-left: 0;
    border-left: none;
    padding-top: 8px;
    border-top: 1px solid #eef3f7;
  }
}

.df-split-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--df-gap);
}

.df-more-tabs {
  margin-top: 6px;
  padding: 4px 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.df-more-tabs .nav-link {
  border: 1px solid var(--df-line) !important;
  border-radius: 999px !important;
  padding: 3px 9px !important;
  font-size: 0.64rem !important;
  font-weight: 700 !important;
  color: var(--df-muted) !important;
  background: #fff !important;
}

.df-more-tabs .nav-link.active {
  background: rgba(0, 169, 165, 0.1) !important;
  border-color: rgba(0, 169, 165, 0.35) !important;
  color: var(--df-teal) !important;
}

.df-device-row,
.df-alarm-row,
.df-telem-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 0;
  border-bottom: 1px solid #eef3f7;
}

.df-device-row:last-child,
.df-alarm-row:last-child,
.df-telem-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.df-device-row:first-child,
.df-alarm-row:first-child,
.df-telem-row:first-child {
  padding-top: 0;
}

.df-device-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.df-device-left i {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: #eef8f8;
  color: var(--df-teal);
  font-size: 0.65rem;
  flex-shrink: 0;
}

.df-device-left strong {
  display: block;
  font-size: 0.68rem;
  line-height: 1.15;
}

.df-device-left > div {
  min-width: 0;   /* lets the status line ellipsis instead of overflowing */
}

.df-device-left small {
  color: var(--df-muted);
  font-size: 0.58rem;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.df-online {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.62rem;
  font-weight: 800;
  color: #059669;
  flex-shrink: 0;
}

.df-online::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
}

.df-offline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.62rem;
  font-weight: 800;
  color: #b45309;
  flex-shrink: 0;
}

.df-offline::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f59e0b;
}

.df-alarm-row i.crit { color: var(--df-alarm); }
.df-alarm-row i.warn { color: var(--df-warn); }
.df-alarm-row i.info { color: #1689ff; }

.df-alarm-row strong {
  display: block;
  font-size: 0.68rem;
}

.df-alarm-row small {
  color: var(--df-muted);
  font-size: 0.55rem;
}

.df-telem-row .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: 0 0 7px;
  display: inline-block;
}

.df-telem-row .dot.solar { background: var(--df-solar); }
.df-telem-row .dot.load { background: var(--df-load); }
.df-telem-row .dot.battery { background: var(--df-battery); }
.df-telem-row .dot.grid { background: var(--df-grid); }
.df-telem-row .dot.inverter { background: var(--df-teal); }

.df-telem-row > span:not(.dot) {
  font-size: 0.68rem;
  color: var(--df-muted);
  font-weight: 600;
  flex: 1;
  min-width: 0;
}

.df-telem-row strong {
  font-size: 0.72rem;
  font-weight: 800;
  flex-shrink: 0;
}

.df-telem-row time {
  font-size: 0.58rem;
  color: var(--df-muted);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  min-width: 52px;
  text-align: right;
}

@media (max-width: 1280px) {
  .df-profile-meta { display: none; }
  .df-refresh-btn span { display: none; }
  .df-refresh-btn { padding: 0 9px; }
  .df-site-card { max-width: 160px; }
}

@media (max-width: 1100px) {
  .df-kpi-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .df-hero-row,
  .df-main-grid,
  .df-charts-row,
  .df-split-2 { grid-template-columns: 1fr; }
  .df-flow-scene { min-height: 240px; }
}

@media (max-width: 900px) {
  .df-topbar {
    flex-wrap: wrap;
    row-gap: 6px;
  }
  .df-greeting { flex: 1 1 100%; }
  .df-topbar-actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .df-kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .df-kpi-row { grid-template-columns: 1fr; }
}

/* Inverter without a battery (energy-flow has_battery = false, e.g. on-grid RS485). */
.df-flow-scene.no-battery #battery-card,
.df-flow-scene.no-battery #flowDeviceToBatteryPath,
.df-flow-scene.no-battery #flowDeviceToBattery {
	display: none;
}
