:root {
    color-scheme: light;
    --navy: #061a63;
    --steel: #6b7fa5;
    --pale: #dce5f6;
    --line: #aab7d2;
    --orange: #ff9419;
    --green: #0b9a28;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
}

* { box-sizing: border-box; }
body { margin: 0; background: #edf1f7; color: var(--navy); }
.app-shell { width: min(1180px, 100%); min-height: 100vh; margin: 0 auto; background: #fff; border-inline: 1px solid #8393b4; box-shadow: 0 0 24px #26365233; display: flex; flex-direction: column; }
.topbar { min-height: 92px; display: grid; grid-template-columns: 260px 1fr 310px; align-items: center; gap: 20px; padding: 12px 24px; color: #fff; background: linear-gradient(105deg, #244d80 0%, #536d92 49%, #d3d8e0 100%); }
.product-mark { display: flex; align-items: center; gap: 10px; font-size: 1.45rem; text-shadow: 0 1px 2px #0007; }
.product-mark .bolt { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 7px 20px 7px 20px; background: var(--orange); font-size: 2rem; font-weight: bold; color: white; }
.tagline { font-size: 1.16rem; text-align: center; }
.site-picker { justify-self: end; display: grid; grid-template-columns: auto minmax(170px, 1fr); gap: 6px 10px; align-items: center; font-size: .9rem; }
.site-picker label { font-weight: bold; text-shadow: 0 1px 1px #0007; }
select { min-height: 36px; padding: 6px 36px 6px 10px; border: 1px solid #95a2bc; border-radius: 4px; color: var(--navy); background: #fff linear-gradient(45deg, transparent 50%, #52678e 50%) calc(100% - 15px) 15px/6px 6px no-repeat; appearance: none; font: inherit; }
.section-title { height: 44px; display: flex; align-items: center; gap: 12px; padding-left: 320px; color: #fff; font-size: 1.25rem; background: linear-gradient(#d9deec, #9fafd0); border-bottom: 1px solid #8ea1c5; text-shadow: 0 1px #50648c; }
.title-icon { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 4px; color: #fff; background: #7186b6; box-shadow: inset 0 0 0 2px #ffffff66; }
.layout { display: grid; grid-template-columns: 250px 1fr; flex: 1; }
.sidebar { padding: 12px 10px 20px; background: var(--pale); border-right: 10px solid #ccd7ee; }
.nav-heading { margin: -5px -6px 10px; padding: 7px 12px; background: #fff; border-radius: 16px; font-weight: bold; font-size: 1.06rem; }
.sidebar a { display: block; padding: 10px 13px; color: var(--navy); text-decoration: none; border-left: 4px solid transparent; }
.sidebar a:hover, .sidebar a:focus-visible { background: #fff9; }
.sidebar a.active { font-weight: bold; background: #fff; border-left-color: var(--orange); }
.site-health { margin: 24px 8px 0; padding-top: 14px; border-top: 1px solid #aebbd3; font-size: .82rem; }
.site-health small { display: block; margin: 6px 0 0 17px; color: #526184; }
.health-dot { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 50%; }
.health-dot.good { background: #1aa544; box-shadow: 0 0 0 3px #1aa54422; }
.health-dot.stale { background: #9ba5b7; }
.content { min-width: 0; padding: 26px 28px 24px; }
.provider-line { display: grid; grid-template-columns: 310px 1fr; padding: 10px 12px; margin-bottom: 18px; border: 1px solid #c8d0df; background: #f4f6fa; }
.status-grid { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(260px, 1fr); gap: 4px 28px; align-items: center; }
.status-label { padding: 5px 0; }
.status-value { min-height: 30px; display: flex; gap: 12px; align-items: center; }
.status-value img { width: 24px; height: 24px; object-fit: contain; }
.battery-icon { width: 32px; height: 32px; flex: none; background: url('../icon/batt_strip.png') 0 0/1376px 32px no-repeat; }
.mini-bolt { width: 24px; text-align: center; color: #e6ae00; font-size: 1.55rem; }
.load-section { margin-top: 54px; }
.load-heading, .load-scale { display: flex; justify-content: space-between; }
.load-heading { margin-bottom: 5px; }
.load-bar { height: 18px; border: 1px solid #9aa2b2; background: #e8eaed; box-shadow: inset 0 1px 2px #0002; overflow: hidden; }
.load-bar span { display: block; height: 100%; min-width: 2px; background: linear-gradient(#40a624, #169512); transition: width .4s; }
.load-scale { margin-top: 4px; }
.load-section p { margin: 8px 0 0; }
.summary-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 32px; }
.summary-card { min-width: 0; min-height: 92px; display: flex; align-items: center; gap: 15px; padding: 12px; border: 4px solid #7286aa; border-radius: 14px; background: #d1d9ed; box-shadow: inset 0 0 0 1px #fff; }
.summary-card > img, .metric-slide img { width: 52px; height: 52px; object-fit: contain; flex: none; }
.summary-card span { display: block; margin-bottom: 10px; font-size: .8rem; }
.summary-card strong { display: block; color: #00165c; }
.rotating-card { position: relative; }
.metric-slide { display: none; align-items: center; gap: 15px; width: 100%; }
.metric-slide.active { display: flex; }
.metric-dots { position: absolute; right: 10px; bottom: 7px; display: flex; gap: 4px; }
.metric-dots i { width: 5px; height: 5px; border-radius: 50%; background: #9aa7c0; }
.metric-dots i.active { background: #294a84; }
.page-intro h1 { margin: 0 0 5px; font-size: 1.25rem; }
.page-intro p { margin: 0 0 24px; }
.log-panel, .energy-panel { border: 1px solid #c9ced8; background: #fff; }
.event-log { margin: 0; padding: 8px 24px 8px 48px; }
.event-log li { padding: 14px 8px; border-bottom: 1px solid #e1e4eb; line-height: 1.45; }
.event-log li:last-child { border-bottom: 0; }
.event-log time { font-weight: bold; font-variant-numeric: tabular-nums; }
.empty-state { min-height: 240px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 12px; color: #526184; text-align: center; }
.empty-state img { width: 34px; height: 34px; image-rendering: auto; }
.energy-header { padding: 0 14px 20px; }
.energy-header p { margin: 0 0 28px; }
.period-picker { display: flex; justify-content: flex-end; align-items: center; gap: 12px; font-weight: bold; }
.energy-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 60px; padding: 42px 48px; }
.energy-stat { display: flex; align-items: center; gap: 20px; }
.energy-stat img { width: 44px; height: 44px; object-fit: contain; }
.factory-icon, .tree-icon { width: 44px; text-align: center; font-size: 2.5rem; color: #1b1b2a; }
.tree-icon { color: #129126; }
.storage-note { padding: 12px 14px; color: #526184; font-size: .84rem; }
.statusbar { min-height: 24px; padding: 4px 8px; color: #fff; background: #59739b; font-size: .8rem; font-weight: bold; }

@media (max-width: 820px) {
    .topbar { grid-template-columns: 1fr auto; }
    .tagline { display: none; }
    .section-title { padding-left: 24px; }
    .layout { grid-template-columns: 1fr; }
    .sidebar { display: flex; padding: 8px; overflow-x: auto; border-right: 0; border-bottom: 6px solid #ccd7ee; }
    .nav-heading, .site-health { display: none; }
    .sidebar a { white-space: nowrap; }
    .summary-cards { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .topbar { grid-template-columns: 1fr; padding: 14px; }
    .site-picker { justify-self: stretch; }
    .content { padding: 18px 14px; }
    .provider-line, .status-grid { grid-template-columns: 1fr; }
    .provider-line strong { margin-top: 5px; }
    .status-label { margin-top: 10px; color: #4b5e86; }
    .load-section { margin-top: 32px; }
    .energy-panel { grid-template-columns: 1fr; padding: 28px 20px; }
    .period-picker { align-items: stretch; flex-direction: column; }
}
