/* Users Dashboard - Professional 4-Box Layout */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, #d1670e, #b8590c) fixed; /* Orange gradient to match dashboard */
  color: #2d3748;
  -webkit-font-smoothing: antialiased;
}

.bg-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('/static/solar-panels-sunrise-renewable-energy.jpg');
  background-size: cover;
  background-position: center;
  opacity: 0.08; /* Very subtle */
  z-index: 0;
  pointer-events: none;
}

/* ============================================
   LAYOUT
   ============================================ */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  width: 210px;
  background: #2d2d2d;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
}

.sidebar-header {
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #404040;
}

.sidebar-logo {
  width: 100%;
  max-width: 160px;
  height: auto;
  object-fit: contain;
}

.sidebar-nav {
  flex: 1;
  padding: 0.25rem 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sidebar-nav::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.nav-item {
  display: block;
  padding: 0.5rem 0.75rem;
  color: #999;
  text-decoration: none;
  font-size: 0.78rem;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: #383838;
  color: #fff;
}

.nav-item.active {
  background: #383838;
  border-left-color: #d1670e;
  color: #fff;
  font-weight: 600;
}

/* Customer PG&E notice (manager-enabled on Service tab) */
.customer-pge-notice-banner {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  margin: 1rem 0 0.5rem;
  padding: 0.9rem 1rem;
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border: 1px solid #fdba74;
  border-left: 4px solid #ea580c;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.12);
}
.customer-pge-notice-icon {
  flex-shrink: 0;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: #ea580c;
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1.6rem;
  text-align: center;
}
.customer-pge-notice-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #9a3412;
  margin-bottom: 0.25rem;
}
.customer-pge-notice-text {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: #7c2d12;
}

/* Dropdown Menu Styles */
.nav-dropdown {
  position: relative;
}

.nav-item-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.nav-item-toggle .nav-text {
  flex: 1;
}

.dropdown-arrow {
  font-size: 0.7rem;
  transition: transform 0.3s ease;
  color: #999;
}

.dropdown-arrow.rotate {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  display: none;
  position: relative;
  background: #252525;
  border-top: 1px solid #404040;
  width: 100%;
}

.nav-dropdown-menu.show,
/* Some templates toggle `active` instead of `show` */
.nav-dropdown-menu.active {
  display: block;
}

.nav-dropdown-section-label {
  padding: 0.6rem 0.75rem 0.3rem 1.25rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #e5e5e5;
  border-top: 1px solid #404040;
  background: #2a2a2a;
}

.nav-dropdown-section-label:first-child {
  border-top: none;
}

.nav-dropdown-section-label--nema {
  color: #fbbf24;
  background: #2f2618;
}

.nav-meter-accordion {
  padding-bottom: 0.35rem;
}

.nav-meter-section--nema {
  border-top: 1px solid #3a3a3a;
}

.nav-meter-section-head {
  display: flex;
  align-items: stretch;
  min-height: 2.1rem;
}

.nav-meter-group-link,
.nav-meter-group-link:visited {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.5rem 0.5rem 0.5rem 1.25rem;
  text-decoration: none;
  color: #d4d4d4;
  font-size: 0.78rem;
  font-weight: 600;
  border-left: 3px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.nav-meter-group-link:hover {
  background: #383838;
  border-left-color: #d1670e;
  color: #fff;
}

.nav-meter-group-link.active-meter {
  background: linear-gradient(135deg, #ff8c42 0%, #ff7629 100%);
  border-left-color: #ff7629;
  color: #fff !important;
}

.nav-meter-group-name {
  flex: 1;
  min-width: 0;
  line-height: 1.25;
  white-space: normal;
  word-break: break-word;
}

.nav-meter-group-count {
  font-size: 0.68rem;
  font-weight: 500;
  color: #9ca3af;
  flex-shrink: 0;
}

.nav-meter-group-link.active-meter .nav-meter-group-count {
  color: rgba(255, 255, 255, 0.9);
}

.nav-meter-expand-btn {
  flex-shrink: 0;
  width: 2.25rem;
  margin: 0;
  padding: 0;
  border: none;
  border-left: 1px solid #404040;
  background: #2e2e2e;
  color: #b0b0b0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-meter-expand-btn:hover {
  background: #3d3426;
  color: #fbbf24;
}

.nav-meter-expand-icon {
  display: inline-block;
  font-size: 0.55rem;
  transition: transform 0.2s ease;
}

.nav-meter-section.is-open .nav-meter-expand-btn {
  background: #3d3426;
  color: #fbbf24;
}

.nav-meter-section-body {
  display: none;
  background: #1f1f1f;
  border-top: 1px solid #333;
}

.nav-meter-section-body.is-open {
  display: block;
}

.nav-dropdown-item,
.nav-dropdown-item:visited {
  display: block;
  padding: 0.5rem 0.75rem;
  padding-left: 1.5rem;
  text-decoration: none;
  color: #999;
  border-left: 3px solid transparent;
  transition: all 0.2s;
  font-size: 0.78rem;
}

.nav-dropdown-item:hover {
  background: #383838;
  border-left-color: #d1670e;
  color: #fff;
}

.nav-dropdown-item.active-meter {
  background: linear-gradient(135deg, #ff8c42 0%, #ff7629 100%);
  border-left-color: #ff7629;
  color: #fff !important;
  font-weight: 600;
}

.nav-dropdown-item.active-meter:hover {
  background: linear-gradient(135deg, #ff7629 0%, #ff6a1a 100%);
}

.nav-dropdown-item--child {
  padding-left: 2rem;
  font-size: 0.76rem;
}

.nav-dropdown-item--empty {
  color: #666;
  cursor: default;
  display: block;
}

.nav-item.logout-nav {
  border-top: 1px solid #404040;
  color: #cc6666;
}

.nav-item.logout-nav:hover {
  background: #4a2a2a;
  color: #ff8888;
}

.nav-item.disabled {
  color: #555;
  cursor: not-allowed;
  opacity: 0.5;
  pointer-events: none;
}

.sidebar-footer {
  padding: 0.6rem 0.5rem;
  border-top: 1px solid #404040;
  background: #252525;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  min-width: 0;
}

.user-info-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  min-width: 0;
  flex: 1;
  line-height: 1.25;
}

.user-avatar {
  width: 26px;
  height: 26px;
  min-width: 26px;
  background: #d1670e;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  color: #fff;
}

.user-name {
  font-size: 0.72rem;
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.user-role {
  font-size: 0.58rem;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.logout-btn {
  display: none;
}

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

/* Laptop / MacBook — match solar dashboard 180px sidebar */
@media (min-width: 901px) and (max-width: 1500px) {
  .sidebar {
    width: 180px !important;
    transform: none !important;
    left: 0 !important;
  }

  .main-content {
    margin-left: 180px !important;
  }
}

/* ============================================
   PAGE HEADER
   ============================================ */
.page-header {
  text-align: center;
  padding: 1rem 0 0 0;
  flex-shrink: 0;
}

.page-title {
  font-size: 3rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
  display: inline-block;
  margin: 0;
}

.page-title::after {
  content: '';
  display: block;
  width: 120px;
  height: 3px;
  background: #ffa861;
  border-radius: 2px;
  margin: 0.2rem auto 0;
}

/* ============================================
   4-BOX GRID
   ============================================ */
.four-box-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 2rem;
  padding: 0 3rem;
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
}

.box-widget {
  background: #fff;
  border: 7px outset rgba(100, 100, 100, 0.6);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 360px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.box-widget:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.box-header {
  padding: 0.5rem 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eee;
  background: #fafafa;
  flex-shrink: 0;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.box-title {
  font-size: 1rem;
  font-weight: 600;
  color: #333;
}

.box-controls {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.filter-btn {
  padding: 0.1rem 0.35rem;
  font-size: 0.6rem;
  border: 1px solid #ccc;
  background: #fff;
  color: #666;
  cursor: pointer;
}

.filter-btn.active {
  background: #4a7fc1;
  border-color: #4a7fc1;
  color: #fff;
}

.dropdown-label {
  font-size: 0.6rem;
  color: #666;
  margin-left: 0.35rem;
}

/* Report source info */
.report-source {
  font-size: 0.58rem;
  color: #666;
  text-align: center;
  margin-top: 0.4rem;
  padding-top: 0.4rem;
  border-top: 1px solid #eee;
}

/* No data message styles */
.no-data-message {
  text-align: center;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.no-data-message .warning-icon,
.no-data-message .info-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.no-data-message h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.5rem;
}

.no-data-message p {
  font-size: 0.75rem;
  color: #666;
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.no-data-message .last-attempt {
  font-size: 0.7rem;
  color: #999;
  font-style: italic;
  margin-bottom: 1rem;
}

.btn-primary {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background: #4a7fc1;
  color: white !important;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  transition: background 0.2s, transform 0.1s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-primary:hover {
  background: #3a6fa1;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}

.box-arrow {
  font-size: 0.9rem;
  color: #4a7fc1;
  text-decoration: none;
  font-weight: bold;
}

.box-body {
  flex: 1;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  overflow: visible;
  min-height: 0;
}

/* Charts */
.chart-wrapper {
  position: relative;
  width: 100%;
  height: 250px;
  flex-shrink: 0;
}

#energyChart, #solarChart {
  width: 100% !important;
  height: 250px !important;
}

.chart-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #666;
  background: #f9f9f9;
  border-radius: 8px;
  margin: 0.5rem;
}

.chart-placeholder p {
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
  font-weight: 500;
}

.link-btn {
  color: #fff;
  background: #d1670e;
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 600;
}

.link-btn:hover {
  background: #b8590c;
}

/* ============================================
   COST ANALYSIS BOX - CARD STYLE
   ============================================ */
.rate-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.25rem;
}

.savings-card {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 12px;
  padding: 2rem 1.5rem;
  text-align: center;
  border: 7px outset rgba(100, 100, 100, 0.6);
}

.card-amount {
  font-size: 3.5rem;
  font-weight: 800;
  color: #2d8f4e;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.card-subtitle {
  font-size: 1.1rem;
  color: #444;
  font-weight: 500;
  margin-bottom: 0.4rem;
}

.card-meta {
  font-size: 1rem;
  color: #16a34a;
  font-weight: 600;
}

.rate-stats {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
}

.rate-stat {
  text-align: center;
}

.stat-num {
  display: block;
  font-size: 2.25rem;
  font-weight: 700;
  color: #333;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.8rem;
  color: #666;
  font-weight: 500;
}

.stat-divider {
  font-size: 2rem;
  color: #ddd;
  font-weight: 300;
}

.more-link-bottom {
  text-align: center;
  font-size: 0.9rem;
  color: #4a7fc1;
  text-decoration: none;
  font-weight: 500;
}

.more-link-bottom:hover {
  text-decoration: underline;
}

/* ============================================
   SOLAR BOX
   ============================================ */
.solar-chart-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.solar-chart-container canvas {
  width: 100% !important;
  height: 230px !important;
  flex-shrink: 0;
}

.solar-legend {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.35rem;
  font-size: 0.55rem;
  color: #666;
  flex-shrink: 0;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.legend-dot.green { background: #5cb85c; }
.legend-dot.yellow { background: #f0ad4e; }

/* ============================================
   CREDIT ANALYSIS BOX
   ============================================ */
.nem-box {
  padding: 0.6rem 0.5rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.credit-hbar-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  width: 100%;
  flex: 1;
  box-sizing: border-box;
}

.credit-hbar-section {
  min-width: 0;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.hbar-period-header {
  font-size: 0.58rem;
  font-weight: 700;
  color: #333;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 0.15rem;
}

.hbar-period-date {
  font-size: 0.52rem;
  color: #6c757d;
  margin-bottom: 0.4rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid #e9ecef;
}

/* Chart with X and Y Axes */
.chart-with-axes {
  display: flex;
  flex-direction: column;
  width: 100%;
  flex: 1;
  box-sizing: border-box;
}

.chart-body {
  display: flex;
  gap: 0.3rem;
  margin-bottom: 0.3rem;
  width: 100%;
  flex: 1;
  box-sizing: border-box;
}

.y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  min-width: 50px;
  max-width: 50px;
  padding-right: 0.3rem;
  box-sizing: border-box;
  flex-shrink: 0;
}

.y-label {
  font-size: 0.6rem;
  color: #495057;
  font-weight: 500;
  text-align: right;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.chart-area {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  border-left: 2px solid #495057;
  border-bottom: 2px solid #495057;
  padding: 0.5rem 2rem 0.5rem 0.5rem;
  background: #fafafa;
  box-sizing: border-box;
}

.grid-lines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.grid-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: #dee2e6;
}

.grid-line:first-child {
  background: #495057;
  width: 2px;
}

.bar-wrapper {
  height: 40px;
  display: flex;
  align-items: center;
  position: relative;
  width: 100%;
}

.hbar {
  height: 32px;
  transition: width 0.3s ease;
  min-width: 30px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 0.3rem;
  border-radius: 3px;
}

.hbar-red {
  background: linear-gradient(90deg, #dc3545, #c82333);
}

.hbar-orange {
  background: linear-gradient(90deg, #fd7e14, #e66a00);
}

.hbar-green {
  background: linear-gradient(90deg, #28a745, #218838);
}

.bar-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.x-axis {
  position: relative;
  height: 16px;
  margin-left: calc(50px + 0.3rem + 2px + 0.3rem);
  width: calc(100% - 50px - 0.3rem - 2px - 0.3rem);
  padding-right: 2rem;
  box-sizing: border-box;
}

.x-tick {
  position: absolute;
  font-size: 0.58rem;
  color: #6c757d;
  font-weight: 500;
  transform: translateX(-50%);
  top: 1px;
}

.x-tick:first-child {
  transform: translateX(0);
}

.x-tick:last-child {
  transform: translateX(-100%);
}

.x-axis-label {
  text-align: center;
  font-size: 0.6rem;
  color: #495057;
  font-weight: 600;
  margin-top: 0.3rem;
  margin-left: calc(50px + 0.3rem + 2px + 0.3rem);
}

@media (max-width: 768px) {
  .credit-hbar-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

@media (max-width: 768px) {
  .credit-stats-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   FOOTER - FULL WIDTH
   ============================================ */
.footer {
  background: rgba(0, 0, 0, 0.4);
  padding: 0.75rem 1rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  margin-top: auto;
  width: 100%;
}

.footer-container {
  text-align: center;
  color: rgba(255,255,255,0.8);
  font-size: 0.75rem;
}

.footer-links {
  margin-top: 0.15rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.footer-links a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 0.7rem;
}

.footer-links a:hover {
  color: #fff;
}

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

/* Large screens - bigger boxes and spacing */
@media (min-width: 1600px) {
  .four-box-grid {
    gap: 2.5rem;
    padding: 0 4rem;
    margin-top: 2rem;
  }
  
  .box-widget {
    min-height: 420px;
  }
  
  .page-header {
    padding: 2.5rem 0 4.5rem 0;
  }
}

/* Tablet/Small laptop - stack to single column */
@media (max-width: 1024px) {
  .four-box-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    gap: 1rem;
    padding: 0 1.5rem;
  }
  
  .main-content {
    height: auto;
    overflow: visible;
  }
  
  .box-widget {
    min-height: 200px;
  }
  
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s;
  }
  
  .sidebar-open .sidebar {
    transform: translateX(0);
  }
  
  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
  }
  
  .sidebar-open .sidebar-overlay {
    opacity: 1;
    visibility: visible;
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .page-title {
    font-size: 1.5rem;
  }
  
  .rate-main {
    flex-direction: column;
    text-align: center;
  }
}


/* Data Analysis specific styles */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.metric-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  transition: transform 0.2s, box-shadow 0.2s;
  border: 3px solid #e0e0e0;
}

.metric-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.metric-icon {
  font-size: 2.5rem;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  margin-right: 1rem;
  flex-shrink: 0;
}

.metric-icon.import {
  background: linear-gradient(135deg, #4a7fc1, #3a6fa1);
}

.metric-icon.export {
  background: linear-gradient(135deg, #5cb85c, #449d44);
}

.metric-icon.net.positive {
  background: linear-gradient(135deg, #5cb85c, #449d44);
}

.metric-icon.net.negative {
  background: linear-gradient(135deg, #f0ad4e, #ec971f);
}

.metric-icon.savings {
  background: linear-gradient(135deg, #5cb85c, #2e7d32);
}

.metric-content {
  flex: 1;
}

.metric-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #333;
  line-height: 1.2;
}

.metric-label {
  font-size: 0.9rem;
  color: #666;
  margin-top: 0.3rem;
  font-weight: 500;
}

.metric-sublabel {
  font-size: 0.75rem;
  color: #999;
  margin-top: 0.2rem;
}

.charts-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.chart-container {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  border: 4px solid #94a3b8;
}

.chart-title {
  font-size: 1.2rem;
  color: #333;
  margin-bottom: 1rem;
  font-weight: 600;
}

.chart-wrapper {
  position: relative;
  height: 300px;
  margin-bottom: 1rem;
}

.chart-legend {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-top: 0.5rem;
  border-top: 1px solid #eee;
  font-size: 0.85rem;
}

.legend-item {
  display: flex;
  align-items: center;
  color: #666;
}

.legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  margin-right: 0.4rem;
}

.chart-info {
  text-align: center;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #eee;
}

.chart-info small {
  color: #999;
  font-size: 0.75rem;
}

.section-title {
  font-size: 1.3rem;
  color: #333;
  margin-bottom: 1rem;
  font-weight: 600;
}

.insights-section {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  border: 4px solid #94a3b8;
}

.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.insight-card {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  padding: 1rem;
  border-radius: 8px;
  display: flex;
  align-items: flex-start;
  border-left: 4px solid #ff8c42;
}

.insight-bullet {
  color: #ff8c42;
  font-size: 1.5rem;
  margin-right: 0.75rem;
  line-height: 1;
}

.insight-text {
  color: #333;
  font-size: 0.9rem;
  line-height: 1.4;
}

.table-section {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  border: 4px solid #94a3b8;
  margin-bottom: 2rem;
}

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

.btn-export {
  padding: 0.6rem 1.2rem;
  background: #5cb85c;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
  box-shadow: 0 3px 8px rgba(92, 184, 92, 0.3);
}

.btn-export:hover {
  background: #449d44;
}

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

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table thead {
  background: linear-gradient(135deg, #4a7fc1, #3a6fa1);
  color: white;
}

.data-table th {
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}

.data-table tbody tr {
  border-bottom: 1px solid #e0e0e0;
  transition: background 0.2s;
}

.data-table tbody tr:hover {
  background: #f8f9fa;
}

.data-table td {
  padding: 0.75rem;
  color: #333;
}

.period-cell {
  font-weight: 500;
  color: #4a7fc1;
  white-space: nowrap;
}

.net-positive {
  color: #5cb85c;
  font-weight: 600;
}

.net-negative {
  color: #f0ad4e;
  font-weight: 600;
}

.savings-cell {
  color: #5cb85c;
  font-weight: 600;
}

.data-table tfoot {
  background: #f8f9fa;
  border-top: 2px solid #333;
}

.totals-row td {
  padding: 1rem 0.75rem;
  font-size: 0.95rem;
}

/* Data Analysis Page Specific Overrides */
.data-analysis-card {
  height: auto !important;
  min-height: auto !important;
  width: 100% !important;
}
