/* ===========================================================
 * 01-dashboard.css — APPEND to your style.css
 * Dark premium dashboard variant. Scoped via .dash-root-host
 * which is added to #pageRoot when dashboardPage.render() runs.
 * =========================================================== */

/* Re-paint shell to dark when dashboard is active.
   We override app-shell + header + bottom-nav from the inside. */
body:has(#pageRoot.dash-root-host) {
  background: #0A1812;
}
body:has(#pageRoot.dash-root-host) .app-shell {
  background:
    radial-gradient(60% 40% at 80% -10%, rgba(52,211,153,0.28) 0%, transparent 60%),
    radial-gradient(50% 35% at 10% 12%, rgba(167,139,250,0.18) 0%, transparent 70%),
    radial-gradient(70% 50% at 50% 110%, rgba(251,191,36,0.10) 0%, transparent 60%),
    #0A1812;
  color: #fff;
}
body:has(#pageRoot.dash-root-host) .app-header { background: transparent; }
body:has(#pageRoot.dash-root-host) .app-title { color: #fff; }
body:has(#pageRoot.dash-root-host) .app-subtitle { color: rgba(255,255,255,0.5); }
body:has(#pageRoot.dash-root-host) .status-pill {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
}
body:has(#pageRoot.dash-root-host) .bottom-nav-inner {
  background: rgba(15,28,22,0.85);
  border-color: rgba(255,255,255,0.06);
  box-shadow: 0 10px 32px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.05);
}
body:has(#pageRoot.dash-root-host) .tab { color: rgba(255,255,255,0.42); }
body:has(#pageRoot.dash-root-host) .tab.is-active {
  background: linear-gradient(180deg, rgba(52,211,153,0.18), rgba(52,211,153,0.06));
  color: #6EE7B7;
}

#pageRoot.dash-root-host { padding: 12px 20px 24px; }

/* ---------- Hero ---------- */
.dash-hero-new {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 4px 0 14px;
}
.dash-hero-new-body { flex: 1; min-width: 0; }
.dash-hero-new-eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.14em;
  color: rgba(167,243,208,0.85);
  margin-bottom: 8px;
}
.dash-hero-new-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #34D399;
  box-shadow: 0 0 12px rgba(52,211,153,0.7);
}
.dash-hero-new-title {
  font-size: 28px; font-weight: 800; letter-spacing: -0.02em;
  margin: 0 0 4px; line-height: 1.05;
  background: linear-gradient(180deg, #FFFFFF 0%, #D1FAE5 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.dash-hero-new-sub {
  font-size: 12.5px; margin: 0;
  color: rgba(255,255,255,0.55);
}
.dash-hero-new-sub strong { color: #34D399; font-weight: 700; }
.dash-hero-new-btn {
  width: 44px; height: 44px; flex-shrink: 0;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  color: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  display: inline-flex; align-items: center; justify-content: center;
}
.dash-hero-new-btn svg { width: 20px; height: 20px; }

/* ---------- GP banner ---------- */
.dash-gp-banner-new {
  width: 100%; text-align: left;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(16,185,129,0.16) 0%, rgba(16,185,129,0.04) 100%);
  border: 1px solid rgba(52,211,153,0.18);
  border-radius: 20px;
  margin-bottom: 18px;
  position: relative; overflow: hidden;
  color: #fff;
}
.dash-gp-banner-new::after {
  content: ""; position: absolute; right: -20px; top: -20px;
  width: 140px; height: 140px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(52,211,153,0.18), transparent 70%);
  pointer-events: none;
}
.dash-gp-ring-new {
  width: 58px; height: 58px; position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.dash-gp-ring-new-num {
  position: absolute; inset: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: "Inter", sans-serif;
  font-size: 18px; font-weight: 800; letter-spacing: -0.02em;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.dash-gp-ring-new-num span { font-size: 10px; opacity: 0.7; margin-left: 1px; }
.dash-gp-body-new { flex: 1; min-width: 0; }
.dash-gp-label-new { font-size: 12px; color: rgba(255,255,255,0.6); margin-bottom: 6px; font-weight: 500; }
.dash-gp-meta-new { display: flex; flex-wrap: wrap; gap: 6px; }
.dash-gp-chip {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.dash-gp-chip.is-good { background: rgba(52,211,153,0.16); color: #6EE7B7; }
.dash-gp-chip.is-warn { background: rgba(251,191,36,0.16); color: #FCD34D; }
.dash-gp-banner-new > svg { width: 18px; height: 18px; color: rgba(255,255,255,0.4); flex-shrink: 0; }

/* ---------- 4 stat cards ---------- */
.dash-stat-grid-new {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-bottom: 22px;
}
.dash-stat-new {
  position: relative; overflow: hidden;
  text-align: left; border: 0; cursor: pointer;
  padding: 14px 14px 13px;
  border-radius: 22px;
  min-height: 128px;
  display: flex; flex-direction: column;
  color: #fff;
}
.dash-stat-new-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 16px;
}
.dash-stat-new-icon {
  width: 38px; height: 38px; border-radius: 12px;
  background: rgba(0,0,0,0.22);
  backdrop-filter: blur(8px);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
}
.dash-stat-new-icon svg { width: 20px; height: 20px; }
.dash-stat-new-value {
  font-family: "Inter", "IBM Plex Sans Thai", sans-serif;
  font-size: 38px; font-weight: 800; line-height: 1;
  letter-spacing: -0.03em;
  color: rgba(255,255,255,0.96);
  text-shadow: 0 2px 12px rgba(0,0,0,0.25);
}
.dash-stat-new-label {
  font-size: 14.5px; font-weight: 700; letter-spacing: -0.005em;
  color: #fff; margin-bottom: 2px;
}
.dash-stat-new-sub {
  font-size: 11px; font-weight: 500;
  color: rgba(255,255,255,0.66);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dash-stat-new-shine {
  position: absolute; top: -40%; left: -20%;
  width: 80%; height: 60%;
  background: radial-gradient(closest-side, rgba(255,255,255,0.18), transparent 70%);
  pointer-events: none;
}
.dash-stat-new--emerald { background: linear-gradient(135deg, #065F46 0%, #047857 55%, #10B981 100%); box-shadow: 0 10px 30px rgba(6,95,70,0.36), inset 0 1px 0 rgba(255,255,255,0.12); }
.dash-stat-new--amber   { background: linear-gradient(135deg, #7C2D12 0%, #9A3412 50%, #F59E0B 110%); box-shadow: 0 10px 30px rgba(124,45,18,0.36), inset 0 1px 0 rgba(255,255,255,0.12); }
.dash-stat-new--rose    { background: linear-gradient(135deg, #831843 0%, #9D174D 50%, #EC4899 110%); box-shadow: 0 10px 30px rgba(131,24,67,0.36), inset 0 1px 0 rgba(255,255,255,0.12); }
.dash-stat-new--violet  { background: linear-gradient(135deg, #4C1D95 0%, #5B21B6 50%, #8B5CF6 110%); box-shadow: 0 10px 30px rgba(76,29,149,0.36), inset 0 1px 0 rgba(255,255,255,0.12); }

/* ---------- Section heading (dark) ---------- */
#pageRoot.dash-root-host .dash-section-h {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin: 0 4px 12px;
}
#pageRoot.dash-root-host .dash-section-h h2 {
  font-size: 15.5px; font-weight: 700; margin: 0;
  letter-spacing: -0.01em; color: #fff;
}
#pageRoot.dash-root-host .dash-section-h p {
  font-size: 11.5px; margin: 2px 0 0;
  color: rgba(255,255,255,0.45);
}
#pageRoot.dash-root-host .dash-section-link {
  background: transparent; border: 0; color: #6EE7B7;
  font-size: 12px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 2px;
  padding: 4px 8px; border-radius: 8px;
}
#pageRoot.dash-root-host .dash-section-link svg { width: 12px; height: 12px; }

/* ---------- Market card ---------- */
.dash-mkt-card {
  width: 100%; text-align: left; border: 0; cursor: pointer;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 14px;
  margin-bottom: 22px;
  backdrop-filter: blur(14px);
}
.dash-mkt-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px;
}
.dash-mkt-tile { padding: 6px 0; }
.dash-mkt-tile-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 4px;
}
.dash-mkt-tile-name { font-size: 12.5px; font-weight: 700; color: rgba(255,255,255,0.85); }
.dash-mkt-tile-delta {
  font-size: 10.5px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 1px 6px; border-radius: 999px;
}
.dash-mkt-tile-delta.is-up   { color: #6EE7B7; background: rgba(52,211,153,0.12); }
.dash-mkt-tile-delta.is-down { color: #FCA5A5; background: rgba(248,113,113,0.12); }
.dash-mkt-tile-row {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 4px;
}
.dash-mkt-tile-price { display: flex; align-items: baseline; gap: 4px; }
.dash-mkt-tile-num {
  font-family: "Inter", sans-serif;
  font-size: 22px; font-weight: 800;
  color: #fff; letter-spacing: -0.02em;
  line-height: 1;
}
.dash-mkt-tile-unit { font-size: 10.5px; color: rgba(255,255,255,0.4); font-weight: 500; }
.dash-mkt-tile-spark { flex-shrink: 0; }

/* ---------- Quick actions ---------- */
.dash-qa-grid-new {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-bottom: 18px;
}
.dash-qa-new {
  position: relative; overflow: hidden;
  text-align: left; border: 0; cursor: pointer;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
  color: #fff;
  backdrop-filter: blur(10px);
  min-height: 58px;
}
.dash-qa-new-icon {
  width: 34px; height: 34px; border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.dash-qa-new-icon svg { width: 18px; height: 18px; }
.dash-qa-new--emerald .dash-qa-new-icon { background: rgba(52,211,153,0.16); color: #6EE7B7; }
.dash-qa-new--amber   .dash-qa-new-icon { background: rgba(251,191,36,0.16); color: #FCD34D; }
.dash-qa-new--rose    .dash-qa-new-icon { background: rgba(244,114,182,0.16); color: #F9A8D4; }
.dash-qa-new--violet  .dash-qa-new-icon { background: rgba(139,92,246,0.16); color: #C4B5FD; }
.dash-qa-new > span {
  font-size: 13px; font-weight: 600; flex: 1;
  color: rgba(255,255,255,0.92);
}
.dash-qa-new-plus {
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: inline-flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.6);
}
.dash-qa-new-plus svg { width: 11px; height: 11px; }

/* ---------- Insight callout ---------- */
.dash-insight-new {
  width: 100%; text-align: left; border: 0; cursor: pointer;
  display: flex; align-items: center; gap: 12px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(251,191,36,0.10) 0%, rgba(248,113,113,0.06) 100%);
  border: 1px solid rgba(251,191,36,0.18);
  border-radius: 16px;
  color: #fff;
}
.dash-insight-new-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, #F59E0B, #DC2626);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(245,158,11,0.36);
}
.dash-insight-new-icon svg { width: 20px; height: 20px; }
.dash-insight-new-body { flex: 1; min-width: 0; }
.dash-insight-new-title {
  font-size: 13.5px; font-weight: 700; color: #FCD34D;
  letter-spacing: -0.005em;
}
.dash-insight-new-desc {
  font-size: 11.5px; color: rgba(255,255,255,0.66);
  margin-top: 2px; line-height: 1.4;
}
.dash-insight-new-desc strong { color: #fff; font-weight: 700; }
.dash-insight-new > svg { width: 16px; height: 16px; color: rgba(255,255,255,0.4); flex-shrink: 0; }

/* ---------- Banner (sample-mode) on dark ---------- */
#pageRoot.dash-root-host .banner-warn {
  background: rgba(245,158,11,0.16);
  color: #FCD34D;
}
