/* =========================================================
   VELAEA Customer Dashboard Overview Redesign
   Scope: dashboard.html only. Sidebar/topbar template remains original.
========================================================= */

.dashboard-overview-content{
  position:relative;
  padding:28px;
  display:grid;
  gap:22px;
  min-width:0;
  overflow-x:hidden;
  isolation:isolate;
}
.dashboard-overview-content::before{
  content:"";
  position:fixed;
  inset:72px 0 0 250px;
  pointer-events:none;
  z-index:-1;
  background:
    radial-gradient(circle at 24% 8%, rgba(242,199,106,.13), transparent 26%),
    radial-gradient(circle at 86% 18%, rgba(78,165,255,.12), transparent 30%),
    linear-gradient(180deg, rgba(255,255,255,.018), transparent 35%);
}
.dash-overview-hero,
.dash-panel,
.dash-kpi-card,
.dash-menu-card{
  border:1px solid rgba(242,199,106,.16);
  background:
    linear-gradient(145deg, rgba(10,22,37,.96), rgba(4,13,24,.92)),
    radial-gradient(circle at 18% 0, rgba(242,199,106,.12), transparent 34%);
  box-shadow:0 22px 58px rgba(0,0,0,.30);
  backdrop-filter:blur(18px);
}
.dash-overview-hero{
  min-height:240px;
  border-radius:28px;
  padding:34px;
  display:grid;
  grid-template-columns:minmax(0,1fr) 260px;
  gap:26px;
  align-items:center;
  overflow:hidden;
  position:relative;
}
.dash-overview-hero::after{
  content:"";
  position:absolute;
  right:-120px;
  top:-160px;
  width:420px;
  height:420px;
  border-radius:999px;
  background:radial-gradient(circle, rgba(242,199,106,.18), rgba(242,199,106,.035) 45%, transparent 70%);
  pointer-events:none;
}
.dash-kicker,
.dash-panel-kicker{
  margin:0 0 10px;
  color:var(--gold,#f2c76a);
  font-weight:950;
  letter-spacing:.16em;
  font-size:11px;
  text-transform:uppercase;
}
.dash-hero-copy h1{
  margin:0;
  font-size:clamp(32px,4.5vw,56px);
  line-height:1.02;
  font-weight:950;
  letter-spacing:-.055em;
}
.dash-hero-copy h1 span{
  color:#fff;
  text-shadow:0 0 26px rgba(242,199,106,.18);
}
.dash-hero-lead{
  margin:18px 0 0;
  max-width:760px;
  color:#b9c8d9;
  font-size:15px;
  line-height:1.78;
}
.dash-hero-status-row{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:22px;
}
.dash-status-chip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:36px;
  padding:0 14px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.045);
  color:#dfeaf6;
  font-size:12px;
  font-weight:950;
  letter-spacing:.03em;
}
.dash-status-chip.is-gold,
#mt5LiveBadge:not(.offline){
  border-color:rgba(242,199,106,.35);
  background:linear-gradient(135deg, rgba(242,199,106,.22), rgba(242,199,106,.07));
  color:#ffe3a0;
}
#mt5LiveBadge.offline,
#mt5AccountStatus.badge-pending{
  border-color:rgba(255,104,104,.28);
  color:#ffb5b5;
  background:rgba(255,104,104,.08);
}
.dash-hero-orb{
  position:relative;
  display:grid;
  place-items:center;
  min-height:210px;
}
.orb-ring{
  position:absolute;
  width:210px;
  height:210px;
  border-radius:999px;
  border:1px solid rgba(242,199,106,.24);
  background:
    conic-gradient(from 230deg, rgba(242,199,106,.04), rgba(242,199,106,.72), rgba(78,165,255,.22), rgba(242,199,106,.04)),
    radial-gradient(circle, rgba(242,199,106,.12), transparent 58%);
  filter:drop-shadow(0 0 34px rgba(242,199,106,.18));
}
.orb-core{
  position:relative;
  width:154px;
  height:154px;
  border-radius:999px;
  display:grid;
  place-items:center;
  align-content:center;
  text-align:center;
  border:1px solid rgba(255,255,255,.12);
  background:linear-gradient(180deg, rgba(2,8,20,.88), rgba(10,22,37,.96));
  box-shadow:inset 0 0 30px rgba(242,199,106,.08), 0 20px 60px rgba(0,0,0,.28);
}
.orb-core span{font-size:10px;font-weight:950;letter-spacing:.18em;color:#91a4bb}
.orb-core strong{font-size:38px;font-weight:950;color:var(--gold,#f2c76a);line-height:1.1}
.orb-core small{font-size:11px;color:#9fb0c3;font-weight:800}
.dash-kpi-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
}
.dash-kpi-card{
  min-height:124px;
  border-radius:22px;
  padding:18px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  position:relative;
  overflow:hidden;
}
.dash-kpi-card::after{
  content:"";
  position:absolute;
  right:-34px;
  top:-34px;
  width:92px;
  height:92px;
  border-radius:999px;
  background:rgba(242,199,106,.10);
}
.dash-kpi-card.primary{
  background:linear-gradient(145deg, rgba(242,199,106,.22), rgba(9,21,35,.94) 48%, rgba(4,13,24,.96));
  border-color:rgba(242,199,106,.32);
}
.dash-kpi-card.risk{
  border-color:rgba(255,104,104,.18);
}
.dash-kpi-card span{
  position:relative;
  z-index:1;
  color:#91a4bb;
  font-size:12px;
  font-weight:950;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.dash-kpi-card strong{
  position:relative;
  z-index:1;
  display:block;
  margin:12px 0 6px;
  font-size:clamp(22px,2.1vw,34px);
  line-height:1.05;
  color:#fff;
  font-weight:950;
  letter-spacing:-.045em;
}
.dash-kpi-card small{
  position:relative;
  z-index:1;
  color:#8fa3ba;
  font-size:12px;
  font-weight:800;
}
.dash-kpi-card .up,
.dash-kpi-card small.up,
.dash-kpi-card strong.up{color:#74e39a!important}
.dash-kpi-card .down,
.dash-kpi-card small.down,
.dash-kpi-card strong.down{color:#ff8d8d!important}
.dash-chart-layout{
  display:grid;
  grid-template-columns:minmax(0,1.35fr) minmax(300px,.65fr);
  gap:18px;
}
.dash-chart-main{min-height:330px}
.dash-panel{
  border-radius:24px;
  padding:22px;
  min-width:0;
  overflow:hidden;
}
.dash-panel-head{
  display:flex;
  justify-content:space-between;
  gap:16px;
  align-items:flex-start;
  margin-bottom:18px;
}
.dash-panel-head.compact{margin-bottom:12px}
.dash-panel-head h2,
.dash-section-title h2{
  margin:0;
  font-size:20px;
  line-height:1.25;
  font-weight:950;
  letter-spacing:-.035em;
}
.dash-panel-head > span,
.dash-panel-action{
  flex:0 0 auto;
  color:#ffe3a0;
  border:1px solid rgba(242,199,106,.22);
  background:rgba(242,199,106,.06);
  border-radius:999px;
  padding:8px 12px;
  font-size:11px;
  font-weight:950;
}
.dash-panel canvas{
  display:block;
  width:100%;
  max-width:100%;
  border-radius:18px;
  background:linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.015));
}
.dash-intel-grid{
  display:grid;
  grid-template-columns:1.1fr .9fr;
  gap:18px;
}
.dash-insight-list,
.dash-alert-list{display:grid;gap:12px}
.dash-insight-item,
.dash-alert-item{
  display:grid;
  gap:6px;
  padding:14px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:18px;
  background:rgba(255,255,255,.035);
}
.dash-insight-item b,
.dash-alert-item b{font-size:14px;color:#fff;line-height:1.35}
.dash-insight-item span,
.dash-alert-item span{color:#9fb0c3;font-size:12px;font-weight:750;line-height:1.55}
.dash-insight-item small,
.dash-alert-item small{color:#ffe3a0;font-size:11px;font-weight:950;text-transform:uppercase;letter-spacing:.06em}
.dash-empty-state{
  padding:18px;
  border-radius:18px;
  border:1px dashed rgba(242,199,106,.22);
  background:rgba(242,199,106,.04);
  color:#aebed1;
  font-size:13px;
  font-weight:800;
}
.dash-menu-section{
  display:grid;
  gap:18px;
  margin-top:2px;
}
.dash-section-title{
  display:grid;
  gap:4px;
}
.dash-section-title span{
  color:#9fb0c3;
  font-size:14px;
  line-height:1.65;
}
.dash-menu-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
}
.dash-menu-card{
  min-height:132px;
  border-radius:22px;
  padding:18px;
  display:grid;
  align-content:start;
  gap:10px;
  position:relative;
  overflow:hidden;
  transition:transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.dash-menu-card::before{
  content:"";
  width:36px;
  height:4px;
  border-radius:999px;
  background:linear-gradient(90deg, var(--gold,#f2c76a), transparent);
}
.dash-menu-card:hover{
  transform:translateY(-3px);
  border-color:rgba(242,199,106,.36);
  box-shadow:0 24px 70px rgba(0,0,0,.36),0 0 0 1px rgba(242,199,106,.06) inset;
}
.dash-menu-card b{font-size:16px;font-weight:950;color:#fff;line-height:1.25}
.dash-menu-card span{font-size:12.5px;color:#9fb0c3;line-height:1.55;font-weight:750}
.dash-compat-sink{
  position:absolute!important;
  left:-99999px!important;
  top:auto!important;
  width:1px!important;
  height:1px!important;
  overflow:hidden!important;
  opacity:0!important;
  pointer-events:none!important;
}
.dash-overview-footer{
  margin-top:8px;
}

body.light-mode .dashboard-overview-content,
html[data-theme="light"] body .dashboard-overview-content{
  color:#101827;
}
body.light-mode .dashboard-overview-content::before,
html[data-theme="light"] body .dashboard-overview-content::before{
  background:
    radial-gradient(circle at 18% 8%, rgba(201,149,46,.16), transparent 26%),
    radial-gradient(circle at 86% 18%, rgba(32,122,210,.12), transparent 30%),
    linear-gradient(180deg, rgba(201,149,46,.04), transparent 35%);
}
body.light-mode .dash-overview-hero,
body.light-mode .dash-panel,
body.light-mode .dash-kpi-card,
body.light-mode .dash-menu-card,
html[data-theme="light"] body .dash-overview-hero,
html[data-theme="light"] body .dash-panel,
html[data-theme="light"] body .dash-kpi-card,
html[data-theme="light"] body .dash-menu-card{
  background:linear-gradient(145deg, rgba(255,255,255,.98), rgba(248,250,253,.96));
  border-color:rgba(201,149,46,.22);
  box-shadow:0 18px 48px rgba(17,24,39,.10);
}
body.light-mode .dash-hero-copy h1,
body.light-mode .dash-panel-head h2,
body.light-mode .dash-section-title h2,
body.light-mode .dash-kpi-card strong,
body.light-mode .dash-menu-card b,
html[data-theme="light"] body .dash-hero-copy h1,
html[data-theme="light"] body .dash-panel-head h2,
html[data-theme="light"] body .dash-section-title h2,
html[data-theme="light"] body .dash-kpi-card strong,
html[data-theme="light"] body .dash-menu-card b{
  color:#0f172a;
}
body.light-mode .dash-hero-lead,
body.light-mode .dash-section-title span,
body.light-mode .dash-kpi-card span,
body.light-mode .dash-kpi-card small,
body.light-mode .dash-menu-card span,
body.light-mode .dash-insight-item span,
body.light-mode .dash-alert-item span,
html[data-theme="light"] body .dash-hero-lead,
html[data-theme="light"] body .dash-section-title span,
html[data-theme="light"] body .dash-kpi-card span,
html[data-theme="light"] body .dash-kpi-card small,
html[data-theme="light"] body .dash-menu-card span,
html[data-theme="light"] body .dash-insight-item span,
html[data-theme="light"] body .dash-alert-item span{
  color:#526274;
}
body.light-mode .orb-core,
html[data-theme="light"] body .orb-core{
  background:linear-gradient(180deg,#fff,#f6f8fb);
}
body.light-mode .dash-panel canvas,
html[data-theme="light"] body .dash-panel canvas{
  background:linear-gradient(180deg, rgba(201,149,46,.045), rgba(15,23,42,.018));
}
body.light-mode .dash-insight-item,
body.light-mode .dash-alert-item,
html[data-theme="light"] body .dash-insight-item,
html[data-theme="light"] body .dash-alert-item{
  border-color:rgba(15,23,42,.08);
  background:rgba(15,23,42,.025);
}
body.light-mode .dash-insight-item b,
body.light-mode .dash-alert-item b,
html[data-theme="light"] body .dash-insight-item b,
html[data-theme="light"] body .dash-alert-item b{
  color:#0f172a;
}

@media (max-width:1180px){
  .dash-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .dash-chart-layout,
  .dash-intel-grid{grid-template-columns:1fr}
  .dash-menu-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media (max-width:900px){
  .dashboard-overview-content{padding:18px;gap:18px}
  .dashboard-overview-content::before{inset:70px 0 0 0}
  .dash-overview-hero{grid-template-columns:1fr;padding:24px;border-radius:24px}
  .dash-hero-orb{min-height:170px;order:-1}
  .orb-ring{width:170px;height:170px}
  .orb-core{width:128px;height:128px}
  .orb-core strong{font-size:30px}
  .dash-menu-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:640px){
  .dashboard-overview-content{padding:14px 12px 18px;gap:14px}
  .dash-overview-hero{padding:20px;min-height:auto}
  .dash-hero-copy h1{font-size:32px;letter-spacing:-.04em}
  .dash-hero-lead{font-size:13px;line-height:1.65}
  .dash-kpi-grid{grid-template-columns:1fr 1fr;gap:10px}
  .dash-kpi-card{min-height:112px;padding:14px;border-radius:18px}
  .dash-kpi-card span{font-size:10px}
  .dash-kpi-card strong{font-size:21px;word-break:break-word}
  .dash-kpi-card small{font-size:10.5px}
  .dash-panel{padding:14px;border-radius:18px}
  .dash-chart-panel{padding:14px 12px}
  .dash-panel-head{display:grid;gap:8px;margin-bottom:10px}
  .dash-panel-head > span,
  .dash-panel-action{justify-self:start;padding:7px 10px;font-size:10px}
  .dash-panel-kicker{font-size:10px;letter-spacing:.11em}
  .dash-panel-head h2,.dash-section-title h2{font-size:17px}
  .dash-chart-main{min-height:auto}
  .dash-panel canvas{border-radius:14px}
  .dash-chart-panel canvas{height:150px!important;max-height:150px!important}
  .dash-menu-grid{grid-template-columns:1fr;gap:10px}
  .dash-menu-card{min-height:108px;border-radius:18px}
  .dash-status-chip{min-height:32px;font-size:11px;padding:0 11px}
}
@media (max-width:420px){
  .dash-kpi-grid{grid-template-columns:1fr}
  .dash-chart-panel{padding:12px 10px}
  .dash-chart-panel canvas{height:138px!important;max-height:138px!important}
}


/* Mobile Dashboard: keep Monthly Snapshot as a compact summary chart. */
@media (max-width:640px){
  .dash-monthly-panel{
    padding:12px 10px!important;
  }
  .dash-monthly-panel .dash-panel-head{
    margin-bottom:6px!important;
    gap:6px!important;
  }
  .dash-monthly-panel .dash-panel-head h2{
    font-size:15px!important;
    line-height:1.35!important;
  }
  .dash-monthly-panel .dash-panel-head > span{
    padding:5px 8px!important;
    font-size:9.5px!important;
  }
  .dash-monthly-panel canvas{
    height:128px!important;
    max-height:128px!important;
    min-height:0!important;
  }
}
@media (max-width:420px){
  .dash-monthly-panel canvas{
    height:118px!important;
    max-height:118px!important;
  }
}

/* =========================================================
   VELAEA Customer Notification Dropdown
   Scope: dashboard topbar notification button
========================================================= */
.velaea-notification-wrap{
  position:relative;
  display:inline-flex;
  align-items:center;
  z-index:1200;
}
.top-actions .notify{
  position:relative;
  overflow:visible;
}
.top-actions .notify .notify-dot{
  position:absolute;
  right:8px;
  top:7px;
  width:8px;
  height:8px;
  border-radius:999px;
  background:#ff4d5f;
  box-shadow:0 0 0 3px rgba(255,77,95,.18), 0 0 18px rgba(255,77,95,.72);
}
.top-actions .notify .notify-count{
  position:absolute;
  right:-8px;
  top:-8px;
  min-width:20px;
  height:20px;
  padding:0 5px;
  border-radius:999px;
  display:inline-grid;
  place-items:center;
  font-size:10px;
  font-weight:950;
  color:#fff;
  background:linear-gradient(135deg,#ff5e6d,#c8243a);
  border:1px solid rgba(255,255,255,.35);
  box-shadow:0 12px 28px rgba(255,45,73,.24);
}
.top-actions .notify:not(.has-unread) .notify-dot,
.top-actions .notify:not(.has-unread) .notify-count{
  display:none!important;
}
.velaea-notification-panel{
  position:absolute;
  top:calc(100% + 14px);
  right:0;
  width:min(390px, calc(100vw - 28px));
  border:1px solid rgba(242,199,106,.20);
  border-radius:24px;
  background:
    radial-gradient(circle at 12% 0, rgba(242,199,106,.16), transparent 34%),
    linear-gradient(150deg, rgba(10,22,37,.98), rgba(2,8,17,.98));
  box-shadow:0 30px 80px rgba(0,0,0,.48), 0 0 0 1px rgba(255,255,255,.04) inset;
  backdrop-filter:blur(22px);
  padding:14px;
  transform-origin:top right;
  animation:velaeaNotifIn .16s ease-out both;
  z-index:3000;
}
@keyframes velaeaNotifIn{
  from{opacity:0;transform:translateY(-8px) scale(.985)}
  to{opacity:1;transform:translateY(0) scale(1)}
}
.velaea-notification-panel::before{
  content:"";
  position:absolute;
  right:28px;
  top:-7px;
  width:14px;
  height:14px;
  transform:rotate(45deg);
  background:rgba(10,22,37,.98);
  border-left:1px solid rgba(242,199,106,.20);
  border-top:1px solid rgba(242,199,106,.20);
}
.velaea-notification-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  padding:8px 8px 12px;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.velaea-notification-head p{
  margin:0 0 4px;
  color:var(--gold,#f2c76a);
  font-size:10px;
  letter-spacing:.18em;
  font-weight:950;
}
.velaea-notification-head h3{
  margin:0;
  color:#fff;
  font-size:18px;
  font-weight:950;
  letter-spacing:-.02em;
}
.velaea-notification-readall{
  border:1px solid rgba(242,199,106,.25);
  background:rgba(242,199,106,.08);
  color:var(--gold,#f2c76a);
  border-radius:999px;
  padding:8px 12px;
  font-size:11px;
  font-weight:950;
  cursor:pointer;
}
.velaea-notification-readall:hover{
  background:rgba(242,199,106,.16);
  transform:translateY(-1px);
}
.velaea-notification-list{
  display:grid;
  gap:8px;
  max-height:430px;
  overflow:auto;
  padding:12px 2px 6px;
  scrollbar-width:thin;
}
.velaea-notification-item{
  width:100%;
  display:grid;
  grid-template-columns:40px minmax(0,1fr) 10px;
  align-items:flex-start;
  gap:12px;
  text-align:left;
  border:1px solid rgba(255,255,255,.075);
  border-radius:18px;
  background:linear-gradient(145deg, rgba(255,255,255,.065), rgba(255,255,255,.025));
  color:#fff;
  padding:12px;
  cursor:pointer;
  transition:transform .18s ease, border-color .18s ease, background .18s ease;
}
.velaea-notification-item:hover{
  transform:translateY(-1px);
  border-color:rgba(242,199,106,.34);
  background:linear-gradient(145deg, rgba(242,199,106,.105), rgba(255,255,255,.035));
}
.velaea-notification-item.is-read{
  opacity:.72;
}
.velaea-notification-icon{
  width:40px;
  height:40px;
  border-radius:14px;
  display:grid;
  place-items:center;
  color:#111827;
  background:linear-gradient(135deg,#ffe49b,#c9942d);
  box-shadow:0 14px 28px rgba(242,199,106,.16);
  font-size:13px;
  font-weight:950;
  letter-spacing:-.03em;
}
.velaea-notification-item.tone-warning .velaea-notification-icon{background:linear-gradient(135deg,#ffd67b,#d08b1c)}
.velaea-notification-item.tone-danger .velaea-notification-icon{background:linear-gradient(135deg,#ff8a99,#d9354f);color:#fff}
.velaea-notification-item.tone-success .velaea-notification-icon{background:linear-gradient(135deg,#91f5b5,#31b970);color:#062014}
.velaea-notification-copy{
  min-width:0;
  display:grid;
  gap:4px;
}
.velaea-notification-copy b{
  color:#fff;
  font-size:13px;
  line-height:1.25;
  font-weight:950;
}
.velaea-notification-copy em{
  color:#b7c5d8;
  font-size:12px;
  line-height:1.45;
  font-style:normal;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.velaea-notification-copy small{
  color:rgba(242,199,106,.78);
  font-size:10.5px;
  font-weight:850;
}
.velaea-notification-unread{
  width:8px;
  height:8px;
  border-radius:999px;
  background:#ff4d5f;
  box-shadow:0 0 18px rgba(255,77,95,.75);
  margin-top:6px;
}
.velaea-notification-empty{
  min-height:130px;
  display:grid;
  place-items:center;
  gap:8px;
  text-align:center;
  color:#b7c5d8;
  padding:22px;
  border:1px dashed rgba(242,199,106,.22);
  border-radius:18px;
  background:rgba(255,255,255,.025);
}
.velaea-notification-empty strong{
  display:block;
  color:#fff;
  font-size:14px;
}
.velaea-notification-empty span{
  display:block;
  max-width:280px;
  font-size:12px;
  line-height:1.5;
}
.velaea-notification-foot{
  padding:10px 8px 4px;
  color:#8292a8;
  font-size:11px;
  border-top:1px solid rgba(255,255,255,.07);
}
html:not([data-theme="dark"]) .velaea-notification-panel,
body.light-mode .velaea-notification-panel{
  background:
    radial-gradient(circle at 12% 0, rgba(201,148,45,.13), transparent 34%),
    linear-gradient(150deg, rgba(255,255,255,.98), rgba(241,246,255,.98));
  border-color:rgba(174,123,30,.22);
  box-shadow:0 28px 70px rgba(28,42,68,.22);
}
html:not([data-theme="dark"]) .velaea-notification-panel::before,
body.light-mode .velaea-notification-panel::before{
  background:rgba(255,255,255,.98);
}
html:not([data-theme="dark"]) .velaea-notification-head h3,
body.light-mode .velaea-notification-head h3,
html:not([data-theme="dark"]) .velaea-notification-copy b,
body.light-mode .velaea-notification-copy b,
html:not([data-theme="dark"]) .velaea-notification-empty strong,
body.light-mode .velaea-notification-empty strong{
  color:#0f1d2f;
}
html:not([data-theme="dark"]) .velaea-notification-copy em,
body.light-mode .velaea-notification-copy em,
html:not([data-theme="dark"]) .velaea-notification-empty,
body.light-mode .velaea-notification-empty{
  color:#53667f;
}
html:not([data-theme="dark"]) .velaea-notification-item,
body.light-mode .velaea-notification-item{
  background:linear-gradient(145deg, rgba(255,255,255,.88), rgba(241,246,255,.78));
  border-color:rgba(15,29,47,.08);
}
@media (max-width:900px){
  .velaea-notification-panel{
    position:fixed;
    top:72px;
    right:12px;
    left:12px;
    width:auto;
    max-height:calc(100vh - 92px);
  }
  .velaea-notification-list{max-height:calc(100vh - 235px)}
  .velaea-notification-panel::before{display:none}
}
.dash-panel-action-button,
.dash-menu-card-button{
  appearance:none;
  font:inherit;
  text-align:left;
  cursor:pointer;
}
.dash-panel-action-button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.dash-menu-card-button{
  width:100%;
}

/* =========================================================
   Dashboard motion polish: chart entrance + compact GPU-safe rendering
========================================================= */
.dash-chart-panel{
  transform-origin: 50% 64%;
  transition: opacity .45s ease, transform .45s cubic-bezier(.2,.8,.2,1), border-color .45s ease, box-shadow .45s ease;
}
.dash-chart-panel.chart-motion-running{
  box-shadow: 0 18px 48px rgba(0,0,0,.24), 0 0 0 1px rgba(242,199,106,.10) inset;
}
.dash-chart-panel.chart-motion-ready{
  transform: translateY(0);
}
.dash-chart-panel canvas{
  will-change: contents;
}
@media (prefers-reduced-motion: reduce){
  .dash-chart-panel,
  .dash-chart-panel canvas{
    transition:none!important;
    will-change:auto!important;
  }
}

/* Patch 20260710: Dashboard KPI card text fit
   Make summary-card labels/values readable and keep desktop text on one line when possible. */
.dash-kpi-grid{
  gap:12px!important;
}
.dash-kpi-card{
  min-width:0!important;
  padding:16px 17px!important;
  gap:8px!important;
}
.dash-kpi-card span,
.dash-kpi-card strong,
.dash-kpi-card small{
  max-width:100%!important;
  white-space:nowrap!important;
  overflow:visible!important;
  text-overflow:clip!important;
  line-height:1.05!important;
}
.dash-kpi-card span{
  font-size:clamp(10px,.72vw,12px)!important;
  letter-spacing:.045em!important;
}
.dash-kpi-card strong{
  margin:9px 0 4px!important;
  font-size:clamp(25px,1.82vw,32px)!important;
  font-variant-numeric:tabular-nums!important;
  letter-spacing:-.055em!important;
}
.dash-kpi-card small{
  font-size:clamp(10.5px,.72vw,12px)!important;
  font-weight:850!important;
}
@media(max-width:1180px){
  .dash-kpi-card span,
  .dash-kpi-card strong,
  .dash-kpi-card small{
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
  .dash-kpi-card strong{font-size:clamp(23px,3vw,30px)!important}
}
@media(max-width:640px){
  .dash-kpi-card{padding:13px!important}
  .dash-kpi-card strong{font-size:21px!important;letter-spacing:-.04em!important}
  .dash-kpi-card small{font-size:10px!important}
}


/* =========================================================
   VELAEA Dashboard Hero Quick Actions
   Adds polished shortcuts inside the top dashboard hero card.
========================================================= */
.dash-hero-side-stack{
  position:relative;
  z-index:2;
  display:grid;
  grid-template-rows:auto minmax(150px,1fr);
  gap:16px;
  align-self:stretch;
  min-width:0;
}
.dash-hero-quick-actions{
  position:relative;
  display:grid;
  gap:9px;
  padding:12px;
  border:1px solid rgba(242,199,106,.22);
  border-radius:22px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.075), rgba(255,255,255,.025)),
    radial-gradient(circle at 100% 0, rgba(242,199,106,.18), transparent 44%);
  box-shadow:0 18px 42px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.08);
  overflow:hidden;
}
.dash-hero-quick-actions::before{
  content:"";
  position:absolute;
  inset:-1px;
  background:linear-gradient(110deg, transparent 0%, rgba(255,255,255,.10) 42%, transparent 58%);
  transform:translateX(-115%);
  animation:dashQuickSweep 5.5s ease-in-out infinite;
  pointer-events:none;
}
@keyframes dashQuickSweep{0%,62%{transform:translateX(-115%)}82%,100%{transform:translateX(115%)}}
.dash-quick-kicker{
  position:relative;
  z-index:1;
  display:inline-flex;
  width:max-content;
  align-items:center;
  gap:6px;
  color:#ffe2a3;
  font-size:10px;
  font-weight:950;
  letter-spacing:.16em;
}
.dash-quick-kicker::before{
  content:"";
  width:7px;
  height:7px;
  border-radius:999px;
  background:#74e39a;
  box-shadow:0 0 14px rgba(116,227,154,.65);
}
.dash-quick-action{
  position:relative;
  z-index:1;
  display:grid;
  grid-template-columns:minmax(0,1fr) 20px;
  align-items:center;
  gap:10px;
  min-height:58px;
  padding:10px 10px 10px 14px;
  border:1px solid rgba(255,255,255,.11);
  border-radius:17px;
  color:#ffffff;
  text-decoration:none;
  background:linear-gradient(135deg, rgba(6,16,30,.84), rgba(16,34,54,.66));
  transition:transform .22s ease, border-color .22s ease, background .22s ease, box-shadow .22s ease;
}
.dash-quick-action:hover,
.dash-quick-action:focus-visible{
  transform:translateY(-2px);
  border-color:rgba(242,199,106,.42);
  background:linear-gradient(135deg, rgba(242,199,106,.18), rgba(12,30,50,.78));
  box-shadow:0 16px 34px rgba(0,0,0,.28), 0 0 0 1px rgba(242,199,106,.08);
  outline:none;
}
.dash-quick-icon{
  display:grid;
  place-items:center;
  width:34px;
  height:34px;
  border-radius:13px;
  color:#08111d;
  font-weight:950;
  background:linear-gradient(135deg, #ffe08c, #d79b25);
  box-shadow:0 10px 22px rgba(242,199,106,.18);
}
.dash-quick-action.is-backtest .dash-quick-icon{
  color:#eaf3ff;
  background:linear-gradient(135deg, rgba(91,171,255,.95), rgba(107,87,255,.72));
  box-shadow:0 10px 22px rgba(91,171,255,.20);
}
.dash-quick-copy{min-width:0;display:grid;gap:2px}
.dash-quick-copy strong{
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  font-size:13px;
  line-height:1.15;
  font-weight:950;
  letter-spacing:-.02em;
}
.dash-quick-copy small{
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  color:#9fb0c3;
  font-size:10.5px;
  font-weight:800;
}
.dash-quick-action i{
  display:grid;
  place-items:center;
  width:20px;
  height:20px;
  border-radius:999px;
  color:#ffe3a0;
  border:1px solid rgba(242,199,106,.20);
  font-style:normal;
  font-size:18px;
  line-height:1;
}
.dash-hero-side-stack .dash-hero-orb{
  min-height:150px;
}
.dash-hero-side-stack .orb-ring{width:188px;height:188px}
.dash-hero-side-stack .orb-core{width:138px;height:138px}
.dash-hero-side-stack .orb-core strong{font-size:34px}

@media (max-width:1180px){
  .dash-overview-hero{grid-template-columns:1fr}
  .dash-hero-side-stack{grid-template-columns:minmax(0,1fr) 220px;grid-template-rows:auto;align-items:center}
  .dash-hero-side-stack .dash-hero-orb{min-height:190px}
}
@media (max-width:760px){
  .dash-hero-side-stack{grid-template-columns:1fr;gap:14px}
  .dash-hero-quick-actions{padding:11px;border-radius:19px}
  .dash-quick-action{min-height:56px}
  .dash-quick-copy strong{font-size:12.5px}
  .dash-hero-side-stack .dash-hero-orb{order:-1;min-height:170px}
}

/* VELAEA Dashboard Quick Actions Text Fit Override - START */
/*
  Fix overflow/truncated text in the two quick action buttons inside dashboard hero.
  Scope is intentionally limited to dashboard quick actions only.
*/
@media (min-width:1181px){
  .dash-overview-hero:has(.dash-hero-side-stack){
    grid-template-columns:minmax(0,1fr) minmax(300px,320px);
  }
}
.dash-hero-side-stack{
  min-width:0;
}
.dash-hero-quick-actions{
  width:100%;
  max-width:320px;
  justify-self:end;
  gap:10px;
  padding:12px 12px 13px;
}
.dash-quick-action{
  grid-template-columns:minmax(0,1fr) 22px;
  min-height:64px;
  align-items:center;
  gap:10px;
  padding:10px;
}
.dash-quick-icon{
  width:36px;
  height:36px;
}
.dash-quick-copy{
  min-width:0;
  gap:3px;
  overflow:visible;
}
.dash-quick-copy strong{
  white-space:normal !important;
  overflow:visible !important;
  text-overflow:clip !important;
  display:block;
  font-size:12.2px;
  line-height:1.22;
  letter-spacing:-.012em;
  overflow-wrap:break-word;
}
.dash-quick-copy small{
  white-space:normal !important;
  overflow:visible !important;
  text-overflow:clip !important;
  display:block;
  color:#aebed0;
  font-size:10px;
  line-height:1.28;
  font-weight:800;
}
.dash-quick-action i{
  flex:0 0 auto;
}

@media (max-width:1180px){
  .dash-hero-quick-actions{
    max-width:none;
    justify-self:stretch;
  }
  .dash-quick-copy strong{
    font-size:12.5px;
  }
}
@media (max-width:760px){
  .dash-hero-side-stack{
    width:100%;
  }
  .dash-hero-quick-actions{
    order:1;
    padding:12px;
    border-radius:20px;
  }
  .dash-quick-action{
    min-height:60px;
    grid-template-columns:minmax(0,1fr) 20px;
  }
  .dash-quick-icon{
    width:34px;
    height:34px;
  }
  .dash-quick-copy strong{
    font-size:12.8px;
  }
  .dash-quick-copy small{
    font-size:10.4px;
  }
}
@media (max-width:430px){
  .dash-quick-action{
    grid-template-columns:minmax(0,1fr);
    padding:10px 11px;
  }
  .dash-quick-action i{
    display:none;
  }
}
/* VELAEA Dashboard Quick Actions Text Fit Override - END */

/* =========================================================
   R9 20260710 — Monthly Snapshot full-history horizontal scroll
   - Keep every available month instead of showing only the latest set.
   - Native touch/trackpad scrolling plus visible previous/next controls.
========================================================= */
.dash-monthly-chart-shell{
  min-width:0;
  display:grid;
  gap:9px;
}
.dash-monthly-scroll{
  position:relative;
  width:100%;
  min-width:0;
  overflow-x:auto;
  overflow-y:hidden;
  overscroll-behavior-inline:contain;
  scroll-behavior:smooth;
  scrollbar-width:thin;
  scrollbar-color:rgba(242,199,106,.52) rgba(255,255,255,.05);
  border-radius:18px;
  cursor:grab;
  -webkit-overflow-scrolling:touch;
}
.dash-monthly-scroll.is-dragging{
  cursor:grabbing;
  user-select:none;
}
.dash-monthly-scroll::-webkit-scrollbar{
  height:7px;
}
.dash-monthly-scroll::-webkit-scrollbar-track{
  background:rgba(255,255,255,.04);
  border-radius:999px;
}
.dash-monthly-scroll::-webkit-scrollbar-thumb{
  background:linear-gradient(90deg,rgba(242,199,106,.38),rgba(242,199,106,.78));
  border-radius:999px;
}
.dash-monthly-scroll #dashOverviewMonthlyChart{
  display:block;
  width:auto;
  min-width:100%;
  max-width:none!important;
  flex:0 0 auto;
}
.dash-monthly-controls{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  min-height:32px;
  color:#91a4bb;
  font-size:10.5px;
  font-weight:850;
}
.dash-monthly-controls[hidden]{display:none!important}
.dash-monthly-controls > span{
  min-width:0;
  flex:1 1 auto;
  text-align:center;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.dash-monthly-nav{
  appearance:none;
  flex:0 0 32px;
  width:32px;
  height:32px;
  display:grid;
  place-items:center;
  border-radius:999px;
  border:1px solid rgba(242,199,106,.28);
  background:linear-gradient(145deg,rgba(242,199,106,.15),rgba(255,255,255,.025));
  color:#ffe3a0;
  font:950 21px/1 Inter,Arial,sans-serif;
  cursor:pointer;
  transition:transform .18s ease,border-color .18s ease,background .18s ease,opacity .18s ease;
}
.dash-monthly-nav:hover:not(:disabled){
  transform:translateY(-1px);
  border-color:rgba(242,199,106,.55);
  background:rgba(242,199,106,.19);
}
.dash-monthly-nav:disabled{
  opacity:.3;
  cursor:default;
}
html[data-theme="light"] body .dash-monthly-controls,
body.light-mode .dash-monthly-controls{color:#64748b}
html[data-theme="light"] body .dash-monthly-scroll,
body.light-mode .dash-monthly-scroll{
  scrollbar-color:rgba(176,124,30,.58) rgba(15,23,42,.06);
}
html[data-theme="light"] body .dash-monthly-scroll::-webkit-scrollbar-track,
body.light-mode .dash-monthly-scroll::-webkit-scrollbar-track{background:rgba(15,23,42,.06)}

@media (max-width:640px){
  .dash-monthly-chart-shell{gap:7px}
  .dash-monthly-scroll{border-radius:14px}
  .dash-monthly-controls{font-size:9.5px;gap:7px;min-height:29px}
  .dash-monthly-nav{width:29px;height:29px;flex-basis:29px;font-size:19px}
  .dash-monthly-scroll::-webkit-scrollbar{height:5px}
}


/* =========================================================
   R10 20260710 — Monthly Snapshot value callout protection
   - Reserve visual headroom for the tallest bar value.
   - Value chips are rendered on canvas; this overlay adds depth only.
========================================================= */
.dash-monthly-scroll::before{
  content:"";
  position:sticky;
  left:0;
  top:0;
  z-index:1;
  display:block;
  width:100%;
  height:18px;
  margin-bottom:-18px;
  pointer-events:none;
  background:linear-gradient(180deg,rgba(4,15,28,.22),rgba(4,15,28,0));
}
html[data-theme="light"] body .dash-monthly-scroll::before,
body.light-mode .dash-monthly-scroll::before{
  background:linear-gradient(180deg,rgba(255,255,255,.42),rgba(255,255,255,0));
}


/* =========================================================
   R11 20260710 — cumulative mobile regression guard
   Keeps Quick Access icon-free after Monthly Snapshot updates.
========================================================= */
.dash-quick-action > .dash-quick-icon{display:none!important}
@media (max-width:430px){
  .dash-quick-action{grid-template-columns:minmax(0,1fr)!important}
}


/* R12: make the Monthly Snapshot unit explicit without crowding mobile. */
.dash-monthly-title-unit{
  color:var(--gold,#f2c76a);
  white-space:nowrap;
}
.dash-monthly-unit-note{
  margin:4px 0 0;
  color:var(--muted,#91a3b8);
  font-size:11px;
  font-weight:700;
  line-height:1.35;
}
@media (max-width:640px){
  .dash-monthly-unit-note{
    margin-top:3px;
    font-size:9.5px;
    line-height:1.3;
  }
}


/* =========================================================
   R13 20260710 — Monthly Snapshot USD / % unit selector
   - Compact segmented control, persistent choice, mobile-safe layout.
========================================================= */
.dash-monthly-head-side{
  flex:0 0 auto;
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:8px;
}
.dash-monthly-auto{
  color:#ffe3a0;
  border:1px solid rgba(242,199,106,.22);
  background:rgba(242,199,106,.06);
  border-radius:999px;
  padding:7px 11px;
  font-size:10.5px;
  font-weight:950;
  white-space:nowrap;
}
.dash-monthly-unit-switch{
  display:inline-grid;
  grid-template-columns:repeat(2,minmax(42px,1fr));
  align-items:center;
  padding:3px;
  border:1px solid rgba(242,199,106,.24);
  border-radius:999px;
  background:rgba(4,15,28,.62);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.04);
}
.dash-monthly-unit-btn{
  appearance:none;
  min-width:42px;
  height:28px;
  padding:0 10px;
  border:0;
  border-radius:999px;
  background:transparent;
  color:#91a4bb;
  font:950 10px/1 Inter,"Noto Sans Thai",Arial,sans-serif;
  cursor:pointer;
  transition:color .18s ease,background .18s ease,box-shadow .18s ease,transform .18s ease;
}
.dash-monthly-unit-btn:hover{
  color:#fff1bf;
}
.dash-monthly-unit-btn:focus-visible{
  outline:2px solid rgba(242,199,106,.78);
  outline-offset:2px;
}
.dash-monthly-unit-btn.is-active{
  color:#07111f;
  background:linear-gradient(135deg,#ffe08a,#d9a93f);
  box-shadow:0 5px 14px rgba(217,169,63,.24),inset 0 1px 0 rgba(255,255,255,.48);
}
html[data-theme="light"] body .dash-monthly-unit-switch,
body.light-mode .dash-monthly-unit-switch{
  background:rgba(255,255,255,.68);
  border-color:rgba(159,109,21,.24);
}
html[data-theme="light"] body .dash-monthly-unit-btn,
body.light-mode .dash-monthly-unit-btn{color:#64748b}
html[data-theme="light"] body .dash-monthly-unit-btn.is-active,
body.light-mode .dash-monthly-unit-btn.is-active{color:#2b1a00}

@media (max-width:640px){
  .dash-monthly-head-side{
    width:100%;
    flex-direction:row;
    align-items:center;
    justify-content:space-between;
    gap:8px;
  }
  .dash-monthly-auto{
    padding:5px 8px;
    font-size:9px;
  }
  .dash-monthly-unit-switch{
    padding:2px;
    grid-template-columns:repeat(2,minmax(38px,1fr));
  }
  .dash-monthly-unit-btn{
    min-width:38px;
    height:25px;
    padding:0 8px;
    font-size:9.5px;
  }
}
@media (max-width:360px){
  .dash-monthly-auto{display:none}
  .dash-monthly-head-side{justify-content:flex-start}
}

/* =========================================================
   R14 20260710 — KPI cards show USD and % together
   - Amount remains the primary value.
   - Return/risk percentage is always visible as a compact status chip.
   - Responsive layout keeps both values readable on desktop and mobile.
========================================================= */
.dash-kpi-card-dual{
  min-height:132px!important;
  justify-content:flex-start!important;
}
.dash-kpi-card-dual > small{
  margin-top:auto;
}
.dash-kpi-value-row{
  position:relative;
  z-index:2;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:end;
  gap:9px;
  min-width:0;
  width:100%;
  margin:9px 0 6px;
}
.dash-kpi-card .dash-kpi-value-row strong{
  min-width:0!important;
  max-width:100%!important;
  margin:0!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  font-size:clamp(23px,1.72vw,31px)!important;
  font-variant-numeric:tabular-nums!important;
}
.dash-kpi-percent-chip{
  position:relative;
  z-index:2;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:64px;
  min-height:29px;
  padding:5px 9px;
  border:1px solid rgba(242,199,106,.25);
  border-radius:999px;
  background:linear-gradient(145deg,rgba(242,199,106,.14),rgba(255,255,255,.035));
  color:#ffe3a0;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06),0 8px 20px rgba(0,0,0,.16);
  font:950 11px/1 Inter,"Noto Sans Thai",Arial,sans-serif;
  font-variant-numeric:tabular-nums;
  letter-spacing:-.01em;
  white-space:nowrap;
}
.dash-kpi-percent-chip.up{
  border-color:rgba(116,227,154,.30);
  background:linear-gradient(145deg,rgba(116,227,154,.18),rgba(116,227,154,.06));
  color:#8ff0ad!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.07),0 0 18px rgba(116,227,154,.10);
}
.dash-kpi-percent-chip.down,
.dash-kpi-percent-chip-risk.down{
  border-color:rgba(255,141,141,.32);
  background:linear-gradient(145deg,rgba(255,104,104,.18),rgba(255,104,104,.055));
  color:#ffabab!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.07),0 0 18px rgba(255,104,104,.10);
}
.dash-kpi-percent-chip.neutral{
  border-color:rgba(105,183,255,.22);
  background:rgba(105,183,255,.075);
  color:#a9d5ff!important;
}
html[data-theme="light"] body .dash-kpi-percent-chip,
body.light-mode .dash-kpi-percent-chip{
  border-color:rgba(166,111,18,.22);
  background:rgba(176,124,30,.08);
  color:#8b5d12;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.65),0 7px 18px rgba(65,42,5,.08);
}
html[data-theme="light"] body .dash-kpi-percent-chip.up,
body.light-mode .dash-kpi-percent-chip.up{
  border-color:rgba(22,163,74,.22);
  background:rgba(22,163,74,.09);
  color:#15803d!important;
}
html[data-theme="light"] body .dash-kpi-percent-chip.down,
body.light-mode .dash-kpi-percent-chip.down{
  border-color:rgba(220,38,38,.22);
  background:rgba(220,38,38,.08);
  color:#b91c1c!important;
}
html[data-theme="light"] body .dash-kpi-percent-chip.neutral,
body.light-mode .dash-kpi-percent-chip.neutral{
  border-color:rgba(37,99,235,.18);
  background:rgba(37,99,235,.065);
  color:#1d4ed8!important;
}

@media (min-width:421px) and (max-width:640px){
  .dash-kpi-card-dual{min-height:138px!important}
  .dash-kpi-value-row{
    grid-template-columns:1fr;
    align-items:start;
    gap:5px;
    margin:7px 0 5px;
  }
  .dash-kpi-percent-chip{
    justify-self:start;
    min-width:58px;
    min-height:25px;
    padding:4px 8px;
    font-size:9.5px;
  }
  .dash-kpi-card .dash-kpi-value-row strong{
    font-size:20px!important;
  }
}

@media (max-width:420px){
  .dash-kpi-card-dual{min-height:118px!important}
  .dash-kpi-value-row{
    grid-template-columns:minmax(0,1fr) auto;
    gap:8px;
    margin:7px 0 5px;
  }
  .dash-kpi-card .dash-kpi-value-row strong{
    font-size:22px!important;
  }
  .dash-kpi-percent-chip{
    min-width:60px;
    min-height:27px;
    padding:4px 8px;
    font-size:10px;
  }
}

@media (max-width:340px){
  .dash-kpi-value-row{
    grid-template-columns:1fr;
    align-items:start;
    gap:5px;
  }
  .dash-kpi-percent-chip{justify-self:start}
}

/* =========================================================
   R15 20260710 — USD and % have equal visual prominence
   - Two equal metric panels per KPI card.
   - Same type scale, height, border and glow treatment.
   - Long currency values remain readable without breaking layout.
========================================================= */
.dash-kpi-card-dual{
  min-height:150px!important;
}
.dash-kpi-card-dual .dash-kpi-value-row{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  align-items:stretch!important;
  gap:8px!important;
  margin:9px 0 7px!important;
}
.dash-kpi-value-box{
  position:relative;
  min-width:0;
  min-height:72px;
  padding:9px 10px 10px;
  border:1px solid rgba(255,255,255,.095);
  border-radius:15px;
  background:linear-gradient(155deg,rgba(255,255,255,.055),rgba(255,255,255,.018));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.055),0 8px 20px rgba(0,0,0,.12);
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  overflow:hidden;
}
.dash-kpi-value-box::after{
  content:"";
  position:absolute;
  right:-18px;
  bottom:-22px;
  width:58px;
  height:58px;
  border-radius:999px;
  background:rgba(242,199,106,.08);
  pointer-events:none;
}
.dash-kpi-value-box-usd{
  border-color:rgba(242,199,106,.22);
  background:linear-gradient(155deg,rgba(242,199,106,.105),rgba(255,255,255,.018));
}
.dash-kpi-value-box-pct{
  border-color:rgba(105,183,255,.18);
  background:linear-gradient(155deg,rgba(105,183,255,.085),rgba(255,255,255,.018));
}
.dash-kpi-unit-label{
  position:relative;
  z-index:2;
  display:block;
  margin:0 0 7px;
  color:#a9b9ca;
  font:950 9px/1 Inter,"Noto Sans Thai",Arial,sans-serif;
  letter-spacing:.11em;
  text-transform:uppercase;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.dash-kpi-card .dash-kpi-value-box strong,
.dash-kpi-card .dash-kpi-value-box .dash-kpi-percent-chip{
  position:relative!important;
  z-index:2!important;
  width:100%!important;
  min-width:0!important;
  max-width:none!important;
  min-height:0!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  display:block!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  font:950 clamp(19px,1.55vw,25px)/1.08 Inter,"Noto Sans Thai",Arial,sans-serif!important;
  letter-spacing:-.045em!important;
  font-variant-numeric:tabular-nums!important;
  text-align:left!important;
}
.dash-kpi-card .dash-kpi-value-box .dash-kpi-percent-chip{
  color:#ffe3a0!important;
}
.dash-kpi-card .dash-kpi-value-box .dash-kpi-percent-chip.up{color:#74e39a!important}
.dash-kpi-card .dash-kpi-value-box .dash-kpi-percent-chip.down{color:#ff9a9a!important}
.dash-kpi-card .dash-kpi-value-box .dash-kpi-percent-chip.neutral{color:#a9d5ff!important}
.dash-kpi-card .dash-kpi-value-box strong.up{color:#74e39a!important}
.dash-kpi-card .dash-kpi-value-box strong.down{color:#ff9a9a!important}

html[data-theme="light"] body .dash-kpi-value-box,
body.light-mode .dash-kpi-value-box{
  border-color:rgba(122,92,34,.18);
  background:linear-gradient(155deg,rgba(255,255,255,.85),rgba(245,238,224,.68));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.92),0 7px 16px rgba(65,42,5,.06);
}
html[data-theme="light"] body .dash-kpi-value-box-pct,
body.light-mode .dash-kpi-value-box-pct{
  border-color:rgba(37,99,235,.14);
  background:linear-gradient(155deg,rgba(237,245,255,.9),rgba(255,255,255,.72));
}
html[data-theme="light"] body .dash-kpi-unit-label,
body.light-mode .dash-kpi-unit-label{color:#68778a}

@media (max-width:980px){
  .dash-kpi-card-dual{min-height:144px!important}
  .dash-kpi-card .dash-kpi-value-box strong,
  .dash-kpi-card .dash-kpi-value-box .dash-kpi-percent-chip{
    font-size:clamp(19px,2.5vw,24px)!important;
  }
}
@media (max-width:640px){
  .dash-kpi-card-dual{min-height:142px!important}
  .dash-kpi-card-dual .dash-kpi-value-row{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:7px!important;
  }
  .dash-kpi-value-box{
    min-height:66px;
    padding:8px 9px 9px;
    border-radius:13px;
  }
  .dash-kpi-card .dash-kpi-value-box strong,
  .dash-kpi-card .dash-kpi-value-box .dash-kpi-percent-chip{
    font-size:clamp(18px,5.1vw,22px)!important;
  }
}
@media (max-width:370px){
  .dash-kpi-card .dash-kpi-value-box strong,
  .dash-kpi-card .dash-kpi-value-box .dash-kpi-percent-chip{
    font-size:17px!important;
  }
  .dash-kpi-unit-label{font-size:8px}
}


/* =========================================================
   R16 20260710 — Full KPI numbers without layout breakage
   - Currency gets a little more horizontal room than percentage.
   - JavaScript fits the complete value to the available width.
   - No ellipsis: the exact number always remains visible.
========================================================= */
.dash-kpi-card-dual .dash-kpi-value-row{
  grid-template-columns:minmax(0,1.18fr) minmax(84px,.82fr)!important;
}
.dash-kpi-value-box{
  --kpi-fit-max:25;
  --kpi-fit-min:13;
  contain:layout paint;
}
.dash-kpi-value-box-usd{
  padding-inline:9px!important;
}
.dash-kpi-card .dash-kpi-value-box strong,
.dash-kpi-card .dash-kpi-value-box .dash-kpi-percent-chip{
  overflow:visible!important;
  text-overflow:clip!important;
  white-space:nowrap!important;
  max-width:100%!important;
  transform-origin:left center!important;
  font-feature-settings:"tnum" 1,"lnum" 1;
  font-variant-numeric:tabular-nums lining-nums!important;
}
.dash-kpi-value-box[data-fit-state="tight"]{
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06),0 8px 20px rgba(0,0,0,.12),0 0 0 1px rgba(242,199,106,.035);
}
@media (max-width:1180px){
  .dash-kpi-value-box{--kpi-fit-max:23;--kpi-fit-min:12.5}
}
@media (max-width:980px){
  .dash-kpi-card-dual .dash-kpi-value-row{
    grid-template-columns:minmax(0,1.16fr) minmax(78px,.84fr)!important;
  }
  .dash-kpi-value-box{--kpi-fit-max:22;--kpi-fit-min:12}
}
@media (max-width:640px){
  .dash-kpi-card-dual .dash-kpi-value-row{
    grid-template-columns:minmax(0,1.14fr) minmax(74px,.86fr)!important;
  }
  .dash-kpi-value-box{--kpi-fit-max:21;--kpi-fit-min:11.5}
}
@media (max-width:370px){
  .dash-kpi-card-dual .dash-kpi-value-row{
    grid-template-columns:minmax(0,1.12fr) minmax(70px,.88fr)!important;
  }
  .dash-kpi-value-box{--kpi-fit-max:17;--kpi-fit-min:10.5}
}

/* =========================================================
   R17 20260710 — Clear all-portfolios KPI summary
   - Removes duplicated Balance/Equity and misleading Today Profit.
   - Shows only decision-critical values with plain-language context.
   - Makes the data scope explicit: all Forward + Backtest portfolios.
========================================================= */
.dash-kpi-summary{
  display:grid;
  gap:12px;
}
.dash-kpi-scope-banner{
  min-width:0;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:16px;
  padding:14px 16px;
  border:1px solid rgba(242,199,106,.22);
  border-radius:18px;
  background:
    radial-gradient(circle at 88% 30%,rgba(242,199,106,.13),transparent 30%),
    linear-gradient(135deg,rgba(242,199,106,.09),rgba(8,20,34,.92) 48%,rgba(5,14,25,.96));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.04),0 10px 28px rgba(0,0,0,.12);
}
.dash-kpi-scope-banner > div{min-width:0}
.dash-kpi-scope-banner span{
  display:block;
  margin-bottom:4px;
  color:#f4c95f;
  font-size:10px;
  font-weight:950;
  letter-spacing:.13em;
}
.dash-kpi-scope-banner strong{
  display:block;
  color:#fff;
  font-size:17px;
  line-height:1.25;
  letter-spacing:-.02em;
}
.dash-kpi-scope-banner p{
  margin:0;
  max-width:520px;
  color:#a7b8ca;
  font-size:12px;
  font-weight:800;
  line-height:1.5;
  text-align:right;
}
.dash-kpi-summary .dash-kpi-card{
  min-height:150px;
}
.dash-kpi-card-key{
  justify-content:flex-start;
}
.dash-kpi-key-value{
  --kpi-fit-max:31;
  --kpi-fit-min:15;
  position:relative;
  min-width:0;
  min-height:76px;
  margin:9px 0 7px;
  padding:10px 12px;
  border:1px solid rgba(242,199,106,.2);
  border-radius:15px;
  background:linear-gradient(155deg,rgba(242,199,106,.095),rgba(255,255,255,.018));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.05),0 8px 20px rgba(0,0,0,.12);
  overflow:hidden;
  contain:layout paint;
}
.dash-kpi-key-value::after{
  content:"";
  position:absolute;
  right:-20px;
  bottom:-27px;
  width:70px;
  height:70px;
  border-radius:999px;
  background:rgba(242,199,106,.08);
  pointer-events:none;
}
.dash-kpi-card .dash-kpi-key-value strong{
  position:relative!important;
  z-index:2!important;
  display:block!important;
  width:100%!important;
  max-width:none!important;
  margin:0!important;
  overflow:visible!important;
  text-overflow:clip!important;
  white-space:nowrap!important;
  transform-origin:left center!important;
  color:#fff!important;
  font:950 clamp(23px,1.9vw,31px)/1.05 Inter,"Noto Sans Thai",Arial,sans-serif!important;
  letter-spacing:-.05em!important;
  font-variant-numeric:tabular-nums lining-nums!important;
}
.dash-kpi-card-profit{
  border-color:rgba(75,215,135,.19);
  background:linear-gradient(145deg,rgba(55,190,113,.11),rgba(7,19,32,.95) 48%,rgba(4,13,24,.97));
}
.dash-kpi-card-count strong{
  margin-top:auto;
  margin-bottom:8px;
  font-size:clamp(30px,2.5vw,42px);
}
.dash-kpi-card-systems .dash-kpi-value-row{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
}
.dash-kpi-card-systems .dash-kpi-value-box strong,
.dash-kpi-card-systems .dash-kpi-percent-chip{
  text-align:center!important;
  transform-origin:center center!important;
}

html[data-theme="light"] body .dash-kpi-scope-banner,
body.light-mode .dash-kpi-scope-banner{
  border-color:rgba(157,111,24,.2);
  background:
    radial-gradient(circle at 88% 30%,rgba(201,149,46,.14),transparent 30%),
    linear-gradient(135deg,rgba(255,248,230,.95),rgba(255,255,255,.95));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.9),0 8px 22px rgba(75,51,6,.07);
}
html[data-theme="light"] body .dash-kpi-scope-banner strong,
body.light-mode .dash-kpi-scope-banner strong{color:#111827}
html[data-theme="light"] body .dash-kpi-scope-banner p,
body.light-mode .dash-kpi-scope-banner p{color:#5f6f82}
html[data-theme="light"] body .dash-kpi-key-value,
body.light-mode .dash-kpi-key-value{
  border-color:rgba(157,111,24,.18);
  background:linear-gradient(155deg,rgba(255,247,224,.92),rgba(255,255,255,.78));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.95),0 7px 16px rgba(65,42,5,.06);
}
html[data-theme="light"] body .dash-kpi-card .dash-kpi-key-value strong,
body.light-mode .dash-kpi-card .dash-kpi-key-value strong{color:#111827!important}

@media (max-width:980px){
  .dash-kpi-scope-banner{
    grid-template-columns:1fr;
    gap:7px;
  }
  .dash-kpi-scope-banner p{text-align:left}
  .dash-kpi-key-value{--kpi-fit-max:28;--kpi-fit-min:14}
}
@media (max-width:640px){
  .dash-kpi-summary{gap:10px}
  .dash-kpi-scope-banner{
    padding:12px 13px;
    border-radius:16px;
  }
  .dash-kpi-scope-banner strong{font-size:15px}
  .dash-kpi-scope-banner p{font-size:10.5px}
  .dash-kpi-summary .dash-kpi-card{min-height:140px!important}
  .dash-kpi-key-value{
    --kpi-fit-max:25;
    --kpi-fit-min:12.5;
    min-height:68px;
    padding:9px 10px;
  }
}
@media (max-width:420px){
  .dash-kpi-summary .dash-kpi-card{min-height:132px!important}
  .dash-kpi-card-dual{min-height:142px!important}
  .dash-kpi-key-value{--kpi-fit-max:24;--kpi-fit-min:12}
}


/* =========================================================
   R18 20260710 — Compact professional KPI cards
   - Short, plain-language captions that never spill outside cards.
   - Tighter vertical rhythm while preserving full USD / % values.
   - Clear footer notes with a subtle status dot.
========================================================= */
.dash-kpi-summary{
  gap:10px!important;
}
.dash-kpi-scope-banner{
  min-height:56px;
  padding:11px 14px!important;
  gap:12px!important;
  border-radius:16px!important;
}
.dash-kpi-scope-banner span{
  margin-bottom:2px!important;
  font-size:9px!important;
  letter-spacing:.14em!important;
}
.dash-kpi-scope-banner strong{
  font-size:15px!important;
  line-height:1.2!important;
}
.dash-kpi-scope-banner p{
  max-width:none!important;
  font-size:10.5px!important;
  line-height:1.3!important;
  white-space:nowrap;
}
.dash-kpi-summary .dash-kpi-grid{
  gap:10px!important;
}
.dash-kpi-summary .dash-kpi-card{
  min-height:132px!important;
  padding:13px 14px!important;
  gap:6px!important;
  border-radius:18px!important;
  justify-content:flex-start!important;
}
.dash-kpi-summary .dash-kpi-card > span{
  min-width:0;
  font-size:10px!important;
  line-height:1.2!important;
  letter-spacing:.055em!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.dash-kpi-summary .dash-kpi-card > small{
  display:flex!important;
  align-items:flex-start;
  gap:7px;
  min-width:0;
  min-height:27px;
  margin-top:auto!important;
  color:#91a6bb!important;
  font-size:10.5px!important;
  font-weight:800!important;
  line-height:1.32!important;
  white-space:normal!important;
  overflow:visible!important;
  text-overflow:clip!important;
  overflow-wrap:anywhere;
}
.dash-kpi-summary .dash-kpi-card > small::before{
  content:"";
  flex:0 0 5px;
  width:5px;
  height:5px;
  margin-top:.42em;
  border-radius:999px;
  background:#f2c76a;
  box-shadow:0 0 10px rgba(242,199,106,.42);
}
.dash-kpi-summary .dash-kpi-card-profit > small::before{
  background:#74e39a;
  box-shadow:0 0 10px rgba(116,227,154,.35);
}
.dash-kpi-summary .dash-kpi-card.risk > small::before{
  background:#ff8d8d;
  box-shadow:0 0 10px rgba(255,141,141,.32);
}
.dash-kpi-summary .dash-kpi-card-key{
  min-height:132px!important;
}
.dash-kpi-summary .dash-kpi-key-value{
  min-height:62px!important;
  margin:7px 0 5px!important;
  padding:8px 10px!important;
  border-radius:13px!important;
}
.dash-kpi-summary .dash-kpi-card .dash-kpi-key-value strong{
  line-height:1!important;
}
.dash-kpi-summary .dash-kpi-card-dual{
  min-height:132px!important;
}
.dash-kpi-summary .dash-kpi-card-dual .dash-kpi-value-row{
  margin:7px 0 5px!important;
  gap:7px!important;
}
.dash-kpi-summary .dash-kpi-value-box{
  min-height:60px!important;
  padding:7px 8px 8px!important;
  border-radius:13px!important;
}
.dash-kpi-summary .dash-kpi-unit-label{
  margin-bottom:5px!important;
  font-size:8px!important;
  letter-spacing:.10em!important;
}
.dash-kpi-summary .dash-kpi-card-count strong{
  margin:8px 0 5px!important;
  font-size:clamp(28px,2.3vw,38px)!important;
}
.dash-kpi-summary .dash-kpi-card-systems .dash-kpi-value-box strong,
.dash-kpi-summary .dash-kpi-card-systems .dash-kpi-percent-chip{
  font-size:clamp(20px,1.55vw,25px)!important;
}
html[data-theme="light"] body .dash-kpi-summary .dash-kpi-card > small,
body.light-mode .dash-kpi-summary .dash-kpi-card > small{
  color:#637489!important;
}
@media(max-width:1180px){
  .dash-kpi-scope-banner p{
    white-space:normal;
  }
}
@media(max-width:640px){
  .dash-kpi-scope-banner{
    min-height:0;
    padding:10px 12px!important;
  }
  .dash-kpi-scope-banner strong{font-size:14px!important}
  .dash-kpi-scope-banner p{font-size:10px!important}
  .dash-kpi-summary .dash-kpi-card,
  .dash-kpi-summary .dash-kpi-card-key,
  .dash-kpi-summary .dash-kpi-card-dual{
    min-height:126px!important;
    padding:12px!important;
  }
  .dash-kpi-summary .dash-kpi-card > small{
    min-height:25px;
    font-size:10px!important;
  }
  .dash-kpi-summary .dash-kpi-key-value{
    min-height:59px!important;
  }
  .dash-kpi-summary .dash-kpi-value-box{
    min-height:58px!important;
  }
}
@media(max-width:420px){
  .dash-kpi-summary .dash-kpi-card,
  .dash-kpi-summary .dash-kpi-card-key,
  .dash-kpi-summary .dash-kpi-card-dual{
    min-height:122px!important;
  }
  .dash-kpi-summary .dash-kpi-card > small{
    min-height:0;
  }
}
