/* SMART SALES - VCB/VCBF green identity, professional finance dashboard */
:root {
  --green: #006B3F; --green-700: #005A35; --green-800: #004D2E; --green-900: #00331F;
  --lime: #8DC63F; --lime-soft: #EEF7E2; --tint: #E6F4EA; --tint-2: #F3F9F5;
  --bg: #F3F6F4; --card: #FFFFFF; --card-2: #FAFCFB; --text: #15261E; --muted: #66786F; --faint: #93A39B;
  --line: #E1E8E4; --line-2: #EDF2EF; --pos: #0B7A3E; --neg: #C62828; --warn: #D98E04; --info: #1F6FB2;
  --input: #FFFDF5; --input-line: #E6C766;
  --shadow: 0 1px 2px rgba(10, 40, 25, .06), 0 4px 16px rgba(10, 40, 25, .06);
  --shadow-lg: 0 10px 40px rgba(5, 30, 18, .18);
  --radius: 14px; --radius-sm: 9px;
  --sidebar: 248px;
  --font: "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
  --num: "Segoe UI", Roboto, Arial, sans-serif;
}
:root[data-theme="dark"] {
  --bg: #0D1612; --card: #13201A; --card-2: #172720; --text: #E4EEE8; --muted: #9AB0A4; --faint: #6F8579;
  --line: #22362C; --line-2: #1B2C24; --tint: #173527; --tint-2: #15261E; --lime-soft: #1F3518;
  --pos: #4CC27E; --neg: #FF6B6B; --input: #1A2A22; --input-line: #8A7A3A;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.25);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--info); }

/* ---------------------------------------------------------------- shell */
.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar); background: linear-gradient(180deg, var(--green-800) 0%, var(--green-900) 100%); color: #DCEFE3;
  position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 30; transition: width .25s ease, transform .25s ease; }
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 20px 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-mark { width: 42px; height: 42px; flex: none; border-radius: 11px; background: #fff; display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.brand-mark img { width: 32px; height: 32px; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; white-space: nowrap; }
.brand-text b { font-size: 19px; letter-spacing: .5px; color: #fff; }
.brand-text span { font-size: 12px; color: var(--lime); letter-spacing: 2px; text-transform: uppercase; margin-top: 3px; }
.nav { padding: 14px 12px; flex: 1; overflow-y: auto; }
.nav .group { font-size: 10.5px; letter-spacing: 1.4px; text-transform: uppercase; color: rgba(220,239,227,.45); padding: 14px 12px 6px; white-space: nowrap; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #CFE6D8; text-decoration: none; font-weight: 500;
  position: relative; white-space: nowrap; transition: background .18s, color .18s; margin-bottom: 2px; }
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a.active { background: rgba(141,198,63,.16); color: #fff; }
.nav a.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--lime); }
.nav a.active svg { color: var(--lime); }
.nav a .badge { margin-left: auto; background: var(--lime); color: var(--green-900); font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 10px; }
.sidebar-foot { padding: 12px 16px 16px; border-top: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 8px; }
.conn { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: rgba(220,239,227,.75); flex: 1; min-width: 0; }
.conn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conn i { width: 8px; height: 8px; border-radius: 50%; background: #999; flex: none; box-shadow: 0 0 0 3px rgba(255,255,255,.06); }
.conn.ok i { background: var(--lime); animation: pulse 2.4s infinite; }
.conn.off i { background: #F2A900; }
.collapse-btn { background: rgba(255,255,255,.06); border: 0; color: #CFE6D8; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; }
.collapse-btn:hover { background: rgba(255,255,255,.14); }
.app.collapsed { --sidebar: 72px; }
.app.collapsed .brand-text, .app.collapsed .nav a span, .app.collapsed .nav .group, .app.collapsed .nav .badge, .app.collapsed .conn span { display: none; }
.app.collapsed .collapse-btn svg { transform: rotate(180deg); }
.app.collapsed .nav a { justify-content: center; }
.app.collapsed .sidebar-foot { flex-direction: column; }

.main { margin-left: var(--sidebar); flex: 1; min-width: 0; transition: margin-left .25s ease; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 28px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.crumbs { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar h1 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -.2px; }
.subtitle { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.stamp { font-size: 12px; color: var(--muted); text-align: right; line-height: 1.35; margin-right: 6px; }
.stamp b { color: var(--text); }
.icon-btn.mobile-menu { display: none; }
.view { padding: 22px 28px 48px; max-width: 1680px; }
.view > * { animation: rise .45s cubic-bezier(.2,.7,.2,1) both; }
.view > *:nth-child(2) { animation-delay: .05s; } .view > *:nth-child(3) { animation-delay: .1s; }
.view > *:nth-child(4) { animation-delay: .15s; } .view > *:nth-child(5) { animation-delay: .2s; } .view > *:nth-child(n+6) { animation-delay: .25s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 3px rgba(141,198,63,.2); } 50% { box-shadow: 0 0 0 6px rgba(141,198,63,0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { from { background-position: -400px 0; } to { background-position: 400px 0; } }

/* ---------------------------------------------------------------- controls */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid transparent; border-radius: 10px; padding: 9px 15px; font-weight: 600; font-size: 13.5px;
  transition: transform .12s, box-shadow .18s, background .18s, border-color .18s; white-space: nowrap; position: relative; overflow: hidden; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: var(--green); color: #fff; box-shadow: 0 2px 8px rgba(0,107,63,.28); }
.btn-primary:hover { background: var(--green-700); box-shadow: 0 4px 14px rgba(0,107,63,.35); }
.btn-lime { background: var(--lime); color: var(--green-900); }
.btn-lime:hover { filter: brightness(1.05); }
.btn-ghost { background: var(--card); border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--green); color: var(--green); }
.btn-danger { background: transparent; border-color: var(--line); color: var(--neg); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn.loading svg { animation: spin 1s linear infinite; }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--muted); }
.icon-btn:hover { color: var(--green); border-color: var(--green); }
.ripple { position: absolute; border-radius: 50%; transform: scale(0); animation: ripple .6s linear; background: rgba(255,255,255,.45); pointer-events: none; }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

.dropdown { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg);
  padding: 6px; min-width: 260px; display: none; z-index: 40; }
.menu.open { display: block; animation: rise .18s ease both; }
.menu button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 10px 12px; border-radius: 8px; font-size: 13.5px; }
.menu button:hover { background: var(--tint); }
.menu b { color: var(--green); display: inline-block; min-width: 72px; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.input, select.input, textarea.input { height: 38px; border: 1px solid var(--line); border-radius: 9px; padding: 0 12px; background: var(--card); color: var(--text); font: inherit; font-size: 13.5px;
  transition: border-color .15s, box-shadow .15s; min-width: 0; }
textarea.input { height: auto; padding: 9px 12px; resize: vertical; width: 100%; }
.input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(0,107,63,.14); }
.input.edit { background: var(--input); border-color: var(--input-line); }
.input.bad { border-color: var(--neg); box-shadow: 0 0 0 3px rgba(198,40,40,.12); }
.seg { display: inline-flex; background: var(--line-2); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); transition: all .15s; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--card); color: var(--green); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 7px 14px 7px 10px; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px;
  transition: all .15s; }
.chip i { width: 10px; height: 10px; border-radius: 50%; }
.chip:hover { border-color: var(--green); }
.chip.on { background: var(--green); border-color: var(--green); color: #fff; box-shadow: 0 3px 10px rgba(0,107,63,.25); }
.chip.on i { box-shadow: 0 0 0 2px #fff; }

/* ---------------------------------------------------------------- cards & layout */
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } .g6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 1760px) { .g6 { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.g-21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } .g-12 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.g-32 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.mt { margin-top: 18px; } .mt-s { margin-top: 10px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 0; flex-wrap: wrap; }
.card-h h3 { margin: 0; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.card-h h3 .dot { width: 8px; height: 8px; border-radius: 2px; background: var(--lime); }
.card-h .hint { color: var(--muted); font-size: 12px; font-weight: 400; }
.card-b { padding: 16px 20px 18px; }
.card-b.flush { padding: 12px 0 0; }
.toolbar { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.toolbar .grow { flex: 1; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 40px; height: 40px; color: var(--faint); margin-bottom: 8px; stroke-width: 1.5; }
.note { font-size: 12px; color: var(--muted); }
.note-box { background: var(--tint-2); border: 1px dashed var(--line); border-radius: 10px; padding: 12px 14px; font-size: 12.5px; color: var(--muted); }
.callout { border-left: 4px solid var(--lime); background: var(--tint); border-radius: 0 10px 10px 0; padding: 12px 16px; font-size: 13.5px; }
.callout.warn { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, var(--card)); }
.pos { color: var(--pos); } .neg { color: var(--neg); } .mut { color: var(--muted); }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--line-2); color: var(--muted); white-space: nowrap; }
.tag.g { background: var(--tint); color: var(--pos); } .tag.r { background: color-mix(in srgb, var(--neg) 12%, var(--card)); color: var(--neg); }
.tag.a { background: color-mix(in srgb, var(--warn) 15%, var(--card)); color: #A86B00; } .tag.b { background: color-mix(in srgb, var(--info) 12%, var(--card)); color: var(--info); }
.skeleton { height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--line-2) 0, var(--line) 50%, var(--line-2) 100%); background-size: 800px 100%; animation: shimmer 1.2s infinite; }

/* ---------------------------------------------------------------- fund cards */
.fund-card { position: relative; overflow: hidden; padding: 16px 18px 12px; cursor: pointer; transition: transform .2s, box-shadow .2s, border-color .2s; }
.fund-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--fc) 40%, var(--line)); }
.fund-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--fc); }
.fund-card .fc-top { display: flex; align-items: center; justify-content: space-between; }
.fund-card .code { font-weight: 800; font-size: 15px; letter-spacing: .3px; }
.fund-card .code small { font-weight: 600; color: var(--muted); font-size: 11px; margin-left: 4px; }
.fund-card .fname { color: var(--muted); font-size: 11.5px; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fund-card .navv { font-size: 26px; font-weight: 700; margin: 10px 0 2px; letter-spacing: -.5px; }
.fund-card .meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.fund-card .delta { font-weight: 700; }
.fund-card .spark { height: 46px; margin: 8px -4px 0; }
.fund-card .foot { display: flex; gap: 6px; margin-top: 8px; border-top: 1px solid var(--line-2); padding-top: 9px; }
.fund-card .foot div { flex: 1; text-align: center; font-size: 11px; color: var(--muted); }
.fund-card .foot b { display: block; font-size: 13px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi { background: var(--card-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; min-width: 0; transition: border-color .15s; }
.kpi:hover { border-color: var(--lime); }
.kpi .k { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .v { font-size: 19px; font-weight: 700; margin-top: 3px; white-space: nowrap; }
.kpi .s { font-size: 11.5px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.hero { grid-column: span 2; background: linear-gradient(135deg, var(--green) 0%, var(--green-800) 100%); border: 0; color: #fff; }
.kpi.hero .k, .kpi.hero .s { color: rgba(255,255,255,.75); }

.signal { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card-2); }
.signal .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.signal .ico.g { background: var(--tint); color: var(--pos); } .signal .ico.a { background: color-mix(in srgb, var(--warn) 15%, var(--card)); color: var(--warn); }
.signal .ico.r { background: color-mix(in srgb, var(--neg) 12%, var(--card)); color: var(--neg); }
.signal b { display: block; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.signal p { margin: 2px 0 0; font-weight: 600; font-size: 13.5px; }

/* range bar (52 weeks) */
.range { position: relative; height: 8px; background: linear-gradient(90deg, #F3C5C5, #F6E7B5 50%, #CDEBC0); border-radius: 8px; margin: 8px 0 4px; }
.range i { position: absolute; top: -4px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--card); border: 3px solid var(--green); box-shadow: 0 1px 4px rgba(0,0,0,.25); transition: left .8s cubic-bezier(.2,.7,.2,1); }
.range-l { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }

/* ---------------------------------------------------------------- tables */
.tbl-wrap { overflow: auto; max-width: 100%; }
.tbl-wrap.tall { max-height: 560px; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tbl th { position: sticky; top: 0; background: var(--card-2); color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px;
  text-align: right; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; z-index: 1; }
.tbl th.l, .tbl td.l { text-align: left; } .tbl th.c, .tbl td.c { text-align: center; }
.tbl th.sortable { cursor: pointer; user-select: none; }
.tbl th.sortable:hover { color: var(--green); }
.tbl th.sorted-asc::after { content: " ▲"; font-size: 9px; } .tbl th.sorted-desc::after { content: " ▼"; font-size: 9px; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: var(--tint-2); }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr.sel { background: var(--tint); box-shadow: inset 3px 0 0 var(--green); }
.tbl tbody tr.hl td { background: color-mix(in srgb, var(--lime) 14%, transparent); font-weight: 600; }
.tbl td.best { background: color-mix(in srgb, var(--pos) 12%, transparent); color: var(--pos); font-weight: 700; }
.tbl td.worst { background: color-mix(in srgb, var(--neg) 10%, transparent); color: var(--neg); font-weight: 700; }
.tbl td.second { background: color-mix(in srgb, var(--warn) 14%, transparent); color: #A86B00; font-weight: 700; }
.tbl tfoot td { font-weight: 700; border-top: 2px solid var(--green); background: var(--card-2); }
.tbl .fund { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.tbl .fund i { width: 9px; height: 9px; border-radius: 3px; }
/* logos (symbol only) before fund codes */
.logo { width: 20px; height: 20px; flex: none; border-radius: 5px; background: #fff; border: 1px solid var(--line); display: inline-grid; place-items: center; overflow: hidden; vertical-align: middle; }
.logo img { width: 100%; height: 100%; object-fit: contain; }
.logo.sym img { object-fit: cover; object-position: left center; }
.logo.vcbf img { width: 84%; height: 84%; object-fit: contain; }
.logo.mono { color: #fff; font-size: 9px; font-weight: 800; letter-spacing: -.2px; border: 0; }
.logo.lg { width: 30px; height: 30px; border-radius: 8px; }
.logo.lg.mono { font-size: 11px; }
.fund, .fcode { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; white-space: nowrap; }
.fund .sw { width: 4px; height: 14px; border-radius: 2px; }
.src-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.src-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--card); position: relative; }
.src-card .row { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 5px; gap: 8px; }
.src-card .row b { color: var(--text); font-weight: 600; text-align: right; }
.src-card.warn { border-color: var(--warn); }
.src-card.bad { border-color: var(--neg, #C62828); }
.fund-card.pending { cursor: default; display: flex; flex-direction: column; }
.fund-card.pending .pend { margin-top: 10px; font-size: 12px; color: var(--muted); line-height: 1.5; flex: 1; }
.btn-refresh.spin svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.tbl .wrap { white-space: normal; min-width: 220px; }
.bar-cell { position: relative; min-width: 90px; }
.bar-cell span { position: relative; z-index: 1; }
.bar-cell em { position: absolute; top: 7px; bottom: 7px; border-radius: 4px; opacity: .18; }
.heat { font-weight: 600; border-radius: 0; }

.chart-box { position: relative; height: 320px; }
.chart-box.sm { height: 230px; } .chart-box.lg { height: 380px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; transition: opacity .15s; }
.legend span.off { opacity: .35; }
.legend i { width: 12px; height: 4px; border-radius: 2px; }

.breadcrumb { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.breadcrumb button { border: 0; background: var(--line-2); padding: 5px 11px; border-radius: 8px; font-weight: 600; color: var(--muted); }
.breadcrumb button:hover { color: var(--green); }
.breadcrumb button.cur { background: var(--green); color: #fff; }
.breadcrumb .sep { color: var(--faint); }

/* ---------------------------------------------------------------- allocation */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.q { border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; background: var(--card-2); }
.q .qt { font-weight: 600; font-size: 13px; margin-bottom: 8px; display: flex; justify-content: space-between; gap: 8px; }
.q .qt .tag { font-weight: 700; }
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opts button { border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 6px 10px; font-size: 12.5px; transition: all .12s; text-align: left; }
.opts button:hover { border-color: var(--green); }
.opts button.on { background: var(--green); color: #fff; border-color: var(--green); }
.profile { display: flex; gap: 18px; align-items: center; }
.gauge { width: 168px; flex: none; }
.profile-name { font-size: 22px; font-weight: 800; color: var(--green); letter-spacing: -.3px; }
.steps5 { display: flex; gap: 4px; margin-top: 10px; }
.steps5 i { flex: 1; height: 8px; border-radius: 4px; background: var(--line); transition: background .4s; }
.steps5 i.on { background: var(--lime); } .steps5 i.cur { background: var(--green); }
.score-row { display: flex; justify-content: space-between; font-size: 13px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.score-row:last-child { border-bottom: 0; }
.alloc-bar { display: flex; height: 16px; border-radius: 8px; overflow: hidden; margin: 6px 0 2px; }
.alloc-bar span { transition: width .6s cubic-bezier(.2,.7,.2,1); }

/* ---------------------------------------------------------------- modal / toasts / progress */
.modal { position: fixed; inset: 0; background: rgba(4, 22, 13, .45); backdrop-filter: blur(3px); display: none; align-items: center; justify-content: center; z-index: 60; padding: 20px; }
.modal.open { display: flex; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
.modal-card { background: var(--card); border-radius: 16px; box-shadow: var(--shadow-lg); width: min(620px, 100%); max-height: 90vh; overflow: auto; animation: pop .25s cubic-bezier(.2,.8,.3,1.2); }
@keyframes pop { from { transform: scale(.95) translateY(10px); opacity: 0; } }
.modal-h { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-h h3 { margin: 0; font-size: 17px; }
.modal-b { padding: 18px 22px; }
.modal-f { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.progress { height: 8px; background: var(--line-2); border-radius: 8px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--green), var(--lime)); border-radius: 8px; transition: width .4s ease; }
.steps { list-style: none; margin: 16px 0 0; padding: 0; }
.steps li { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; font-size: 13.5px; color: var(--muted); }
.steps li .st { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); flex: none; display: grid; place-items: center; margin-top: 1px; }
.steps li.run { color: var(--text); } .steps li.run .st { border-color: var(--green); border-top-color: transparent; animation: spin .8s linear infinite; }
.steps li.ok { color: var(--text); } .steps li.ok .st { background: var(--green); border-color: var(--green); }
.steps li.ok .st::after { content: ""; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.steps li.err .st { background: var(--neg); border-color: var(--neg); }
.steps li.warn .st { background: var(--warn); border-color: var(--warn); }
.steps li small { display: block; color: var(--muted); font-size: 12px; }
.toasts { position: fixed; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 70; }
.toast { background: var(--green-900); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 13.5px; max-width: 380px; display: flex; gap: 10px; align-items: flex-start;
  animation: slidein .3s cubic-bezier(.2,.8,.3,1.1); border-left: 4px solid var(--lime); }
.toast.err { border-left-color: #FF6B6B; } .toast.warn { border-left-color: #F2A900; }
.toast.out { animation: slideout .3s ease forwards; }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }
@keyframes slideout { to { transform: translateX(30px); opacity: 0; } }

.print-head { display: none; }
.only-print { display: none; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1280px) { .g5, .g6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g-21, .g-12, .g-32 { grid-template-columns: 1fr; } }
@media (max-width: 960px) {
  .icon-btn.mobile-menu { display: grid; }
  .sidebar { transform: translateX(-100%); width: 248px; } .app.menu-open .sidebar { transform: none; }
  .main { margin-left: 0; } .mobile-menu { display: grid; } .g2, .g3, .g4, .g5, .g6 { grid-template-columns: 1fr 1fr; }
  .stamp { display: none; } .view { padding: 16px; } .topbar { padding: 12px 16px; } .form-grid { grid-template-columns: 1fr; }
  .top-actions .btn span { display: none; }
}
@media (max-width: 560px) { .g2, .g3, .g4, .g5, .g6 { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- print / PDF */
@media print {
  @page { size: A4 landscape; margin: 10mm 10mm 14mm;
    @bottom-left { content: "Tài liệu tham khảo lập bằng công cụ nội bộ SMART SALES, không phải tài liệu chính thức của VCBF hay tổ chức nào; không phải lời chào bán hay khuyến nghị đầu tư."; font: 7pt "Be Vietnam Pro", Arial, sans-serif; color: #6B7A73; vertical-align: top; padding-top: 3mm; }
    @bottom-right { content: counter(page) " / " counter(pages); font: 7.5pt Arial, sans-serif; color: #6B7A73; vertical-align: top; padding-top: 3mm; width: 16mm; } }
  :root { --bg: #fff; }
  body { background: #fff; font-size: 11px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sidebar, .topbar, .toasts, .modal, .no-print, .btn, .seg, .icon-btn, .toolbar .field:has(select), .dropdown { display: none !important; }
  .main { margin: 0; } .view { padding: 0; max-width: none; }
  .view > * { animation: none; }
  .print-head { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 3px solid var(--green); padding-bottom: 8px; margin-bottom: 12px; }
  .print-head h2 { margin: 0; color: var(--green); font-size: 18px; } .print-head div { font-size: 11px; color: var(--muted); text-align: right; }
  .only-print { display: block; }
  .card { box-shadow: none; break-inside: avoid; border-color: #ccc; }
  .tbl-wrap, .tbl-wrap.tall { max-height: none; overflow: visible; }
  .tbl th { position: static; }
  .fund-card:hover { transform: none; }
  .chart-box, .chart-box.lg, .chart-box.sm { height: 230px !important; }
  .page-break { break-before: page; }
  .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } .g6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g-21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } .g-12 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
  .g-32 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
  .grid:has(> .no-print) { display: block; }
  .kpis { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .tbl td, .tbl th { padding: 5px 7px; }
  .grid, .kpis { gap: 10px; } .mt { margin-top: 10px; }
}
