:root {
       --page-bg: #f4f4f4;
       --panel-bg: #ffffff;
       --card-bg: #fdfdfd;
       --text-main: #111;
       --text-muted: #555;
       --border-main: #ccc;
    }

    body.dark-theme {
       --page-bg: #111;
       --panel-bg: #181818;
       --card-bg: #222;
       --text-main: #eee;
       --text-muted: #aaa;
       --border-main: #333;
    }
	
	body {
      font-family: Arial, sans-serif;
      background: var(--page-bg);
      color: var(--text-main);
      margin: 20px;
    }

    h1 {
      margin-bottom: 5px;
    }

    .updated {
      color: var(--text-muted);
      margin-bottom: 20px;
    }

    .cards {
      display: flex;
      flex-wrap: wrap;
      gap: 15px;
      margin-bottom: 25px;
      align-items: stretch;
    }

    .card {
      background: var(--card-bg);
      border-radius: 10px;
      padding: 15px;
      min-width: 150px;
      min-width: 120px;
      box-shadow: 0 0 8px rgba(0,0,0,0.4);
      transition: all 0.25s ease;
    }
    .card-green {
      border: 1px solid #00cc66;
      box-shadow: 0 0 10px rgba(0, 255, 120, 0.35);
    }

    .card-red {
      border: 1px solid #ff6633;
      box-shadow: 0 0 10px rgba(255, 80, 50, 0.35);
    }

    .card-amber {
      border: 1px solid #ffcc00;
      box-shadow: 0 0 10px rgba(255, 200, 0, 0.35);
    }

    .card-cost {
      border: 1px solid #2e8b57;
      box-shadow: 0 0 12px rgba(46,139,87,0.45);
    }

    .label {
      color: var(--text-muted);
      font-size: 14px;
    }

    .value {
      font-size: 28px;
      font-weight: bold;
      margin-top: 5px;
    }


    .stats-section {
      border: 1px solid var(--border-main);
      border-radius: 10px;
      padding: 12px;
      margin-bottom: 20px;
      background: var(--panel-bg);
    }

    .stats-title {
      text-align: center;
      font-size: 20px;
      font-weight: bold;
      color: var(--text-main);
      margin-bottom: 12px;
      letter-spacing: 1px;
#     text-transform: uppercase;
    }

    .card:hover {
      transform: translateY(-2px);
      box-shadow: 0 0 14px rgba(255,255,255,0.08);
    }

    .stats-divider {
      width: 1px;
      background: rgba(255,255,255,0.12);
      margin: 0 14px;
      align-self: stretch;
      box-shadow: 0 0 6px rgba(255,255,255,0.08);
    }

    #chart {
      height: 500px;
      background: var(--panel-bg);
      border-radius: 10px;
      padding: 10px;
      border: 1px solid var(--border-main);
    }

    #gridChart {
      height: 300px;
      background: var(--panel-bg);
      border-radius: 10px;
      padding: 10px;
      border: 1px solid var(--border-main);
    }

    .top-row {
      display: block;
      margin-bottom: 10px;
    }

    .powerflow-header {
      float: right;
      width: 360px;
      background: var(--card-bg);
      border-radius: 10px;
      padding: 10px;
      border: 1px solid rgba(255,255,255,0.12);
      margin-left: 20px;
      margin-bottom: 10px;
    }


    .pvlocal-header {
      flex: 1;
    }

    .powerflow-title {
      text-align: center;
      font-size: 20px;
      font-weight: bold;
      color: var(--text-main);
      margin-bottom: 8px;
      letter-spacing: 1px;
    }

    .powerflow-frame {
      display: block;
      width: 600px;
      height: 445px;
      border: 0;
    }

    #powerflow-container {
      width: 400px;
      height: 260px;
      overflow: hidden;
    }

    .powerflow-display {
      position: relative;
      width: 600px;
      max-width: 600px;
      background: var(--card-bg);
      overflow: hidden;
      transform: scale(0.60);
      transform-origin: top left;
    }
