/* ============================================================
   CLA Tech — "Living Grid" design tokens (CLADemo)
   ALIGNED 1:1 with the live site design system in
   CLATech.Presentation/wwwroot/app.css (v1.0.0).
   Demo-only additions are clearly marked at the bottom.

   Usage in CLATech.Demo: <link href="css/design-tokens.css" rel="stylesheet" />
   ============================================================ */

:root {
  /* ── Brand colors — identical to CLATech app.css ───────────── */
  --color-primary-dark:    #0F172A;
  --color-primary-darker:  #0a0f1c;
  --color-accent-blue:     #0EA5E9;
  --color-accent-blue-dark:#0284C7;
  --color-accent-blue-light:#38BDF8;
  --color-accent-green:    #10B981;
  --color-accent-green-dark:#059669;
  --color-bg:              #F8FAFC;
  --color-surface:         #FFFFFF;
  --color-text:            #0F172A;
  --color-text-muted:      #64748B;
  --color-text-light:      #94A3B8;
  --color-border:          #E2E8F0;
  --color-border-light:    #F1F5F9;
  --color-danger:          #EF4444;
  --color-danger-dark:     #DC2626;
  --color-warning:         #F59E0B;
  --color-warning-dark:    #D97706;

  /* ── Typography — identical to CLATech app.css ─────────────── */
  --font-family: 'Inter', 'Kanit', system-ui, -apple-system, sans-serif;
  --font-thai:   'Kanit', 'Inter', sans-serif;
  --font-mono:   ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  --font-size-base: 0.9375rem;
  --line-height: 1.6;
  --line-height-tight: 1.2;

  /* ── Radius / shadow — match CLATech scale (subset) ────────── */
  --radius-sm: 0.375rem; --radius-md: 0.5rem; --radius-lg: 0.75rem; --radius-xl: 1rem;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -1px rgba(0,0,0,.04);
  --shadow-glow-blue: 0 0 20px rgba(14,165,233,.3);

  /* ============================================================
     DEMO-ONLY EXTENSIONS (not present on the website)
     The dashboard needs status + chart-series semantics and a
     dark "control-room" surface. Built from the brand palette.
     ============================================================ */

  /* Status */
  --color-success: var(--color-accent-green);  /* online / healthy / generating */
  --color-info:    var(--color-accent-blue);

  /* Light theme aliases used by demo components */
  --bg:            var(--color-bg);
  --surface:       var(--color-surface);
  --surface-alt:   var(--color-border-light);
  --text:          var(--color-text);
  --text-muted:    var(--color-text-muted);
  --border:        var(--color-border);
  --primary:       var(--color-accent-blue);
  --primary-hover: var(--color-accent-blue-dark);
  --on-primary:    #FFFFFF;

  /* Dark control-room surfaces (values observed in the live site) */
  --surface-dark:   #162032;
  --surface-dark-2: #1e293b;

  /* Chart series — energy semantics */
  --chart-consumption: var(--color-accent-blue);   /* load / baseline */
  --chart-generation:  var(--color-warning);        /* solar output (amber) */
  --chart-storage:     var(--color-accent-green);   /* battery / BESS */
  --chart-grid:        var(--color-text-muted);      /* grid import */

  /* Optional gradients for hero/marketing surfaces */
  --grad-grid:   linear-gradient(135deg, #0F172A 0%, #162032 60%, #0284C7 100%);
  --grad-energy: linear-gradient(135deg, #10B981 0%, #0EA5E9 100%);
}

/* ── Dark "control-room" mode (demo) ───────────────────────── */
[data-theme="dark"] {
  --bg:          var(--color-primary-dark);
  --surface:     var(--surface-dark);
  --surface-alt: var(--surface-dark-2);
  --text:        #F8FAFC;
  --text-muted:  #94A3B8;
  --border:      #1e293b;
  --primary:       var(--color-accent-blue);
  --primary-hover: var(--color-accent-blue-light);
  --on-primary:    #0F172A;
}

/* ── Base helpers (optional) ───────────────────────────────── */
body { background: var(--bg); color: var(--text); font-family: var(--font-family); line-height: var(--line-height); }
h1,h2,h3,h4 { font-family: var(--font-family); font-weight: 600; line-height: var(--line-height-tight); color: var(--text); }
a { color: var(--primary); }
code, .mono { font-family: var(--font-mono); }
.btn-primary { background: var(--primary); color: var(--on-primary); border: 0; border-radius: var(--radius-sm); padding: .5rem 1rem; }
.btn-primary:hover { background: var(--primary-hover); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.status-online  { color: var(--color-success); }
.status-warning { color: var(--color-warning); }
.status-fault   { color: var(--color-danger); }
