/* ==========================================================================
   cb-viz.css — thành phần mới & biểu đồ v3.6 (nạp SAU theme-corbel.css)
   Class biểu đồ (db-*) giữ tên gốc của Corbel để dễ đối chiếu với mã tham chiếu.
   ========================================================================== */

/* ---------- Bảng màu (radio-pill) + hàng cài đặt + viên chọn trượt ---------- */
.pal { flex-wrap: wrap; gap: 10px; display: flex; }
.pal__opt { background: var(--glass-2); min-height: 44px; box-shadow: inset 0 0 0 1px var(--line); font-size: var(--fs-md); color: var(--muted); border-radius: 999px; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; font-weight: 600; transition: box-shadow .2s, color .2s; display: inline-flex; border: 0; cursor: pointer; font-family: var(--font); height: auto; }
.pal__opt:hover { color: var(--text); }
.pal__opt[aria-checked="true"] { color: var(--text); box-shadow: inset 0 0 0 2px var(--text); }
.pal__sw { border-radius: 50%; flex: none; grid-template-columns: 1fr 1fr; width: 32px; height: 32px; display: grid; overflow: hidden; box-shadow: inset 0 0 0 1px #00000014; }
.pal__sw i { display: block; }
.cb-set-help { font-size: var(--fs-sm); margin: 4px 0 14px; max-width: 62ch; }
.cb-set-list { list-style: none; margin: 0; padding: 0; }
.cb-set-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cb-set-row:last-child { border-bottom: 0; }
.cb-set-row b { font-weight: 600; display: block; }
.cb-set-row small { color: var(--muted); font-size: var(--fs-sm); display: block; max-width: 56ch; }
.cb-seg--sm button { height: 28px; min-height: 28px; font-size: var(--fs-xs); padding: 0 11px; }
.cb-listpill { position: absolute; z-index: 0; top: 0; left: 0; background: var(--glass-3); border-radius: 14px; box-shadow: inset 0 0 0 1px var(--rim); opacity: 0; pointer-events: none; }
:root[data-theme="dark"] .cb-listpill { background: #ffffff24; }
body.cb-fx .settings-nav-item.active { background: transparent; box-shadow: none; }

/* thanh nạp tab cũ (laser) đơn sắc; bỏ viên "telemetry" cũ vì đã có chuyển cảnh Corbel */
.quant-tab-loader-pill { display: none !important; }
.quant-tab-laser-fill { background: var(--text) !important; box-shadow: none !important; }
body.cb-fx:not([data-cb-page="cockpit"]) #cb-cockpit-views, body:not([data-cb-page="cockpit"]) #cb-cockpit-views { display: none; }
@media (min-width: 1700px) { .cb-ph-meta { display: inline-flex; } }

/* ==========================================================================
   VÙNG "TỔNG QUAN" (Cockpit › Tổng quan) — bố cục lưới 12 cột của trang Dashboard Corbel
   ========================================================================== */
.db { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; display: grid; width: 100%; min-width: 0; }
.db[hidden] { display: none; }
.db > .card { min-width: 0; }
.db .card, .cbo-card { border-radius: var(--r); background: var(--glass); box-shadow: inset 0 0 0 1px var(--rim), var(--shadow); padding: 20px; position: relative; min-width: 0; }
.db .card.tile--ocean { background: var(--ocean); box-shadow: none; }
.db .card__head, .cbo-head { align-items: center; gap: 10px; min-height: 32px; margin-bottom: 14px; display: flex; }
.db .card__title { font-size: var(--fs-lg); letter-spacing: -.005em; align-items: center; gap: 6px; font-weight: 600; display: flex; margin: 0; }
.db .card__actions { align-items: center; gap: 6px; margin-left: auto; display: flex; }
.db .card__sub { color: var(--muted); font-size: var(--fs-sm); }
.db-perf { grid-column: span 4; flex-direction: column; display: flex; }
.db-an { grid-column: span 8; }
.cbo-line { grid-column: span 7; }
.db-vis { grid-column: span 5; }
.db-heatc { grid-column: span 7; }
.cbo-funnel { grid-column: span 5; }
.cbo-movers { grid-column: span 12; }
.db-info { color: var(--faint); cursor: help; border-radius: 50%; place-items: center; display: inline-grid; font-size: 11px; }
.db-info:hover { color: var(--muted); }
.tile--ocean .db-info { color: var(--muted); }
.delta { background: var(--up-soft); height: 20px; color: var(--up); font-size: var(--fs-2xs); border-radius: 999px; align-items: center; gap: 2px; padding: 0 7px 0 5px; font-weight: 700; display: inline-flex; font-family: var(--font); }
.delta i { font-size: 9px; transition: none; display: inline-block; }
.delta.is-down { background: var(--down-soft); color: var(--down); }
.db-more { color: var(--text); font-size: var(--fs-sm); font-weight: 600; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; cursor: pointer; background: none; border: 0; padding: 0; height: auto; box-shadow: none; text-align: left; font-family: var(--font); }
.db-more:hover { color: var(--primary-ink); text-decoration-color: currentColor; }
.tile--ocean .db-more { color: var(--text); }

/* mini trong thẻ KPI */
.cb-kpi-viz { position: absolute; right: 20px; top: 40px; width: 84px; height: 44px; display: flex; align-items: flex-end; justify-content: flex-end; gap: 0; }
.db-mbars { align-items: stretch; gap: 5px; height: 42px; display: flex; }
.db-mt { background: var(--well); border-radius: 5px; width: 13px; position: relative; overflow: hidden; }
.db-mf { background: var(--c2); border-radius: 5px; position: absolute; inset: 0; }
.db-mt:last-child .db-mf { background: var(--primary); }
.db-spark { width: 84px; height: 40px; overflow: visible; }
.db-spark__line { fill: none; stroke: var(--c1); stroke-width: 2.2px; stroke-linecap: round; stroke-linejoin: round; }
.db-spark__dot { fill: var(--surface); stroke: var(--c1); stroke-width: 2.2px; }
.db-ring { width: 46px; height: 46px; position: relative; }
.db-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.db-ring circle { fill: none; stroke-width: 5px; }
.db-ring__track { stroke: var(--well); }
.db-ring__fill { stroke: var(--c3); stroke-linecap: round; stroke-dasharray: 0 100; }
.db-ring__fill.warn { stroke: var(--warn); } .db-ring__fill.down { stroke: var(--down); }
.db-ring__pct { font-size: var(--fs-2xs); place-items: center; font-weight: 600; display: grid; position: absolute; inset: 0; }
.db-eq { align-items: stretch; gap: 3px; height: 42px; display: flex; }
.db-et { background: var(--well); border-radius: 3px; width: 5px; position: relative; overflow: hidden; }
.db-ef { background: var(--c2); border-radius: 3px; position: absolute; inset: 0; }
.db-et:last-child .db-ef { background: var(--primary); }
.db-eq.is-hot .db-et:last-child .db-ef { background: var(--down); }

/* đồng hồ (gauge) */
.db-gauge { width: 100%; max-width: 290px; margin: 2px auto 0; position: relative; }
.db-gauge svg { width: 100%; height: auto; display: block; overflow: visible; }
.db-ticks line { stroke: var(--primary); stroke-width: 2px; stroke-linecap: round; opacity: .14; transition: opacity .25s; }
.db-ticks line.is-lit { opacity: .85; }
.db-g-track, .db-g-arc { fill: none; stroke-width: 16px; stroke-linecap: round; }
.db-g-track { stroke: var(--well); }
.db-g-arc { stroke: url(#cbo-gauge-g); stroke-dasharray: 0 100; }
.db-g-knob circle:first-child { fill: var(--surface); stroke: var(--primary); stroke-width: 3px; }
.db-g-knob circle:last-child { fill: var(--primary); }
.db-gauge__c { justify-items: center; gap: 2px; display: grid; position: absolute; bottom: 0; left: 0; right: 0; }
.db-gauge__c p { align-items: center; gap: 6px; display: flex; margin: 0; }
.db-gauge__c b { font-size: var(--fs-display); letter-spacing: -.035em; font-weight: 600; line-height: 1; font-family: var(--display); }
.db-gauge__c small { color: var(--faint); font-size: var(--fs-xs); }
.db-note { gap: 4px; margin-top: 16px; display: grid; }
.db-note h3 { font-size: var(--fs-base); font-weight: 600; margin: 0; }
.db-note p { color: var(--muted); font-size: var(--fs-sm); margin: 0; }
.db-perf__more { margin-top: auto; padding-top: 14px; }

/* cột kẻ sọc + viên nhấn + chú thích nổi */
.db-an__sum { color: var(--faint); font-size: var(--fs-sm); }
.db-chart { padding-bottom: 28px; position: relative; }
.db-plot { height: 238px; position: relative; }
.db-grid { flex-direction: column; justify-content: space-between; display: flex; position: absolute; inset: 0; }
.db-gl { height: 0; padding-left: 44px; position: relative; }
.db-gl i { border-top: 1px dashed var(--line-2); display: block; }
.db-gl span { text-align: right; width: 36px; font-size: var(--fs-2xs); color: var(--faint); position: absolute; top: -8px; left: 0; }
.db-avg { border-top: 1.5px dashed var(--c4); z-index: 2; pointer-events: none; height: 0; position: absolute; top: 0; left: 44px; right: 0; }
.db-avg span { background: var(--sea-soft); color: var(--sea); font-size: var(--fs-2xs); border-radius: 6px; padding: 1px 7px; font-weight: 600; position: absolute; top: -21px; right: 0; }
.db-cols { grid-template-columns: repeat(12, minmax(0, 1fr)); display: grid; position: absolute; inset: 0 0 0 44px; }
.db-col { border-radius: 10px; justify-content: center; height: 100%; display: flex; position: relative; background: none; border: 0; padding: 0; box-shadow: none; min-height: 0; cursor: pointer; }
.db-col:focus-visible { outline-offset: -2px; }
.db-col__track { border-radius: 999px; width: min(30px, 66%); height: 100%; position: relative; overflow: hidden; }
.db-col__fill { background: repeating-linear-gradient(-45deg, var(--hatch) 0 2px, transparent 2px 7px), var(--hatch-bg); border-radius: 999px; transition: background-color .25s; position: absolute; inset: 0; }
.db-col:hover .db-col__fill { background-color: color-mix(in srgb, var(--primary) 12%, transparent); }
.db-col.is-neg .db-col__fill { background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--down) 38%, transparent) 0 2px, transparent 2px 7px), color-mix(in srgb, var(--down) 8%, transparent); }
.db-col.is-fc .db-col__fill { border: 1.5px dashed color-mix(in srgb, var(--primary) 50%, transparent); }
.db-col__x { font-size: var(--fs-2xs); color: var(--faint); transition: color .2s; position: absolute; bottom: -25px; white-space: nowrap; }
.db-col.is-on .db-col__x { color: var(--text); font-weight: 600; }
.db-hl { pointer-events: none; z-index: 1; border-radius: 999px; width: 30px; position: absolute; top: 0; bottom: 0; left: 0; overflow: hidden; }
.db-hl__fill { background: linear-gradient(180deg, var(--primary-2), var(--primary) 40%, var(--primary-ink)); border-radius: 999px; position: absolute; inset: 0; box-shadow: inset 0 1px #ffffff59; }
.db-hl.is-neg .db-hl__fill { background: linear-gradient(180deg, color-mix(in srgb, var(--down) 70%, #fff), var(--down)); }
.db-hl__cap { background: #fff; border-radius: 50%; width: 10px; height: 10px; margin-left: -5px; position: absolute; top: 7px; left: 50%; box-shadow: 0 0 0 4px #ffffff4d; }
.db-tip { z-index: 3; background: var(--ink-btn); min-width: 164px; color: var(--on-ink-btn); box-shadow: var(--shadow-pop); font-size: var(--fs-xs); pointer-events: none; border-radius: 12px; padding: 10px 12px; position: absolute; top: 0; left: 0; }
.db-tip__h { justify-content: space-between; align-items: center; gap: 8px; margin: 0 0 7px; font-weight: 600; display: flex; }
.db-tip__h em { font-style: normal; font-size: var(--fs-2xs); background: #8ec3ea40; border-radius: 5px; padding: 1px 6px; }
.db-tip dl { gap: 4px; margin: 0; display: grid; }
.db-tip dl div { justify-content: space-between; gap: 18px; display: flex; }
.db-tip dt { opacity: .68; }
.db-tip dd { margin: 0; font-weight: 600; }
.db-tip .up { color: #5ee6b4; } .db-tip .down { color: #ff9ea2; }
:root[data-theme="dark"] .db-tip .up { color: #08775a; } :root[data-theme="dark"] .db-tip .down { color: #c22d34; }

/* bản đồ nhiệt */
.db-scale { font-size: var(--fs-2xs); color: var(--faint); gap: 4px; align-items: center; }
.db-scale span { margin: 0 3px; }
.db-sw { background: var(--c); border-radius: 4px; width: 14px; height: 14px; display: inline-block; }
.db-heat { grid-template-columns: 112px repeat(7, minmax(0, 1fr)); align-items: center; gap: 7px; display: grid; }
.db-heat__d { text-align: center; font-size: var(--fs-2xs); color: var(--faint); font-weight: 500; }
.db-heat__p { font-size: var(--fs-2xs); color: var(--faint); white-space: nowrap; }
.db-cell { height: 32px; }
.db-cell i { background: var(--c, var(--heat-0)); border-radius: 10px; height: 100%; transition: background-color .35s, box-shadow .2s; display: block; }
.db-cell.is-hot i { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--primary); }
.db-htip { z-index: 3; background: var(--ink-btn); color: var(--on-ink-btn); box-shadow: var(--shadow-pop); font-size: var(--fs-xs); white-space: nowrap; pointer-events: none; opacity: 0; border-radius: 10px; gap: 1px; padding: 7px 11px; display: grid; position: absolute; top: 0; left: 0; }
.db-htip b { font-weight: 600; } .db-htip span { opacity: .72; }

/* vòng donut + chú giải */
.db-vis__body { grid-template-columns: minmax(0, 1fr) 168px; align-items: center; gap: 18px; display: grid; }
.db-vis .stat__val, .stat__val { font-size: var(--fs-4xl); letter-spacing: -.025em; font-weight: 600; line-height: 1.1; font-family: var(--display); margin: 0; }
.stat__meta { color: var(--faint); font-size: var(--fs-sm); align-items: center; gap: 6px; display: flex; margin: 6px 0 0; flex-wrap: wrap; }
.db-legend { gap: 2px; margin: 14px 0 0; padding: 0; list-style: none; display: grid; }
.db-legend button { border-radius: 9px; align-items: center; gap: 9px; width: 100%; margin-left: -8px; padding: 6px 8px; transition: background-color .2s, opacity .25s; display: flex; background: none; border: 0; height: auto; box-shadow: none; cursor: pointer; font-family: var(--font); color: var(--text); }
.db-legend button:hover { background: var(--well); }
.db-legend button.is-dim { opacity: .42; }
.db-legend i { background: var(--c); border-radius: 3px; flex: none; width: 10px; height: 10px; }
.db-legend__l { text-align: left; color: var(--muted); font-size: var(--fs-sm); flex: 1; }
.db-legend__v { font-weight: 600; font-size: var(--fs-sm); }
.db-donut { aspect-ratio: 1; width: 168px; position: relative; }
.db-donut svg { width: 100%; height: 100%; display: block; overflow: visible; }
.db-donut__track { fill: none; stroke: var(--well); stroke-width: 20px; }
.db-seg { fill: none; stroke-width: 20px; stroke-dasharray: 0 100; cursor: pointer; }
.db-donut__c { text-align: center; pointer-events: none; place-content: center; display: grid; position: absolute; inset: 0; }
.db-donut__c b { font-size: var(--fs-4xl); letter-spacing: -.03em; font-weight: 600; line-height: 1.1; font-family: var(--display); }
.db-donut__c small { color: var(--faint); font-size: var(--fs-xs); }

/* đường vốn (line chart có thước ngắm) */
.cbo-line { display: flex; flex-direction: column; }
.an-main__head { align-items: flex-start; margin-bottom: 6px; }
.an-main__fig { gap: 4px; display: grid; }
.an-main__total { align-items: center; gap: 10px; margin-top: 4px; display: flex; }
.an-main__total b { font-size: var(--fs-display); line-height: 1.1; font-family: var(--display); font-weight: 600; letter-spacing: -.02em; }
.an-legend { font-size: var(--fs-sm); color: var(--muted); gap: 16px; margin: 0 0 0 auto; padding: 0; list-style: none; display: flex; }
.an-legend li { white-space: nowrap; align-items: center; gap: 7px; display: flex; }
.an-sw { border-top: 2.5px solid var(--c1); border-radius: 2px; flex: none; width: 16px; height: 0; display: inline-block; }
.an-sw--prev { border-top: 2px dashed var(--faint); }
.an-chart { outline-offset: 4px; touch-action: pan-y; border-radius: 10px; flex: 1; min-height: 280px; margin: 0 -6px -6px; position: relative; }
.an-chart__svg { display: block; position: absolute; inset: 0; overflow: visible; }
.an-grad-a { stop-color: var(--c1); stop-opacity: .16; } .an-grad-b { stop-color: var(--c1); stop-opacity: 0; }
:root[data-theme="dark"] .an-grad-a { stop-opacity: .24; }
.an-gridlines line { stroke: var(--line); stroke-width: 1px; } .an-gridlines line:last-of-type { stroke: var(--line-2); }
.an-gridlines text, .an-xlabels text { fill: var(--faint); font: 500 var(--fs-xs) var(--font); font-feature-settings: "tnum" 1; }
.an-area { fill: url(#cbo-grad); }
.an-line { fill: none; stroke: var(--c1); stroke-width: 2.2px; stroke-linecap: round; stroke-linejoin: round; }
.an-prev { fill: none; stroke: var(--faint); stroke-width: 1.7px; stroke-dasharray: 5 5; stroke-linecap: round; opacity: .8; }
.an-cross { stroke: var(--line-2); stroke-width: 1px; stroke-dasharray: 3 3; pointer-events: none; }
.an-dot { fill: var(--surface); stroke: var(--c1); stroke-width: 3px; pointer-events: none; }
.an-tip { z-index: 2; border-radius: var(--r-sm); background: var(--float); min-width: 196px; box-shadow: var(--shadow-pop), inset 0 0 0 1px var(--line); font-size: var(--fs-sm); pointer-events: none; gap: 5px; padding: 10px 12px; display: grid; position: absolute; top: 0; left: 0; }
.an-tip > b { font-weight: 600; font-size: var(--fs-sm); }
.an-tip__row { color: var(--muted); align-items: center; gap: 8px; display: flex; }
.an-tip__row b { color: var(--text); margin-left: auto; padding-left: 12px; font-weight: 600; }
.an-tip__delta { font-size: var(--fs-xs); color: var(--up); font-weight: 600; } .an-tip__delta.is-down { color: var(--down); }
.cbo-empty { display: grid; place-items: center; text-align: center; color: var(--muted); gap: 6px; padding: 48px 16px; font-size: var(--fs-sm); }
.cbo-empty b { color: var(--text); font-weight: 600; font-size: var(--fs-md); }

/* phễu tín hiệu */
.an-funnel { display: grid; }
.an-fstep { gap: 8px; display: grid; }
.an-fstep__top { font-size: var(--fs-sm); align-items: baseline; gap: 12px; display: flex; }
.an-fstep__name { color: var(--muted); font-weight: 500; }
.an-fstep__top b { font-weight: 600; font-size: var(--fs-base); margin-left: auto; }
.an-fstep__pct { text-align: right; min-width: 44px; color: var(--faint); font-size: var(--fs-xs); }
.an-fstep__track { background: var(--well); border-radius: 999px; height: 12px; overflow: hidden; }
.an-fstep__fill { border-radius: inherit; background: var(--c1); transform-origin: 0; height: 100%; display: block; }
.an-drop { font-size: var(--fs-xs); color: var(--faint); align-items: center; gap: 4px; padding: 8px 0; display: flex; }
.an-drop span { color: var(--muted); font-weight: 600; } .an-drop.is-worst span { color: var(--down); }
.cbo-fnote { margin: 14px 0 0; color: var(--faint); font-size: var(--fs-xs); }

/* mã biến động mạnh (danh sách + sparkline) */
.cbo-movers__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.cbo-movers h3 { margin: 0 0 4px; font-size: var(--fs-sm); color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.cbo-mv { display: grid; grid-template-columns: 30px minmax(0, 1fr) 84px auto; gap: 12px; align-items: center; padding: 9px 8px; border-radius: 12px; cursor: pointer; margin: 0 -8px; transition: background-color .15s; }
.cbo-mv:hover { background: var(--well); }
.cbo-mv + .cbo-mv { border-top: 1px solid var(--line); border-radius: 0; }
.cbo-mv__rank { color: var(--faint); font-weight: 600; }
.cbo-mv__name b { font-weight: 600; display: block; } .cbo-mv__name small { color: var(--faint); font-size: var(--fs-xs); }
.cbo-mv svg { width: 84px; height: 28px; overflow: visible; }
.cbo-mv svg path { fill: none; stroke-width: 1.8px; stroke-linecap: round; stroke-linejoin: round; }
.cbo-mv .delta { justify-self: end; }
.cbo-mv__px { text-align: right; font-weight: 600; font-size: var(--fs-sm); }

@media (max-width: 1320px) { .db-perf { grid-column: span 5; } .db-an { grid-column: span 7; } .db-heatc, .db-vis, .cbo-line, .cbo-funnel { grid-column: span 12; } .db-vis__body { grid-template-columns: minmax(0, 1fr) 180px; } }
@media (max-width: 1100px) { .db-perf, .db-an { grid-column: span 12; } .cbo-movers__grid { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .db-heat { grid-template-columns: 64px repeat(7, minmax(0, 1fr)); gap: 5px; } .db-cell { height: 26px; } .db-cell i { border-radius: 7px; } .db-plot { height: 210px; } .db-gl { padding-left: 38px; } .db-gl span { width: 32px; } .db-avg, .db-cols { left: 38px; } .db-cols { inset-inline-start: 38px; } .an-legend { display: none; } .db-vis__body { grid-template-columns: minmax(0, 1fr); } .db-donut { justify-self: center; grid-row: 1; width: 160px; } }
@media (max-width: 560px) { .db .card { padding: 16px; } .cb-kpi-viz { display: none; } .cbo-mv { grid-template-columns: 22px minmax(0, 1fr) 64px auto; gap: 8px; } .cbo-mv svg { width: 64px; } }

body.cb [hidden], body.cb .delta[hidden] { display: none !important; }

/* ---------- Thanh điểm (meter) + Radar dạng thẻ (lưới sản phẩm Corbel) ---------- */
.meter { background: var(--well); border-radius: 99px; height: 7px; overflow: hidden; }
.meter__fill { border-radius: inherit; background: var(--primary); transform-origin: 0; height: 100%; transition: background-color .35s; }
.meter[data-state="ok"] .meter__fill { background: var(--up); } .meter[data-state="low"] .meter__fill { background: var(--warn); } .meter[data-state="mid"] .meter__fill { background: var(--primary); }
.cb-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 16px; padding: 6px 4px 8px; }
.cb-cards[hidden] { display: none; }
.cb-card { position: relative; min-width: 0; }
.cb-card__in { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; border-radius: var(--r); background: var(--glass-2); box-shadow: 0 0 0 1px var(--line); height: 100%; position: relative; cursor: pointer; isolation: isolate; outline: none; }
.cb-card__in::before { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: var(--shadow-lift); opacity: 0; transition: opacity .3s; z-index: -1; }
.cb-card__in::after { content: ""; position: absolute; inset: 0; border-radius: inherit; border: 1px solid transparent; transition: border-color .25s; pointer-events: none; }
.cb-card__in:hover::before, .cb-card__in:focus-visible::before { opacity: 1; } .cb-card__in:hover::after { border-color: var(--line-2); }
.cb-card__in:focus-visible::after { border-color: var(--text); }
.cb-card__ring { position: absolute; inset: -1px; border-radius: inherit; box-shadow: 0 0 0 2px var(--primary), 0 0 0 6px var(--primary-soft); opacity: 0; transition: opacity .3s; pointer-events: none; }
.cb-card.is-selected .cb-card__ring { opacity: 1; }
.cb-card__top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cb-card__sym { font-size: var(--fs-lg); font-weight: 600; letter-spacing: -.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-card__star { margin-left: auto; width: 28px; height: 28px; display: inline-grid; place-items: center; border-radius: 50%; color: var(--faint); background: none; border: 0; padding: 0; cursor: pointer; box-shadow: none; transition: background-color .2s, color .2s; }
.cb-card__star:hover { background: var(--well); color: var(--text); } .cb-card__star .fa-solid { color: var(--warn); }
.cb-card__px { font: 600 var(--fs-3xl)/1.15 var(--display); letter-spacing: -.02em; }
.cb-card__px strong { font-weight: 600; }
.cb-card__chg { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: var(--fs-sm); }
.cb-card__chg .radar-pct { font-weight: 700; } .cb-card__vol { color: var(--faint); }
.cb-card__sig { margin-left: auto; }
.cb-card__row { display: flex; justify-content: space-between; font-size: var(--fs-sm); color: var(--muted); margin-bottom: 6px; }
.cb-card__row b { color: var(--text); font-weight: 600; }
.cb-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); margin-top: auto; padding-top: 12px; font-size: var(--fs-sm); color: var(--muted); }
.cb-card__foot small { color: var(--faint); font-size: var(--fs-2xs); }
.cb-card__trend svg { width: 64px; height: 22px; display: block; }
.cb-card__trend svg polyline { stroke: var(--text) !important; opacity: .8; }
#radar-table-body .radar-confluence-wrap + * { }
@media (max-width: 560px) { .cb-cards { grid-template-columns: 1fr; gap: 12px; } .cb-card__in { padding: 16px; } }

/* ---------- Sổ tay: ô tìm kiếm lớn + tô sáng ---------- */
.cb-guide-search { margin: 4px 0 8px; display: grid; gap: 8px; }
.cb-guide-search__box { position: relative; display: block; width: min(640px, 100%); }
.cb-guide-search__box > i.fa-magnifying-glass { position: absolute; left: 18px; top: 50%; margin-top: -8px; color: var(--faint); pointer-events: none; font-size: 15px; }
.cb-guide-search__box input { width: 100%; height: 52px; padding: 0 52px 0 48px; border: 0; border-radius: var(--r-sm); background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--line-2); font-size: var(--fs-lg); transition: box-shadow .2s; }
.cb-guide-search__box input::-webkit-search-cancel-button { display: none; }
.cb-guide-search__box input:focus { box-shadow: inset 0 0 0 1.5px var(--text), 0 0 0 4px var(--primary-soft); outline: none; }
.cb-guide-search__clear { position: absolute; right: 8px; top: 8px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer; box-shadow: none; }
.cb-guide-search__clear:hover { background: var(--well); color: var(--text); }
.cb-guide-count { margin: 0; color: var(--muted); font-size: var(--fs-sm); min-height: 1.4em; }
mark.cb-mark { background: color-mix(in srgb, var(--c5) 32%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
#tab-guide .cb-hide { display: none !important; }
#tab-guide.is-searching .guide-nav-tabs { display: none; }

/* ---------- Sức khoẻ hệ thống: thanh CPU/RAM kiểu meter Corbel (trước đây chưa có CSS cho .bar) ---------- */
.settings-card .bar { background: var(--well); border-radius: 99px; height: 7px; overflow: hidden; margin: 10px 0 6px; }
.settings-card .bar > i { display: block; height: 100%; border-radius: inherit; background: var(--primary); transition: width .9s var(--ease), background-color .35s; }
.settings-card .bar > i[data-state="warn"] { background: var(--warn); } .settings-card .bar > i[data-state="down"] { background: var(--down); }
.cc-metric-sub { color: var(--muted); font-size: var(--fs-sm); }

/* cán cân LONG / SHORT (an-split) */
.an-split__share { gap: 10px; display: grid; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.an-split__pcts { color: var(--muted); font-size: var(--fs-sm); justify-content: space-between; display: flex; gap: 12px; }
.an-split__pcts b { font: 600 var(--fs-3xl)/1.1 var(--display); color: var(--text); margin-right: 4px; }
.an-split__track { background: var(--well); border-radius: 999px; height: 10px; position: relative; overflow: hidden; }
.an-split__fill { width: 100%; position: absolute; top: 0; bottom: 0; }
.an-split__fill--on { background: var(--up); transform-origin: 0; border-radius: 999px 0 0 999px; left: 0; transform: scaleX(0); }
.an-split__fill--st { background: var(--down); transform-origin: 100%; box-shadow: -2px 0 0 var(--surface); border-radius: 0 999px 999px 0; right: 0; transform: scaleX(0); }

/* Lãi/Lỗ theo thứ trong tuần (an-week) */
.cbo-movers { grid-column: span 7; } .cbo-week { grid-column: span 5; display: flex; flex-direction: column; }
.an-week__cap { font-size: var(--fs-sm); flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: -4px 0 16px; display: flex; }
.an-week__cap b { font-weight: 600; } .an-week__cap span { color: var(--faint); }
.an-bars { --n: 7; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: clamp(2px, calc(56px / var(--n)), 12px); border-bottom: 1px solid var(--line-2); flex: 172px; align-items: stretch; min-height: 172px; max-height: 236px; display: grid; }
.an-bar { border-radius: var(--r-xs) var(--r-xs) 0 0; justify-content: center; align-items: flex-end; height: 100%; transition: background-color .2s; display: flex; position: relative; overflow: hidden; }
.an-bar:hover { background: var(--well); }
.an-bar__fill { transform-origin: 50% 100%; border-radius: 6px 6px 2px 2px; width: min(100%, 28px); height: 100%; display: block; transform: scaleY(0); }
.an-bars__x { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: clamp(2px, 8px, 12px); font-size: var(--fs-xs); color: var(--faint); text-align: center; margin-top: 8px; display: grid; }
.an-week__sum { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: auto 0 0; padding-top: 16px; display: grid; }
.an-week__sum > div { border-top: 1px solid var(--line); gap: 2px; padding: 12px 0 0 12px; display: grid; }
.an-week__sum > div:first-child { padding-left: 0; } .an-week__sum > div + div { border-left: 1px solid var(--line); }
.an-week__sum dt { color: var(--faint); font-size: var(--fs-xs); white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.an-week__sum dd { font: 600 var(--fs-md)/1.3 var(--display); letter-spacing: -.01em; margin: 0; }
@media (max-width: 1320px) { .cbo-movers, .cbo-week { grid-column: span 12; } }

/* thẻ thấp hơn thẻ bên cạnh: căn nội dung vào giữa thay vì để trống phía dưới */
.db-heatc, .db-vis { display: flex; flex-direction: column; }
.db-heatc .db-heat { flex: 1; grid-template-rows: auto; grid-auto-rows: minmax(44px, 1fr); align-content: stretch; }
.db-heatc .db-cell { height: auto; min-height: 44px; align-self: stretch; }
.db-vis__body { flex: 1; align-content: center; }
@media (max-width: 700px) { .db-heatc .db-heat { grid-auto-rows: minmax(26px, 1fr); } .db-heatc .db-cell { min-height: 26px; } }
