/* Seller XIXA — giao diện theo bản thiết kế v4 */
:root {
  --blue: #2F6BFF; --blue-d: #1F55E0; --blue-50: #EAF0FF; --blue-25: #F1F5FF;
  --violet: #7B61FF; --violet-2: #6D5CF0; --green: #12A150; --green-2: #22B573; --amber: #D98A00; --red: #E5484D; --orange: #F07B22;
  --ink: #121A33; --ink-2: #1A2238; --text: #3A4560; --muted: #6E7891; --muted-2: #8A93A8;
  --line: #EDF1F7; --line-2: #E3E8F1; --line-3: #EEF2F8; --bg: #F5F7FC; --card: #FFFFFF; --chip: #F3F5FA;
  --shadow: 0 1px 2px rgba(20,40,90,.04), 0 10px 30px -12px rgba(20,40,90,.10);
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); font-family: 'Plus Jakarta Sans', system-ui, sans-serif; color: var(--ink-2); -webkit-font-smoothing: antialiased; font-size: 14px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--violet-2); }
input::placeholder, textarea::placeholder { color: var(--muted-2); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #DDE3EE; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }

/* ---------- Khung ---------- */
.app { display: flex; height: 100vh; overflow: hidden; }
.side { width: 224px; flex: none; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 22px 14px; gap: 20px; overflow: auto; }
.logo { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.logo-ic { width: 34px; height: 34px; border-radius: 10px; display: block; flex: none; }
.logo-tx { font-weight: 800; font-size: 19px; letter-spacing: -.02em; color: var(--ink); }
.logo-tx span { color: #EE2551; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-i { padding: 10px 12px; border-radius: 10px; font-size: 14px; font-weight: 500; color: #5B6680; display: flex; align-items: center; gap: 12px; cursor: pointer; border: 0; background: transparent; text-align: left; width: 100%; }
.nav-i:hover { background: #F3F6FD; }
.nav-i.on { background: var(--blue-50); color: var(--blue); font-weight: 600; }
.nav-i svg { flex: none; }
.nav-i .lb { flex: 1; }
.nav-i .chev { color: #B4BCCB; font-size: 15px; }
.side-h { font-size: 12.5px; color: var(--muted); padding: 0 12px 6px; font-weight: 500; }
.sep { height: 1px; background: var(--line); margin: 0 8px; }
.src-i { padding: 8px 12px; font-size: 13.5px; color: var(--text); display: flex; align-items: center; gap: 12px; }
.src-i .lb { flex: 1; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.profile { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px 4px; text-align: center; }
.avatar-lg { width: 72px; height: 72px; border-radius: 50%; background: linear-gradient(150deg,#FFE3D3,#FFC7A8); color: #C2410C; display: grid; place-items: center; font-size: 24px; font-weight: 800; box-shadow: 0 6px 16px -6px rgba(194,65,12,.35); outline: 3px dashed #B9ADFF; outline-offset: 5px; margin-bottom: 10px; }
.p-name { font-size: 16px; font-weight: 800; color: #1F3A8A; }
.p-role { font-size: 13px; color: var(--blue); font-weight: 500; }
.p-out { font-size: 12px; color: var(--muted-2); margin-top: 8px; cursor: pointer; background: none; border: 0; }
.p-out:hover { color: var(--red); }

main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
.top { display: flex; align-items: center; gap: 16px; padding: 14px 28px; border-bottom: 1px solid var(--line); background: #fff; }
.ask { flex: 1 1 320px; max-width: 560px; display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 42px; border-radius: 11px; background: var(--chip); border: 1px solid var(--line); }
.ask input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; font-size: 13.5px; color: var(--ink); }
.top-r { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.btn-ai { position: relative; height: 38px; display: flex; align-items: center; gap: 7px; padding: 0 14px; border-radius: 10px; font-size: 13px; font-weight: 600; color: #fff; background: linear-gradient(135deg,#7C6CF2,#2F6BFF); border: 0; }
.btn-ai.off { background: #9DB4F2; }
.badge { position: absolute; top: -7px; right: -7px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: #F0453A; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; }
.me { display: flex; align-items: center; gap: 10px; cursor: pointer; background: none; border: 0; padding: 0; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: #FFE3D3; color: #C2410C; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.me-tx { display: flex; flex-direction: column; text-align: left; }
.me-tx b { font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.me-tx span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.vline { width: 1px; height: 28px; background: var(--line); }

.content { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 24px 28px 36px; display: flex; flex-direction: column; gap: 18px; }
.ph { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.ph-l { display: flex; flex-direction: column; gap: 4px; margin-right: auto; }
.ph-t { font-size: 27px; font-weight: 800; letter-spacing: -.025em; color: var(--ink); }
.ph-s { font-size: 14px; color: var(--muted); }
.ph-r { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.range { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 6px 0 14px; background: #fff; border: 1px solid var(--line-2); border-radius: 11px; }
.range-lb { font-size: 13px; font-weight: 500; color: var(--ink); white-space: nowrap; }
.seg { display: flex; gap: 2px; background: var(--chip); border-radius: 8px; padding: 3px; }
.seg button { padding: 4px 9px; border-radius: 6px; font-size: 12px; font-weight: 600; background: transparent; color: var(--muted); border: 0; }
.seg button.on { background: var(--blue); color: #fff; }
.custom-range { display: flex; gap: 6px; align-items: center; }
.custom-range input { height: 30px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 8px; font-size: 12.5px; }
.btn { height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; border: 1px solid var(--line-2); background: #fff; border-radius: 11px; font-size: 13px; color: var(--text); white-space: nowrap; }
.btn:hover { border-color: #C5CCDA; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-p { background: var(--blue); color: #fff; font-weight: 700; border-color: var(--blue); box-shadow: 0 8px 18px -8px rgba(47,107,255,.7); }
.btn-p:hover { background: var(--blue-d); border-color: var(--blue-d); }
.btn-sm { height: 32px; padding: 0 11px; border-radius: 8px; font-size: 12.5px; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
.btn-ghost { border-color: transparent; background: transparent; }

/* ---------- Thẻ ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 18px 20px; min-width: 0; }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-t { font-size: 15.5px; font-weight: 700; color: var(--ink); }
.card-s { font-size: 12.5px; color: var(--muted-2); }
.card-h .r { margin-left: auto; }
.link { color: var(--blue); font-size: 12.5px; font-weight: 600; cursor: pointer; background: none; border: 0; padding: 0; }
.grid { display: grid; gap: 16px; }
.g-kpi { grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.g-kpi6 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-1-1 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; }
.kpi-top { display: flex; align-items: center; gap: 10px; }
.kpi-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; flex: none; }
.kpi-lb { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi-v { font-size: 26px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.kpi-row { display: flex; align-items: flex-end; gap: 10px; }
.kpi-d { font-size: 12px; font-weight: 600; }
.kpi-d span { color: var(--muted-2); font-weight: 400; }
.spark { width: 100%; height: 30px; display: block; }

/* ---------- Biểu đồ ---------- */
.chart { position: relative; height: 230px; margin-left: 46px; }
.chart svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.chart .yax { position: absolute; left: -46px; top: 0; bottom: 0; display: flex; flex-direction: column; justify-content: space-between; font-size: 11px; color: var(--muted-2); width: 40px; text-align: right; }
.chart .xax { position: absolute; left: 0; right: 0; bottom: -22px; height: 16px; font-size: 11px; color: var(--muted-2); }
.chart .xax div { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.chart .grid-l { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line-3); }
.chart .hit { position: absolute; inset: 0; cursor: crosshair; }
.chart .vl { position: absolute; top: 0; bottom: 0; width: 1px; background: #C9D6F5; pointer-events: none; display: none; }
.tip { position: absolute; pointer-events: none; background: #121A33; color: #fff; border-radius: 10px; padding: 9px 11px; font-size: 12px; line-height: 1.5; white-space: nowrap; display: none; z-index: 5; box-shadow: 0 10px 24px -10px rgba(0,0,0,.5); }
.tip b { font-weight: 700; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding-bottom: 20px; position: relative; }
.bars .b { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; height: 100%; position: relative; min-width: 0; }
.bars .b > i { display: block; flex: 1; max-width: 16px; border-radius: 4px 4px 0 0; min-height: 2px; }
.bars .b > span { position: absolute; bottom: -20px; font-size: 10.5px; color: var(--muted-2); white-space: nowrap; }
.hbar { display: flex; flex-direction: column; gap: 6px; }
.hbar-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.hbar-row .nm { flex: 0 0 38%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-row .tr { flex: 1; height: 8px; border-radius: 999px; background: var(--line-3); overflow: hidden; }
.hbar-row .tr i { display: block; height: 100%; border-radius: 999px; }
.hbar-row .vl2 { flex: 0 0 auto; min-width: 54px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut { position: relative; width: 150px; height: 150px; flex: none; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut .c { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.donut .c b { display: block; font-size: 22px; font-weight: 800; color: var(--ink); }
.donut .c span { font-size: 12px; color: var(--muted); }
.dl { display: flex; flex-direction: column; gap: 9px; flex: 1; min-width: 150px; font-size: 13px; }
.dl > div { display: flex; align-items: center; gap: 8px; }
.dl i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.dl .v { margin-left: auto; font-weight: 600; }
.funnel { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.fstep { flex: 1 1 140px; border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.fstep .lb { font-size: 12.5px; color: var(--muted); }
.fstep .v { font-size: 21px; font-weight: 800; color: var(--ink); }
.fstep .r { font-size: 11.5px; font-weight: 600; }

/* ---------- Bảng QC ---------- */
.ins-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.ins { border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; border: 1px solid transparent; }
.ins-k { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.ins-g { margin-left: auto; font-size: 10.5px; color: var(--muted-2); }
.ins-t { font-size: 13.5px; font-weight: 600; line-height: 1.45; }
.ins-b { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.ins-a { display: flex; gap: 8px; margin-top: 2px; flex-wrap: wrap; }
.ins-a button { padding: 6px 11px; border-radius: 7px; font-size: 12px; font-weight: 600; border: 0; }
.ins-a .ghost { font-weight: 500; color: #5B6680; border: 1px solid #DDE3EE; background: #fff; }
.tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search { flex: 0 1 280px; min-width: 180px; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border: 1px solid #E6EBF3; border-radius: 9px; background: #fff; }
.search input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; font-size: 13px; }
.chip { padding: 7px 12px; border-radius: 999px; font-size: 12.5px; border: 1px solid var(--line-2); background: #fff; color: #5B6680; }
.chip.on { background: var(--blue); color: #fff; border-color: var(--blue); }
.sw { width: 30px; height: 17px; border-radius: 999px; background: #D4DAE6; padding: 2px; display: flex; justify-content: flex-start; border: 0; flex: none; }
.sw::after { content: ''; width: 13px; height: 13px; border-radius: 50%; background: #fff; }
.sw.on { background: #7C6CF2; justify-content: flex-end; }
.sw.ad { width: 28px; height: 16px; }
.sw.ad::after { width: 12px; height: 12px; }
.sw.ad.on { background: #22B573; }
.sw:disabled { opacity: .5; cursor: not-allowed; }
.sw-lb { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #5B6680; cursor: pointer; background: none; border: 0; padding: 0; }
.tbl-wrap { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: auto; max-height: calc(100vh - 330px); min-height: 320px; }
table.sheet { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; font-variant-numeric: tabular-nums; }
.sheet th { position: sticky; top: 0; z-index: 3; background: #F7F9FD; border-bottom: 1px solid var(--line-2); padding: 8px 14px; text-align: right; vertical-align: bottom; font-weight: 600; font-size: 12px; color: var(--ink-2); cursor: pointer; user-select: none; }
.sheet th.sorted { background: #EEF3FF; }
.sheet th .src { font-size: 9.5px; font-weight: 700; letter-spacing: .06em; margin-bottom: 3px; }
.sheet th .lb { line-height: 1.3; text-wrap: balance; }
.sheet th.l, .sheet td.l { text-align: left; }
.sheet td { border-bottom: 1px solid var(--line-3); padding: 9px 14px; text-align: right; white-space: nowrap; background: #fff; }
.sheet.roomy td { padding-top: 14px; padding-bottom: 14px; }
.sheet tr.sel td { background: #EEF3FF; }
.sheet .stk0 { position: sticky; left: 0; z-index: 2; padding-left: 14px; padding-right: 0; width: 34px; }
.sheet .stk1 { position: sticky; left: 34px; z-index: 2; border-right: 1px solid var(--line-2); min-width: 280px; max-width: 360px; text-align: left; white-space: normal; }
.sheet th.stk0, .sheet th.stk1 { z-index: 4; }
.sheet tfoot td { position: sticky; bottom: 0; z-index: 3; background: #F1F5FF; border-top: 1px solid #D9E1F0; border-bottom: 0; padding: 12px 14px; font-weight: 700; }
.sheet tfoot td.stk0, .sheet tfoot td.stk1 { z-index: 4; }
.sheet .sub { font-size: 11px; color: var(--muted-2); margin-top: 2px; font-weight: 400; }
.sheet .id { font-family: var(--mono); font-size: 11.5px; color: var(--muted); text-align: left; }
.cb { width: 15px; height: 15px; border-radius: 4px; border: 1.5px solid #C5CCDA; background: transparent; color: #fff; font-size: 10px; display: grid; place-items: center; padding: 0; line-height: 1; }
.cb.on { background: #7C6CF2; border-color: #7C6CF2; }
.namecell { display: flex; align-items: center; gap: 10px; }
.namecell .nm { font-weight: 500; }
.namecell .cp { font-size: 11.5px; color: var(--muted-2); }
.rec { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; border: 0; }
.rec::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.foot-note { display: flex; gap: 18px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted-2); }

/* ---------- Bảng thường ---------- */
table.list { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.list th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.list td { padding: 10px; border-bottom: 1px solid var(--line-3); vertical-align: middle; }
.list .r { text-align: right; }
.list tr:last-child td { border-bottom: 0; }
.pill { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.who { display: flex; align-items: center; gap: 10px; }
.av-s { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; }
.muted { color: var(--muted); }
.empty { padding: 36px; text-align: center; color: var(--muted-2); font-size: 13px; }
.note { font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.warn { background: #FFF4DD; color: #8A5A00; border-radius: 12px; padding: 12px 14px; font-size: 13px; line-height: 1.5; }
.err { background: #FDECEE; color: #B42318; border-radius: 12px; padding: 12px 14px; font-size: 13px; }
.ok-box { background: #E6F7EE; color: #0B7A3B; border-radius: 12px; padding: 12px 14px; font-size: 13px; }
.banner { border-radius: 16px; padding: 18px 20px; color: #fff; background: linear-gradient(120deg,#2F6BFF,#7B61FF); display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.banner .t { font-size: 16px; font-weight: 700; }
.banner .s { font-size: 13px; opacity: .85; margin-top: 3px; }
.banner button { margin-left: auto; background: #fff; color: var(--blue); border: 0; border-radius: 10px; padding: 9px 14px; font-weight: 700; font-size: 13px; }
.progress { height: 8px; border-radius: 999px; background: var(--line-3); overflow: hidden; min-width: 80px; }
.progress i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg,#7B61FF,#2F6BFF); }

/* ---------- Form ---------- */
.form { display: grid; gap: 14px; }
.fld { display: flex; flex-direction: column; gap: 6px; }
.fld label { font-size: 12.5px; font-weight: 600; color: var(--text); }
.fld .hint { font-size: 11.5px; color: var(--muted-2); }
.inp { height: 40px; border: 1px solid var(--line-2); border-radius: 10px; padding: 0 12px; background: #fff; outline: none; width: 100%; }
textarea.inp { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; font-family: var(--mono); font-size: 12.5px; }
.inp:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,107,255,.12); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.g-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 14px; }

/* ---------- Đăng nhập ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(1200px 600px at 10% -10%, #E4ECFF, transparent), radial-gradient(900px 500px at 110% 110%, #EEE9FF, transparent), var(--bg); }
.login-card { width: min(400px, 100%); background: #fff; border-radius: 20px; padding: 30px 28px; box-shadow: 0 30px 60px -30px rgba(20,40,90,.35); display: flex; flex-direction: column; gap: 18px; }
.login-card h1 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.login-card p { margin: 0; color: var(--muted); font-size: 13.5px; }

/* ---------- Trợ lý Gemini ---------- */
.ai { width: 380px; flex: none; background: #fff; border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.ai-h { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.ai-ic { width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(135deg,#7C6CF2,#2F6BFF); color: #fff; display: grid; place-items: center; }
.ai-h b { font-size: 14.5px; }
.ai-h span { font-size: 11.5px; color: var(--muted-2); display: block; }
.ai-body { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 92%; padding: 10px 13px; border-radius: 12px; font-size: 13px; line-height: 1.55; border: 1px solid #E6EBF3; background: var(--bg); color: #2E3A55; align-self: flex-start; white-space: pre-wrap; word-break: break-word; }
.msg.me { align-self: flex-end; background: var(--blue); border-color: var(--blue); color: #fff; }
.msg h4 { margin: 0 0 4px; font-size: 13.5px; color: var(--ink); }
.msg .who2 { font-size: 10.5px; color: var(--muted-2); margin-top: 4px; }
.msg.thinking { color: var(--violet-2); font-weight: 500; }
.sugs { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 18px 10px; }
.sugs button { font-size: 12px; padding: 6px 10px; border-radius: 999px; border: 1px solid #E1DCFB; background: #F7F5FF; color: var(--violet-2); }
.ai-in { display: flex; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid var(--line); }
.ai-in input { flex: 1; min-width: 0; height: 40px; border: 1px solid var(--line-2); border-radius: 10px; padding: 0 12px; outline: none; }
.ai-in button { width: 40px; height: 40px; border-radius: 10px; border: 0; background: var(--blue); color: #fff; display: grid; place-items: center; }
.scrim { display: none; }

/* ---------- Modal & toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(18,26,51,.42); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: #fff; border-radius: 18px; padding: 22px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 30px 70px -20px rgba(0,0,0,.4); }
.modal.wide { width: min(920px, 100%); }
.modal h3 { margin: 0; font-size: 17px; }
.modal .acts { display: flex; justify-content: flex-end; gap: 8px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #121A33; color: #fff; padding: 11px 16px; border-radius: 12px; font-size: 13px; z-index: 60; box-shadow: 0 12px 28px -12px rgba(0,0,0,.5); max-width: calc(100vw - 32px); }
.toast.bad { background: #B42318; }
.loading-bar { height: 3px; background: linear-gradient(90deg, transparent, var(--blue), transparent); background-size: 200% 100%; animation: lb 1.1s linear infinite; position: fixed; top: 0; left: 0; right: 0; z-index: 70; }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin .9s linear infinite; }
@keyframes lb { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.menu { position: absolute; top: 58px; right: 20px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; z-index: 30; min-width: 190px; }
.menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 8px; border: 0; background: none; font-size: 13px; }
.menu button:hover { background: var(--chip); }

/* ---------- Responsive ---------- */
@media (max-width: 1279px) {
  .ai { position: fixed; right: 0; top: 0; bottom: 0; width: min(380px, 100vw); z-index: 40; box-shadow: -24px 0 60px rgba(20,40,90,.18); }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(18,26,51,.25); z-index: 39; }
}
@media (max-width: 1099px) {
  .side { width: 64px; padding: 18px 8px; align-items: center; }
  .side .logo-tx, .nav-i .lb, .nav-i .chev, .side-h, .src-i .lb, .profile { display: none; }
  .nav-i, .src-i { justify-content: center; padding: 10px; }
  .g-2-1, .g-3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 759px) {
  .app { flex-direction: column; }
  .side { order: 2; width: 100%; height: 60px; flex-direction: row; padding: 6px 8px; gap: 0; border-right: 0; border-top: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; }
  .side .logo, .side .sep, .side .srcs { display: none; }
  .nav { flex-direction: row; gap: 2px; }
  .nav-i { width: 48px; flex: none; }
  main { order: 1; min-height: 0; }
  .top { padding: 10px 16px; gap: 10px; }
  .me-tx, .top .vline { display: none; }
  .content { padding: 16px 16px 28px; }
  .ph-t { font-size: 22px; }
  .g-1-1 { grid-template-columns: minmax(0, 1fr); }
  .tbl-wrap { max-height: calc(100vh - 300px); }
  .sheet .stk1 { min-width: 190px; }
  .chart { height: 190px; }
}

/* ===== Giao diện theo thiết kế "So Ads v4" (style chính viết inline trong app.js) ===== */
.rb { border: 0; background: transparent; font: inherit; color: inherit; text-align: inherit; cursor: pointer; padding: 0; margin: 0; }
.rb:disabled { cursor: default; opacity: .6; }
.rb:focus-visible { outline: 2px solid #2F6BFF; outline-offset: 2px; }
.hv-nav:hover { background: #FFF4F6 !important; }
.hv-bg:hover { background: #F3F5FA !important; }
.hv-out:hover { color: #E5484D !important; }
.hv-blue:hover { background: #1F55E0 !important; }
.hv-ask:hover { background: #EEF3FF !important; }
.hv-bd:hover { border-color: #C5CCDA !important; }
.hv-sug:hover { border-color: #B9ADFF !important; }
.hv-ghost:hover { background: #F1F4FA !important; color: #1A2238 !important; }
.hv-pick:hover { background: #F5F2FE !important; }
.hv-bright:hover { filter: brightness(1.1); }
#content .warn, #content .err, #content .ok-box { flex: none; }
@media (max-width: 759px) {
  .ct { padding: 16px 16px 28px !important; }
  .hd { padding: 12px 16px !important; gap: 10px !important; }
  .sf-title { font-size: 30px !important; }
  .rg { height: auto !important; flex-wrap: wrap; padding: 6px 8px 6px 12px !important; row-gap: 6px; }
}

/* Hiệu ứng thẻ hồ sơ (thanh trái) */
@keyframes pf-spin { from { transform: rotate(-90deg); } to { transform: rotate(270deg); } }
@keyframes pf-float { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(2px, -5px); } 50% { transform: translate(-2px, -8px); } 75% { transform: translate(-3px, -3px); } }
@keyframes pf-pulse { 0% { box-shadow: 0 0 0 0 rgba(34,181,115,.55); } 70% { box-shadow: 0 0 0 8px rgba(34,181,115,0); } 100% { box-shadow: 0 0 0 0 rgba(34,181,115,0); } }
.pf-ring { animation: pf-spin 14s linear infinite; }
.pf-dot { animation: pf-float 3.6s ease-in-out infinite; }
.pf-on { animation: pf-pulse 2s ease-out infinite; }
.pf-face { transition: transform .35s cubic-bezier(.34,1.56,.64,1); }
.pf-av:hover .pf-face { transform: scale(1.07); }
.pf-av:hover .pf-ring { animation-duration: 3s; }
@media (prefers-reduced-motion: reduce) { .pf-ring, .pf-dot, .pf-on { animation: none; } }

/* Nhấn nút / mục: lún vào khi giữ, bật ra có độ nảy khi thả */
button:not(:disabled), .btn, [data-act]:not(.modal-bg):not(tr):not(td) { transition: transform .42s cubic-bezier(.34,1.56,.64,1); }
button:not(:disabled):active, .btn:active, [data-act]:not(.modal-bg):not(tr):not(td):not(:disabled):active { transform: scale(.94); transition: transform .08s ease-out; }
tr[data-act] { transition: background-color .2s; }
@media (prefers-reduced-motion: reduce) { button, .btn, [data-act] { transition: none !important; } button:active, .btn:active, [data-act]:active { transform: none !important; } }

/* =====================================================================
 * KHUNG MỚI — thanh trên nổi + menu giữa + thanh icon trái (tông đỏ đen)
 * ===================================================================== */
:root { --x-red: #E11931; --x-red-2: #FF3B4E; --x-red-50: #FDE8EA; --x-ink: #111114; --x-ink-2: #2A2A31; --x-bg: #ECEDF1; --x-line: #E6E7EC; --x-spring: cubic-bezier(.34,1.56,.64,1); --x-ease: cubic-bezier(.2,.8,.2,1); }
body { background: var(--x-bg); }
.shell { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: radial-gradient(1200px 500px at 85% -10%, rgba(225,25,49,.07), transparent 60%), var(--x-bg); }
.shell-b { flex: 1; min-height: 0; display: flex; gap: 16px; padding: 0 18px 16px; }
.shell-m { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.shell-m .ct { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 6px 10px 36px 4px; display: flex; flex-direction: column; gap: 18px; }

/* ---------- Thanh trên ---------- */
.tb { position: relative; z-index: 30; margin: 14px 18px 16px; height: 68px; padding: 0 12px 0 14px; display: flex; align-items: center; gap: 14px; background: rgba(255,255,255,.92); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); border: 1px solid rgba(255,255,255,.9); border-radius: 999px; box-shadow: 0 1px 2px rgba(14,14,18,.04), 0 18px 40px -22px rgba(14,14,18,.28); }
.tb-logo { display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 4px; border-radius: 999px; flex: none; }
.tb-logo img { width: 40px; height: 40px; border-radius: 12px; display: block; box-shadow: 0 8px 18px -8px rgba(225,25,49,.7); transition: transform .5s var(--x-spring); }
.tb-logo:hover img { transform: rotate(-8deg) scale(1.06); }
.tb-name { font-weight: 800; font-size: 19px; letter-spacing: -.02em; color: var(--x-ink); white-space: nowrap; }
.tb-name b { color: var(--x-red); font-weight: 800; }

.tnav { position: relative; display: flex; align-items: center; gap: 2px; margin: 0 auto; padding: 4px; border-radius: 999px; background: #F3F3F6; border: 1px solid #ECECF0; }
.tnav-ind { position: absolute; left: 0; top: 4px; bottom: 4px; width: 0; border-radius: 999px; background: linear-gradient(180deg, #24242B, var(--x-ink)); box-shadow: 0 8px 18px -8px rgba(14,14,18,.65), inset 0 1px 0 rgba(255,255,255,.12); transition: transform .5s var(--x-spring), width .45s var(--x-spring), opacity .2s; pointer-events: none; }
.tnav-ind::after { content: ''; position: absolute; left: 50%; bottom: 3px; width: 14px; height: 2px; margin-left: -7px; border-radius: 2px; background: var(--x-red); }
.tnav-i { position: relative; z-index: 1; height: 40px; padding: 0 18px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: #5C5C66; white-space: nowrap; transition: color .25s, transform .42s var(--x-spring) !important; }
.tnav-i:hover { color: var(--x-ink); }
.tnav-i.on { color: #FFFFFF; }

.tb-r { display: flex; align-items: center; gap: 10px; flex: none; margin-left: auto; }
.tnav + .tb-r { margin-left: 0; }
.tb-ic { position: relative; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--x-ink); background: #FFFFFF; border: 1px solid var(--x-line); transition: background .2s, border-color .2s, transform .42s var(--x-spring) !important; }
.tb-ic:hover { border-color: #CFCFD6; background: #FAFAFB; }
.tb-dot { position: absolute; top: 9px; right: 10px; width: 9px; height: 9px; border-radius: 50%; background: var(--x-red); border: 2px solid #FFFFFF; animation: x-ping 1.8s ease-out infinite; }
@keyframes x-ping { 0% { box-shadow: 0 0 0 0 rgba(225,25,49,.55); } 75%, 100% { box-shadow: 0 0 0 8px rgba(225,25,49,0); } }

.tb-search { position: relative; display: flex; align-items: center; height: 44px; border-radius: 999px; }
.tb-search input { width: 0; opacity: 0; padding: 0; border: 0; outline: none; background: transparent; font-size: 13.5px; color: var(--x-ink); pointer-events: none; }
.tb-search kbd { display: none; }
.tb-search.open { background: #FFFFFF; border: 1px solid var(--x-ink); box-shadow: 0 0 0 4px rgba(14,14,18,.06); padding-right: 10px; animation: x-grow .45s var(--x-spring); }
.tb-search.open .tb-ic { border: 0; background: transparent; width: 42px; height: 42px; color: var(--x-red); }
.tb-search.open input { width: 250px; opacity: 1; pointer-events: auto; animation: x-type .45s var(--x-ease); }
.tb-search.open kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 6px; background: #F2F2F5; border: 1px solid var(--x-line); font: 600 11px/1 var(--mono); color: #8A8A94; }
@keyframes x-grow { from { transform: scaleX(.6); opacity: .4; transform-origin: right; } to { transform: none; opacity: 1; } }
@keyframes x-type { from { width: 0; opacity: 0; } }

.tb-ai { position: relative; height: 44px; padding: 0 18px 0 14px; display: flex; align-items: center; gap: 8px; border-radius: 999px; color: #FFFFFF; font-size: 13.5px; font-weight: 700; overflow: visible; background: linear-gradient(135deg, #2A2A31, var(--x-ink) 55%, #3A0A12); box-shadow: 0 10px 22px -12px rgba(14,14,18,.8), inset 0 1px 0 rgba(255,255,255,.1); isolation: isolate; }
.tb-ai::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(110deg, transparent 30%, rgba(255,59,78,.55) 50%, transparent 70%); background-size: 250% 100%; background-position: 120% 0; z-index: -1; transition: background-position .8s var(--x-ease); }
.tb-ai:hover::before { background-position: -20% 0; }
.tb-ai-s { color: var(--x-red-2); font-size: 15px; display: inline-block; animation: x-twinkle 3.2s ease-in-out infinite; }
@keyframes x-twinkle { 0%, 100% { transform: rotate(0) scale(1); } 50% { transform: rotate(90deg) scale(1.2); } }
.tb-badge { position: absolute; top: -6px; right: -6px; min-width: 21px; height: 21px; padding: 0 5px; border-radius: 999px; background: var(--x-red); color: #FFFFFF; font-size: 11px; font-weight: 800; display: grid; place-items: center; border: 2px solid #FFFFFF; animation: x-pop .5s var(--x-spring); }
@keyframes x-pop { from { transform: scale(0); } }

.tb-me { display: flex; align-items: center; gap: 10px; height: 52px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid transparent; transition: background .2s, border-color .2s, transform .42s var(--x-spring) !important; }
.tb-me:hover, .tb-me.open { background: #FFFFFF; border-color: var(--x-line); }
.tb-av { position: relative; width: 44px; height: 44px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #FFFFFF; background: linear-gradient(135deg, var(--x-red), #7A0D1A); box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 4px rgba(225,25,49,.35); }
.tb-av i { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; background: #22B573; border: 2px solid #FFFFFF; animation: pf-pulse 2s ease-out infinite; }
.tb-me-tx { display: flex; flex-direction: column; text-align: left; line-height: 1.25; }
.tb-me-tx b { font-size: 13.5px; font-weight: 700; color: var(--x-ink); white-space: nowrap; }
.tb-me-tx small { font-size: 11.5px; color: #8A8A94; white-space: nowrap; }
.tb-chev { display: grid; color: #6B6B75; transition: transform .35s var(--x-spring); }
.tb-me.open .tb-chev { transform: rotate(180deg); }

/* menu tài khoản */
.menu.me-menu { top: 74px; right: 10px; width: 300px; padding: 8px; border-radius: 22px; border: 1px solid var(--x-line); background: #FFFFFF; box-shadow: 0 30px 60px -24px rgba(14,14,18,.4); transform-origin: top right; animation: x-menu .38s var(--x-spring); }
@keyframes x-menu { from { opacity: 0; transform: translateY(-8px) scale(.92); } }
.me-menu > * { animation: x-item .4s var(--x-ease) backwards; }
.me-menu > *:nth-child(2) { animation-delay: .03s; } .me-menu > *:nth-child(3) { animation-delay: .06s; } .me-menu > *:nth-child(4) { animation-delay: .09s; } .me-menu > *:nth-child(5) { animation-delay: .12s; } .me-menu > *:nth-child(n+6) { animation-delay: .15s; }
@keyframes x-item { from { opacity: 0; transform: translateY(-4px); } }
.me-card { display: flex; align-items: center; gap: 12px; padding: 12px; margin-bottom: 6px; border-radius: 16px; color: #FFFFFF; background: radial-gradient(160px 90px at 100% 0, rgba(225,25,49,.55), transparent 70%), linear-gradient(135deg, #1D1D23, var(--x-ink)); }
.me-card b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-card small { display: block; font-size: 11.5px; color: #B9B9C2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-av { position: relative; width: 56px; height: 56px; flex: none; display: grid; place-items: center; }
.me-av svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.me-av span { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #FFFFFF; background: linear-gradient(135deg, var(--x-red), #7A0D1A); }
.me-av .pf-on { position: absolute; right: 4px; bottom: 4px; width: 12px; height: 12px; border-radius: 50%; background: #22B573; border: 2px solid var(--x-ink); }
.me-menu button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; font-size: 13.5px; font-weight: 500; color: var(--x-ink-2); transition: background .2s, color .2s, padding-left .25s var(--x-ease); }
.me-menu button svg { color: #8A8A94; transition: color .2s; }
.me-menu button:hover { background: #F4F4F7; padding-left: 16px; }
.me-menu button:hover svg { color: var(--x-red); }
.me-h { margin: 8px 12px 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #9A9AA3; }
.me-src { display: flex; align-items: center; gap: 10px; padding: 7px 12px; font-size: 13px; color: var(--x-ink-2); }
.me-src svg { color: var(--x-red); flex: none; }
.me-src span { flex: 1; }
.me-src small { color: #9A9AA3; font-size: 11.5px; }
.me-src i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.me-menu .me-out { margin-top: 6px; border-top: 1px solid #F0F0F3; border-radius: 0 0 14px 14px; color: var(--x-red); }
.me-menu .me-out svg { color: var(--x-red); }
.me-menu .me-out:hover { background: var(--x-red-50); }

/* ---------- Thanh icon trái ---------- */
.rail { position: relative; z-index: 20; flex: none; width: 76px; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px 0; background: #FFFFFF; border: 1px solid rgba(255,255,255,.9); border-radius: 40px; box-shadow: 0 1px 2px rgba(14,14,18,.04), 0 18px 40px -24px rgba(14,14,18,.25); }
.rail-g { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.rail-sep { width: 26px; height: 1px; background: #ECECF0; margin: 4px 0; flex: none; }
.rail-src { margin-top: auto; gap: 2px; padding: 8px 0; }
.rail-end { padding-top: 8px; border-top: 1px solid #F0F0F3; }
.rail-i { position: relative; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: #4A4A55; flex: none; transition: background .25s, color .25s, transform .42s var(--x-spring) !important; }
.rail-i:hover { background: #F3F3F6; color: var(--x-ink); }
.rail-i:hover svg { transform: translateY(-1px) scale(1.08); }
.rail-i svg { transition: transform .35s var(--x-spring); }
.rail-i.on { background: var(--x-ink); color: #FFFFFF; box-shadow: 0 10px 20px -10px rgba(14,14,18,.8); }
.rail-i.on::before { content: ''; position: absolute; left: -15px; top: 50%; width: 4px; height: 20px; margin-top: -10px; border-radius: 0 4px 4px 0; background: var(--x-red); animation: x-bar .45s var(--x-spring); }
@keyframes x-bar { from { transform: scaleY(0); } }
.rail-i.pop { animation: x-railpop .55s var(--x-spring); }
@keyframes x-railpop { 0% { transform: scale(.7); } 60% { transform: scale(1.1); } 100% { transform: scale(1); } }
.rail-s { width: 40px; height: 36px; border-radius: 12px; color: var(--x-red); cursor: default; }
.rail-s:hover { background: var(--x-red-50); }
.rail-s i { position: absolute; top: 6px; right: 7px; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid #FFFFFF; }
.rail-av { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 12px; color: #FFFFFF; background: linear-gradient(135deg, var(--x-red), #7A0D1A); }
.rail-i.on .rail-av { box-shadow: 0 0 0 2px var(--x-ink), 0 0 0 4px #FFFFFF; }
.rail-out { color: #8A8A94; }
.rail-out:hover { background: var(--x-red-50); color: var(--x-red); }
/* nhãn nổi khi rê chuột */
.rail-i[data-tip]::after { content: attr(data-tip); position: absolute; left: calc(100% + 14px); top: 50%; transform: translate(-6px, -50%); opacity: 0; pointer-events: none; white-space: nowrap; padding: 7px 12px; border-radius: 10px; background: var(--x-ink); color: #FFFFFF; font-size: 12.5px; font-weight: 600; box-shadow: 0 12px 24px -12px rgba(14,14,18,.7); transition: opacity .18s, transform .3s var(--x-spring); z-index: 60; }
.rail-i[data-tip]:hover::after { opacity: 1; transform: translate(0, -50%); }

/* nút đỏ (Xuất báo cáo) + nút chọn kỳ */
.btn-red { background: linear-gradient(135deg, var(--x-red-2), var(--x-red) 55%, #B3101F); box-shadow: 0 12px 22px -12px rgba(225,25,49,.9), inset 0 1px 0 rgba(255,255,255,.2); transition: filter .2s, box-shadow .2s, transform .42s var(--x-spring) !important; }
.btn-red:hover { filter: brightness(1.06); box-shadow: 0 16px 26px -12px rgba(225,25,49,.95), inset 0 1px 0 rgba(255,255,255,.2); }
.seg:not(.on):hover { background: #E7E7EC !important; color: var(--x-ink) !important; }
.seg.on { box-shadow: 0 6px 14px -8px rgba(14,14,18,.8); }

/* ---------- Màn vừa / nhỏ ---------- */
@media (max-width: 1240px) { .tb-me-tx { display: none; } .tnav-i { padding: 0 13px; font-size: 13px; } }
@media (max-width: 1060px) { .tnav { display: none; } .tb-r { margin-left: auto; } .tb-name { font-size: 17px; } }
@media (max-width: 759px) {
  .tb { margin: 10px 10px 10px; height: 60px; padding: 0 8px 0 8px; gap: 8px; }
  .tb-name, .tb-ai-l, .tb-chev { display: none; }
  .tb-ai { padding: 0 14px; }
  .tb-ic { width: 40px; height: 40px; }
  .tb-me { height: 46px; padding: 2px; }
  .tb-av { width: 40px; height: 40px; }
  .tb-search.open { position: absolute; right: 0; left: auto; z-index: 5; }
  .tb-search.open input { width: calc(100vw - 150px); }
  .menu.me-menu { top: 66px; right: 0; width: min(300px, calc(100vw - 20px)); }
  .shell-b { padding: 0 10px; gap: 0; }
  .shell-m .ct { padding: 4px 6px 100px !important; }
  .rail { position: fixed; left: 10px; right: 10px; bottom: 10px; width: auto; height: 64px; flex-direction: row; justify-content: flex-start; padding: 0 8px; border-radius: 999px; overflow-x: auto; overflow-y: hidden; gap: 4px; z-index: 35; }
  .rail-g { flex-direction: row; gap: 4px; }
  .rail-sep { width: 1px; height: 26px; margin: 0 4px; }
  .rail-src { display: none; }
  .rail-end { margin-left: auto; padding: 0 0 0 6px; border-top: 0; border-left: 1px solid #F0F0F3; }
  .rail-i { width: 46px; height: 46px; }
  .rail-i.on::before { left: 50%; top: auto; bottom: -9px; width: 18px; height: 3px; margin: 0 0 0 -9px; border-radius: 3px 3px 0 0; }
  .rail-i[data-tip]::after { display: none; }
}
@media (prefers-reduced-motion: reduce) { .tnav-ind, .tb-dot, .tb-ai-s, .tb-av i, .menu.me-menu, .me-menu > *, .rail-i.pop, .tb-search.open, .tb-search.open input { animation: none !important; transition: none !important; } }

/* thanh trái gọn lại khi màn thấp (nguồn dữ liệu vẫn xem được trong menu tài khoản) */
@media (min-width: 760px) and (max-height: 940px) { .rail { gap: 6px; padding: 12px 0; } .rail-g { gap: 3px; } .rail-i { width: 44px; height: 44px; } .rail-s { height: 30px; } }
@media (min-width: 760px) and (max-height: 860px) { .rail-src { display: none; } .rail-end { margin-top: auto; } }
@media (min-width: 760px) and (max-height: 700px) { .rail-i { width: 40px; height: 40px; } .rail-sep { display: none; } }
/* khung Gemini: thẻ bo tròn cùng phong cách */
.shell-b > aside:not(.rail) { border: 1px solid rgba(255,255,255,.9) !important; border-radius: 28px; overflow: hidden; box-shadow: 0 1px 2px rgba(14,14,18,.04), 0 18px 40px -24px rgba(14,14,18,.25) !important; animation: x-slide .45s var(--x-ease); }
@keyframes x-slide { from { opacity: 0; transform: translateX(24px); } }

.tb { z-index: 55; }
@media (max-width: 1060px) { .tnav + .tb-r { margin-left: auto; } }
@media (max-width: 759px) { .rail { scrollbar-width: none; } .rail::-webkit-scrollbar { display: none; } }

/* Vùng nội dung: cùng nền với bên ngoài (thẻ nổi trên nền xám), mép cuộn mờ dần thay vì cắt thẳng */
main.shell-m { background: transparent; }
.shell-m .ct { padding: 14px 14px 40px 6px; margin-top: -8px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 16px, #000 calc(100% - 24px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 16px, #000 calc(100% - 24px), transparent 100%);
  scrollbar-width: thin; scrollbar-color: #CFCFD6 transparent; }
.shell-m .ct::-webkit-scrollbar { width: 8px; }
.shell-m .ct::-webkit-scrollbar-thumb { background: #D3D3DA; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
.shell-m .ct::-webkit-scrollbar-thumb:hover { background-color: #B9B9C2; }
.shell-m .ct::-webkit-scrollbar-track { margin: 18px 0; }
@media (max-width: 759px) { .shell-m .ct { padding: 12px 4px 100px !important; } }
.card { border-radius: 24px; }

/* Đang tải phần Pancake / KiotViet (bản nhanh chỉ có số Meta) */
.pload { flex: none; display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 20px; background: #FFFFFF; border: 1px solid #F6D2D7; box-shadow: 0 10px 26px -18px rgba(225,25,49,.5); animation: x-item .4s var(--x-ease); }
.pload b { display: block; font-size: 13.5px; color: var(--x-ink); }
.pload span:not(.pload-sp) { display: block; font-size: 12.5px; color: #6B6B75; margin-top: 2px; }
.pload-sp { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--x-red-50); border-top-color: var(--x-red); animation: spin .8s linear infinite; }
.pskel { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.pskel i { display: block; height: 170px; border-radius: 24px; background: linear-gradient(100deg, #FFFFFF 30%, #F4F4F7 50%, #FFFFFF 70%); background-size: 300% 100%; animation: lb 1.4s ease-in-out infinite; border: 1px solid #EFEFF3; }
.pskel i:first-child { grid-column: 1 / -1; height: 120px; }
@media (prefers-reduced-motion: reduce) { .pload-sp, .pskel i { animation: none; } }

/* Ô mật khẩu có nút con mắt hiện / ẩn */
.pw-wrap { position: relative; display: block; }
.pw-wrap .inp { width: 100%; padding-right: 46px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: #8A8A94; display: grid; place-items: center; cursor: pointer; transition: background .2s, color .2s; }
.pw-eye:hover { background: #F0F0F3; color: var(--x-ink); }
.pw-eye.on { color: var(--x-red); }
.pw-eye:focus-visible { outline: 2px solid var(--x-red); outline-offset: 1px; }
.pw-eye:active { transform: translateY(-50%) scale(.9) !important; }

/* Cửa sổ popup (đơn hàng, việc cần làm, xác nhận…) luôn nằm trên thanh trên */
.modal-bg { z-index: 90; }
.hv-miss:hover { background: #FDE8EA; }
