/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0f1117;
  color: #e0e6f0;
  min-height: 100vh;
}

/* ===== LOGIN ===== */
.login-screen {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f1117 0%, #1a2236 60%, #1e2d1e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.login-card {
  background: #161c2b;
  border: 1px solid #2a3050;
  border-radius: 16px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}
.logo-sun { margin-bottom: 0.75rem; }
.login-logo h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
}
.login-subtitle { color: #7a8aaa; font-size: 0.9rem; margin-top: 0.25rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.82rem; color: #7a8aaa; margin-bottom: 0.4rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.form-group input {
  width: 100%;
  background: #0f1117;
  border: 1px solid #2a3050;
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  color: #e0e6f0;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}
.form-group input:focus { outline: none; border-color: #FF9F1C; }
.btn-primary {
  background: linear-gradient(135deg, #FF9F1C, #e8870e);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.72rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}
.btn-primary:hover { opacity: 0.9; }
.btn-primary:active { transform: scale(0.98); }
.btn-full { width: 100%; margin-top: 0.5rem; }
.login-demo-note { text-align: center; color: #4a5570; font-size: 0.8rem; margin-top: 0.8rem; }

/* ===== LAYOUT ===== */
.hidden { display: none !important; }
.app { display: flex; min-height: 100vh; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: 220px;
  min-height: 100vh;
  background: #161c2b;
  border-right: 1px solid #1e2640;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.3s;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 1.25rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  border-bottom: 1px solid #1e2640;
  margin-bottom: 0.75rem;
}
.nav-links { list-style: none; flex: 1; }
.nav-links li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 1.25rem;
  cursor: pointer;
  color: #7a8aaa;
  font-size: 0.9rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all 0.15s;
}
.nav-links li:hover { color: #c8d4e8; background: #1a2236; }
.nav-links li.active { color: #FF9F1C; border-left-color: #FF9F1C; background: rgba(255,159,28,0.08); }
.sidebar-footer { padding: 1rem 1.25rem; border-top: 1px solid #1e2640; }
.system-status {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.82rem; color: #7a8aaa; margin-bottom: 0.75rem;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #4EC87A; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.4; } }
.btn-logout {
  background: transparent; border: 1px solid #2a3050;
  color: #7a8aaa; border-radius: 6px; padding: 0.45rem 0.9rem;
  font-size: 0.82rem; cursor: pointer; width: 100%; transition: all 0.2s;
}
.btn-logout:hover { border-color: #FF9F1C; color: #FF9F1C; }

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: 220px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== TOPBAR ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
  background: #161c2b;
  border-bottom: 1px solid #1e2640;
  position: sticky; top: 0; z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 0.75rem; }
.menu-toggle { display: none; background: none; border: none; color: #7a8aaa; cursor: pointer; padding: 4px; }
.page-title { font-size: 1.1rem; font-weight: 600; color: #fff; }
.topbar-right { display: flex; align-items: center; gap: 1rem; }
.weather-widget {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.88rem; color: #c8d4e8;
  background: #1a2236; padding: 0.4rem 0.75rem; border-radius: 20px;
}
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #FF9F1C, #e8870e);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.95rem; color: #fff; cursor: pointer;
}

/* ===== PAGES ===== */
.page { display: none; padding: 1.5rem; }
.page.active { display: block; }
.date-line { color: #7a8aaa; font-size: 0.85rem; margin-bottom: 1rem; }

/* ===== CARDS ===== */
.card {
  background: #161c2b;
  border: 1px solid #1e2640;
  border-radius: 12px;
  padding: 1.25rem;
}
.card-title { font-size: 0.95rem; font-weight: 600; color: #c8d4e8; margin-bottom: 1rem; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.card-header .card-title { margin-bottom: 0; }
.full-card { margin-bottom: 1.25rem; }

/* ===== ENERGY FLOW ===== */
.flow-card { margin-bottom: 1.25rem; }
.flow-diagram {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0;
}
.flow-node {
  display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
  min-width: 80px;
}
.flow-icon {
  width: 60px; height: 60px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.solar-node .flow-icon { background: rgba(255,159,28,0.15); }
.home-node .flow-icon { background: rgba(108,155,200,0.15); }
.battery-node .flow-icon { background: rgba(78,200,122,0.15); }
.grid-node .flow-icon { background: rgba(150,130,200,0.15); }
.flow-label { font-size: 0.78rem; color: #7a8aaa; font-weight: 500; }
.flow-value { font-size: 1rem; font-weight: 700; color: #fff; }
.flow-arrows {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.arrow-row { display: flex; flex-direction: column; gap: 0.3rem; }
.flow-center { display: flex; align-items: center; }
.flow-right-nodes { display: flex; flex-direction: column; gap: 1rem; }

/* ===== STATS ROW ===== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.stat-card {
  background: #161c2b;
  border: 1px solid #1e2640;
  border-radius: 12px;
  padding: 1rem 1.1rem;
  display: flex; align-items: center; gap: 0.85rem;
}
.stat-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.solar-icon { background: rgba(255,159,28,0.15); color: #FF9F1C; }
.home-icon { background: rgba(108,155,200,0.15); color: #6C9BC8; }
.grid-icon { background: rgba(150,130,200,0.15); color: #9682C8; }
.savings-icon { background: rgba(78,200,122,0.15); color: #4EC87A; }
.stat-label { font-size: 0.78rem; color: #7a8aaa; margin-bottom: 0.25rem; }
.stat-value { font-size: 1.2rem; font-weight: 700; color: #fff; }

/* ===== CHARTS ROW ===== */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.chart-wrap { position: relative; height: 200px; width: 100%; }
.chart-wrap-tall { height: 280px; }
.chart-wrap canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
.legend { display: flex; align-items: center; gap: 0.75rem; font-size: 0.8rem; color: #7a8aaa; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 3px; }
.solar-dot { background: #FF9F1C; }
.home-dot { background: #6C9BC8; }
.tab-switch { display: flex; gap: 0.3rem; }
.tab {
  background: transparent; border: 1px solid #2a3050; color: #7a8aaa;
  padding: 0.28rem 0.65rem; border-radius: 6px; font-size: 0.78rem; cursor: pointer;
  transition: all 0.15s;
}
.tab.active { background: rgba(255,159,28,0.15); border-color: #FF9F1C; color: #FF9F1C; }
.tab:hover:not(.active) { border-color: #4a5570; color: #c8d4e8; }

/* ===== BOTTOM ROW ===== */
.bottom-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}

/* ===== BATTERY STATUS CARD ===== */
.battery-display { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.battery-graphic { display: flex; align-items: center; }
.battery-body {
  width: 110px; height: 40px;
  border: 2px solid #2a3050; border-radius: 6px;
  padding: 4px; position: relative; overflow: hidden;
}
.battery-fill {
  height: 100%; background: linear-gradient(90deg, #4EC87A, #5de088);
  border-radius: 3px; transition: width 1s ease;
}
.battery-tip {
  width: 8px; height: 18px; background: #2a3050; border-radius: 0 3px 3px 0;
  margin-left: 2px;
}
.battery-pct { font-size: 1.6rem; font-weight: 700; color: #4EC87A; }
.battery-meta { display: flex; flex-direction: column; gap: 0.5rem; }
.battery-meta-item { display: flex; justify-content: space-between; font-size: 0.85rem; }
.meta-label { color: #7a8aaa; }
.meta-value { color: #c8d4e8; font-weight: 600; }
.meta-value.charging { color: #4EC87A; }

/* ===== ENV CARD ===== */
.env-stats { display: flex; flex-direction: column; gap: 0.85rem; }
.env-item { display: flex; align-items: center; gap: 0.75rem; }
.env-icon { font-size: 1.4rem; width: 36px; text-align: center; }
.env-value { font-size: 1.05rem; font-weight: 700; color: #fff; }
.env-label { font-size: 0.78rem; color: #7a8aaa; }

/* ===== ALERTS ===== */
.alerts-list { display: flex; flex-direction: column; gap: 0.6rem; }
.alert-item {
  display: flex; align-items: flex-start; gap: 0.5rem;
  font-size: 0.85rem; padding: 0.5rem 0.75rem; border-radius: 8px;
}
.alert-item.success { background: rgba(78,200,122,0.1); color: #4EC87A; }
.alert-item.info { background: rgba(108,175,225,0.18); color: #90c4e8; border: 1px solid rgba(108,175,225,0.25); }
.alert-item.warning { background: rgba(255,193,7,0.1); color: #FFC107; }
.alert-icon { font-weight: 700; flex-shrink: 0; }

/* ===== PRODUCTION PAGE ===== */
.production-summary {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1rem; margin-top: 1.25rem; padding-top: 1.25rem;
  border-top: 1px solid #1e2640;
}
.summary-item { text-align: center; }
.summary-label { font-size: 0.78rem; color: #7a8aaa; margin-bottom: 0.3rem; }
.summary-value { font-size: 1.3rem; font-weight: 700; color: #FF9F1C; }

/* ===== PANELS PAGE ===== */
.roof-diagram { margin-bottom: 1rem; }
.roof-label { font-size: 0.82rem; color: #7a8aaa; margin-bottom: 0.75rem; }
.panel-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
  max-width: 700px;
}
.panel-cell {
  aspect-ratio: 0.85;
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  border: 1px solid rgba(255,255,255,0.08);
  transition: transform 0.15s, box-shadow 0.15s;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 1px;
  padding: 3px 2px;
}
.pc-num   { font-size: 0.52rem; font-weight: 600; color: rgba(255,255,255,0.6); line-height: 1; }
.pc-watts { font-size: 0.7rem;  font-weight: 800; color: rgba(255,255,255,0.95); line-height: 1; }
.pc-serial { font-size: 0.46rem; font-weight: 600; color: rgba(255,255,255,0.5); line-height: 1; letter-spacing: 0; }
.panel-cell:hover { transform: scale(1.08); box-shadow: 0 0 10px rgba(255,159,28,0.4); z-index: 2; }
.panel-cell.high { background: linear-gradient(135deg, #FF9F1C, #e8870e); }
.panel-cell.med { background: linear-gradient(135deg, #c87a00, #a06000); }
.panel-cell.low { background: linear-gradient(135deg, #7a5020, #5a3810); }
.panel-cell.shade { background: linear-gradient(135deg, #2a3450, #1e2840); }
.panel-cell.selected { outline: 2px solid #fff; }
.panel-legend { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.panel-legend-item {
  font-size: 0.75rem; padding: 0.25rem 0.6rem; border-radius: 4px; font-weight: 600;
}
.panel-legend-item.high { background: linear-gradient(135deg,#FF9F1C,#e8870e); color:#fff; }
.panel-legend-item.med { background: linear-gradient(135deg,#c87a00,#a06000); color:#fff; }
.panel-legend-item.low { background: linear-gradient(135deg,#7a5020,#5a3810); color:#fff; }
.panel-legend-item.shade { background: linear-gradient(135deg,#2a3450,#1e2840); color:#8a9aaa; }
.panel-detail {
  background: #0f1117; border: 1px solid #2a3050; border-radius: 8px;
  padding: 0.85rem 1rem; margin-top: 0.75rem;
}
.panel-hint { color: #4a5570; font-size: 0.85rem; font-style: italic; }
.panel-info-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 0.75rem; }
.panel-info-item { }
.panel-info-label { font-size: 0.75rem; color: #7a8aaa; }
.panel-info-value { font-size: 1.05rem; font-weight: 700; color: #fff; margin-top: 0.1rem; }

/* ===== BATTERY PAGE ===== */
.battery-page-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.full-span { grid-column: 1 / -1; }
.big-battery { display: flex; align-items: flex-start; gap: 2rem; padding: 0.5rem 0; }
.big-battery-wrap { display: flex; align-items: flex-end; gap: 4px; }
.big-battery-body {
  width: 60px; height: 160px;
  border: 2.5px solid #2a3050; border-radius: 6px;
  padding: 4px;
  display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden;
}
.big-battery-fill {
  background: linear-gradient(to top, #4EC87A, #5de088);
  border-radius: 3px; width: 100%;
  transition: height 1.5s ease;
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 4px;
}
.big-battery-fill span { font-size: 0.75rem; font-weight: 700; color: rgba(255,255,255,0.9); }
.big-battery-tip {
  width: 22px; height: 12px; background: #2a3050; border-radius: 0 0 4px 4px;
  align-self: flex-start; margin-left: 19px;
}
.big-battery-info { display: flex; flex-direction: column; gap: 0.75rem; padding-top: 0.5rem; }
.info-row { display: flex; justify-content: space-between; gap: 2rem; font-size: 0.88rem; }
.info-row span { color: #7a8aaa; }
.info-row strong { color: #fff; }
.mode-options { display: flex; flex-direction: column; gap: 0.75rem; }
.mode-option {
  display: flex; align-items: flex-start; gap: 0.75rem;
  background: #0f1117; border: 2px solid #2a3050; border-radius: 10px;
  padding: 0.85rem; cursor: pointer; transition: border-color 0.2s;
}
.mode-option input { display: none; }
.mode-option.active { border-color: #FF9F1C; background: rgba(255,159,28,0.06); }
.mode-option:hover:not(.active) { border-color: #4a5570; }
.mode-icon { font-size: 1.3rem; flex-shrink: 0; padding-top: 2px; }
.mode-body strong { display: block; color: #fff; font-size: 0.9rem; margin-bottom: 0.2rem; }
.mode-body p { font-size: 0.8rem; color: #7a8aaa; line-height: 1.4; }

/* ===== SAVINGS PAGE ===== */
.savings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.savings-hero {
  grid-column: 1 / -1;
  text-align: center; padding: 2rem;
  background: linear-gradient(135deg, #1a2820 0%, #161c2b 100%);
}
.savings-total-label { color: #7a8aaa; font-size: 0.9rem; margin-bottom: 0.5rem; }
.savings-total-value { font-size: 3rem; font-weight: 800; color: #4EC87A; letter-spacing: -1px; }
.savings-since { color: #4a5570; font-size: 0.8rem; margin-top: 0.5rem; }
.savings-breakdown { display: flex; flex-direction: column; gap: 0.6rem; }
.breakdown-item { display: flex; justify-content: space-between; align-items: center; padding: 0.6rem 0; border-bottom: 1px solid #1e2640; font-size: 0.88rem; }
.breakdown-item:last-child { border-bottom: none; }
.breakdown-label { color: #7a8aaa; }
.breakdown-value { font-weight: 600; color: #c8d4e8; }
.breakdown-value.green { color: #4EC87A; }

/* ===== SETTINGS PAGE ===== */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.settings-list { display: flex; flex-direction: column; gap: 0; }
.setting-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.65rem 0; border-bottom: 1px solid #1e2640; font-size: 0.88rem;
}
.setting-row:last-child { border-bottom: none; }
.setting-row span { color: #7a8aaa; }
.setting-row strong { color: #c8d4e8; }
.toggle-row { }
.toggle { position: relative; display: inline-block; width: 40px; height: 22px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; background: #2a3050; border-radius: 22px; cursor: pointer;
  transition: background 0.2s;
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 16px; height: 16px; left: 3px; bottom: 3px;
  background: #7a8aaa; border-radius: 50%; transition: transform 0.2s, background 0.2s;
}
.toggle input:checked + .toggle-slider { background: rgba(255,159,28,0.3); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); background: #FF9F1C; }
.settings-note { color: #7a8aaa; font-size: 0.85rem; margin-bottom: 1rem; line-height: 1.5; }
.export-buttons { display: flex; gap: 0.75rem; }
.btn-secondary {
  background: #1a2236; border: 1px solid #2a3050; color: #c8d4e8;
  padding: 0.55rem 1.1rem; border-radius: 8px; font-size: 0.85rem;
  cursor: pointer; transition: all 0.2s;
}
.btn-secondary:hover { border-color: #FF9F1C; color: #FF9F1C; }

/* ===== PRODUCTION PAGE ===== */
.prod-controls {
  display: flex; flex-direction: column; gap: 0.6rem;
  padding: 0.8rem 1rem !important;
}
.prod-charts-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-top: 1.1rem;
}
.custom-date-row {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
}
.custom-date-row input[type="date"] {
  background: #0f1117; border: 1px solid #2a3050; border-radius: 6px;
  color: #e0e6f0; padding: 0.35rem 0.6rem; font-size: 0.85rem;
  color-scheme: dark;
}
.custom-date-row input[type="date"]:focus { outline: none; border-color: #FF9F1C; }
.date-sep { color: #4a5570; font-size: 0.9rem; }
.btn-apply {
  background: linear-gradient(135deg, #FF9F1C, #e8870e);
  color: #fff; border: none; border-radius: 6px;
  padding: 0.35rem 0.85rem; font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.btn-apply:hover { opacity: 0.9; }
.chart-unit-badge {
  font-size: 0.75rem; color: #7a8aaa; font-weight: 500;
  background: #0f1117; border: 1px solid #2a3050; border-radius: 4px;
  padding: 0.15rem 0.5rem;
}

/* ===== WEATHER FORECAST CARD ===== */
.weather-forecast-card { margin-top: 1.25rem; }
.wx-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 0;
  padding-top: 0.5rem;
}
.wx-col {
  padding: 0.9rem 1rem;
  border-right: 1px solid #1e2640;
  text-align: center;
}
.wx-col:last-child { border-right: none; }
.wx-today { text-align: left; background: #0d1117; border-radius: 8px 0 0 8px; }
.wx-day-label {
  font-size: 0.72rem; font-weight: 700; color: #7a8aaa;
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.5rem;
}
.wx-icon-big { font-size: 2rem; line-height: 1; margin-bottom: 0.3rem; }
.wx-temp-big { font-size: 2rem; font-weight: 800; color: #fff; line-height: 1; margin-bottom: 0.25rem; }
.wx-desc-text { font-size: 0.82rem; color: #c8d4e8; margin-bottom: 0.35rem; }
.wx-hilow { font-size: 0.8rem; color: #e0e6f0; margin-bottom: 0.25rem; }
.wx-hi { font-weight: 700; color: #fff; }
.wx-lo { color: #6a7a9a; }
.wx-meta { font-size: 0.72rem; color: #7a8aaa; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .bottom-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .menu-toggle { display: block; }
  .charts-row { grid-template-columns: 1fr; }
  .prod-charts-row { grid-template-columns: 1fr; }
  .production-summary { grid-template-columns: repeat(2,1fr); }
  .battery-page-grid { grid-template-columns: 1fr; }
  .savings-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .panel-grid { grid-template-columns: repeat(5, 1fr); }
  .flow-diagram { flex-wrap: wrap; justify-content: center; }
  .wx-grid { grid-template-columns: 1fr 1fr; }
  .wx-col { border-right: none; border-bottom: 1px solid #1e2640; }
  .wx-col:last-child { border-bottom: none; }
}
@media (max-width: 600px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
  .bottom-row { grid-template-columns: 1fr; }
  .topbar { padding: 0.7rem 1rem; }
  .page { padding: 1rem; }
  .weather-widget span:last-child { display: none; }
}

/* ===== PANEL HISTORY ===== */
.panel-history-tabs {
  display: flex;
  gap: 0.4rem;
  margin: 1.2rem 0 0.6rem;
}
.ph-tab {
  padding: 0.3rem 0.9rem;
  border-radius: 20px;
  border: 1px solid #2a3050;
  background: transparent;
  color: #7a8aaa;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s;
}
.ph-tab:hover { border-color: #FF9F1C; color: #FF9F1C; }
.ph-tab.active { background: #FF9F1C; border-color: #FF9F1C; color: #0d1117; font-weight: 600; }
.panel-history-wrap {
  position: relative;
  height: 180px;
  margin-top: 0.4rem;
}
.panel-history-wrap canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
.ph-empty {
  color: #7a8aaa;
  font-size: 0.82rem;
  padding: 1rem 0;
  text-align: center;
}
