/* Style cho /dang-ky và /portal */

fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
dl { margin: 0; }
legend { padding: 0; margin-bottom: 10px; }

.app-page { background: var(--bg-soft); min-height: 100vh; }
.app-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.app-header .container { display: flex; align-items: center; gap: 12px; height: 60px; }
.save-state { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.save-state .i { color: var(--ok); }
.save-state.saving .i { color: var(--muted); }
@media (max-width: 479px) { .logo-tag { display: none; } .save-state .txt-long { display: none; } .hide-sm { display: none; } }

/* ---------- Wizard ---------- */
.wz-main { max-width: 1100px; margin: 0 auto; padding: 20px var(--gutter) 64px; display: grid; gap: 20px; }
@media (min-width: 1024px) { .wz-main { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; padding-top: 36px; gap: 28px; } }

.wz-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; }
@media (min-width: 640px) { .wz-card { padding: 32px 36px; } }
/* Trang đăng ký lúc mới mở / vừa đăng nhập (P54): ẩn form tới khi kiểm tra xong tài khoản (đã có doanh nghiệp thì chuyển portal) */
.wz-boot { display: none; }
.wz-booting .wz-boot { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 260px; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); color: var(--muted); font-weight: 600; text-align: center; }
.wz-booting .wz-boot .spinner { color: var(--brand); flex: none; }
.wz-booting .wz-main > :not(.wz-boot) { display: none; }
.wz-main > * { min-width: 0; } /* cột lưới không nở theo nội dung dài (email, link) */
/* MST đã có doanh nghiệp do người khác đăng ký (P56): cảnh báo + 2 lựa chọn. legend thả nổi để không nằm đè lên viền khung */
.dup-box { border: 1px solid #ffd36b; background: var(--accent-50); border-radius: var(--radius); padding: 16px; }
.dup-box > .dup-head { float: left; width: 100%; display: flex; align-items: flex-start; gap: 10px; padding: 0; margin: 0 0 var(--sp-2); color: #7a5000; }
.dup-head .i { flex: none; margin-top: 2px; color: var(--accent-600); }
.dup-head b { display: block; font-size: 15px; line-height: 1.4; }
.dup-head small { display: block; margin-top: 2px; font-size: 13px; font-weight: 400; color: var(--ink-2); }
.dup-box > .choices { clear: both; }
.dup-box > :is(.notice, .dup-actions, .field-error) { margin-top: var(--sp-2); }
.dup-box .choice-body { background: #fff; }
.dup-box .notice > span { min-width: 0; overflow-wrap: anywhere; } /* email dài xuống dòng, không tràn khung trên mobile */
.dup-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.wz-progress { margin-bottom: 24px; }
.wz-progress-top { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.wz-progress-top b { color: var(--brand-700); }
.wz-progress-top .muted { color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.wz-steps { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 10px; }
.wz-steps button { all: unset; display: grid; gap: 8px; width: 100%; cursor: default; }
.wz-steps button.can { cursor: pointer; }
.wz-steps button:focus-visible { outline: 3px solid var(--brand-200); border-radius: 4px; }
.wz-steps .bar { height: 6px; border-radius: 999px; background: var(--line); transition: background 0.2s; }
.wz-steps .lbl { font-size: 12.5px; color: var(--muted); font-weight: 500; display: none; }
.wz-steps li.done .bar { background: var(--brand); }
.wz-steps li.current .bar { background: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
.wz-steps li.current .lbl { color: var(--brand-700); font-weight: 700; }
.wz-steps li.done .lbl { color: var(--ink-2); }
/* Bước bỏ qua (Thương hiệu khi đối tác đã có trên UrGift) */
.wz-steps li.skipped .bar { background: repeating-linear-gradient(90deg, var(--brand-200) 0 6px, transparent 6px 10px); }
.wz-steps li.skipped .lbl { color: var(--muted); text-decoration: line-through; }
@media (min-width: 640px) { .wz-steps .lbl { display: block; } }

.wz-title { font-size: clamp(24px, 4vw, 30px); font-weight: 800; letter-spacing: -0.02em; }
.wz-title:focus { outline: none; }
.wz-lead { color: var(--muted); margin: 8px 0 24px; }
.wz-step > .wz-lead + * { margin-top: 24px; }

/* ===== Nhịp khoảng cách form đăng ký =====
   8px: nhãn → ô nhập, ô → gợi ý/lỗi · 12px: thành phần phụ (chip, link, ô con trong tùy chọn)
   20px: giữa các ô, giữa tiêu đề khối và nội dung, giữa các khối · 24px: sau dòng mô tả của bước
   Áp dụng cho form đăng ký (.wz-step) và form ưu đãi ở portal (.offer-form). */
:root { --sp-1: 8px; --sp-2: 12px; --sp-3: 20px; }
/* :is() (độ ưu tiên 1 class) để thắng các reset margin theo thẻ như fieldset, p, h3 */
:is(.wz-step, .offer-form, .offer-rest, .offer-sec, .sign-sec, .brand-card, .wz-block, .contact-fields, .more-body) > * + * { margin-top: var(--sp-3); }
.wz-step > .wz-lead { margin-top: var(--sp-1); margin-bottom: 0; }
:is(.wz-step, .offer-form) .field { gap: var(--sp-1); }
:is(.wz-step, .offer-form) :is(.field, .field-row) + :is(.field, .field-row) { margin-top: var(--sp-3); }
:is(.wz-step, .offer-form) .field-row { gap: var(--sp-3) 16px; }
:is(.wz-step, .offer-form) .field-row > .field + .field { margin-top: 0; }
:is(.wz-step, .offer-form) fieldset > legend { margin-bottom: var(--sp-1); }
:is(.wz-step, .offer-form) :not(.field) > .field-error:not([hidden]) { margin-top: var(--sp-1); }
:is(.wz-step, .offer-form) details.more { margin-top: var(--sp-3); }

.wz-actions {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; gap: 12px; justify-content: space-between; align-items: center;
  margin: 32px -20px -20px; padding: 12px 20px;
  background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(6px);
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.wz-actions .btn-primary { min-width: 160px; }
@media (min-width: 640px) { .wz-actions { margin: 36px -36px -32px; padding: 16px 36px; } }
@media (max-width: 479px) { .wz-actions .btn-primary { flex: 1; } }

.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 12px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.g-logo { width: 20px; height: 20px; }

.signed-in { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-soft); }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 700; flex: none; }
.signed-in .who { flex: 1; min-width: 0; }
.signed-in .who b { display: block; overflow-wrap: anywhere; }
.signed-in .who span { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }

.program-sum { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border: 1px solid var(--brand-200); border-radius: var(--radius); background: var(--brand-50); }
.program-sum b { color: var(--brand-700); }

.kyb-card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.kyb-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; background: var(--bg-soft); border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 600; color: var(--ink-2); flex-wrap: wrap; }
.kyb-body { padding: 4px 16px; }
.kv { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv dt { font-size: 13px; color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; } /* email, website dài không làm tràn ngang mobile */
@media (min-width: 560px) { .kv { grid-template-columns: 160px minmax(0, 1fr); gap: 12px; align-items: baseline; } } /* nhãn nhỏ, giá trị lớn: thẳng chân chữ */
.kyb-foot { padding: 10px 16px; font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); }
.kyb-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }

.brand-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
@media (min-width: 640px) { .brand-card { padding: 20px; } }
.logo-row { display: flex; gap: 16px; align-items: center; }
.logo-preview { width: 72px; height: 72px; border-radius: 18px; display: grid; place-items: center; background: #7b4b2a; color: #fff; font-weight: 800; font-size: 22px; flex: none; overflow: hidden; border: 1px solid var(--line); }
.logo-preview img { width: 100%; height: 100%; object-fit: cover; }
.counter { font-size: 13px; color: var(--muted); text-align: right; }
.counter.over { color: var(--err); font-weight: 600; }
.counter.warn { color: var(--warn); font-weight: 600; }
.intro-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.intro-foot .counter { flex: none; }
.terms-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); }

/* ===== Bước Ưu đãi ===== */
/* Chọn loại ưu đãi: 3 ô gọn, luôn nằm 1 hàng */
.type-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.type-choice { position: relative; display: block; cursor: pointer; }
.type-choice input { position: absolute; opacity: 0; pointer-events: none; }
.tc-body { height: 100%; display: flex; align-items: center; gap: 12px; padding: 14px; border: 1.5px solid var(--line-2); border-radius: var(--radius); background: #fff; transition: border-color 0.15s, background 0.15s, box-shadow 0.15s; }
.tc-body:hover { border-color: #b9b3cc; }
.type-choice input:checked + .tc-body { border-color: var(--brand); background: var(--brand-50); box-shadow: 0 0 0 3px var(--brand-100); }
.type-choice input:focus-visible + .tc-body { outline: 3px solid var(--brand-200); outline-offset: 2px; }
.tc-ic { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); font-weight: 800; font-size: 18px; transition: background 0.15s, color 0.15s; }
.type-choice input:checked + .tc-body .tc-ic { background: var(--brand); color: #fff; }
.tc-text { display: grid; gap: 2px; min-width: 0; }
.tc-text b { font-size: 15px; line-height: 1.3; }
.tc-text small { font-size: 13px; color: var(--muted); }
@media (max-width: 559px) {
  .tc-body { flex-direction: column; justify-content: center; text-align: center; gap: 8px; padding: 12px 6px; }
  .tc-text b { font-size: 14px; }
  .tc-text small { display: none; }
}
/* Mô tả ưu đãi bằng lời, AI điền giúp (mặc định ở bước Chiến dịch, P52) */
.describe-box { padding: 16px; display: grid; gap: var(--sp-1); border-radius: var(--radius); background: var(--brand-50); border: 1px solid var(--brand-100); }
.describe-box .label { display: inline-flex; align-items: center; gap: 6px; }
.describe-box .label .i { color: var(--brand); }
.describe-box .textarea { background: #fff; }
.describe-box .actions { display: flex; justify-content: flex-end; margin-top: 4px; }

/* Các khối nội dung */
.offer-sec { padding: 20px; border-radius: var(--radius-lg); background: var(--bg-soft); }
.offer-sec .input, .offer-sec .select, .offer-sec .textarea { background: #fff; }
.sec-title { font-size: 17px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0; }
.sign-sec > .sec-title + .hint { display: block; margin-top: var(--sp-1); }
.sec-title > span:first-child { display: inline-flex; align-items: center; gap: 8px; }
.sec-title .i { color: var(--brand); }

/* Tùy chọn bật/tắt (giảm tối đa, hóa đơn tối thiểu, yêu cầu mua): mỗi dòng một ô, full width */
.opt-row { display: grid; gap: var(--sp-2); padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); transition: border-color 0.15s; }
.opt-row:has(.toggle input:checked) { border-color: var(--brand-200); }
.opt-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; }
.opt-text { display: grid; gap: 2px; min-width: 0; }
.opt-text b { font-size: 15px; font-weight: 600; }
.opt-text small { font-size: 13px; color: var(--muted); }
.opt-row > .field-error:not([hidden]) { margin-top: -4px; }
.toggle { display: inline-flex; align-items: center; cursor: pointer; }
.toggle input { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 40px; height: 24px; margin: 0; border-radius: 999px; background: var(--line-2); cursor: pointer; transition: background 0.15s; }
.toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(27, 21, 48, 0.25); transition: transform 0.15s; }
.toggle input:checked { background: var(--brand); }
.toggle input:checked::after { transform: translateX(16px); }
.toggle input:focus-visible { outline: 3px solid var(--brand-200); outline-offset: 2px; }

/* Mã do ai tạo: nhóm nút 1 hàng */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; background: #fff; border: 1px solid var(--line); border-radius: 999px; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 9px 6px; border-radius: 999px; text-align: center; font-size: 14px; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background 0.15s, color 0.15s; }
.seg label:hover span { color: var(--brand-700); }
.seg input:checked + span { background: var(--brand); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid var(--brand-200); }
.seg-desc { display: block; margin-top: 8px; }
@media (max-width: 479px) {
  .seg { border-radius: 14px; }
  .seg span { padding: 8px 4px; border-radius: 10px; font-size: 13px; line-height: 1.3; white-space: normal; }
}

/* Chọn nhanh */
.end-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.end-sec > .end-quick, .end-sec > .hint { margin-top: var(--sp-2); }
.chip-btn { border: 1px solid var(--line-2); background: #fff; color: var(--ink-2); border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 600; cursor: pointer; }
.chip-btn:hover { border-color: var(--brand-200); }
.chip-btn.on { border-color: var(--brand); background: var(--brand-50); color: var(--brand-700); }

/* Thời gian áp dụng: một dòng nổi bật */
.end-banner { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: var(--radius); }
.end-ic { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); }
.end-label { flex: 1; min-width: 150px; font-weight: 700; font-size: 16px; }
.end-input { width: 190px; font-weight: 700; color: var(--brand-700); }
@media (max-width: 479px) { .end-input { width: 100%; } }
.end-sec > .hint { display: block; }

/* Xem trước voucher */
.vp { padding: 16px; border-radius: var(--radius-lg); background: linear-gradient(160deg, var(--brand-700), var(--brand) 75%); color: #fff; }
.vp-head { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; font-size: 13px; font-weight: 600; opacity: 0.92; }
.vp-card { position: relative; background: #fff; color: var(--ink); border-radius: 16px; box-shadow: 0 10px 24px rgba(20, 10, 50, 0.25); }
.vp-top { display: flex; align-items: center; gap: 12px; padding: 16px; }
.vp-logo { width: 52px; height: 52px; flex: none; border-radius: 14px; display: grid; place-items: center; overflow: hidden; background: var(--line-2); color: #fff; font-weight: 800; border: 1px solid var(--line); }
.vp-logo img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.vp-info { display: grid; gap: 2px; min-width: 0; }
.vp-brand { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vp-title { font-size: 20px; font-weight: 800; line-height: 1.25; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.vp-cond { font-size: 13px; color: var(--ink-2); }
.vp-cut { position: relative; margin: 0 16px; border-top: 1.5px dashed var(--line-2); }
.vp-cut::before, .vp-cut::after { content: ""; position: absolute; top: -9px; width: 16px; height: 16px; border-radius: 50%; background: var(--brand); }
.vp-cut::before { left: -24px; }
.vp-cut::after { right: -24px; }
.vp-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 8px; padding: 10px 16px 12px; font-size: 12px; font-weight: 500; color: var(--muted); }
.vp-bottom span { white-space: nowrap; }
/* Dòng cách hiển thị mã có thể dài (nhiều cách, kèm mã chung): cho xuống dòng để không tràn ngang trên mobile */
.vp-bottom span:first-child { white-space: normal; overflow-wrap: anywhere; min-width: 0; }
.vp-stats { margin: 12px 0 0; padding: 4px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.12); }
.vp-stats div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; }
.vp-stats div + div { border-top: 1px solid rgba(255, 255, 255, 0.16); }
.vp-stats dt { font-size: 13px; opacity: 0.85; white-space: nowrap; }
.vp-stats dd { margin: 0; font-size: 15px; font-weight: 700; text-align: right; }
.vp-note { margin-top: 10px; font-size: 12px; opacity: 0.85; }
/* Desktop: bản xem trước ở cột phải, dính khi cuộn */
@media (min-width: 1024px) {
  body[data-wz-step="4"] .wz-aside { position: sticky; top: calc(var(--header-h) + 20px); }
  body[data-wz-step="4"] .wz-aside .help-card.ctx { display: none; }
}

/* Bước Xem lại: thông tin ký hợp đồng */
.sign-sec { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); }
details.more { margin-top: 18px; }
details.more summary { cursor: pointer; font-weight: 600; color: var(--brand); font-size: 15px; list-style: none; display: inline-flex; align-items: center; gap: 6px; }
details.more summary::-webkit-details-marker { display: none; }
details.more[open] summary .i { transform: rotate(180deg); }
details.more .more-body { margin-top: 12px; }

.review-block { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.review-block + .review-block { margin-top: 12px; }
.review-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 6px; }
.review-head h3 { font-size: 16px; display: flex; gap: 8px; align-items: center; }
.review-head h3 .i { color: var(--brand); }
.review-block .kv { padding: 8px 0; }
.review-block .kv dd { font-weight: 500; }
/* Thể lệ trong khối Chiến dịch ở bước Xem lại (P52) */
.review-block details.review-terms { margin-top: var(--sp-2); }

/* Aside */
.wz-aside { display: grid; gap: 16px; }
.help-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; }
.help-card h3 { font-size: 16px; display: flex; gap: 8px; align-items: center; }
.help-card h3 .i { color: var(--brand); }
.help-card p, .help-card li { font-size: 14px; color: var(--ink-2); }
.help-card p { margin-top: 8px; }
.help-card ul { margin-top: 8px; padding-left: 18px; display: grid; gap: 6px; }
.wz-spin { color: var(--brand); margin-top: 2px; }
.logo-up { display: grid; gap: 6px; justify-items: start; }
@media (max-width: 1023px) { .wz-aside .help-card.ctx { display: none; } }

/* Success */
.success { text-align: center; max-width: 640px; margin: 0 auto; }
.success-icon { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-50); color: var(--ok); margin: 8px auto 16px; }
.success-icon .i { width: 36px; height: 36px; }
.success .dossier { display: inline-flex; gap: 8px; align-items: center; margin-top: 12px; padding: 6px 14px; border-radius: 999px; background: var(--bg-soft); font-size: 14px; }
.next-list { list-style: none; text-align: left; margin: 28px 0; display: grid; gap: 0; }
.next-list li { display: grid; grid-template-columns: 32px 1fr auto; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: start; }
.next-list li:last-child { border-bottom: 0; }
.next-list .n { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-700); font-weight: 700; font-size: 14px; }
.next-list b { display: block; }
.next-list span.d { font-size: 14px; color: var(--muted); }
.success .hero-cta { justify-content: center; }

/* ---------- Portal, /admin: khối dùng chung (panel, việc thiết lập, file, bảng, số liệu). Khung portal ở portal.css ---------- */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-head h2 { font-size: 18px; }
.panel-body { padding: 20px; }
.progress-mini { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.progress-mini .track { width: 120px; height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress-mini .fill { height: 100%; background: var(--brand); border-radius: 999px; transition: width 0.3s; }

.task { border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.task > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 40px 1fr auto; gap: 14px; align-items: center; padding: 16px 20px; }
.task > summary::-webkit-details-marker { display: none; }
.task > summary:hover { background: var(--bg-soft); }
.task-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); }
.task.is-done .task-ic { background: var(--ok-50); color: var(--ok); }
.task.is-wait .task-ic { background: var(--info-50); color: var(--info); }
.task-t b { display: block; font-size: 16px; }
.task-t span { font-size: 14px; color: var(--muted); }
.task-r { display: flex; align-items: center; gap: 8px; }
.task-r .chev { color: var(--muted); transition: transform 0.2s; }
.task[open] .task-r .chev { transform: rotate(180deg); }
.task-body { padding: 4px 20px 24px 74px; display: grid; gap: 16px; }
/* Màn hẹp: nhãn trạng thái xuống dưới tên việc (tên không bị ép hẹp), mũi tên giữ bên phải */
@media (max-width: 639px) {
  .task-body { padding: 4px 16px 20px; }
  .task > summary { padding: 14px 16px; grid-template-columns: 36px minmax(0, 1fr) auto; grid-template-areas: "ic t chev" "ic st chev"; gap: 6px 12px; }
  .task-ic { grid-area: ic; align-self: start; width: 36px; height: 36px; }
  .task-t { grid-area: t; }
  .task-r { display: contents; }
  .task-r .badge { grid-area: st; justify-self: start; }
  .task-r .chev { grid-area: chev; }
}
.task-actions { display: flex; flex-wrap: wrap; gap: 10px; }
/* Việc có file tải lên: giấy tờ, hình ảnh thương hiệu */
.up-part { display: grid; gap: var(--sp-1); }
/* Hợp đồng mẫu điền sẵn (việc "Ký hợp đồng"): khung xem trước + nút in, tải Word */
.contract-frame { display: block; width: 100%; height: 440px; border: 1px solid var(--line); border-radius: var(--radius); background: #f4f2f8; }
@media (max-width: 639px) { .contract-frame { height: 360px; } }
.tpl-actions { display: flex; flex-wrap: wrap; gap: var(--sp-1); align-items: center; margin: 0; }
.tpl-actions a:not(.btn) { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.file-pill .link-btn { flex: none; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.thumb { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg-soft); }
.thumb img { display: block; width: 100%; aspect-ratio: 2 / 1; object-fit: cover; }
.thumb figcaption { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 13px; }
.thumb figcaption span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 12px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; font-size: 14px; }
.tabs button[aria-selected="true"] { color: var(--brand-700); border-bottom-color: var(--brand); }

.result-box { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.result-sum { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px; background: var(--bg-soft); border-bottom: 1px solid var(--line); align-items: center; font-size: 14px; }
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; background: #fff; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .input { min-height: 38px; padding: 6px 10px; font-size: 14px; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }

.invite-list { list-style: none; display: grid; gap: 8px; }
.invite-list li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.invite-list .who { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.invite-list .who .hint { display: block; }
.invite-list .avatar { width: 32px; height: 32px; font-size: 13px; background: var(--brand-100); color: var(--brand-700); }

.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.kpi .k { font-size: 13px; color: var(--muted); }
.kpi .v { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 13px; color: var(--muted); margin-top: 2px; }
.kpi .meter { height: 6px; border-radius: 999px; background: var(--line); margin-top: 10px; overflow: hidden; }
.kpi .meter i { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.kpi.warn .meter i { background: var(--accent-600); }

.bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; align-items: end; height: 180px; padding-top: 24px; }
.bar-col { display: grid; justify-items: center; gap: 6px; height: 100%; grid-template-rows: 1fr auto; }
.bar-col .b-wrap { width: 100%; max-width: 56px; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.bar-col .b { background: var(--brand); border-radius: 6px 6px 0 0; position: relative; min-height: 4px; }
.bar-col .b span { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: 12px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.bar-col .x { font-size: 12px; color: var(--muted); }

/* Đăng nhập (Google + mã qua email), dùng chung cho /dang-ky và /portal */
.auth-box { max-width: 400px; }
/* Trong form đăng ký: đăng nhập là một ô như các ô khác của form (thẳng mép trái, không khung lồng trong khung). Nhãn của ô là
   "Email doanh nghiệp" trong khối đăng nhập, nên bỏ nhãn chung "Tài khoản đăng nhập" lúc chưa đăng nhập. Màn rộng: ô email và
   nút nhận mã cùng một hàng */
#authBox .auth-box { max-width: none; }
.field:has(> #authBox:not([hidden])) > .label { display: none; }
@media (min-width: 640px) {
  #authBox .auth-email { grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; }
  #authBox .auth-email > .label { grid-column: 1 / -1; }
  #authBox .auth-email .btn { margin-top: 0; width: auto; }
  #authBox .auth-otp { max-width: 400px; }
}
.auth-box .or { margin: var(--sp-3) 0; }
.auth-box .btn { min-height: 48px; }
.g-btn { min-height: 44px; display: flex; justify-content: center; }
.auth-email { display: grid; gap: var(--sp-1); }
.auth-email .btn { margin-top: var(--sp-2); }
.auth-start > [data-err]:not([hidden]) { margin-top: var(--sp-2); }
.btn .spinner { width: 16px; height: 16px; border-width: 2px; }
/* Ô nhập có icon phía trước */
.input-ic { position: relative; }
.input-ic > .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; transition: color 0.15s; }
.input-ic > .input { padding-left: 44px; }
.input-ic:focus-within > .i { color: var(--brand); }

/* Bước nhập mã: 6 ô số, ô nhập thật nằm trong suốt phía trên */
.auth-otp { display: grid; gap: var(--sp-3); }
.auth-back { justify-self: start; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-2); }
.auth-back:hover { color: var(--brand); text-decoration: none; }
.auth-otp-head { display: flex; gap: 14px; align-items: center; }
.auth-otp-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; flex: none; background: var(--brand-50); color: var(--brand); }
.auth-otp-head > div { min-width: 0; font-size: 14px; color: var(--muted); }
.auth-otp-head b { display: block; font-size: 17px; color: var(--ink); }
.auth-to { color: var(--brand-700); font-weight: 600; overflow-wrap: anywhere; }
.otp-field { position: relative; }
.otp-slots { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.otp-slots span {
  height: 56px; display: grid; place-items: center;
  border: 1.5px solid var(--line-2); border-radius: var(--radius); background: #fff;
  font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.otp-slots span.filled { border-color: var(--brand-200); background: var(--brand-50); }
.otp-slots span.on { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px var(--brand-100); }
.otp-slots span.on:empty::after { content: ""; width: 2px; height: 24px; border-radius: 2px; background: var(--brand); animation: otp-caret 1s steps(1) infinite; }
@keyframes otp-caret { 50% { opacity: 0; } }
.otp-field.err .otp-slots span { border-color: var(--err); background: #fff; }
.otp-field.err .otp-slots span.on { box-shadow: 0 0 0 4px var(--err-50); }
.otp-input {
  position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%;
  border: 0; padding: 0; margin: 0; background: transparent; outline: none;
  color: transparent; -webkit-text-fill-color: transparent; caret-color: transparent;
  font-size: 16px; /* 16px để iOS không tự phóng to */
}
.otp-input::selection { background: transparent; }
.otp-input:focus-visible { outline: none; }
.auth-otp > [data-err]:not([hidden]) { margin-top: calc(var(--sp-1) - var(--sp-3)); }
.auth-otp-foot { display: grid; gap: 6px; font-size: 13px; color: var(--muted); text-align: center; }
.auth-otp-actions { font-size: 14px; color: var(--ink-2); }
@media (max-width: 400px) { .otp-slots { gap: 6px; } .otp-slots span { height: 50px; font-size: 22px; } }
@media (prefers-reduced-motion: reduce) { .otp-slots span.on:empty::after { animation: none; } }

/* ===== Trang đăng nhập portal, admin: thẻ 2 cột (giới thiệu + form) ===== */
.login-shell {
  display: grid; max-width: 1040px; margin: 0 auto; overflow: hidden;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-xl); box-shadow: var(--shadow);
}
.login-form { display: flex; flex-direction: column; padding: 28px 20px 24px; }
.login-form-inner { width: 100%; max-width: 400px; margin: auto; }
.login-title { font-size: clamp(26px, 3.4vw, 32px); font-weight: 800; letter-spacing: -0.025em; }
.login-title:focus { outline: none; }
.login-lead { color: var(--muted); margin-top: var(--sp-1); }
.login-form .auth-box { max-width: none; margin-top: 28px; }
.login-alt { margin-top: 28px; padding-top: var(--sp-3); border-top: 1px solid var(--line); text-align: center; font-size: 15px; color: var(--ink-2); }
.login-alt a { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.login-help { margin-top: 32px; text-align: center; font-size: 13px; color: var(--muted); }
.login-help a { color: var(--ink-2); font-weight: 600; white-space: nowrap; }

.login-brand {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; gap: 24px; padding: 28px 20px;
  color: #fff;
  background:
    radial-gradient(420px 280px at 100% 0%, rgba(255, 183, 0, 0.3), transparent 62%),
    radial-gradient(520px 420px at 0% 100%, rgba(138, 59, 232, 0.65), transparent 65%),
    linear-gradient(155deg, var(--brand-700), var(--brand) 60%, #7a30d8);
}
/* Vòng tròn trang trí */
.login-brand::before, .login-brand::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.14); pointer-events: none; }
.login-brand::before { width: 420px; height: 420px; right: -180px; bottom: -160px; }
.login-brand::after { width: 260px; height: 260px; right: -100px; bottom: -80px; border-color: rgba(255, 183, 0, 0.28); }
.login-pill { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); font-size: 13px; font-weight: 600; }
.login-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.login-brand h2 { font-size: clamp(22px, 2.8vw, 30px); font-weight: 800; letter-spacing: -0.025em; line-height: 1.25; text-wrap: balance; }
.login-brand h2 em { font-style: normal; color: var(--accent); }
.login-points { list-style: none; display: grid; gap: 18px; }
.login-points li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; align-items: start; }
.login-points .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.14); color: var(--accent); }
.login-points b { display: block; font-size: 15px; line-height: 1.4; }
.login-points span { display: block; margin-top: 2px; font-size: 14px; line-height: 1.5; color: rgba(255, 255, 255, 0.78); }

/* Minh họa một ưu đãi đang chạy (trang trí) */
.login-ticket { position: relative; margin-top: auto; padding-top: 8px; display: none; }
.login-ticket::before { content: ""; position: absolute; inset: 22px 18px -10px; border-radius: 16px; background: rgba(255, 255, 255, 0.22); transform: rotate(-3deg); }
.lt-card { position: relative; display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 16px; background: #fff; color: var(--ink); box-shadow: 0 16px 36px rgba(20, 10, 50, 0.3); }
.lt-logo { width: 48px; height: 48px; flex: none; border-radius: 14px; display: grid; place-items: center; background: var(--accent-50); color: var(--accent-600); }
.lt-text { flex: 1; min-width: 0; display: grid; }
.lt-text small { font-size: 12px; color: var(--muted); }
.lt-text b { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.3; }
.lt-text span { font-size: 13px; color: var(--ink-2); }

@media (min-width: 640px) {
  .login-form { padding: 48px 48px 28px; }
  .login-brand { padding: 40px; }
}
@media (min-width: 900px) {
  .adm-main:has(> .login:not([hidden])) { padding-top: 40px; }
  .login-shell { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); grid-template-areas: "brand form"; min-height: 560px; }
  .login-brand { grid-area: brand; padding: 48px; }
  /* Không có thẻ minh họa (trang admin): căn giữa nội dung theo chiều dọc */
  .login-brand:not(:has(.login-ticket)) { justify-content: center; }
  .login-form { grid-area: form; padding: 56px 56px 28px; }
  .login-ticket { display: block; }
}

/* ===== Portal: khu vực ưu đãi ===== */
.offer-list { list-style: none; }
.offer-item { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; padding: 16px 20px; border-top: 1px solid var(--line); align-items: start; }
.offer-list .offer-item:first-child { border-top: 0; }
.oi-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); font-weight: 800; font-size: 17px; }
.oi-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px 12px; flex-wrap: wrap; }
.oi-top b { font-size: 16px; overflow-wrap: anywhere; }
.oi-meta { margin-top: 4px; font-size: 13px; color: var(--muted); }
.oi-note { margin-top: 8px; display: flex; gap: 6px; align-items: flex-start; font-size: 13px; color: var(--ink-2); }
.oi-note .i { margin-top: 2px; color: var(--brand); flex: none; }
.offer-new { border-bottom: 1px solid var(--line); }
.offer-new-head h3 { font-size: 17px; }
.offer-new-head .hint { display: block; margin-top: var(--sp-1); }
.offer-new > * + * { margin-top: var(--sp-3); }
.offer-new .task-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 639px) { .offer-item { padding: 14px 16px; gap: 12px; } }
/* Kho mã: lỗi từng dòng của file mã, file mẫu */
.err-rows { border: 1px solid var(--err-50); border-radius: var(--radius); overflow: hidden; }
.err-rows .tbl th { background: var(--err-50); color: var(--err); }
.err-rows .tbl td.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; overflow-wrap: anywhere; }
.rules { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 14px; color: var(--ink-2); }
.err-more { padding: 10px 14px; }
.input-code { max-width: 260px; text-transform: uppercase; }
/* Chọn phần việc giao cho đồng nghiệp */
.chips { display: flex; gap: var(--sp-1); flex-wrap: wrap; }
.chips .chip input { accent-color: var(--brand); }
.chips .chip { cursor: pointer; }
.chips .chip:has(input:checked) { border-color: var(--brand); background: var(--brand-50); color: var(--brand-700); }
.chips .chip:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
/* Ô số ngắn (VD số thương hiệu): không kéo hết chiều ngang */
.input-affix.input-short { max-width: 240px; }
.input-affix.input-short .input { padding-right: 104px; }

/* Thông tin ngắn của từng ưu đãi */
.oi-facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.oi-facts span { font-size: 12px; font-weight: 600; color: var(--ink-2); padding: 3px 10px; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--line); }

/* Hộp thoại (dialog) */
.dlg { padding: 0; border: 0; border-radius: var(--radius-lg); width: min(720px, calc(100% - 32px)); max-height: calc(100dvh - 48px); color: var(--ink); background: #fff; box-shadow: 0 24px 64px rgba(20, 15, 38, 0.28); }
.dlg::backdrop { background: rgba(20, 15, 38, 0.45); }
.dlg[open] { display: flex; flex-direction: column; }
.dlg-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.dlg-head h2 { font-size: 19px; }
.dlg-head .hint { display: block; margin-top: 4px; }
.dlg-body { flex: 1; overflow-y: auto; padding: 20px; overscroll-behavior: contain; }
.dlg-body > .field-error:not([hidden]) { margin-top: var(--sp-3); }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: #fff; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
body.dlg-open { overflow: hidden; }
@media (max-width: 639px) {
  .dlg { width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .dlg-foot { border-radius: 0; }
  .dlg-foot .btn { flex: 1; }
}

/* Phần tử giãn hết chỗ còn lại trong hàng flex (VD chữ trong thông báo có nút) */
.grow { flex: 1; }

/* Việc đã xong */
.task.is-done .task-t b { color: var(--ink-2); }

/* Trạng thái trống: icon + một câu + một nút */
.empty { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 32px 20px; color: var(--muted); }
.empty > .i { width: 36px; height: 36px; color: var(--brand); margin-bottom: 4px; }
.empty b { color: var(--ink); font-size: 16px; }
.empty span { font-size: 14px; max-width: 440px; }
.empty .btn { margin-top: 10px; }

/* Số liệu khi đang chạy */
.kpi .k { display: flex; align-items: center; gap: 6px; }
.kpi .k .i { color: var(--brand); }
.kpi .meter.ok i { background: var(--ok); }

/* Danh sách mã Voucher: tóm tắt khi đã chọn gửi qua API */
.code-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); flex: none; }
.code-done { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--ok-50); }
.code-done > div { flex: 1; min-width: 0; }
.code-done p { margin: 0; font-size: 15px; }
.code-done .code-ic { background: #fff; color: var(--ok); }

/* ===== Form tạo chiến dịch (P42): Loại → Chi tiết → Xem lại ===== */
.cf > * + * { margin-top: var(--sp-3); }
:is(.cf-pane, .cf-detail) > * + * { margin-top: var(--sp-3); }
/* Thương hiệu áp dụng của form chiến dịch (P57, P83): tất cả thương hiệu hoặc chọn một / nhiều thương hiệu, hiện khi doanh nghiệp từ 2 thương hiệu */
.cf-adv { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
fieldset.cf-adv { margin-left: 0; margin-right: 0; padding: 0; min-width: 0; }
.cf-brands-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.cf-adv-body > .choices:first-child { margin-top: 0; }
.cf-adv > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; padding: 12px 16px; }
.cf-adv > summary::-webkit-details-marker { display: none; }
.cf-adv[open] > summary { border-bottom: 1px solid var(--line); }
.cf-adv-t { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--brand-700); }
.cf-adv-sum { min-width: 0; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.cf-adv-sum b { font-weight: 600; color: var(--ink-2); }
.cf-adv-body { padding: 16px; }
.cf-adv-body > :is(.choices, .cf-brand-list, .field-error, .hint) { margin-top: var(--sp-2); }
.cf-adv-body > legend + .choices { margin-top: 0; } /* nhãn ẩn (sr-only): tiêu đề Tùy chọn nâng cao đã ghi Thương hiệu áp dụng */
.cf-adv-body > .hint { display: block; }
.cf-brand-list { display: grid; gap: 10px; padding: 12px; border-radius: var(--radius); background: var(--bg-soft); }
.cf-brand-list .check span { min-width: 0; overflow-wrap: anywhere; }
@media (min-width: 640px) { .cf-brand-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cf-h { font-size: 17px; margin: 0; }
.cf-steps { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; }
.cf-steps li { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding-top: 10px; border-top: 3px solid var(--line); font-size: 13px; color: var(--muted); }
.cf-steps li > button { display: flex; align-items: center; gap: 8px; padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; min-width: 0; }
.cf-steps .dot { width: 22px; height: 22px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--line); color: var(--muted); font-size: 12px; font-weight: 700; }
.cf-steps .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-steps li.done { border-top-color: var(--brand); color: var(--brand-700); }
.cf-steps li.done .dot { background: var(--brand); color: #fff; }
.cf-steps li.current { border-top-color: var(--brand); color: var(--ink); font-weight: 700; }
.cf-steps li.current .dot { background: var(--brand-100); color: var(--brand-700); }
@media (max-width: 479px) { .cf-steps li:not(.current) .t { display: none; } }
.cf-types { display: grid; gap: 12px; }
@media (min-width: 600px) { .cf-types { grid-template-columns: 1fr 1fr; } }
.cf-type .choice-body { gap: 8px; padding: 20px; align-content: start; }
.cf-type .choice-title { font-size: 17px; }
.cf-type-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); }
.cf-type input:checked + .choice-body .cf-type-ic { background: var(--brand); color: #fff; }
.cf-type-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
/* Phân loại chiến dịch (P54): Sponsored (tài trợ ưu đãi), Voucher (điểm chấp nhận UrBox Voucher). Dùng chung form chiến dịch, portal */
.cls-tag { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; line-height: 18px; letter-spacing: .02em; background: var(--brand-50); color: var(--brand-700); white-space: nowrap; }
.cls-tag.cls-voucher { background: var(--info-50); color: var(--info); }
.cf-ticks { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); }
.cf-ticks li { display: flex; gap: 8px; align-items: flex-start; }
.cf-ticks .i { color: var(--ok); margin-top: 3px; }
.cf-dist .choice-body { gap: 6px; }
/* Kênh UrBox của Promotion (P85): chọn 1-3 kênh, mỗi kênh một dòng có mô tả */
.cf-dist > :is(.cf-channels, .field-error, .hint) { margin-top: var(--sp-2); }
.cf-channels { display: grid; gap: 10px; padding: 12px; border-radius: var(--radius); background: var(--bg-soft); }
.cf-channels .check { align-items: flex-start; }
.cf-channels .check span { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.cf-channels .check small { font-weight: 400; }
.cf-req { display: flex; gap: 6px; align-items: flex-start; font-size: 13px; color: var(--warn); }
.cf-req .i { margin-top: 2px; }
.cf-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cf-chips .chip-btn { padding: 8px 14px; font-size: 14px; }
.cf-add { display: flex; gap: 8px; align-items: center; max-width: 360px; }
.cf-add .input-affix { flex: 1; }
.cf-review { display: grid; gap: var(--sp-3); align-items: start; }
@media (min-width: 640px) { .cf-review { grid-template-columns: minmax(0, 300px) minmax(0, 1fr); } }
.cf-review-card { padding: 12px; border-radius: 16px; background: linear-gradient(160deg, var(--brand-700), var(--brand) 75%); }
.cf-sum { margin: 0; display: grid; gap: 10px; font-size: 14px; }
.cf-sum div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: baseline; }
.cf-sum dt { grid-column: 1; font-size: 12px; color: var(--muted); }
.cf-sum dd { grid-column: 1; margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.cf-sum .link-btn { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.cf-terms { display: grid; gap: var(--sp-1); padding: 14px 16px; border-radius: 14px; background: var(--bg-soft); }
.cf-terms-list { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 14px; color: var(--ink-2); }
.cf-skel { display: grid; gap: 8px; }
.cf-skel i { display: block; height: 12px; border-radius: 6px; background: var(--line); }
.cf-skel i:nth-child(2) { width: 85%; } .cf-skel i:nth-child(3) { width: 60%; }
.cf-back { display: flex; }
.cf-back .link-btn { display: inline-flex; align-items: center; gap: 6px; }
/* Chân hộp thoại: Quay lại bên trái, nút chính bên phải */
.dlg-foot .dlg-spacer { flex: 1; }
@media (max-width: 639px) { .dlg-foot .dlg-spacer { display: none; } }
.cf-later { display: flex; gap: 6px; align-items: flex-start; }
.cf-later .i { margin-top: 3px; color: var(--brand); flex: none; }

/* Nhãn Bắt buộc / Tùy chọn cạnh tên việc (hiện cả trên mobile) */

/* Hộp thoại sau khi gửi đăng ký: hồ sơ đã khởi tạo, việc cần làm */
.dlg-sm { width: min(540px, calc(100% - 32px)); }
.wl-head { display: flex; gap: 12px; align-items: flex-start; }
.wl-ic { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--ok-50); color: var(--ok); display: grid; place-items: center; }
.wl-sub { margin-top: var(--sp-3); font-weight: 600; }
.wl-list { list-style: none; padding: 0; margin: var(--sp-1) 0 0; display: grid; gap: 8px; }
.wl-list li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius); background: var(--bg-soft); }
.wl-list li > .i { margin-top: 3px; color: var(--brand); flex: none; }
.wl-list b { display: block; font-size: 14px; }
.wl-list small { display: block; color: var(--muted); font-size: 13px; }
#welcomeBody > .hint { display: block; margin-top: var(--sp-3); }
@media (max-width: 639px) { .dlg.dlg-sm { height: auto; margin: auto 0 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; } }

/* Việc "Thông tin thương hiệu" (trên 3 thương hiệu, P43): mỗi thương hiệu khác một khối */
.bx-row { display: grid; gap: var(--sp-2); padding: 16px; border-radius: var(--radius); background: var(--bg-soft); }
.bx-row .input, .bx-row .select, .bx-row .textarea { background: #fff; }
.bx-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.bx-head b { font-size: 14px; }
