/* Cổng cộng tác viên và trang đăng ký – theo bản thiết kế "Giao diện Cộng tác viên HT24", đổi sang thương hiệu Bảo Long.
   Dùng màu, font, nút và ô nhập sẵn có của web. Cỡ chữ theo chuẩn của web: chữ chính 16px, chữ phụ 14px, nhỏ nhất 13px. */

.page-ctv { background: #f4f6f3; }
.page-ctv #main { padding-bottom: 48px; }
.page-ctv .breadcrumb { padding-bottom: 4px; }

/* ---------- đầu cổng: tên CTV, hạng, các mục ---------- */
.ctv-head { background: #fff; border-bottom: 1px solid var(--line); }
.ctv-head__inner { display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: center; justify-content: space-between; padding-top: 14px; padding-bottom: 14px; }
.ctv-head__brand { display: flex; align-items: center; gap: 12px; }
.ctv-mark { width: 44px; height: 44px; flex: none; border-radius: 12px; background: var(--green-800); color: #fff; display: grid; place-items: center; font-weight: 900; font-size: 16px; letter-spacing: .02em; }
.ctv-head__title { margin: 0; font-size: 17px; font-weight: 900; color: var(--ink); }
.ctv-head__sub { margin: 0; font-size: 14px; color: var(--muted); }
.ctv-head__me { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ctv-tier { font-size: 14px; font-weight: 800; color: #6b4a08; background: var(--honey-50); border-radius: 999px; padding: 6px 12px; white-space: nowrap; }
.ctv-head__who { text-align: right; }
.ctv-head__name { margin: 0; font-size: 15.5px; font-weight: 800; }
.ctv-head__code { margin: 0; font-size: 13.5px; color: var(--muted); }
.ctv-logout { height: 38px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line-2); background: #fff; font: inherit; font-size: 14px; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.ctv-logout:hover { border-color: var(--green-700); color: var(--green-800); }
.ctv-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; scroll-padding-inline: var(--gutter); }
.ctv-tabs::-webkit-scrollbar { display: none; }
.ctv-tabs__item { display: inline-flex; align-items: center; gap: 6px; min-height: 50px; padding: 0 14px; border-bottom: 3px solid transparent; font-size: 15.5px; font-weight: 800; color: var(--muted); white-space: nowrap; }
.ctv-tabs__item:hover { color: var(--green-800); }
.ctv-tabs__item.is-active { color: var(--green-800); border-bottom-color: var(--green-800); }
.ctv-tabs__badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: 13px; }

.ctv-main { display: flex; flex-direction: column; gap: 20px; padding-top: 24px; }
.ctv-main > .flash, .ctv-wrap > .flash { margin: 0; }

/* ---------- thẻ ---------- */
.ctv-card { min-width: 0; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.ctv-card--accent { background: var(--green-50); border-color: var(--green-800); }
.ctv-card--soft { background: var(--green-50); border-color: var(--green-200); }
.ctv-card--muted { background: #f8faf8; }
.ctv-card__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 12px; }
.ctv-card__head--base { align-items: baseline; }
.ctv-stack { display: flex; flex-direction: column; gap: 12px; }
.ctv-stack--16 { gap: 16px; }
.ctv-stack--8 { gap: 8px; }
.ctv-card__head--flush { margin-bottom: 0; }
.ctv-center { text-align: center; }
.ctv-h1 { margin: 0; font-size: 28px; font-weight: 900; line-height: 1.2; color: var(--ink); }
.ctv-h2 { margin: 0; font-size: 19px; font-weight: 800; line-height: 1.3; color: var(--ink); }
.ctv-h2.ctv-card__head { margin-bottom: 14px; }
.ctv-card--soft .ctv-h2 { color: var(--green-900); }
.ctv-lbl { margin: 0; font-size: 14px; color: var(--muted); }
.ctv-big { margin: 6px 0 0; font-size: 28px; font-weight: 900; line-height: 1.2; color: var(--ink); }
.ctv-note { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.ctv-card--accent .ctv-lbl, .ctv-card--accent .ctv-big, .ctv-card--accent .ctv-note { color: var(--green-900); }
.ctv-text { margin: 0; font-size: 16px; }

.ctv-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.ctv-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.ctv-grow { flex: 999 1 520px; min-width: 0; }
.ctv-side { flex: 1 1 300px; min-width: 0; }
.ctv-half { flex: 1 1 380px; min-width: 0; }

/* tiến độ lên hạng */
.ctv-progress-text { margin: 16px 0 8px; font-size: 16px; }
.ctv-bar { height: 12px; overflow: hidden; border-radius: 999px; background: #eef0ec; }
.ctv-bar > span { display: block; height: 100%; border-radius: 999px; background: var(--green-800); }
.ctv-tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.ctv-tiers li { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #f4f6f3; }
.ctv-tiers li.is-on { background: var(--honey-50); border-color: #d9a441; }
.ctv-tiers strong { display: block; font-size: 15px; }
.ctv-tiers span { font-size: 13.5px; color: var(--muted); }

.ctv-dl { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.ctv-dl > div { display: flex; justify-content: space-between; gap: 12px; font-size: 15.5px; }
.ctv-dl dt { color: var(--muted); }
.ctv-dl dd { margin: 0; font-weight: 800; text-align: right; }
.ctv-dl--total > div:last-child { padding-top: 12px; border-top: 1px solid var(--line); font-size: 18px; }
.ctv-dl--total > div:last-child dd { color: var(--green-900); }

.ctv-alert { margin: 0; padding: 12px 14px; border-radius: 9px; font-size: 14.5px; line-height: 1.5; }
.ctv-alert--warn { background: var(--honey-50); color: #6b4a08; }
.ctv-alert--good { background: var(--green-50); color: var(--green-900); }
.ctv-alert--bad { background: #fdecea; color: #9b1c1c; }

/* ---------- bảng ---------- */
.ctv-scroll { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ctv-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.ctv-scroll > .ctv-table { min-width: 640px; }          /* điện thoại: bảng cuộn ngang, không bóp cột chữ */
.ctv-scroll > .ctv-table--wide { min-width: 920px; }
.ctv-table th { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.ctv-table td { padding: 12px; border-bottom: 1px solid #f0ece6; vertical-align: top; color: var(--ink); }
.ctv-table tbody tr:last-child td { border-bottom: 0; }
.ctv-table .num { text-align: right; white-space: nowrap; }
.ctv-table .b { font-weight: 800; }
.ctv-table .nowrap { white-space: nowrap; }
.ctv-table .prod { min-width: 220px; }
.ctv-empty { margin: 0; padding: 20px 4px; text-align: center; font-size: 15px; color: var(--muted); }

/* nhãn trạng thái: xám chờ xử lý, vàng tạm duyệt, xanh lá đã duyệt, xanh dương đã thanh toán, đỏ bị hủy */
.ctv-badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 800; white-space: nowrap; }
.ctv-badge--gray { color: #3f4943; background: #eef0ec; }
.ctv-badge--amber { color: #6b4a08; background: #fbf1e1; }
.ctv-badge--green { color: var(--green-900); background: var(--green-100); }
.ctv-badge--blue { color: #1e40af; background: #e8eefd; }
.ctv-badge--red { color: #b42318; background: #fdecea; }
.ctv-reason { margin: 6px 0 0; font-size: 13.5px; color: #b42318; }
.ctv-reason--muted { color: var(--muted); }

/* ---------- bộ lọc dạng nút tròn ---------- */
.ctv-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.ctv-pill { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border: 1px solid var(--line-2); border-radius: 999px; background: #fff; font-size: 15px; font-weight: 800; color: var(--ink); }
.ctv-pill:hover { border-color: var(--green-700); color: var(--green-800); }
.ctv-pill.is-active { background: var(--green-800); border-color: var(--green-800); color: #fff; }
.ctv-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.ctv-select { min-height: 40px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 9px; background: #fff; font: inherit; font-size: 15px; font-weight: 700; }

/* ---------- thống kê ---------- */
.ctv-hbars { display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 0; list-style: none; }
.ctv-hbars__row { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; font-size: 15.5px; }
.ctv-hbars__track { height: 8px; border-radius: 999px; background: #eef0ec; }
.ctv-hbars__fill { height: 8px; border-radius: 999px; background: var(--green-800); }
.ctv-lines { display: flex; flex-direction: column; gap: 12px; font-size: 15.5px; }
.ctv-lines > div { display: flex; justify-content: space-between; gap: 12px; }
.ctv-sep { height: 1px; background: var(--line); }

/* ---------- link và mã ---------- */
.ctv-copyrow { display: flex; flex-wrap: wrap; gap: 8px; }
.ctv-copyrow input { flex: 1 1 280px; min-width: 0; }
.ctv-input { min-height: 44px; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; font: inherit; font-size: 16px; font-weight: 600; color: var(--ink); }
.ctv-input:focus { outline: none; border-color: var(--green-700); box-shadow: 0 0 0 3px rgba(37, 107, 61, .12); }
.ctv-input[readonly] { background: #f8faf8; }
.ctv-made { padding: 12px 14px; border: 1px dashed var(--line-2); border-radius: 9px; background: #f8faf8; font-size: 15px; word-break: break-all; }
.ctv-code { padding: 16px; border: 2px dashed var(--green-800); border-radius: 10px; text-align: center; font-size: 34px; font-weight: 900; letter-spacing: .08em; color: var(--green-900); }
.ctv-list { display: flex; flex-direction: column; gap: 6px; margin: 0; padding-left: 20px; list-style: disc; font-size: 14.5px; color: var(--muted); }
.ctv-qr { display: flex; align-items: center; gap: 16px; }
.ctv-qr img { flex: none; width: 112px; height: 112px; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.btn.is-done { background: var(--green-900); color: #fff; }

/* ---------- thư viện tài liệu ---------- */
.ctv-mats { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.ctv-mat { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.ctv-mat__thumb { position: relative; display: grid; place-items: center; height: 150px; overflow: hidden; font-size: 15px; font-weight: 800; background: var(--green-50); color: var(--green-900); }
.ctv-mat__thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ctv-mat__thumb--video { background: #e8eefd; color: #1e40af; }
.ctv-mat__thumb--caption { background: var(--honey-50); color: #6b4a08; }
.ctv-mat__thumb--article { background: #eef0ec; color: #3f4943; }
.ctv-mat__body { display: flex; flex: 1; flex-direction: column; gap: 8px; padding: 16px; }
.ctv-mat__title { margin: 0; font-size: 16px; font-weight: 800; }
.ctv-mat__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 4px; }

/* ---------- thông báo ---------- */
.ctv-notices { padding: 4px 20px; }
.ctv-notice { display: flex; align-items: flex-start; gap: 14px; padding: 14px 0; border-bottom: 1px solid #f0ece6; }
.ctv-notice:last-child { border-bottom: 0; }
.ctv-notice.is-new { background: linear-gradient(90deg, rgba(240, 246, 241, .9), transparent); }
.ctv-dot { flex: none; width: 10px; height: 10px; margin-top: 7px; border-radius: 999px; background: #1d4ed8; }
.ctv-dot--good { background: var(--green-800); }
.ctv-dot--warn { background: #b7791f; }
.ctv-dot--bad { background: var(--red); }
.ctv-notice__body { flex: 1; min-width: 0; }
.ctv-notice__title { margin: 0; font-size: 15.5px; font-weight: 800; }
.ctv-notice__text { margin: 2px 0 0; font-size: 14.5px; color: var(--muted); }
.ctv-notice__time { font-size: 13.5px; color: var(--muted); white-space: nowrap; }

/* ---------- đăng ký, đăng nhập ---------- */
.ctv-wrap { display: flex; flex-direction: column; gap: 20px; padding-top: 12px; }
.ctv-reg { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.ctv-reg__form { flex: 999 1 560px; display: flex; flex-direction: column; gap: 18px; padding: 28px; }
.ctv-reg__side { flex: 1 1 320px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ctv-reg__fields { display: flex; flex-direction: column; gap: 18px; }
.ctv-reg .form-grid { margin-top: 0; }
fieldset.field { margin: 0; padding: 0; border: 0; }
fieldset.field legend { margin-bottom: 6px; padding: 0; }
.js .ctv-otp[data-wait] { display: none; }
.ctv-field-row { display: flex; flex-wrap: wrap; gap: 8px; }
.ctv-field-row input { flex: 1 1 220px; min-width: 0; }
.ctv-otp input { max-width: 220px; letter-spacing: .3em; }
.ctv-otp-msg { margin: 0; font-size: 14px; color: var(--muted); }
.ctv-otp-msg.is-ok { color: var(--green-800); }
.ctv-otp-msg.is-error { color: var(--red); font-weight: 700; }
.ctv-channels { display: flex; flex-direction: column; gap: 10px; }
.ctv-channel { display: flex; flex-wrap: wrap; gap: 8px; }
.ctv-channel select { flex: 0 1 210px; }
.ctv-channel input { flex: 1 1 260px; min-width: 0; }
.ctv-check { display: flex; align-items: flex-start; gap: 10px; font-size: 15.5px; font-weight: 600; color: var(--ink-2); }
.ctv-check input { flex: none; width: 20px; height: 20px; margin-top: 2px; accent-color: var(--green-800); }
.ctv-check a { color: var(--green-800); text-decoration: underline; }
.ctv-benefits { display: flex; flex-direction: column; gap: 8px; margin: 0; padding-left: 20px; list-style: disc; font-size: 15.5px; }
.ctv-benefits li::marker, .ctv-list li::marker { color: var(--green-800); }
.ctv-steps { display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 0; list-style: none; }
.ctv-step { display: flex; align-items: flex-start; gap: 12px; }
.ctv-step__n { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 999px; background: var(--green-800); color: #fff; font-size: 14px; font-weight: 800; }
.ctv-step__n--warn { background: var(--honey-50); color: #6b4a08; }
.ctv-step__title { margin: 0; font-size: 15.5px; font-weight: 800; }
.ctv-done { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.ctv-done__icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 999px; background: var(--green-100); color: var(--green-800); font-size: 28px; }
.ctv-narrow { width: 100%; max-width: 480px; margin: 0 auto; }
.ctv-narrow .ctv-card { padding: 28px; }
.ctv-links-inline { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 15px; }
.ctv-links-inline a { color: var(--green-800); font-weight: 700; text-decoration: underline; }
.ctv-terms { font-size: 16px; line-height: 1.7; }
.ctv-terms h2 { margin: 22px 0 8px; font-size: 19px; }
.ctv-terms ul { padding-left: 22px; list-style: disc; }
.ctv-terms li::marker { color: var(--green-800); }
.ctv-kyc { display: flex; flex-direction: column; gap: 12px; }

/* ---------- Tổng quan: kết quả bán hàng theo kỳ (dashboard) ---------- */
.ctv-dash { display: flex; flex-direction: column; gap: 16px; }
.ctv-dash__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.ctv-dash__title { margin: 0; font-size: 22px; font-weight: 900; line-height: 1.3; color: var(--ink); }
.ctv-dash__range { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.ctv-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.ctv-kpi { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.ctv-kpi--green { --tone: #15803d; --tint: #e3f4e8; }
.ctv-kpi--amber { --tone: #b45309; --tint: #fdf0d9; }
.ctv-kpi--blue { --tone: #1d4ed8; --tint: #e5eefe; }
.ctv-kpi--purple { --tone: #6d28d9; --tint: #efe8fe; }
.ctv-kpi--teal { --tone: #0f766e; --tint: #dff4f1; }
.ctv-kpi__icon { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 8px; border-radius: 12px; background: var(--tint); color: var(--tone); }
.ctv-kpi__icon .icon { width: 22px; height: 22px; }
.ctv-kpi__label { margin: 0; font-size: 14px; font-weight: 800; color: var(--muted); }
.ctv-kpi__value { margin: 2px 0 0; font-size: 24px; font-weight: 900; line-height: 1.25; color: var(--ink); white-space: nowrap; }
.ctv-kpi__sub { margin: 2px 0 0; font-size: 13.5px; color: var(--muted); }
.ctv-mix th[scope="row"] { padding: 12px; border-bottom-color: #f0ece6; font-size: 15.5px; font-weight: 800; color: var(--ink); text-transform: none; letter-spacing: 0; }
.ctv-mix tbody tr:last-child th { border-bottom: 0; }
.ctv-mix td { vertical-align: middle; font-variant-numeric: tabular-nums; }
.ctv-mix__money { min-width: 180px; font-weight: 800; white-space: nowrap; }
.ctv-mix__bar { display: block; height: 6px; margin-top: 6px; border-radius: 999px; background: #eef0ec; overflow: hidden; }
.ctv-mix__bar span { display: block; height: 100%; border-radius: 999px; background: var(--green-800); }
/* link và mã: xanh lá, vàng cam; khe trắng 2px giữa hai phần */
.ctv-split { display: flex; gap: 2px; height: 10px; margin-bottom: 12px; border-radius: 999px; background: #eef0ec; overflow: hidden; }
.ctv-split span { display: block; height: 100%; }
.ctv-split__link, .ctv-src__col--link .ctv-src__dot { background: var(--green-800); }
.ctv-split__code, .ctv-src__col--coupon .ctv-src__dot { background: var(--honey); }
.ctv-src-card { flex: 1 1 440px; min-width: 0; }  /* hai cột link, mã cần chỗ cho số tiền */
.ctv-src { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ctv-src__col { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfa; }
.ctv-src__head { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 15px; font-weight: 800; color: var(--ink); }
.ctv-src__head .icon { width: 18px; height: 18px; color: var(--muted); }
.ctv-src__dot { flex: none; width: 10px; height: 10px; border-radius: 3px; }
.ctv-src__list { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.ctv-src__list > div { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.ctv-src__list dt { color: var(--muted); }
.ctv-src__list dd { margin: 0; font-weight: 800; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ctv-src__share { margin: 8px 0 0; padding-top: 8px; border-top: 1px dashed var(--line-2); font-size: 13.5px; font-weight: 800; color: var(--ink-2); }
.ctv-hbars__qty { font-style: normal; color: var(--muted); font-size: 14px; }
.ctv-short { display: none; }
.ctv-short[title] { text-decoration: none; }
.ctv-hbars__fill--blue { background: #2f7cf6; }
@media (max-width: 1100px) {
  .ctv-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .ctv-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* điện thoại: bảng loại sản phẩm vừa màn hình, bỏ cột Đơn để thấy ngay doanh thu, hoa hồng */
  .ctv-scroll > .ctv-mix { min-width: 0; font-size: 14px; }
  .ctv-mix th, .ctv-mix td, .ctv-mix th[scope="row"] { padding: 10px 6px; font-size: 14px; }
  .ctv-mix .ctv-mix__orders { display: none; }
  .ctv-mix .ctv-long { display: none; }
  .ctv-mix .ctv-short { display: inline; }
  .ctv-mix__money { min-width: 0; }
  .ctv-kpi__value { font-size: 20px; }
  .ctv-src { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 767px) {
  .ctv-head__me { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px 12px; width: 100%; }
  .ctv-head__who { order: 1; text-align: left; }
  .ctv-head__me form { order: 2; }
  .ctv-tier { order: 3; justify-self: start; }
  .ctv-card, .ctv-reg__form, .ctv-narrow .ctv-card { padding: 18px 16px; }
  .ctv-big { font-size: 24px; }
  .ctv-h1 { font-size: 24px; }
  .ctv-code { font-size: 28px; }
  .ctv-notices { padding: 4px 16px; }
  .ctv-notice { flex-wrap: wrap; gap: 4px 12px; }
  .ctv-notice__time { order: 3; margin-left: 22px; }
}
