/* System Z — Pastel Pop theme (phương án D, chốt 29/09/2026)
   Lớp giao diện nạp sau cùng, chỉ đổi hình thức; không đổi chức năng.
   Bảng màu:
   - Tím chủ đạo #6C47FF (nút chính, mục đang chọn)
   - Nền trang #F1EDFF, thẻ trắng, ô phụ #F7F5FF
   - Màu phân biệt từng mục menu (data-tone): lilac, peach, sky, mint, butter, rose, grey
   Bo góc: thẻ lớn 15px, ô nhỏ 8–10px, nút và nhãn trạng thái bo tròn hai đầu. */

:root {
  --pp-violet: #6C47FF;
  --pp-violet-hover: #5A36F0;
  --pp-violet-pressed: #4B2FD6;
  --pp-violet-soft: #F1EDFF;
  --pp-ink: #1D1A2E;
  --pp-ink-2: #3B3752;
  --pp-muted: #5E5877;
  --pp-subtle: #F7F5FF;
  --pp-line: #ECE8F6;
  --pp-line-strong: #D9D2F2;
  --pp-radius-card: 15px;
  --pp-radius-control: 10px;
  --pp-shadow: 0 1px 2px rgba(60, 40, 140, .04), 0 8px 24px rgba(60, 40, 140, .05);
  --pp-lilac-bg: #EDE7FF; --pp-lilac-fg: #4B2FD6;
  --pp-peach-bg: #FFE3D3; --pp-peach-fg: #7A2E0E;
  --pp-sky-bg: #DCEBFF; --pp-sky-fg: #1E4DA1;
  --pp-mint-bg: #D5F5E6; --pp-mint-fg: #0E4A31;
  --pp-butter-bg: #FFF1C2; --pp-butter-fg: #6B4E00;
  --pp-rose-bg: #FFE0E6; --pp-rose-fg: #8C1D3A;
  --pp-grey-bg: #F1EFF6; --pp-grey-fg: #3B3752;

  --blue: var(--pp-violet);
  --blue-hover: var(--pp-violet-hover);
  --blue-pressed: var(--pp-violet-pressed);
  --blue-soft: var(--pp-violet-soft);
  --violet: var(--pp-violet);
  --bg: #F1EDFF;
  --surface: #FFFFFF;
  --surface-subtle: var(--pp-subtle);
  --line: var(--pp-line);
  --line-strong: var(--pp-line-strong);
  --text: var(--pp-ink);
  --muted: var(--pp-muted);
  --radius: var(--pp-radius-card);
  --shadow: var(--pp-shadow);
  --shadow-hover: 0 2px 4px rgba(60, 40, 140, .06), 0 14px 32px rgba(60, 40, 140, .09);
}

html body { background: var(--bg); color: var(--pp-ink); }
body .main-content { background: transparent; }

/* ---------- Thanh menu bên trái: khối trắng nổi, bo góc ---------- */
body .sidebar {
  top: 16px; bottom: 16px; left: 16px; width: 248px; height: auto;
  padding: 18px 14px 14px; border: 0; border-radius: var(--pp-radius-card);
  background: #FFFFFF; color: var(--pp-ink); box-shadow: var(--pp-shadow);
  overflow-y: auto; scrollbar-width: thin;
}
/* Khe giữa menu và nội dung 4px (menu cách mép trái 16px, rộng 248px); cộng lề trái 16px của trang = 20px.
   Từ 1200px trở xuống menu ẩn vào nút ☰ (ux-v3.css) nên nội dung dùng hết chiều ngang, không chừa chỗ cho menu. */
@media (min-width: 1201px) {
  body .main-content { margin-left: 268px; width: calc(100% - 268px); }
  body.sidebar-collapsed .main-content { margin-left: 96px; width: calc(100% - 96px); }
}
/* ux-v3.css đặt lại margin-left 240px ở cuối file nên đè mất quy tắc ẩn menu ≤1200px của chính nó; đặt lại ở đây */
@media (max-width: 1200px) {
  body .main-content, body.sidebar-collapsed .main-content { margin-left: 0; width: 100%; }
}
body .sidebar .sidebar-brand-row { padding: 0 2px 10px 6px; }
body .sidebar .brand { color: var(--pp-ink); gap: 10px; }
body .sidebar .brand-mark { width: 40px; height: 40px; border: 0; border-radius: 10px; background: #FFFFFF; box-shadow: 0 0 0 1px var(--pp-line); }
body .sidebar .brand strong { color: var(--pp-ink); font-size: 17px; font-weight: 750; }
body .sidebar .brand span { color: var(--pp-muted); }
body .sidebar .sidebar-collapse-button {
  width: 34px; height: 34px; border: 0; border-radius: 8px;
  color: var(--pp-ink-2); background: var(--pp-subtle);
}
body .sidebar .sidebar-collapse-button:hover { color: var(--pp-violet-pressed); background: var(--pp-violet-soft); }
body .sidebar .sidebar-collapse-button .app-icon { width: 18px; height: 18px; }

body .sidebar .main-nav { gap: 2px; }
body .sidebar .nav-section-label {
  margin: 10px 0 2px; padding: 0 10px; color: #6E6887;
  font-size: 11px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase;
}
body .sidebar .nav-section-label:first-child { margin-top: 0; }
body .sidebar .nav-item {
  min-height: 44px; padding: 5px 10px 5px 5px; gap: 12px; border-radius: 10px;
  color: var(--pp-ink-2); background: transparent; box-shadow: none;
  font-size: 14px; font-weight: 550;
}
body .sidebar .nav-item::before { display: none; }
body .sidebar .nav-item:hover { color: var(--pp-ink); background: var(--pp-subtle); }
body .sidebar .nav-item.active,
body .sidebar .nav-item.group-active { color: var(--pp-ink); background: var(--pp-violet-soft); box-shadow: none; font-weight: 750; }
body .sidebar .nav-icon {
  width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center;
  border-radius: 8px; background: var(--pp-grey-bg); color: var(--pp-grey-fg);
}
body .sidebar .nav-icon .app-icon { width: 18px; height: 18px; stroke-width: 1.8; transform: none; filter: none; }
body .sidebar .nav-item[data-tone="lilac"] .nav-icon { background: var(--pp-lilac-bg); color: var(--pp-lilac-fg); }
body .sidebar .nav-item[data-tone="peach"] .nav-icon { background: var(--pp-peach-bg); color: var(--pp-peach-fg); }
body .sidebar .nav-item[data-tone="sky"] .nav-icon { background: var(--pp-sky-bg); color: var(--pp-sky-fg); }
body .sidebar .nav-item[data-tone="mint"] .nav-icon { background: var(--pp-mint-bg); color: var(--pp-mint-fg); }
body .sidebar .nav-item[data-tone="butter"] .nav-icon { background: var(--pp-butter-bg); color: var(--pp-butter-fg); }
body .sidebar .nav-item[data-tone="rose"] .nav-icon { background: var(--pp-rose-bg); color: var(--pp-rose-fg); }
body .sidebar .nav-item.active .nav-icon { box-shadow: inset 0 0 0 2px var(--pp-violet); }

body .sidebar .sidebar-foot {
  margin-top: 14px; padding: 12px; border: 0; border-radius: 10px;
  background: var(--pp-subtle); color: var(--pp-ink-2);
}
body .sidebar .sidebar-foot strong { color: var(--pp-ink); }
body .sidebar .sidebar-foot span { color: var(--pp-muted); }
body .sidebar .status-dot { background: #12805A; box-shadow: 0 0 0 4px #D5F5E6; }

/* Thu gọn menu (người dùng bấm nút icon cạnh logo, hệ thống nhớ lựa chọn) */
body.sidebar-collapsed .sidebar { width: 76px; padding: 18px 10px 14px; }
body.sidebar-collapsed .sidebar .sidebar-brand-row { flex-direction: column; gap: 10px; padding: 0 0 8px; }
body.sidebar-collapsed .sidebar .sidebar-collapse-button { position: static; width: 34px; height: 34px; border: 0; border-radius: 8px; color: var(--pp-ink-2); background: var(--pp-subtle); box-shadow: none; }
body.sidebar-collapsed .sidebar .nav-section-label { display: block; height: 1px; margin: 8px auto; padding: 0; width: 28px; overflow: hidden; color: transparent; background: var(--pp-line-strong); }
body.sidebar-collapsed .sidebar .main-nav { align-items: center; }
body.sidebar-collapsed .sidebar .nav-item { width: 44px; min-height: 44px; padding: 5px; justify-content: center; }
body.sidebar-collapsed .sidebar .sidebar-foot { padding: 10px; display: grid; place-items: center; }

/* ---------- Thanh trên cùng ---------- */
body .topbar {
  height: 84px; padding: 0 16px; border: 0;
  /* Thanh này dính ở đầu trang khi cuộn, nên phải có nền để chữ không đè lên nội dung */
  background: rgba(241, 237, 255, .92); backdrop-filter: blur(10px); box-shadow: none;
}
body .topbar .eyebrow { display: none; }
body .topbar h1 { margin: 0; color: var(--pp-ink); font-size: 30px; font-weight: 750; letter-spacing: -.01em; }
body .connection-badge { padding: 7px 12px; border: 0; border-radius: 999px; background: #FFFFFF; color: var(--pp-ink-2); box-shadow: var(--pp-shadow); font-weight: 600; }
body .avatar { width: 42px; height: 42px; border: 0; border-radius: 12px; background: var(--pp-peach-bg); color: var(--pp-peach-fg); font-weight: 750; }
body .account-popover { border: 0; border-radius: 12px; box-shadow: 0 18px 40px rgba(60, 40, 140, .16); }

body .view { padding-top: 4px; }
/* Lề hai bên nội dung gọn lại để dành chỗ hiển thị: 16px mỗi bên, bằng lề của menu */
@media (min-width: 781px) {
  body .view { padding-right: 16px; padding-left: 16px; padding-bottom: 40px; }
  /* Các khối tràn sát mép (màn dựng chiến dịch, thanh trên/dưới của trình soạn mẫu tin) dùng lề âm khớp với lề mới */
  body .workflow-builder { margin-right: -16px; margin-left: -16px; margin-bottom: -40px; }
  body .zbs-flat-head { margin-right: -16px; margin-left: -16px; padding-right: 16px; padding-left: 16px; }
  body .zbs-flat-actions { margin-right: -16px; margin-left: -16px; margin-bottom: -40px; padding-right: 16px; padding-left: 16px; }
  body .zbs-design-stage .zbs-flat-actions { margin: 0; padding: 12px 20px; }
}
body .section-toolbar h2 { color: var(--pp-ink); }
body .section-eyebrow, body .modal-eyebrow { color: var(--pp-violet-pressed); letter-spacing: .08em; }

/* ---------- Thẻ, khung nội dung ---------- */
body .panel,
body .stat-card,
body .campaign-card,
body .welcome-card,
body .campaign-insights article,
body .history-overview article,
body .table-panel {
  border: 0; border-radius: var(--pp-radius-card); background: #FFFFFF; box-shadow: var(--pp-shadow);
}
body .panel-head { border-color: var(--pp-line); }
body .notice { border-radius: var(--pp-radius-control); }
body .empty-icon { border-radius: 12px; background: var(--pp-violet-soft); color: var(--pp-violet-pressed); }

/* Ô icon số liệu: màu pastel thay cho hình 3D */
body :is(.stat-icon, .quick-action-icon, .insight-icon, .customer360-metric-icon, .appointment-metric-icon, .offer-kpi-icon, .zbs-summary-icon, .history-metric-icon) {
  border-radius: 10px; background: var(--pp-lilac-bg); color: var(--pp-lilac-fg);
}
body :is(.stat-icon, .quick-action-icon, .insight-icon, .customer360-metric-icon, .appointment-metric-icon, .offer-kpi-icon, .zbs-summary-icon).blue { background: var(--pp-sky-bg); color: var(--pp-sky-fg); }
body :is(.stat-icon, .quick-action-icon, .insight-icon, .customer360-metric-icon, .appointment-metric-icon, .offer-kpi-icon, .zbs-summary-icon).green { background: var(--pp-mint-bg); color: var(--pp-mint-fg); }
body :is(.stat-icon, .quick-action-icon, .insight-icon, .customer360-metric-icon, .appointment-metric-icon, .offer-kpi-icon, .zbs-summary-icon).orange { background: var(--pp-peach-bg); color: var(--pp-peach-fg); }
body :is(.stat-icon, .quick-action-icon, .insight-icon, .customer360-metric-icon, .appointment-metric-icon, .offer-kpi-icon, .zbs-summary-icon).violet { background: var(--pp-lilac-bg); color: var(--pp-lilac-fg); }

/* ---------- Nút bấm ---------- */
body .primary-button {
  min-height: 42px; padding: 0 20px; border: 0; border-radius: 999px;
  background: var(--pp-violet); color: #FFFFFF; font-weight: 700; box-shadow: 0 6px 16px rgba(108, 71, 255, .22);
}
body .primary-button:hover { background: var(--pp-violet-hover); }
body .primary-button:active { background: var(--pp-violet-pressed); }
body .primary-button:disabled { background: #B9ACF5; box-shadow: none; }
body .secondary-button {
  min-height: 42px; padding: 0 18px; border: 1px solid var(--pp-line-strong); border-radius: 999px;
  background: #FFFFFF; color: var(--pp-ink); font-weight: 600; box-shadow: none;
}
body .secondary-button:hover { border-color: #C3B6F2; background: var(--pp-subtle); color: var(--pp-ink); }
body .text-button { color: var(--pp-violet-pressed); }
/* Canh giữa chữ trong nút (02/10/2026): nút chính/phụ cao tối thiểu 42px, padding dọc = 0; nút nào bị quy tắc khác
   chuyển sang flex (vd. nút trong ô "Chưa có dữ liệu") thì chữ dính mép trên. Canh giữa cả dọc lẫn ngang. */
body :is(.primary-button, .secondary-button) { align-items: center; justify-content: center; }
body .icon-button { border-radius: var(--pp-radius-control); background: var(--pp-subtle); color: var(--pp-ink-2); }
body .icon-button:hover { background: var(--pp-violet-soft); color: var(--pp-violet-pressed); }
body .button-with-icon .app-icon { width: 17px; height: 17px; }

/* ---------- Ô nhập, ô chọn, tìm kiếm ---------- */
body .search-box,
body .select-control,
body .form-stack :is(input, select, textarea),
body .form-grid :is(input, select, textarea) {
  border: 1px solid var(--pp-line-strong); border-radius: var(--pp-radius-control); background: #FFFFFF; color: var(--pp-ink);
}
body .search-box { border-radius: 999px; background: var(--pp-subtle); border-color: transparent; }
body :is(input, select, textarea):focus-visible,
body .search-box:focus-within { outline: 0; border-color: var(--pp-violet); box-shadow: 0 0 0 3px rgba(108, 71, 255, .16); }

/* ---------- Bảng ---------- */
body .table-wrap th, body th { background: #FBFAFF; color: var(--pp-muted); }
body .table-wrap th:last-child { background: #FBFAFF; }
body .table-wrap tbody tr:nth-child(even),
body .table-wrap tbody tr:nth-child(even) td:last-child { background: #FDFCFF; }
body .table-wrap tbody tr:hover,
body .table-wrap tbody tr:hover td:last-child { background: var(--pp-subtle); }
body .table-wrap tbody td { border-top-color: #F0EDF8; }

/* ---------- Nhãn trạng thái, thẻ, tab ---------- */
body :is(.status-badge, .tag, .config-chip, .record-count-badge) { border-radius: 999px; }
body .tag.draft { background: var(--pp-butter-bg); color: var(--pp-butter-fg); }
body .campaign-tabs button.active,
body [role="tab"].active,
body .tabs button.active { color: var(--pp-violet-pressed); }

/* ---------- Hộp thoại ---------- */
body .modal-backdrop { background: rgba(29, 26, 46, .42); }
body .modal { border: 0; border-radius: 16px; box-shadow: 0 30px 70px rgba(40, 24, 110, .25); }
body .modal-head { background: #FFFFFF; border-color: var(--pp-line); }
body .modal-actions { border-color: var(--pp-line); }

/* ---------- Đăng nhập ---------- */
body .auth-gate { background: #F1EDFF; }
body .auth-card { border: 0; border-radius: 20px; box-shadow: 0 24px 60px rgba(60, 40, 140, .12); }

/* ---------- Điện thoại / màn hình hẹp ---------- */
@media (max-width: 780px) {
  body .sidebar { top: 0; bottom: 0; left: 0; border-radius: 0 15px 15px 0; }
  body .main-content, body.sidebar-collapsed .main-content { margin-left: 0; width: 100%; }
  body .topbar { height: 72px; padding: 0 16px; }
  body .topbar h1 { font-size: 22px; }
  body.sidebar-collapsed .sidebar { width: 248px; padding: 18px 14px 14px; }
  body.sidebar-collapsed .sidebar .nav-section-label { width: auto; height: auto; margin: 10px 0 2px; padding: 0 10px; color: #6E6887; background: none; }
  body.sidebar-collapsed .sidebar .nav-item { width: 100%; justify-content: flex-start; padding: 5px 10px 5px 5px; }
  body.sidebar-collapsed .sidebar .sidebar-brand-row { flex-direction: row; }
}

/* Thanh menu: không co các khối khi thiếu chiều cao, tên thương hiệu một dòng */
body .sidebar > * { flex-shrink: 0; }
body .sidebar .sidebar-brand-row { min-height: 48px; }
body .sidebar .brand-mark { flex: 0 0 40px; }
body .sidebar .brand > div:last-child { min-width: 0; }
body .sidebar .brand span { white-space: nowrap; text-transform: none; letter-spacing: 0; font-size: 12px; }
/* Tên phần mềm "Phát Tiến HUB" giữ trên 1 dòng cạnh logo */
body .sidebar .brand strong { white-space: nowrap; font-size: 15.5px; letter-spacing: -.015em; }
@media (max-height: 940px) and (min-width: 781px) {
  body .sidebar .nav-item { min-height: 40px; padding-block: 3px; }
  body .sidebar .nav-section-label { margin-top: 8px; }
  body .sidebar .sidebar-foot { display: none; }
}

/* Ô icon lối tắt ở Tổng quan: bỏ màu nâu cũ, dùng pastel theo từng mục */
html body .quick-action-icon { border-radius: 10px; box-shadow: none; }
html body .quick-action-icon.customer { background: var(--pp-peach-bg); color: var(--pp-peach-fg); }
html body .quick-action-icon.data { background: var(--pp-mint-bg); color: var(--pp-mint-fg); }
html body .quick-action-icon.campaign { background: var(--pp-butter-bg); color: var(--pp-butter-fg); }
html body .quick-action-icon.history { background: var(--pp-lilac-bg); color: var(--pp-lilac-fg); }

/* Trang Dữ liệu: thanh lọc được xuống dòng, không bóp ô tìm kiếm và chữ trên nút */
body #datahub-view .table-tools { flex-wrap: wrap; row-gap: 10px; }
body #datahub-view .table-tools .search-box { flex: 1 1 220px; min-width: 220px; }
body #datahub-view .table-tools :is(.secondary-button, .select-control) { white-space: nowrap; flex-shrink: 0; }
body #datahub-view .datahub-saved-view-tools { flex-wrap: nowrap; }
/* Thanh công cụ bảng gọn trên 1 hàng: chế độ xem, ô tìm, trạng thái dạng chữ; các thao tác phụ là nút biểu tượng có chú thích khi rê chuột */
body #datahub-view .table-tools { align-items: center; gap: 8px; }
body #datahub-view .datahub-saved-view-tools { gap: 6px; }
body #datahub-view .datahub-saved-view-tools .select-control { width: 176px; min-width: 140px; }
body #datahub-view .table-tools .search-box { flex: 1 1 160px; min-width: 110px; }
body #datahub-view .table-tools #statusFilter { width: 150px; }
body #datahub-view .dh-tool-icon { position: relative; display: inline-grid; place-items: center; flex: 0 0 auto; width: 40px; height: 40px; padding: 0; border-radius: 12px; }
body #datahub-view .dh-tool-icon[hidden] { display: none; }
body #datahub-view .dh-tool-icon .app-icon { width: 18px; height: 18px; margin: 0; }
body #datahub-view .dh-tool-icon.datahub-filter-button b { position: absolute; top: -6px; right: -6px; }
body #datahub-view .dh-tool-icon[data-tooltip]::after {
  content: attr(data-tooltip); position: absolute; top: calc(100% + 8px); left: 50%; z-index: 40;
  padding: 6px 10px; border-radius: 8px; background: var(--pp-ink, #1F1A33); color: #FFFFFF;
  font-size: 12px; font-weight: 600; line-height: 1.3; white-space: nowrap;
  transform: translateX(-50%); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .12s ease;
}
body #datahub-view .dh-tool-icon[data-tooltip]:is(:hover, :focus-visible)::after { opacity: 1; visibility: visible; }
/* ux-v3.css kéo nhóm "Chế độ xem" giãn hết hàng khi màn ≤1100px; trên máy tính giữ gọn để cả thanh nằm 1 hàng */
@media (min-width: 781px) {
  body #datahub-view .table-tools { flex-wrap: nowrap; }
  body #datahub-view .table-tools .datahub-saved-view-tools { flex: 0 0 auto; width: auto; }
  body #datahub-view .table-tools #statusFilter { flex: 0 1 150px; min-width: 130px; }
  body #datahub-view .table-tools .datahub-saved-view-tools .select-control { flex: 0 0 176px; }
}
/* Nút cuối hàng: chú thích canh phải để không tràn ra ngoài khung */
body #datahub-view .table-tools > .dh-tool-icon:last-child::after { left: auto; right: 0; transform: none; }

/* Nguồn chiến dịch (Dữ liệu / Mini App / Webhook): ô màu pastel thống nhất với menu */
body :is(.campaign-source-options, .campaign-starter-grid button[data-campaign-template], .campaign-selected-source) b { border-radius: 10px; box-shadow: none; }
body :is(.campaign-source-options b, .campaign-starter-grid button[data-campaign-template] > b, .campaign-selected-source > b).datahub { background: var(--pp-mint-bg); color: var(--pp-mint-fg); }
body :is(.campaign-source-options b, .campaign-starter-grid button[data-campaign-template] > b, .campaign-selected-source > b).miniapp { background: var(--pp-sky-bg); color: var(--pp-sky-fg); }
body :is(.campaign-source-options b, .campaign-starter-grid button[data-campaign-template] > b, .campaign-selected-source > b).webhook { background: var(--pp-peach-bg); color: var(--pp-peach-fg); }
body :is(.campaign-source-options b, .campaign-starter-grid button[data-campaign-template] > b, .campaign-selected-source > b).customer { background: var(--pp-lilac-bg); color: var(--pp-lilac-fg); }
body .campaign-starter-grid button[data-campaign-template] { border-color: var(--pp-line); border-radius: 12px; }
body .campaign-starter-grid button[data-campaign-template]:hover,
body .campaign-source-options > button:hover { border-color: #C3B6F2; box-shadow: 0 9px 24px rgba(108, 71, 255, .12); }

/* ===== Trang Dữ liệu theo thiết kế 04 =====
   Trái: cây 3 cấp Nhóm Hub › Data Hub › Table (ô icon màu theo cấp, số dòng, tìm nhanh, chú thích).
   Phải: đường dẫn + tên Table + số bản ghi; chỉ 3 nút "Nhập CSV", "⋯", "+ Thêm bản ghi".
   Màu cấp: Nhóm Hub = vàng (butter), Data Hub = xanh trời (sky), Table = bạc hà (mint). */
html body #datahub-view .datahub-workspace { display: grid; grid-template-columns: 284px minmax(0, 1fr); gap: 16px; align-items: start; }
html body #datahub-view .datahub-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

html body #datahub-view .datahub-tree-panel { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 12px; min-height: 0; min-height: min(640px, calc(100vh - 120px)); max-height: calc(100vh - 32px); padding: 18px 14px; border: 0; border-radius: var(--pp-radius-card); background: #FFFFFF; box-shadow: var(--pp-shadow); overflow: hidden; }
html body #datahub-view .dh-tree-head { display: flex; align-items: center; gap: 8px; padding: 0 4px; }
html body #datahub-view .dh-tree-head h2 { flex: 1; margin: 0; color: var(--pp-ink); font-size: 18px; font-weight: 700; }
html body #datahub-view .dh-tree-head button { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 8px; background: var(--pp-violet); color: #FFFFFF; cursor: pointer; }
html body #datahub-view .dh-tree-head button:hover { background: var(--pp-violet-hover); }
html body #datahub-view .dh-tree-head button .app-icon { width: 17px; height: 17px; }
html body #datahub-view .dh-tree-search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 8px; background: var(--pp-subtle); color: var(--pp-muted); }
html body #datahub-view .dh-tree-search .app-icon { width: 16px; height: 16px; flex: 0 0 auto; }
html body #datahub-view .dh-tree-search input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: transparent; box-shadow: none; color: var(--pp-ink); font: inherit; font-size: 13.5px; }
html body #datahub-view .dh-tree-search:focus-within { box-shadow: inset 0 0 0 2px #CFC3FF; }

html body #datahub-view .dh-tree { display: flex; flex-direction: column; gap: 2px; min-height: 0; padding: 0; overflow-y: auto; }
html body #datahub-view .dh-tree-row { position: relative; display: flex; align-items: center; border-radius: 8px; }
html body #datahub-view .dh-tree-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 5px 8px 5px calc(4px + var(--level) * 16px); border: 0; border-radius: 8px; background: transparent; color: var(--pp-ink); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
html body #datahub-view .dh-tree-row:hover .dh-tree-main { background: var(--pp-subtle); }
html body #datahub-view .dh-tree-main:focus-visible { outline: 2px solid var(--pp-violet); outline-offset: -2px; }
html body #datahub-view .dh-caret { display: grid; place-items: center; width: 16px; flex: 0 0 auto; color: #6E6887; transition: transform .15s ease; }
html body #datahub-view .dh-caret .app-icon { width: 14px; height: 14px; stroke-width: 2.2; }
html body #datahub-view .dh-caret.open { transform: rotate(90deg); }
html body #datahub-view .dh-caret.none { visibility: hidden; }
html body #datahub-view .dh-tile { display: grid; place-items: center; width: 24px; height: 24px; flex: 0 0 auto; border-radius: 6px; }
html body #datahub-view .dh-tile .app-icon { width: 15px; height: 15px; }
html body #datahub-view .dh-tile.space { background: var(--pp-butter-bg); color: var(--pp-butter-fg); }
html body #datahub-view .dh-tile.hub { background: var(--pp-sky-bg); color: var(--pp-sky-fg); }
html body #datahub-view .dh-tile.table { background: var(--pp-mint-bg); color: var(--pp-mint-fg); }
html body #datahub-view .dh-label { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 500; }
html body #datahub-view .kind-space .dh-label { font-weight: 700; }
html body #datahub-view .dh-count { color: #6E6887; font-size: 12px; font-variant-numeric: tabular-nums; }
html body #datahub-view .dh-tree-row.active .dh-tree-main,
html body #datahub-view .dh-tree-row.active:hover .dh-tree-main { background: var(--pp-violet); color: #FFFFFF; }
html body #datahub-view .dh-tree-row.active .dh-label { font-weight: 700; }
html body #datahub-view .dh-tree-row.active .dh-count { color: rgba(255, 255, 255, .85); }
html body #datahub-view .dh-tree-row.active .dh-tile { background: #FFFFFF; color: var(--pp-violet-pressed); }
html body #datahub-view .dh-tree-add { position: absolute; right: 4px; display: grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 7px; background: #FFFFFF; color: var(--pp-violet-pressed); box-shadow: 0 0 0 1px var(--pp-line-strong); cursor: pointer; opacity: 0; transition: opacity .12s ease; }
html body #datahub-view .dh-tree-add .app-icon { width: 14px; height: 14px; }
html body #datahub-view .dh-tree-row:hover .dh-tree-add,
html body #datahub-view .dh-tree-add:focus-visible { opacity: 1; }
@media (hover: none) { html body #datahub-view .dh-tree-add { opacity: 1; } }
html body #datahub-view .dh-tree-empty { padding: 10px 8px; color: var(--pp-muted); font-size: 13px; }
html body #datahub-view .dh-tree-legend { display: flex; flex-direction: column; gap: 6px; margin-top: auto; padding: 12px; border-radius: 10px; background: var(--pp-subtle); color: var(--pp-ink-2); font-size: 12.5px; }
html body #datahub-view .dh-tree-legend span { display: flex; align-items: center; gap: 8px; }
html body #datahub-view .dh-tree-legend .dh-tile { width: 22px; height: 22px; }
html body #datahub-view .dh-tree-legend .dh-tile .app-icon { width: 13px; height: 13px; }

html body #datahub-view .datahub-header { display: flex; align-items: center; gap: 10px; margin: 0; padding: 6px 4px 0 0; border: 0; background: transparent; box-shadow: none; }
html body #datahub-view .datahub-header .section-title-block { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
html body #datahub-view .dh-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; color: var(--pp-muted); font-size: 13.5px; }
html body #datahub-view .dh-breadcrumb i { font-style: normal; }
html body #datahub-view .dh-breadcrumb strong { color: var(--pp-ink); font-weight: 600; }
html body #datahub-view .datahub-header .section-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
html body #datahub-view .datahub-header h2 { margin: 0; font-size: 26px; font-weight: 700; line-height: 1.2; }
html body #datahub-view .datahub-header .record-count-badge { padding: 3px 10px; border: 0; background: #FFFFFF; color: var(--pp-ink); font-size: 13px; font-weight: 700; }
html body #datahub-view .dh-oa-scope { padding: 3px 10px; border-radius: 999px; background: var(--pp-butter-bg); color: var(--pp-butter-fg); font-size: 12px; font-weight: 600; }
html body #datahub-view .datahub-header .button-row { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-wrap: nowrap; }
html body #datahub-view .datahub-header :is(.secondary-button, .primary-button) { height: 44px; padding: 0 18px; white-space: nowrap; }
html body #datahub-view .datahub-header .secondary-button { border-color: transparent; background: #FFFFFF; }
html body #datahub-view .datahub-more-wrap { position: relative; }
html body #datahub-view .dh-more-button { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: #FFFFFF; color: var(--pp-ink); }
html body #datahub-view .dh-more-button[aria-expanded="true"] { background: var(--pp-violet-soft); box-shadow: inset 0 0 0 2px var(--pp-violet); }
html body #datahub-view .dh-more-button .app-icon { width: 20px; height: 20px; stroke-width: 3; }
html body #datahub-view .datahub-more-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 30; display: grid; gap: 2px; width: 272px; padding: 6px; border: 1px solid var(--pp-line); border-radius: 12px; background: #FFFFFF; box-shadow: 0 16px 38px rgba(60, 40, 140, .16); }
html body #datahub-view .datahub-more-menu[hidden] { display: none; }
html body #datahub-view .datahub-more-menu button { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--pp-ink); font: inherit; text-align: left; cursor: pointer; }
html body #datahub-view .datahub-more-menu button[hidden] { display: none; }
html body #datahub-view .datahub-more-menu button:hover:not(:disabled) { background: var(--pp-subtle); }
html body #datahub-view .datahub-more-menu button .app-icon { width: 17px; height: 17px; margin-top: 1px; flex: 0 0 auto; color: var(--pp-muted); }
html body #datahub-view .datahub-more-menu button > span { display: grid; gap: 1px; min-width: 0; }
html body #datahub-view .datahub-more-menu strong { font-size: 13.5px; font-weight: 600; }
html body #datahub-view .datahub-more-menu small { color: var(--pp-muted); font-size: 12px; line-height: 1.35; }
html body #datahub-view .datahub-more-menu button.danger { margin-top: 4px; border-top: 1px solid var(--pp-line); border-radius: 0 0 8px 8px; padding-top: 11px; }
html body #datahub-view .datahub-more-menu button.danger :is(strong, .app-icon) { color: #A3163A; }
html body #datahub-view .datahub-more-menu button.danger:hover:not(:disabled) { background: #FFF0F3; }
html body #datahub-view .datahub-more-menu button:disabled { cursor: not-allowed; }
html body #datahub-view .datahub-more-menu button:disabled strong { color: #B98A96; }

/* Bảng dữ liệu: ô chữ viết tắt tên khách (màu cố định theo khách), nhãn trạng thái dạng viên thuốc */
html body #datahub-view .customer-avatar { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; border-radius: 8px; font-size: 12.5px; font-weight: 700; }
html body #datahub-view .customer-avatar.tone-peach { background: var(--pp-peach-bg); color: var(--pp-peach-fg); }
html body #datahub-view .customer-avatar.tone-mint { background: var(--pp-mint-bg); color: var(--pp-mint-fg); }
html body #datahub-view .customer-avatar.tone-sky { background: var(--pp-sky-bg); color: var(--pp-sky-fg); }
html body #datahub-view .customer-avatar.tone-butter { background: var(--pp-butter-bg); color: var(--pp-butter-fg); }
html body #datahub-view .customer-avatar.tone-lilac { background: var(--pp-lilac-bg); color: var(--pp-lilac-fg); }
html body #datahub-view .customer-identity { display: flex; align-items: center; gap: 10px; }
html body #datahub-view .status-badge { padding: 4px 10px; border: 0; font-size: 12px; font-weight: 700; }
html body #datahub-view .status-badge.success { background: var(--pp-mint-bg); color: var(--pp-mint-fg); }
html body #datahub-view .status-badge.failed { background: var(--pp-rose-bg); color: var(--pp-rose-fg); }
html body #datahub-view .status-badge.ready { background: var(--pp-grey-bg); color: var(--pp-grey-fg); }
html body #datahub-view .status-badge.processing { background: var(--pp-sky-bg); color: var(--pp-sky-fg); }
html body #datahub-view tbody tr:nth-child(odd) td { background-color: #FBFAFF; }
html body #datahub-view .table-tools .search-box { border-radius: 999px; }

@media (max-width: 1050px) {
  html body #datahub-view .datahub-workspace { grid-template-columns: 1fr; }
  html body #datahub-view .datahub-tree-panel { position: static; min-height: 0; max-height: 380px; }
  html body #datahub-view .dh-tree-legend { display: none; }
}
@media (max-width: 780px) {
  html body #datahub-view .datahub-header { flex-wrap: wrap; padding: 0; }
  html body #datahub-view .datahub-header .button-row { width: 100%; margin-left: 0; }
  html body #datahub-view .datahub-header .primary-button { flex: 1; justify-content: center; }
  html body #datahub-view .datahub-header h2 { font-size: 22px; }
  html body #datahub-view .table-tools .search-box { flex: 0 0 auto; min-width: 0; width: 100%; }
  html body #datahub-view .datahub-saved-view-tools { flex-wrap: wrap; }
  html body #datahub-view .datahub-saved-view-tools > * { flex: 1 1 100%; }
  html body #datahub-view .datahub-saved-view-tools { flex-wrap: nowrap; }
  html body #datahub-view .datahub-saved-view-tools > .select-control { flex: 1 1 auto; width: auto; }
  html body #datahub-view .datahub-saved-view-tools > .dh-tool-icon { flex: 0 0 40px; }
  /* Điện thoại: hàng 1 chế độ xem, hàng 2 ô tìm, hàng 3 trạng thái + 3 nút biểu tượng */
  html body #datahub-view .table-tools { flex-direction: row; flex-wrap: wrap; align-items: center; }
  html body #datahub-view .table-tools .datahub-saved-view-tools { flex: 1 1 100%; width: 100%; }
  html body #datahub-view .table-tools #statusFilter { flex: 1 1 0; width: auto; min-width: 0; }
}

/* ===== Trang Tổng quan theo thiết kế 01 =====
   Lưới 4 cột: thẻ tím "Tin gửi hôm nay" (2 cột) · thẻ đào "Lịch hẹn chờ" · thẻ bạc hà "Chi phí hôm nay"
   hàng dưới: "Chiến dịch đang chạy" (2 cột, nền trắng) · "Khách mới tuần này" (2 cột, xanh trời). */
html body #overview-view .ov-header { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
html body #overview-view .ov-header > div { display: flex; flex-direction: column; min-width: 0; }
html body #overview-view .ov-header span { color: var(--pp-muted); font-size: 14px; }
html body #overview-view .ov-header h2 { margin: 0; color: var(--pp-ink); font-size: 26px; font-weight: 700; }
html body #overview-view .ov-header .primary-button { margin-left: auto; height: 46px; padding: 0 22px; }

html body #overview-view .ov-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
html body #overview-view .ov-card { position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 24px; overflow: hidden; border-radius: var(--pp-radius-card); background: #FFFFFF; color: var(--pp-ink); }
html body #overview-view .ov-card h3 { margin: 0; font-size: 19px; font-weight: 700; }
html body #overview-view .ov-card small { font-size: 13px; line-height: 1.4; }
html body #overview-view .ov-card-title { font-size: 15px; font-weight: 700; }
html body #overview-view .ov-big { font-size: 44px; font-weight: 750; line-height: 1; font-variant-numeric: tabular-nums; }

html body #overview-view .ov-sent { grid-column: span 2; min-height: 290px; padding: 26px 28px; background: var(--pp-violet); color: #FFFFFF; }
html body #overview-view .ov-sent::before { content: ""; position: absolute; right: -70px; top: -80px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
html body #overview-view .ov-card-label { position: relative; font-size: 15px; font-weight: 500; }
html body #overview-view .ov-sent-value { position: relative; display: flex; align-items: flex-end; gap: 16px; }
html body #overview-view .ov-sent-value strong { font-size: 76px; font-weight: 750; line-height: .95; font-variant-numeric: tabular-nums; }
html body #overview-view .ov-trend { margin-bottom: 8px; padding: 5px 12px; border-radius: 999px; background: var(--pp-mint-bg); color: var(--pp-mint-fg); font-size: 13px; font-weight: 700; }
html body #overview-view .ov-trend.down { background: var(--pp-rose-bg); color: var(--pp-rose-fg); }
html body #overview-view :is(.ov-hour-bars, .ov-week-bars) { display: flex; align-items: stretch; gap: 8px; }
html body #overview-view .ov-hour-bars { position: relative; height: 112px; margin-top: auto; }
html body #overview-view :is(.ov-hour-bars, .ov-week-bars) > div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; min-width: 0; }
html body #overview-view :is(.ov-hour-bars, .ov-week-bars) span { width: 100%; max-width: 30px; border-radius: 5px; }
html body #overview-view .ov-hour-bars span { background: rgba(255, 255, 255, .8); }
html body #overview-view .ov-hour-bars span.peak { background: #FFD6C2; }
html body #overview-view .ov-hour-bars small { font-size: 11px; }

html body #overview-view .ov-appointments { background: var(--pp-peach-bg); }
html body #overview-view .ov-card-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 8px; background: #FFFFFF; color: var(--pp-peach-fg); }
html body #overview-view .ov-card-icon .app-icon { width: 22px; height: 22px; }
html body #overview-view .ov-appointments small { color: #5A3A2B; }
html body #overview-view .ov-dark-button { align-self: flex-start; margin-top: auto; padding: 10px 16px; border: 0; border-radius: 999px; background: var(--pp-ink); color: #FFFFFF; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
html body #overview-view .ov-dark-button:hover { background: #33304A; }

html body #overview-view .ov-cost { align-items: center; text-align: center; background: var(--pp-mint-bg); }
html body #overview-view .ov-cost .ov-card-title { align-self: flex-start; }
html body #overview-view .ov-ring { width: 136px; height: 136px; }
html body #overview-view .ov-ring circle { fill: none; stroke-width: 18; }
html body #overview-view .ov-ring-track { stroke: #FFFFFF; }
html body #overview-view .ov-ring-value { stroke: #12805A; stroke-linecap: round; }
html body #overview-view .ov-ring text { fill: var(--pp-mint-fg); font-size: 26px; font-weight: 750; }
html body #overview-view .ov-ring text.ov-ring-caption { font-size: 11px; font-weight: 600; }
html body #overview-view .ov-cost strong { font-size: 18px; font-weight: 750; }
html body #overview-view .ov-cost small { color: #245C44; }

html body #overview-view .ov-campaigns { grid-column: span 2; padding: 22px 24px; }
html body #overview-view .ov-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
html body #overview-view .ov-card-head .text-button { color: var(--pp-violet-pressed); font-weight: 700; }
html body #overview-view .ov-campaign-list { display: flex; flex-direction: column; gap: 8px; }
html body #overview-view .ov-campaign { display: flex; align-items: center; gap: 14px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: var(--pp-subtle); color: var(--pp-ink); font: inherit; text-align: left; cursor: pointer; }
html body #overview-view .ov-campaign:hover { background: var(--pp-violet-soft); }
html body #overview-view .ov-campaign-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; border-radius: 7px; }
html body #overview-view .ov-campaign-icon .app-icon { width: 18px; height: 18px; }
html body #overview-view .ov-campaign-icon.lilac { background: var(--pp-lilac-bg); color: var(--pp-lilac-fg); }
html body #overview-view .ov-campaign-icon.peach { background: var(--pp-peach-bg); color: var(--pp-peach-fg); }
html body #overview-view .ov-campaign-icon.sky { background: var(--pp-sky-bg); color: var(--pp-sky-fg); }
html body #overview-view .ov-campaign-name { display: flex; flex-direction: column; flex: 1; min-width: 0; }
html body #overview-view .ov-campaign-name strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 14px; font-weight: 600; }
html body #overview-view .ov-campaign-name small { color: var(--pp-muted); font-size: 12.5px; }
html body #overview-view .ov-campaign .status-badge { padding: 4px 11px; border: 0; font-size: 12px; font-weight: 700; }
html body #overview-view .ov-campaign .status-badge.success { background: var(--pp-mint-bg); color: var(--pp-mint-fg); }
html body #overview-view .ov-campaign .status-badge.failed { background: var(--pp-rose-bg); color: var(--pp-rose-fg); }
html body #overview-view .ov-campaign b { width: 64px; text-align: right; font-size: 14px; font-variant-numeric: tabular-nums; }
html body #overview-view .ov-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; flex: 1; min-height: 150px; border-radius: 10px; background: var(--pp-subtle); color: var(--pp-muted); font-size: 14px; }
html body #overview-view .ov-empty .app-icon { width: 26px; height: 26px; color: var(--pp-butter-fg); }

html body #overview-view .ov-week { grid-column: span 2; flex-direction: row; gap: 22px; min-height: 250px; padding: 22px 24px; background: var(--pp-sky-bg); }
html body #overview-view .ov-week-summary { display: flex; flex-direction: column; gap: 6px; width: 200px; flex: 0 0 auto; }
html body #overview-view .ov-week-summary h3 { white-space: nowrap; }
html body #overview-view .ov-week-summary .ov-big { margin-top: 8px; font-size: 48px; }
html body #overview-view .ov-week-summary small { color: #24406E; }
html body #overview-view .ov-week-bars { flex: 1; gap: 12px; min-height: 180px; }
html body #overview-view .ov-week-bars span { max-width: none; border-radius: 6px; background: #FFFFFF; }
html body #overview-view .ov-week-bars span.peak { background: var(--pp-violet); }
html body #overview-view .ov-week-bars span.future { opacity: .45; }
html body #overview-view .ov-week-bars small { color: #24406E; font-size: 12px; font-weight: 600; }

@media (max-width: 1180px) {
  html body #overview-view .ov-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 780px) {
  html body #overview-view .ov-header { flex-wrap: wrap; }
  html body #overview-view .ov-header .primary-button { width: 100%; margin-left: 0; justify-content: center; }
  html body #overview-view .ov-grid { grid-template-columns: 1fr; gap: 14px; }
  html body #overview-view :is(.ov-sent, .ov-campaigns, .ov-week) { grid-column: auto; }
  html body #overview-view .ov-sent-value strong { font-size: 60px; }
  html body #overview-view .ov-hour-bars { gap: 4px; }
  html body #overview-view .ov-hour-bars small { font-size: 9.5px; }
  html body #overview-view .ov-week { flex-direction: column; }
  html body #overview-view .ov-week-summary { width: auto; }
  html body #overview-view .ov-campaign b { width: auto; }
}

/* ===== Trang Chiến dịch theo thiết kế 05 =====
   4 thẻ trên cùng: Đang chạy (bạc hà) · Tạm dừng (hồng) · Bản nháp (vàng) là nút lọc, bấm lại để bỏ lọc; Tin gửi trong tháng (trắng).
   Danh sách chiến dịch dạng thẻ 3 cột: nguồn · trạng thái · menu ⋯, tên, các bước chính, 3 số liệu. */
html body #campaignLibraryView .cp-header { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; padding: 0; border: 0; background: transparent; box-shadow: none; }
html body #campaignLibraryView .cp-header p { margin: 0; color: var(--pp-muted); font-size: 14px; }
html body #campaignLibraryView .cp-header-tools { display: flex; align-items: center; gap: 10px; margin-left: auto; }
html body #campaignLibraryView .cp-header-tools .search-box { width: 260px; height: 46px; border: 0; border-radius: 999px; background: #FFFFFF; }
html body #campaignLibraryView .cp-header-tools .select-control { height: 46px; border: 0; border-radius: 999px; background-color: #FFFFFF; }
html body #campaignLibraryView .cp-header-tools .primary-button { height: 46px; padding: 0 22px; white-space: nowrap; }

html body #campaignLibraryView .cp-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
html body #campaignLibraryView .cp-stat { display: flex; flex-direction: column; gap: 6px; padding: 16px 20px; border: 0; border-radius: 12px; font: inherit; text-align: left; }
html body #campaignLibraryView button.cp-stat { cursor: pointer; transition: box-shadow .12s ease, transform .12s ease; }
html body #campaignLibraryView button.cp-stat:hover { transform: translateY(-1px); }
html body #campaignLibraryView .cp-stat span { font-size: 14px; font-weight: 600; }
html body #campaignLibraryView .cp-stat strong { font-size: 34px; font-weight: 750; line-height: 1; font-variant-numeric: tabular-nums; }
html body #campaignLibraryView .cp-stat.running { background: var(--pp-mint-bg); color: #0B3D28; }
html body #campaignLibraryView .cp-stat.paused { background: var(--pp-rose-bg); color: #6E1530; }
html body #campaignLibraryView .cp-stat.draft { background: var(--pp-butter-bg); color: #5A4100; }
html body #campaignLibraryView .cp-stat.month { background: #FFFFFF; color: var(--pp-ink); }
html body #campaignLibraryView .cp-stat.active { box-shadow: inset 0 0 0 3px var(--pp-violet); }
html body #campaignLibraryView .cp-filter-note { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; color: var(--pp-muted); font-size: 13.5px; font-weight: 600; }
html body #campaignLibraryView .cp-filter-note[hidden] { display: none; }
html body #campaignLibraryView .cp-filter-note .text-button { color: var(--pp-violet-pressed); font-weight: 700; }

html body #campaignLibraryView .cp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
html body #campaignLibraryView .cp-grid:empty { display: none; }
html body #campaignLibraryView .cp-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 20px; border-radius: 14px; background: #FFFFFF; box-shadow: var(--pp-shadow); }
html body #campaignLibraryView .cp-card-top { display: flex; align-items: center; gap: 8px; }
html body #campaignLibraryView .cp-pill { padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; }
html body #campaignLibraryView .cp-pill.lilac { background: var(--pp-lilac-bg); color: var(--pp-lilac-fg); }
html body #campaignLibraryView .cp-pill.peach { background: var(--pp-peach-bg); color: var(--pp-peach-fg); }
html body #campaignLibraryView .cp-pill.sky { background: var(--pp-sky-bg); color: var(--pp-sky-fg); }
html body #campaignLibraryView .cp-card .status-badge { padding: 4px 11px; border: 0; font-size: 12px; font-weight: 700; }
html body #campaignLibraryView .cp-card .status-badge.success { background: var(--pp-mint-bg); color: var(--pp-mint-fg); }
html body #campaignLibraryView .cp-card .status-badge.failed { background: var(--pp-rose-bg); color: var(--pp-rose-fg); }
html body #campaignLibraryView .cp-card .status-badge.draft { background: var(--pp-butter-bg); color: var(--pp-butter-fg); }
html body #campaignLibraryView .cp-card .campaign-more-menu { margin-left: auto; }
html body #campaignLibraryView .cp-card .campaign-more-menu > summary { width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--pp-subtle); color: var(--pp-ink-2); }
html body #campaignLibraryView .cp-card .campaign-more-menu > summary:hover,
html body #campaignLibraryView .cp-card .campaign-more-menu[open] > summary { background: var(--pp-violet-soft); color: var(--pp-violet-pressed); }
html body #campaignLibraryView .cp-card-name { padding: 0; border: 0; background: none; color: var(--pp-ink); font: inherit; font-size: 18px; font-weight: 700; line-height: 1.3; text-align: left; cursor: pointer; }
html body #campaignLibraryView .cp-card-name:hover { color: var(--pp-violet-pressed); }
html body #campaignLibraryView .cp-card-code { margin-top: -6px; overflow: hidden; color: var(--pp-muted); font-size: 12.5px; white-space: nowrap; text-overflow: ellipsis; }
html body #campaignLibraryView .cp-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
html body #campaignLibraryView .cp-flow span { padding: 4px 9px; border-radius: 5px; background: var(--pp-grey-bg); color: var(--pp-ink-2); font-size: 12.5px; font-weight: 600; }
html body #campaignLibraryView .cp-flow span.more { background: transparent; color: var(--pp-muted); }
html body #campaignLibraryView .cp-flow i { color: var(--pp-muted); font-size: 12px; font-style: normal; }
html body #campaignLibraryView .cp-pause-reason { display: flex; align-items: flex-start; gap: 6px; color: #A3163A; font-size: 12.5px; line-height: 1.4; }
html body #campaignLibraryView .cp-pause-reason .app-icon { width: 14px; height: 14px; flex: 0 0 auto; margin-top: 2px; }
html body #campaignLibraryView .cp-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: auto; padding: 12px; border-radius: 9px; background: var(--pp-subtle); }
html body #campaignLibraryView .cp-metrics span { display: flex; flex-direction: column; min-width: 0; }
html body #campaignLibraryView .cp-metrics strong { font-size: 18px; font-weight: 750; font-variant-numeric: tabular-nums; }
html body #campaignLibraryView .cp-metrics small { color: var(--pp-muted); font-size: 12px; }
html body #campaignLibraryView #campaignEmpty { border-radius: var(--pp-radius-card); }

@media (max-width: 1280px) {
  html body #campaignLibraryView .cp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html body #campaignLibraryView .cp-header { flex-wrap: wrap; }
  html body #campaignLibraryView .cp-header-tools { width: 100%; margin-left: 0; }
  html body #campaignLibraryView .cp-header-tools .search-box { flex: 1; width: auto; }
}
@media (max-width: 780px) {
  html body #campaignLibraryView .cp-header-tools { flex-wrap: wrap; }
  html body #campaignLibraryView .cp-header-tools :is(.search-box, .select-control, .primary-button) { flex: 1 1 100%; width: 100%; justify-content: center; }
  html body #campaignLibraryView .cp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  html body #campaignLibraryView .cp-stat strong { font-size: 28px; }
  html body #campaignLibraryView .cp-grid { grid-template-columns: 1fr; }
}

/* ===== Trang Kết nối Zalo theo thiết kế 07 =====
   2 tab: Zalo OA (trang zalo-view) · Mini App (khu Cài đặt Mini App, trước đây là mục menu riêng).
   Trái: thẻ từng OA (thẻ đang chọn nền tím), nút "+ Thêm Zalo OA", ghi chú bảo mật vàng.
   Phải: 4 bước kết nối (xong = bạc hà, đang làm = viền tím), ô nhập của bước đang chọn, 3 ô tình trạng. */
html body .zc-header { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; padding: 0; border: 0; background: transparent; box-shadow: none; }
html body .zc-header p { margin: 0; color: var(--pp-muted); font-size: 14px; }

html body #zalo-view .zc-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 18px; align-items: start; }
html body #zalo-view .zc-sidebar { display: flex; flex-direction: column; gap: 14px; }
html body #zalo-view .zc-list-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 4px; }
html body #zalo-view .zc-list-head strong { font-size: 15px; }
html body #zalo-view .zc-list-head span { color: var(--pp-muted); font-size: 13px; }
html body #zalo-view .zc-oa-list { display: flex; flex-direction: column; gap: 12px; }
html body #zalo-view .oa-connection-card { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; width: 100%; padding: 18px; border: 0; border-radius: 13px; background: #FFFFFF; color: var(--pp-ink); box-shadow: var(--pp-shadow); text-align: left; transform: none; }
html body #zalo-view .oa-connection-card:hover { box-shadow: 0 0 0 2px #CFC3FF; }
html body #zalo-view .oa-connection-card.is-selected { background: var(--pp-violet); color: #FFFFFF; box-shadow: none; }
html body #zalo-view .zc-oa-top { display: flex; align-items: center; gap: 12px; min-width: 0; width: 100%; }
html body #zalo-view .zc-oa-top b { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 auto; border-radius: 8px; background: var(--pp-mint-bg); color: var(--pp-mint-fg); font-size: 13px; }
html body #zalo-view .is-selected .zc-oa-top b { background: #FFFFFF; color: var(--pp-violet-pressed); }
html body #zalo-view .zc-oa-top > span { display: flex; flex-direction: column; min-width: 0; }
html body #zalo-view .zc-oa-top strong { overflow: hidden; font-size: 16px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
html body #zalo-view .oa-connection-card small { color: inherit; font-size: 12.5px; opacity: .85; }
html body #zalo-view .zc-oa-badges { display: flex; flex-wrap: wrap; gap: 6px; }
html body #zalo-view .zc-badge, html body #zalo-view .zc-oa-badges em { padding: 4px 11px; border-radius: 999px; font-size: 12px; font-style: normal; font-weight: 700; }
html body #zalo-view .zc-badge.ok { background: var(--pp-mint-bg); color: var(--pp-mint-fg); }
html body #zalo-view .zc-badge.warn { background: var(--pp-peach-bg); color: var(--pp-peach-fg); }
html body #zalo-view .zc-oa-badges em { background: var(--pp-lilac-bg); color: var(--pp-lilac-fg); }
html body #zalo-view .zc-oa-stats { display: flex; gap: 16px; font-size: 12.5px; }
html body #zalo-view .zc-add-oa { display: flex; align-items: center; justify-content: center; gap: 8px; height: 64px; border: 2px dashed #C9C0EA; border-radius: 13px; background: transparent; color: var(--pp-violet-pressed); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
html body #zalo-view .zc-add-oa:hover { background: #FFFFFF; }
html body #zalo-view .zc-secret-note { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 13px; background: var(--pp-butter-bg); color: #4A3600; }
html body #zalo-view .zc-secret-note strong { font-size: 15px; }
html body #zalo-view .zc-secret-note span { font-size: 13px; line-height: 1.5; }

html body #zalo-view .zc-editor { display: flex; flex-direction: column; gap: 18px; padding: 24px 26px; border-radius: var(--pp-radius-card); background: #FFFFFF; box-shadow: var(--pp-shadow); }
html body #zalo-view .zc-editor-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
html body #zalo-view .zc-editor-head h3 { margin: 0; font-size: 22px; font-weight: 700; }
html body #zalo-view .zc-editor-head small { flex-basis: 100%; color: var(--pp-muted); font-size: 13px; }
html body #zalo-view .zc-progress { padding: 4px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
html body #zalo-view .zc-progress.warn { background: var(--pp-peach-bg); color: var(--pp-peach-fg); }
html body #zalo-view .zc-progress.ok { background: var(--pp-mint-bg); color: var(--pp-mint-fg); }
html body #zalo-view .zc-form { display: flex; flex-direction: column; gap: 18px; }
html body #zalo-view .zc-name-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 12px; align-items: end; }
html body #zalo-view .zc-name-row .setting-row { margin: 0; padding: 10px 14px; border: 0; border-radius: 10px; background: var(--pp-subtle); }
html body #zalo-view .zc-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
html body #zalo-view .zc-steps button { display: flex; align-items: center; gap: 10px; width: 100%; height: 100%; padding: 12px; border: 0; border-radius: 10px; background: var(--pp-subtle); color: var(--pp-ink-2); font: inherit; text-align: left; cursor: pointer; }
html body #zalo-view .zc-steps button b { display: grid; place-items: center; width: 28px; height: 28px; flex: 0 0 auto; border-radius: 6px; background: var(--pp-violet); color: #FFFFFF; font-size: 14px; }
html body #zalo-view .zc-steps button > span { display: flex; flex-direction: column; min-width: 0; }
html body #zalo-view .zc-steps strong { font-size: 13.5px; line-height: 1.3; }
html body #zalo-view .zc-steps small { font-size: 12px; }
html body #zalo-view .zc-steps button.done { background: var(--pp-mint-bg); color: #0B3D28; }
html body #zalo-view .zc-steps button.done b { background: #FFFFFF; color: var(--pp-mint-fg); font-size: 0; }
html body #zalo-view .zc-steps button.done b::before { content: "✓"; font-size: 15px; }
html body #zalo-view .zc-steps button.current { background: #FFFFFF; color: var(--pp-ink); box-shadow: inset 0 0 0 3px var(--pp-violet); }
html body #zalo-view .zc-steps button.done.current { background: var(--pp-mint-bg); }
html body #zalo-view .zc-step-panel { display: flex; flex-direction: column; gap: 14px; padding: 20px; border-radius: 12px; background: var(--pp-subtle); }
html body #zalo-view .zc-step-panel[hidden] { display: none; }
html body #zalo-view .zc-step-head { display: flex; flex-direction: column; gap: 4px; }
html body #zalo-view .zc-step-head strong { font-size: 17px; }
html body #zalo-view .zc-step-head small { color: var(--pp-muted); font-size: 13.5px; line-height: 1.5; }
html body #zalo-view .zc-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
html body #zalo-view .zc-fields.one { grid-template-columns: minmax(0, 420px); }
html body #zalo-view .zc-fields :is(input, textarea) { background: #FFFFFF; }
html body #zalo-view .zc-fields label > small { color: var(--pp-muted); font-size: 12px; }
html body #zalo-view .zc-warning { margin: 0; color: #8C1D3A; font-size: 12.5px; font-weight: 600; }
html body #zalo-view .zc-warning[hidden] { display: none; }
html body #zalo-view .zc-checks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
html body #zalo-view .zc-checks:empty { display: none; }
html body #zalo-view .zc-checks > div { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 9px; }
html body #zalo-view .zc-checks > div.ok { background: var(--pp-mint-bg); color: #0B3D28; }
html body #zalo-view .zc-checks > div.bad { background: var(--pp-rose-bg); color: #6E1530; }
html body #zalo-view .zc-checks i { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 50%; background: #12805A; }
html body #zalo-view .zc-checks .bad i { background: #C0395F; }
html body #zalo-view .zc-checks span { display: flex; flex-direction: column; min-width: 0; }
html body #zalo-view .zc-checks strong { font-size: 13.5px; }
html body #zalo-view .zc-checks small { font-size: 12.5px; }
html body #zalo-view .zc-actions { display: flex; justify-content: flex-end; gap: 10px; margin: 0; }
html body #zalo-view .zc-actions button { height: 46px; padding: 0 20px; }
html body #zalo-view .zc-actions button[hidden] { display: none; }
html body #zalo-view .zc-actions #oaNextStepButton { margin-right: auto; }

@media (max-width: 1180px) {
  html body #zalo-view .zc-layout { grid-template-columns: 1fr; }
  html body #zalo-view .zc-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 780px) {
  html body .zc-header { flex-wrap: wrap; }
  html body #zalo-view .zc-editor { padding: 18px 16px; }
  html body #zalo-view :is(.zc-name-row, .zc-fields, .zc-checks) { grid-template-columns: 1fr; }
  html body #zalo-view .zc-steps { grid-template-columns: 1fr; gap: 8px; }
  html body #zalo-view .zc-actions { flex-wrap: wrap; }
  html body #zalo-view .zc-actions button { flex: 1 1 100%; }
  html body #zalo-view .zc-actions #oaNextStepButton { margin-right: 0; }
}
/* Trang Kết nối Mini App: ô icon thương hiệu theo màu pastel xanh trời */
html body #miniAppSettingsArea .miniapp-config-brand > span { border-radius: 10px; background: var(--pp-sky-bg); color: var(--pp-sky-fg); box-shadow: none; }

/* ===== Trang Lịch hẹn theo thiết kế 03 =====
   Mặc định xem "Theo ngày": hàng = các giờ có lịch trong ngày, cột = cửa hàng; bên phải là chi tiết lịch đang chọn.
   Màu trạng thái: Chờ xác nhận đào · Đã xác nhận bạc hà · Hoàn tất xanh trời · Đã hủy xám. Tab "Danh sách" giữ bảng cũ. */
html body #appointments-view .ap-header { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; padding: 0; border: 0; background: transparent; box-shadow: none; }
html body #appointments-view .ap-header p { margin: 0; color: var(--pp-muted); font-size: 14px; }
html body #appointments-view .ap-header-tools { display: flex; align-items: center; gap: 10px; margin-left: auto; }
html body #appointments-view .ap-day-nav { display: flex; align-items: center; gap: 6px; padding: 5px; border-radius: 999px; background: #FFFFFF; }
html body #appointments-view .ap-day-nav[hidden] { display: none; }
html body #appointments-view .ap-day-nav button { display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--pp-subtle); color: var(--pp-ink); cursor: pointer; }
html body #appointments-view .ap-day-nav button .app-icon { width: 16px; height: 16px; }
html body #appointments-view .ap-day-nav .ap-day-label { width: auto; padding: 0 10px; background: transparent; font: inherit; font-size: 15px; font-weight: 700; border-radius: 999px; }
html body #appointments-view .ap-day-nav .ap-day-label:hover { background: var(--pp-subtle); }
html body #appointments-view .ap-view-switch { display: flex; padding: 5px; border-radius: 999px; background: #FFFFFF; }
html body #appointments-view .ap-view-switch button { height: 38px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; color: var(--pp-ink-2); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
html body #appointments-view .ap-view-switch button.active { background: var(--pp-violet); color: #FFFFFF; font-weight: 700; }
html body #appointments-view .ap-refresh { width: 48px; height: 48px; border-radius: 50%; background: #FFFFFF; }
html body #appointments-view .ap-refresh.is-refreshing .app-icon { animation: pp-spin 1s linear infinite; }
@keyframes pp-spin { to { transform: rotate(360deg); } }

html body #appointments-view .ap-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
html body #appointments-view .ap-stats button { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px 20px; border: 0; border-radius: 12px; font: inherit; text-align: left; cursor: pointer; box-shadow: none; }
html body #appointments-view .ap-stats strong { font-size: 34px; font-weight: 750; line-height: 1; }
html body #appointments-view .ap-stats span { font-size: 14px; font-weight: 600; }
html body #appointments-view .ap-stats .pending { background: var(--pp-peach-bg); color: #5A2410; }
html body #appointments-view .ap-stats .confirmed { background: var(--pp-mint-bg); color: #0B3D28; }
html body #appointments-view .ap-stats .completed { background: var(--pp-sky-bg); color: #163A78; }
html body #appointments-view .ap-stats .cancelled { background: #FFFFFF; color: var(--pp-ink-2); }
html body #appointments-view .ap-stats button.active { box-shadow: inset 0 0 0 3px var(--pp-violet); }

html body #appointments-view .ap-day-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
html body #appointments-view .ap-day-layout[hidden] { display: none; }
html body #appointments-view .ap-board { min-width: 0; padding: 18px 20px; overflow-x: auto; border-radius: var(--pp-radius-card); background: #FFFFFF; box-shadow: var(--pp-shadow); }
html body #appointments-view .ap-grid { display: grid; gap: 10px 12px; align-items: stretch; }
html body #appointments-view .ap-branch { padding: 10px 14px; border-radius: 7px; background: var(--pp-subtle); font-size: 15px; font-weight: 700; }
html body #appointments-view .ap-time { padding-top: 12px; color: var(--pp-ink-2); font-size: 15px; font-weight: 700; }
html body #appointments-view .ap-cell-stack { display: flex; flex-direction: column; gap: 8px; }
html body #appointments-view .ap-cell { display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 10px 14px; border: 0; border-radius: 9px; font: inherit; text-align: left; }
html body #appointments-view button.ap-cell { cursor: pointer; }
html body #appointments-view .ap-cell > span { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
html body #appointments-view .ap-cell strong { font-size: 14px; font-weight: 700; }
html body #appointments-view .ap-cell small { overflow: hidden; font-size: 12.5px; white-space: nowrap; text-overflow: ellipsis; }
html body #appointments-view .ap-cell em { flex: 0 0 auto; padding: 4px 10px; border-radius: 999px; background: #FFFFFF; font-size: 12px; font-style: normal; font-weight: 700; }
html body #appointments-view .ap-cell.pending { background: var(--pp-peach-bg); color: #5A2410; }
html body #appointments-view .ap-cell.confirmed { background: var(--pp-mint-bg); color: #0B3D28; }
html body #appointments-view .ap-cell.completed { background: var(--pp-sky-bg); color: #163A78; }
html body #appointments-view .ap-cell.cancelled { background: var(--pp-grey-bg); color: var(--pp-muted); }
html body #appointments-view .ap-cell.cancelled strong { text-decoration: line-through; }
html body #appointments-view .ap-cell.selected { box-shadow: inset 0 0 0 3px var(--pp-violet); }
html body #appointments-view .ap-free { border: 2px dashed #E4DFF2; color: #6E6887; font-size: 13px; }
html body #appointments-view .ap-board-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 320px; color: var(--pp-muted); text-align: center; }
html body #appointments-view .ap-board-empty .app-icon { width: 30px; height: 30px; color: var(--pp-peach-fg); }
html body #appointments-view .ap-board-empty strong { color: var(--pp-ink); font-size: 16px; }
html body #appointments-view .ap-board-empty .secondary-button { margin-top: 6px; }

html body #appointments-view .ap-detail { display: flex; flex-direction: column; gap: 14px; min-height: 420px; padding: 22px; border-radius: var(--pp-radius-card); background: #FFFFFF; box-shadow: var(--pp-shadow); }
html body #appointments-view .ap-detail-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; flex: 1; color: var(--pp-muted); text-align: center; }
html body #appointments-view .ap-detail-empty .app-icon { width: 26px; height: 26px; }
html body #appointments-view .ap-status { align-self: flex-start; padding: 4px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
html body #appointments-view .ap-status.pending { background: var(--pp-peach-bg); color: var(--pp-peach-fg); }
html body #appointments-view .ap-status.confirmed { background: var(--pp-mint-bg); color: var(--pp-mint-fg); }
html body #appointments-view .ap-status.completed { background: var(--pp-sky-bg); color: var(--pp-sky-fg); }
html body #appointments-view .ap-status.cancelled { background: var(--pp-grey-bg); color: var(--pp-grey-fg); }
html body #appointments-view .ap-detail-name { display: flex; flex-direction: column; gap: 2px; }
html body #appointments-view .ap-detail-name small { color: var(--pp-muted); font-size: 13px; }
html body #appointments-view .ap-detail-name strong { font-size: 22px; font-weight: 700; }
html body #appointments-view .ap-detail-info { display: grid; grid-template-columns: 90px minmax(0, 1fr); row-gap: 10px; margin: 0; padding: 16px; border-radius: 10px; background: var(--pp-subtle); font-size: 13.5px; }
html body #appointments-view .ap-detail-info dt { color: var(--pp-muted); }
html body #appointments-view .ap-detail-info dd { margin: 0; font-weight: 700; }
html body #appointments-view .ap-detail-note small { color: var(--pp-ink-2); font-size: 13px; font-weight: 600; }
html body #appointments-view .ap-detail-note p { margin: 6px 0 0; padding: 12px; border-radius: 8px; background: var(--pp-subtle); color: var(--pp-ink-2); font-size: 13.5px; line-height: 1.5; }
html body #appointments-view .ap-customer-note p { background: #fff6e5; color: var(--pp-ink); white-space: pre-wrap; overflow-wrap: anywhere; }
html body #appointments-view .ap-detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
html body #appointments-view .ap-detail-actions button { height: 46px; padding: 0 14px; border-radius: 999px; white-space: nowrap; }
html body #appointments-view .ap-detail-actions .primary-button { flex: 1; }
html body #appointments-view .ap-detail-actions .secondary-button { border: 0; background: var(--pp-violet-soft); }
html body #appointments-view .ap-cancel { border: 0; background: var(--pp-rose-bg); color: var(--pp-rose-fg); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
html body #appointments-view .ap-detail-hint { color: var(--pp-muted); font-size: 12.5px; line-height: 1.45; }

@media (max-width: 1180px) {
  html body #appointments-view .ap-header { flex-wrap: wrap; }
  html body #appointments-view .ap-header-tools { width: 100%; margin-left: 0; }
  html body #appointments-view .ap-day-layout { grid-template-columns: 1fr; }
  html body #appointments-view .ap-detail { min-height: 0; }
}
@media (max-width: 780px) {
  html body #appointments-view .ap-header-tools { flex-wrap: wrap; }
  html body #appointments-view .ap-day-nav { flex: 1 1 100%; justify-content: space-between; }
  html body #appointments-view .ap-view-switch { flex: 1; }
  html body #appointments-view .ap-view-switch button { flex: 1; }
  html body #appointments-view .ap-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  html body #appointments-view .ap-stats strong { font-size: 28px; }
  html body #appointments-view .ap-board { padding: 14px; }
  html body #appointments-view .ap-cell { flex-direction: column; align-items: flex-start; gap: 6px; }
  html body #appointments-view .ap-cell > span { width: 100%; }
}

/* ===== Trang Mẫu tin theo thiết kế 08 =====
   Tab trạng thái có số đếm (tab đang chọn nền tối); danh sách 4 cột; bên phải khung "Xem trước trên Zalo" của mẫu đang chọn. */
html body #templates-view .tp-header { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; padding: 0; border: 0; background: transparent; box-shadow: none; }
html body #templates-view .tp-header p { margin: 0; color: var(--pp-muted); font-size: 14px; }
html body #templates-view .tp-header .zbs-toolbar-actions { display: flex; gap: 10px; margin-left: auto; }
html body #templates-view .tp-header :is(.secondary-button, .primary-button) { height: 46px; padding: 0 20px; }
html body #templates-view .tp-header .secondary-button { border: 0; background: #FFFFFF; }
html body #templates-view .tp-tabs { display: flex; gap: 10px; margin: 0 0 18px; padding: 0; border: 0; overflow-x: auto; }
html body #templates-view .tp-tabs button { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border: 0; border-radius: 999px; background: #FFFFFF; color: var(--pp-ink-2); font-size: 14px; font-weight: 600; white-space: nowrap; }
html body #templates-view .tp-tabs button.active { background: var(--pp-ink); color: #FFFFFF; font-weight: 700; }
html body #templates-view .tp-tabs b { margin: 0; padding: 1px 8px; border-radius: 999px; background: var(--pp-violet-soft); color: var(--pp-violet-pressed); font-size: 12px; }
html body #templates-view .tp-tabs button.active b { background: var(--pp-violet); color: #FFFFFF; }

html body #templates-view .tp-list { padding: 16px; border: 0; border-radius: var(--pp-radius-card); }
html body #templates-view .tp-filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 0 10px; grid-template-columns: none; border: 0; background: transparent; }
html body #templates-view .tp-filters .search-box { flex: 1 1 220px; border-radius: 999px; }
html body #templates-view .tp-filters .select-control { flex: 0 1 190px; width: auto; border-radius: 999px; }
html body #templates-view .zbs-template-table { width: 100%; min-width: 620px; table-layout: fixed; border-collapse: separate; border-spacing: 0 4px; }
html body #templates-view .zbs-template-table :is(th, td) { position: static; height: auto; box-shadow: none; border: 0; }
html body #templates-view .zbs-template-table :is(th, td):first-child { padding-left: 12px; }
html body #templates-view .zbs-template-table th { padding: 6px 12px; border: 0; background: transparent; color: var(--pp-muted); font-size: 12px; font-weight: 700; letter-spacing: .05em; text-align: left; text-transform: uppercase; }
html body #templates-view .zbs-template-table td { padding: 9px 12px; border: 0; background: transparent; font-size: 13.5px; vertical-align: middle; }
html body #templates-view .tp-row { cursor: pointer; }
html body #templates-view .tp-row td:first-child { border-radius: 9px 0 0 9px; }
html body #templates-view .tp-row td:last-child { border-radius: 0 9px 9px 0; }
html body #templates-view .tp-row:hover td { background: var(--pp-subtle); }
html body #templates-view .tp-row.selected td { background: var(--pp-violet-soft); }
html body #templates-view .tp-row:focus-visible { outline: 2px solid var(--pp-violet); outline-offset: -2px; }
html body #templates-view .tp-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
html body #templates-view .tp-name > span:last-child { display: flex; flex-direction: column; min-width: 0; }
html body #templates-view .tp-name strong { overflow: hidden; font-size: 14px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
html body #templates-view .tp-name small { overflow: hidden; color: var(--pp-muted); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
html body #templates-view .tp-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; border-radius: 7px; }
html body #templates-view .tp-icon .app-icon { width: 17px; height: 17px; }
html body #templates-view .tp-icon.lilac { background: var(--pp-lilac-bg); color: var(--pp-lilac-fg); }
html body #templates-view .tp-icon.peach { background: var(--pp-peach-bg); color: var(--pp-peach-fg); }
html body #templates-view .tp-icon.mint { background: var(--pp-mint-bg); color: var(--pp-mint-fg); }
html body #templates-view .tp-icon.sky { background: var(--pp-sky-bg); color: var(--pp-sky-fg); }
html body #templates-view .zbs-price, html body #templates-view .tp-sent { font-variant-numeric: tabular-nums; white-space: nowrap; }
html body #templates-view .tp-sent { font-weight: 600; }
html body :is(#templates-view, #templatePreviewModal) .zbs-status { padding: 4px 11px; border-radius: 999px; font-size: 12.5px; }
html body :is(#templates-view, #templatePreviewModal) .zbs-status::before { display: none; }
html body :is(#templates-view, #templatePreviewModal) .zbs-status.approved { background: var(--pp-mint-bg); color: var(--pp-mint-fg); }
html body :is(#templates-view, #templatePreviewModal) .zbs-status.review { background: var(--pp-sky-bg); color: var(--pp-sky-fg); }
html body :is(#templates-view, #templatePreviewModal) .zbs-status.rejected { background: var(--pp-rose-bg); color: var(--pp-rose-fg); }
html body :is(#templates-view, #templatePreviewModal) .zbs-status.draft { background: var(--pp-butter-bg); color: var(--pp-butter-fg); }

/* Xem trước chính thức của Zalo: khung 375 điểm thu nhỏ vừa khung điện thoại (app.js: fitZaloPreview) */
html body .zbs-official-preview .zbs-preview-viewport { position: relative; overflow: hidden; height: 435px; background: #fff; }
html body .zbs-official-preview .zbs-preview-viewport iframe { position: absolute; top: 0; left: 0; width: 375px; max-width: none; height: 600px; border: 0; transform-origin: 0 0; }

@media (max-width: 780px) {
  html body #templates-view .tp-header { flex-wrap: wrap; }
  html body #templates-view .tp-header .zbs-toolbar-actions { width: 100%; margin-left: 0; }
  html body #templates-view .tp-header .zbs-toolbar-actions button { flex: 1; justify-content: center; padding: 0 12px; white-space: nowrap; }
  html body #templates-view .tp-filters :is(.search-box, .select-control) { flex: 1 1 100%; }
}

/* ===== Trang Cài đặt theo thiết kế 13 =====
   3 tab: Nhân viên (danh sách 4 cột + bảng quyền ô tích của người đang chọn) · Nhật ký hoạt động · Hệ thống. */
html body #settings-view .st-header { display: flex; align-items: center; gap: 12px; margin: 0 0 8px; padding: 0; border: 0; background: transparent; box-shadow: none; }
html body #settings-view .st-header p { margin: 0; color: var(--pp-muted); font-size: 14px; }
/* Phương án B: tab gạch chân căn trái; ô nút cố định cuối hàng (tab có nút thì hiện, không có thì để trống) nên thanh tab không xê dịch */
html body #settings-view .st-tabbar { display: flex; align-items: flex-end; gap: 12px; margin: 0 0 18px; border-bottom: 1px solid var(--pp-line-strong); }
html body #settings-view .st-tabs { display: flex; gap: 4px; min-width: 0; }
html body #settings-view .st-tabs button { position: relative; height: 46px; padding: 0 16px; border: 0; background: transparent; color: var(--pp-muted); font: inherit; font-size: 14.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
html body #settings-view .st-tabs button::after { content: ""; position: absolute; right: 10px; bottom: -1px; left: 10px; height: 3px; border-radius: 3px 3px 0 0; background: transparent; }
html body #settings-view .st-tabs button:hover { color: var(--pp-ink); }
html body #settings-view .st-tabs button.active { color: var(--pp-ink); }
html body #settings-view .st-tabs button.active::after { background: var(--pp-violet); }
html body #settings-view .st-tabs button[hidden] { display: none; }
html body #settings-view .st-action-slot { display: flex; min-width: 190px; height: 52px; box-sizing: border-box; align-items: center; justify-content: flex-end; margin-left: auto; padding-bottom: 6px; }
html body #settings-view .st-action-slot .primary-button { height: 40px; padding: 0 18px; border-radius: 999px; white-space: nowrap; }
html body #settings-view .st-action-slot .primary-button[hidden] { display: none; }
html body #settings-view .st-panel[hidden] { display: none; }

html body #settings-view .st-staff-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
html body #settings-view .settings-access { grid-column: auto; padding: 16px; border: 0; border-radius: var(--pp-radius-card); }
html body #settings-view .settings-access[hidden] { display: none; }
html body #settings-view :is(.st-staff-head, .st-staff-row) { display: grid; grid-template-columns: minmax(0, 1.5fr) 120px minmax(0, 1fr) 130px; gap: 12px; align-items: center; }
html body #settings-view .st-staff-head { padding: 6px 12px; color: var(--pp-muted); font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
html body #settings-view .staff-list { display: flex; flex-direction: column; gap: 4px; }
html body #settings-view .st-staff-row { width: 100%; margin: 0; padding: 10px 12px; border: 0; border-radius: 9px; background: transparent; color: var(--pp-ink); font: inherit; text-align: left; cursor: pointer; box-shadow: none; }
html body #settings-view .st-staff-row:hover { background: var(--pp-subtle); }
html body #settings-view .st-staff-row.selected { background: var(--pp-violet-soft); }
html body #settings-view .st-staff-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
html body #settings-view .st-staff-name > span:last-child { display: flex; flex-direction: column; min-width: 0; }
html body #settings-view .st-staff-name strong { overflow: hidden; font-size: 14px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
html body #settings-view .st-staff-name small { color: var(--pp-muted); font-size: 12px; }
html body #settings-view .st-avatar { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; border-radius: 7px; font-size: 13px; font-weight: 700; }
html body #settings-view .st-avatar.large { width: 48px; height: 48px; border-radius: 8px; font-size: 15px; }
html body #settings-view :is(.st-avatar, .st-role).lilac { background: var(--pp-lilac-bg); color: var(--pp-lilac-fg); }
html body #settings-view :is(.st-avatar, .st-role).mint { background: var(--pp-mint-bg); color: var(--pp-mint-fg); }
html body #settings-view :is(.st-avatar, .st-role).peach { background: var(--pp-peach-bg); color: var(--pp-peach-fg); }
html body #settings-view :is(.st-avatar, .st-role).sky { background: var(--pp-sky-bg); color: var(--pp-sky-fg); }
html body #settings-view :is(.st-avatar, .st-role).butter { background: var(--pp-butter-bg); color: var(--pp-butter-fg); }
html body #settings-view :is(.st-avatar, .st-role).rose { background: var(--pp-rose-bg); color: var(--pp-rose-fg); }
html body #settings-view :is(.st-avatar, .st-role).grey { background: var(--pp-grey-bg); color: var(--pp-grey-fg); }
html body #settings-view .st-role { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
html body #settings-view .st-scope { overflow: hidden; font-size: 13px; white-space: nowrap; text-overflow: ellipsis; }
html body #settings-view .st-last { color: var(--pp-ink-2); font-size: 13px; }
html body #settings-view .st-last.locked, html body #settings-view .inactive .st-scope { color: #8C1D3A; font-weight: 700; }
html body #settings-view .st-staff-summary { margin: 10px 12px 0; color: var(--pp-muted); font-size: 12.5px; }

html body #settings-view .st-staff-detail { display: flex; flex-direction: column; gap: 12px; padding: 20px; border-radius: var(--pp-radius-card); background: #FFFFFF; box-shadow: var(--pp-shadow); }
html body #settings-view .st-detail-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 40px 10px; color: var(--pp-muted); }
html body #settings-view .st-detail-head { display: flex; align-items: center; gap: 12px; }
html body #settings-view .st-detail-head > span:last-child { display: flex; flex-direction: column; }
html body #settings-view .st-detail-head strong { font-size: 18px; font-weight: 700; }
html body #settings-view .st-detail-head small { color: var(--pp-muted); font-size: 12.5px; }
html body #settings-view .st-detail-scope { display: grid; grid-template-columns: 80px minmax(0, 1fr); row-gap: 6px; margin: 0; padding: 12px; border-radius: 9px; background: var(--pp-subtle); font-size: 13px; }
html body #settings-view .st-detail-scope dt { color: var(--pp-muted); }
html body #settings-view .st-detail-scope dd { margin: 0; font-weight: 600; }
html body #settings-view :is(.st-perm-head, .st-perm-row) { display: grid; grid-template-columns: minmax(0, 1fr) 46px 46px 70px; gap: 6px; align-items: center; }
html body #settings-view .st-perm-head { padding: 0 10px; color: var(--pp-muted); font-size: 11.5px; font-weight: 700; text-transform: uppercase; }
html body #settings-view .st-perm-head span:not(:first-child) { text-align: center; }
html body #settings-view .st-perm-list { display: flex; flex-direction: column; gap: 4px; }
html body #settings-view .st-perm-row { padding: 7px 10px; border-radius: 7px; background: var(--pp-subtle); font-size: 13.5px; }
html body #settings-view .st-perm-row strong { font-weight: 600; }
html body #settings-view .st-perm { display: grid; place-items: center; justify-self: center; width: 24px; height: 24px; border-radius: 5px; font-size: 14px; font-weight: 700; }
html body #settings-view .st-perm.on { background: var(--pp-violet); color: #FFFFFF; }
html body #settings-view .st-perm.off { background: #FFFFFF; box-shadow: inset 0 0 0 2px #D9D2F2; }
html body #settings-view .st-perm.na { color: #9C95B8; }
html body #settings-view .st-perm-note { color: var(--pp-muted); font-size: 12px; line-height: 1.45; }
html body #settings-view .st-detail-actions { display: flex; flex-wrap: wrap; gap: 8px; }
html body #settings-view .st-detail-actions button { height: 44px; padding: 0 16px; border-radius: 999px; }
html body #settings-view .st-detail-actions .primary-button { flex: 1; }
html body #settings-view .st-detail-actions .secondary-button { border: 0; background: var(--pp-violet-soft); }
html body #settings-view .st-detail-actions .staff-owner-lock { flex: 1; padding: 12px; border-radius: 999px; background: var(--pp-subtle); color: var(--pp-muted); font-size: 13px; text-align: center; }

@media (max-width: 1180px) {
  html body #settings-view .st-staff-layout { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  html body #settings-view .st-tabbar { flex-wrap: wrap; }
  html body #settings-view .st-tabs { width: 100%; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  html body #settings-view .st-tabs button { padding: 0 10px; }
  html body #settings-view .st-action-slot { width: 100%; min-height: 0; height: auto; padding: 8px 0; }
  html body #settings-view .st-action-slot .primary-button { width: 100%; justify-content: center; }
  html body #settings-view .st-staff-head { display: none; }
  html body #settings-view .st-staff-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; }
  html body #settings-view .st-staff-row .st-scope, html body #settings-view .st-staff-row .st-last { grid-column: 1 / -1; padding-left: 50px; }
}

/* ===== Trang Mini Game theo thiết kế 11 =====
   4 thẻ số liệu màu · game đang chọn (thời gian, lượt, bảng quà: tỷ lệ, còn lại, mỗi khách) · khung điện thoại xem trước. */
html body #miniAppGamesArea #miniGameOverview[hidden] { display: none; }
html body #miniAppGamesArea .mg-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
html body #miniAppGamesArea .mg-stats > div { display: flex; flex-direction: column; gap: 6px; padding: 16px 20px; border: 0; border-radius: 12px; box-shadow: none; }
html body #miniAppGamesArea .mg-stats strong { font-size: 32px; font-weight: 750; line-height: 1; }
html body #miniAppGamesArea .mg-stats span { font-size: 14px; font-weight: 600; }
html body #miniAppGamesArea .mg-stats .lilac { background: var(--pp-lilac-bg); color: #2E1D86; }
html body #miniAppGamesArea .mg-stats .sky { background: var(--pp-sky-bg); color: #163A78; }
html body #miniAppGamesArea .mg-stats .mint { background: var(--pp-mint-bg); color: #0B3D28; }
html body #miniAppGamesArea .mg-stats .peach { background: var(--pp-peach-bg); color: #4A1D0A; }
/* Vận hành Mini Game (docs/dac-ta-mini-game.md mục 6): trạng thái, menu ⋯, cảnh báo, tab Quà đã trúng */
html body #miniAppGamesArea .of-tabbar[hidden], html body #miniAppGamesArea .of-header[hidden] { display: none; }
html body #miniAppGamesArea .mg-dot.running { background: #22A06B; }
html body #miniAppGamesArea .mg-dot.scheduled { background: #5B8DEF; }
html body #miniAppGamesArea .mg-dot.ended, html body #miniAppGamesArea .mg-dot.archived { background: #9A94AE; }
html body #miniAppGamesArea .mg-card-actions .mg-pause { background: var(--pp-butter-bg); color: var(--pp-butter-fg); }
html body #miniAppGamesArea .mg-more { position: relative; }
html body #miniAppGamesArea .mg-more-pop { position: absolute; top: 46px; right: 0; z-index: 30; display: grid; gap: 2px; min-width: 250px; padding: 6px; border-radius: 14px; background: #FFFFFF; box-shadow: 0 14px 38px rgba(40, 28, 110, .18); }
html body #miniAppGamesArea .mg-more-pop button { display: grid; gap: 2px; height: auto; padding: 9px 11px; border: 0; border-radius: 10px; background: transparent; text-align: left; font: inherit; cursor: pointer; }
html body #miniAppGamesArea .mg-more-pop button:hover, html body #miniAppGamesArea .mg-more-pop button:focus-visible { background: var(--pp-subtle); }
html body #miniAppGamesArea .mg-more-pop button b { font-size: 14px; color: var(--pp-ink); }
html body #miniAppGamesArea .mg-more-pop button.danger b { color: #B42343; }
html body #miniAppGamesArea .mg-more-pop button small { color: var(--pp-muted); font-size: 12px; }
html body #miniAppGamesArea .mg-alert { margin: 4px 0 10px; padding: 9px 12px; border-radius: 10px; background: var(--pp-subtle); color: var(--pp-ink-2); font-size: 13px; line-height: 1.45; }
html body #miniAppGamesArea .mg-alert.warn { background: var(--pp-butter-bg); color: var(--pp-butter-fg); }
html body #miniAppGamesArea .mg-alert.danger { background: #FFE0E6; color: #8C1D3A; }
html body #miniAppGamesArea .mg-award-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 12px; }
html body #miniAppGamesArea .mg-award-tools input { flex: 0 1 320px; min-width: 0; height: 40px; padding: 0 14px; border: 1px solid var(--pp-line-strong); border-radius: 999px; background: #FFFFFF; font: inherit; }
html body #miniAppGamesArea .mg-award-filters { display: flex; flex-wrap: wrap; gap: 6px; }
html body #miniAppGamesArea .mg-award-filters button { height: 34px; padding: 0 14px; border: 0; border-radius: 999px; background: #FFFFFF; color: var(--pp-ink-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
html body #miniAppGamesArea .mg-award-filters button.active { background: var(--pp-ink); color: #FFFFFF; }
html body #miniAppGamesArea .mg-award-table { overflow-x: auto; padding: 6px 16px; border-radius: 18px; background: #FFFFFF; box-shadow: var(--pp-shadow, 0 8px 24px rgba(60, 40, 140, .06)); }
html body #miniAppGamesArea .mg-award-table table { width: 100%; min-width: 760px; border-collapse: collapse; }
html body #miniAppGamesArea .mg-award-table th { padding: 11px 8px; border-bottom: 1px solid var(--pp-line); color: var(--pp-muted); font-size: 11px; font-weight: 800; letter-spacing: .05em; text-align: left; text-transform: uppercase; white-space: nowrap; }
html body #miniAppGamesArea .mg-award-table td { padding: 11px 8px; border-bottom: 1px solid var(--pp-line); font-size: 13.5px; vertical-align: middle; }
html body #miniAppGamesArea .mg-award-table tr:last-child td { border-bottom: 0; }
html body #miniAppGamesArea .mg-award-table tr.is-using td { background: var(--pp-violet-soft); }
html body #miniAppGamesArea .mg-award-table td small { display: block; margin-top: 2px; color: var(--pp-muted); font-size: 12px; }
html body #miniAppGamesArea .mg-award-code { font-family: ui-monospace, Menlo, monospace; font-weight: 750; letter-spacing: .04em; white-space: nowrap; }
html body #miniAppGamesArea .mg-award-chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
html body #miniAppGamesArea .mg-award-chip.sky { background: #DCEBFF; color: #1E4DA1; }
html body #miniAppGamesArea .mg-award-chip.butter { background: var(--pp-butter-bg); color: var(--pp-butter-fg); }
html body #miniAppGamesArea .mg-award-chip.mint { background: var(--pp-mint-bg); color: var(--pp-mint-fg); }
html body #miniAppGamesArea .mg-award-chip.violet { background: var(--pp-violet-soft); color: #4B2FD1; }
html body #miniAppGamesArea .mg-award-chip.grey { background: #EEEDF3; color: #4A475A; }
html body #miniAppGamesArea .mg-award-action { text-align: right; white-space: nowrap; }
html body #miniAppGamesArea .mg-award-action .primary-button { height: 34px; padding: 0 14px; border-radius: 999px; font-size: 13px; }
html body #miniAppGamesArea .mg-award-use { display: inline-flex; align-items: center; gap: 6px; }
html body #miniAppGamesArea .mg-award-use select { height: 34px; max-width: 200px; padding: 0 8px; border: 1px solid var(--pp-line-strong); border-radius: 10px; background: #FFFFFF; font: inherit; font-size: 13px; }
html body #miniAppGamesArea .mg-award-muted { color: var(--pp-muted); font-size: 12px; white-space: normal; }
html body #miniAppGamesArea .mg-award-empty { padding: 26px 8px !important; color: var(--pp-muted); text-align: center; }
@media (max-width: 780px) {
  html body #miniAppGamesArea .mg-award-tools input { flex: 1 1 100%; }
}
html body #miniAppGamesArea :is(.mg-prize-head, .mg-prize-row) { display: grid; grid-template-columns: minmax(0, 1.5fr) 90px minmax(0, 1.3fr) 120px; gap: 12px; align-items: center; }
html body #miniAppGamesArea :is(.mg-prize-icon, .mg-stock b).lilac { background: var(--pp-lilac-bg); color: var(--pp-lilac-fg); }
html body #miniAppGamesArea :is(.mg-prize-icon, .mg-stock b).mint { background: var(--pp-mint-bg); color: var(--pp-mint-fg); }
html body #miniAppGamesArea :is(.mg-prize-icon, .mg-stock b).rose { background: var(--pp-rose-bg); color: var(--pp-rose-fg); }
html body #miniAppGamesArea :is(.mg-prize-icon, .mg-stock b).sky { background: var(--pp-sky-bg); color: var(--pp-sky-fg); }
html body #miniAppGamesArea :is(.mg-prize-icon, .mg-stock b).butter { background: var(--pp-butter-bg); color: var(--pp-butter-fg); }
html body #miniAppGamesArea :is(.mg-prize-icon, .mg-stock b).peach { background: var(--pp-peach-bg); color: var(--pp-peach-fg); }
html body #miniAppGamesArea .mg-prize-icon.grey { background: var(--pp-grey-bg); color: var(--pp-grey-fg); }
html body #miniAppGamesArea .mg-stock b.lilac { background: var(--pp-violet); }
html body #miniAppGamesArea .mg-stock b.mint { background: #12805A; }
html body #miniAppGamesArea .mg-stock b.rose { background: #C0395F; }
html body #miniAppGamesArea .mg-stock b.sky { background: #1E4DA1; }
html body #miniAppGamesArea .mg-stock b.butter { background: #B8860B; }
html body #miniAppGamesArea .mg-stock b.peach { background: #D2693A; }
html body #miniAppGamesArea .mg-note { color: var(--pp-muted); font-size: 12.5px; }


@media (max-width: 1180px) {
}
@media (max-width: 780px) {
  html body #miniAppGamesArea .mg-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  html body #miniAppGamesArea .mg-stats strong { font-size: 26px; }
}

/* ===== Trang Khách hàng 360 theo thiết kế 02 =====
   Tab lọc nhanh có số đếm · bảng 5 cột (khách, SĐT, hạng, điểm, Mini App) · khung hồ sơ tóm tắt bên phải
   (thẻ hạng tím có thanh tiến độ lên hạng, nhãn trạng thái, xe, liên kết, hoạt động gần đây). */
html body #customer360-view .c3-header { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; padding: 0; border: 0; background: transparent; box-shadow: none; }
html body #customer360-view .c3-header p { margin: 0; color: var(--pp-muted); font-size: 14px; }
html body #customer360-view .c3-header .customer360-toolbar-actions { display: flex; gap: 10px; margin-left: auto; }
html body #customer360-view .c3-header :is(.secondary-button, .primary-button) { height: 46px; padding: 0 20px; white-space: nowrap; }
html body #customer360-view .c3-header .secondary-button { border: 0; background: #FFFFFF; }
html body #customer360-view .c3-tabs { display: flex; gap: 10px; margin-bottom: 18px; overflow-x: auto; }
html body #customer360-view .c3-tabs button { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border: 0; border-radius: 999px; background: #FFFFFF; color: var(--pp-ink-2); font: inherit; font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer; }
html body #customer360-view .c3-tabs button.active { background: var(--pp-ink); color: #FFFFFF; font-weight: 700; }
html body #customer360-view .c3-tabs b { padding: 1px 8px; border-radius: 999px; background: var(--pp-violet-soft); color: var(--pp-violet-pressed); font-size: 12px; }
html body #customer360-view .c3-tabs button.active b { background: var(--pp-violet); color: #FFFFFF; }

html body #customer360-view .c3-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
html body #customer360-view .customer360-list-panel { padding: 18px; border: 0; border-radius: var(--pp-radius-card); }
html body #customer360-view .c3-tools { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 0 10px; border: 0; background: transparent; }
html body #customer360-view .c3-tools .search-box { flex: 1 1 220px; border: 0; border-radius: 999px; background: var(--pp-subtle); }
html body #customer360-view .c3-tools .select-control { flex: 0 1 170px; width: auto; border: 0; border-radius: 999px; background-color: var(--pp-subtle); font-weight: 600; }
html body #customer360-view .customer360-table-wrap table { width: 100%; min-width: 0; table-layout: fixed; border-collapse: separate; border-spacing: 0 4px; }
html body #customer360-view .customer360-table-wrap :is(th, td) { height: auto; padding: 8px 12px; border: 0; background: transparent; box-shadow: none; vertical-align: middle; }
html body #customer360-view .customer360-table-wrap th { color: var(--pp-muted); font-size: 12px; font-weight: 700; letter-spacing: .05em; text-align: left; text-transform: uppercase; }
html body #customer360-view .customer360-table-wrap :is(th, td):nth-child(2) { width: 118px; }
html body #customer360-view .customer360-table-wrap :is(th, td):nth-child(3) { width: 106px; }
html body #customer360-view .customer360-table-wrap :is(th, td):nth-child(4) { width: 72px; }
html body #customer360-view .customer360-table-wrap :is(th, td):nth-child(5) { width: 124px; }
html body #customer360-view .c3-num { text-align: right; font-variant-numeric: tabular-nums; }
html body #customer360-view .c3-phone { font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
html body #customer360-view .customer360-row { cursor: pointer; }
html body #customer360-view .customer360-row td:first-child { border-radius: 9px 0 0 9px; }
html body #customer360-view .customer360-row td:last-child { border-radius: 0 9px 9px 0; }
html body #customer360-view .customer360-row:hover td { background: var(--pp-subtle); }
html body #customer360-view .customer360-row.selected td { background: var(--pp-violet-soft); }
html body #customer360-view .customer-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
html body #customer360-view .customer-identity > span:last-child { display: flex; flex-direction: column; min-width: 0; }
html body #customer360-view .customer-identity strong { overflow: hidden; font-size: 14px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
html body #customer360-view .customer-identity small { color: var(--pp-muted); font-size: 12px; }
html body #customer360-view .profile-avatar { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; border-radius: 7px; font-size: 13px; font-weight: 700; }
html body #customer360-view .profile-avatar.tone-peach { background: var(--pp-peach-bg); color: var(--pp-peach-fg); }
html body #customer360-view .profile-avatar.tone-mint { background: var(--pp-mint-bg); color: var(--pp-mint-fg); }
html body #customer360-view .profile-avatar.tone-sky { background: var(--pp-sky-bg); color: var(--pp-sky-fg); }
html body #customer360-view .profile-avatar.tone-butter { background: var(--pp-butter-bg); color: var(--pp-butter-fg); }
html body #customer360-view .profile-avatar.tone-lilac { background: var(--pp-lilac-bg); color: var(--pp-lilac-fg); }
html body #customer360-view .c3-tier { padding: 4px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
html body #customer360-view :is(.c3-tier, .c3-chips span).grey { background: var(--pp-grey-bg); color: var(--pp-grey-fg); }
html body #customer360-view :is(.c3-tier, .c3-chips span).sky { background: var(--pp-sky-bg); color: var(--pp-sky-fg); }
html body #customer360-view :is(.c3-tier, .c3-chips span).butter { background: var(--pp-butter-bg); color: var(--pp-butter-fg); }
html body #customer360-view :is(.c3-tier, .c3-chips span).lilac { background: var(--pp-lilac-bg); color: var(--pp-lilac-fg); }
html body #customer360-view :is(.c3-tier, .c3-chips span).rose { background: var(--pp-rose-bg); color: var(--pp-rose-fg); }
html body #customer360-view :is(.c3-tier, .c3-chips span).mint { background: var(--pp-mint-bg); color: var(--pp-mint-fg); }
html body #customer360-view .c3-chips span.peach { background: var(--pp-peach-bg); color: var(--pp-peach-fg); }
html body #customer360-view .c3-app { display: flex; align-items: center; gap: 6px; font-size: 13px; }
html body #customer360-view .c3-app i { width: 9px; height: 9px; border-radius: 50%; background: #B7B2C8; }
html body #customer360-view .c3-app.on i { background: #12805A; }
html body #customer360-view .c3-footnote { margin: 10px 12px 0; color: var(--pp-muted); font-size: 12.5px; }
html body #customer360-view #customer360Rejections > .c3-footnote { margin: 0 12px 10px; }
html body #customer360-view .c3-rejection-actions { white-space: nowrap; text-align: right; }

html body #customer360-view .c3-side { display: flex; flex-direction: column; gap: 14px; }
html body #customer360-view .c3-card { display: flex; flex-direction: column; gap: 14px; padding: 22px; border-radius: var(--pp-radius-card); background: #FFFFFF; box-shadow: var(--pp-shadow); }
html body #customer360-view .c3-card h3 { margin: 0; font-size: 18px; font-weight: 700; }
html body #customer360-view .c3-empty { align-items: center; padding: 40px 20px; color: var(--pp-muted); text-align: center; }
html body #customer360-view .c3-empty .app-icon { width: 26px; height: 26px; }
html body #customer360-view .c3-profile-head { display: flex; align-items: center; gap: 14px; }
html body #customer360-view .c3-profile-head > span:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
html body #customer360-view .c3-profile-head strong { font-size: 21px; font-weight: 700; }
html body #customer360-view .c3-profile-head small { color: var(--pp-muted); font-size: 13px; }
html body #customer360-view .c3-avatar { display: grid; place-items: center; width: 60px; height: 60px; flex: 0 0 auto; border-radius: 10px; background: var(--pp-violet); color: #FFFFFF; font-size: 22px; font-weight: 700; }
html body #customer360-view .c3-loyalty { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 18px; overflow: hidden; border-radius: 11px; background: var(--pp-violet); color: #FFFFFF; }
html body #customer360-view .c3-loyalty::before { content: ""; position: absolute; right: -30px; top: -30px; width: 100px; height: 100px; border-radius: 50%; background: rgba(255, 255, 255, .14); }
html body #customer360-view .c3-loyalty > span { font-size: 13px; font-weight: 600; }
html body #customer360-view .c3-loyalty strong { font-size: 32px; font-weight: 750; line-height: 1; }
html body #customer360-view .c3-loyalty i { display: block; height: 8px; overflow: hidden; border-radius: 999px; background: rgba(255, 255, 255, .35); }
html body #customer360-view .c3-loyalty i b { display: block; height: 100%; border-radius: 999px; background: #FFD6C2; }
html body #customer360-view .c3-loyalty small { font-size: 12.5px; }
html body #customer360-view .c3-chips { display: flex; flex-wrap: wrap; gap: 6px; }
html body #customer360-view .c3-chips span { padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
html body #customer360-view .c3-facts { display: grid; grid-template-columns: 90px minmax(0, 1fr); row-gap: 8px; margin: 0; font-size: 13.5px; }
html body #customer360-view .c3-facts dt { color: var(--pp-muted); }
html body #customer360-view .c3-facts dd { margin: 0; font-weight: 600; }
html body #customer360-view .c3-actions { display: flex; gap: 8px; }
html body #customer360-view .c3-actions button { height: 44px; padding: 0 16px; border-radius: 999px; }
html body #customer360-view .c3-actions .primary-button { flex: 1; }
html body #customer360-view .c3-actions .secondary-button { border: 0; background: var(--pp-violet-soft); }
html body #customer360-view .c3-activity { display: flex; gap: 12px; }
html body #customer360-view .c3-activity > span:last-child { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
html body #customer360-view .c3-activity strong { font-size: 13.5px; font-weight: 600; }
html body #customer360-view .c3-activity small { overflow: hidden; color: var(--pp-muted); font-size: 12.5px; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
html body #customer360-view .c3-activity-icon { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 auto; border-radius: 6px; }
html body #customer360-view .c3-activity-icon .app-icon { width: 15px; height: 15px; }
html body #customer360-view .c3-activity-icon.lilac { background: var(--pp-lilac-bg); color: var(--pp-lilac-fg); }
html body #customer360-view .c3-activity-icon.sky { background: var(--pp-sky-bg); color: var(--pp-sky-fg); }
html body #customer360-view .c3-activity-icon.peach { background: var(--pp-peach-bg); color: var(--pp-peach-fg); }
html body #customer360-view .c3-activity-icon.rose { background: var(--pp-rose-bg); color: var(--pp-rose-fg); }
html body #customer360-view .c3-muted { margin: 0; color: var(--pp-muted); font-size: 13px; }

@media (max-width: 1180px) {
  html body #customer360-view .c3-layout { grid-template-columns: 1fr; }
  html body #customer360-view .c3-header { flex-wrap: wrap; }
  html body #customer360-view .c3-header .customer360-toolbar-actions { width: 100%; margin-left: 0; }
}
@media (max-width: 780px) {
  html body #customer360-view .c3-header .customer360-toolbar-actions button { flex: 1; justify-content: center; padding: 0 10px; font-size: 13.5px; }
  html body #customer360-view .c3-tools :is(.search-box, .select-control) { flex: 1 1 100%; }
  html body #customer360-view .customer360-table-wrap thead { display: none; }
  html body #customer360-view .customer360-table-wrap :is(table, tbody) { display: block; }
  html body #customer360-view .customer360-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; margin-bottom: 6px; border-radius: 9px; }
  html body #customer360-view .customer360-row td { display: block; width: auto !important; padding: 4px 12px; border-radius: 0 !important; }
  html body #customer360-view .customer360-row td:first-child { grid-column: 1 / -1; padding-top: 10px; }
  html body #customer360-view .customer360-row td.c3-num { text-align: right; }
  html body #customer360-view .customer360-row td:last-child { padding-bottom: 10px; }
  html body #customer360-view .customer360-row:hover td, html body #customer360-view .customer360-row.selected td { background: transparent; }
  html body #customer360-view .customer360-row.selected { background: var(--pp-violet-soft); }
}

/* ===== Màn Dựng chiến dịch theo thiết kế 06 (chỉ đổi hình thức, không đổi cách kéo thả / nối bước) =====
   Màu theo loại bước: Bắt đầu tím nhạt · Kiểm tra vàng · Gửi ZBS tím · Trì hoãn xanh trời · Cập nhật dữ liệu bạc hà
   · Hành động khách đào · Cộng lượt game hồng · Kết thúc xám. Nhánh "Đúng" xanh lá, "Nếu không" đỏ nét đứt. */
html body #workflowBuilderView.workflow-builder { margin-top: 0; background: var(--bg); }
html body #workflowBuilderView .workflow-toolbar { border: 0; background: var(--bg); padding: 12px 18px; }
html body #workflowBuilderView #workflowBackButton { width: 46px; height: 46px; padding: 0; border: 0; border-radius: 50%; background: #FFFFFF; justify-content: center; font-size: 0; gap: 0; }
html body #workflowBuilderView #workflowBackButton .app-icon { width: 18px; height: 18px; }
html body #workflowBuilderView .workflow-name-field > span { color: var(--pp-muted); font-size: 12.5px; font-weight: 600; }
html body #workflowBuilderView .workflow-name-field input { min-height: 44px; border: 0; border-radius: 10px; background: #FFFFFF; font-size: 18px; font-weight: 700; }
html body #workflowBuilderView .workflow-toolbar-actions :is(.secondary-button, .primary-button) { height: 44px; padding: 0 16px; border-radius: 999px; white-space: nowrap; }
@media (min-width: 781px) { html body #workflowBuilderView .workflow-toolbar-actions { flex-wrap: nowrap; } }
@media (max-width: 780px) { html body #workflowBuilderView .workflow-toolbar-actions { flex-wrap: wrap; } html body #workflowBuilderView .workflow-toolbar { grid-template-columns: minmax(0, 1fr); } }
html body #workflowBuilderView .workflow-toolbar-actions .tag { white-space: nowrap; border-radius: 999px; }
html body #workflowBuilderView .workflow-toolbar-actions .secondary-button { border: 0; background: #FFFFFF; }
html body #workflowBuilderView .workflow-context-tabs { border: 0; background: var(--bg); }
html body #workflowBuilderView .workflow-context-tabs button.active { color: var(--pp-violet-pressed); border-bottom-color: var(--pp-violet); }

html body #workflowBuilderView .workflow-canvas { background-color: #FBFAFF; background-image: radial-gradient(#D9D2F2 1.4px, transparent 1.4px); background-size: 22px 22px; }
html body #workflowBuilderView :is(.workflow-palette, .workflow-config) { border: 0; background: #FFFFFF; }
html body #workflowBuilderView .workflow-config { border-radius: var(--pp-radius-card) 0 0 0; }

/* Hàng nút thêm bước dạng viên thuốc phía trên sơ đồ (mọi khổ màn hình) */
html body #workflowBuilderView .workflow-palette { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; height: auto; max-height: none; padding: 12px 16px; overflow: visible; background: #FBFAFF; }
html body #workflowBuilderView .workflow-palette > div { order: 99; flex-basis: 100%; display: block; padding: 2px 4px 0; }
html body #workflowBuilderView .workflow-palette > div > strong { display: none; }
html body #workflowBuilderView .workflow-palette > div > span { color: var(--pp-muted); font-size: 12.5px; }
html body #workflowBuilderView .workflow-palette > button { width: auto; min-height: 0; height: 36px; margin: 0; padding: 0 14px 0 6px; align-items: center; gap: 6px; border: 0; border-radius: 999px; font-weight: 700; }
html body #workflowBuilderView .workflow-palette > button b { width: 26px; height: 26px; border-radius: 50%; background: rgba(255, 255, 255, .7); color: inherit; }
html body #workflowBuilderView .workflow-palette > button b .app-icon { width: 14px; height: 14px; }
html body #workflowBuilderView .workflow-palette > button small { display: none; }
html body #workflowBuilderView .workflow-palette > button strong { font-size: 13px; }
html body #workflowBuilderView .workflow-palette > button strong::before { content: "+ "; }
html body #workflowBuilderView .workflow-palette.connecting { box-shadow: inset 0 -3px 0 var(--pp-violet); }
@media (min-width: 1181px) {
  html body #workflowBuilderView .workflow-workspace { grid-template-columns: minmax(0, 1fr) 340px; grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "palette config" "stage config"; }
  html body #workflowBuilderView .workflow-palette { grid-area: palette; border-radius: var(--pp-radius-card) var(--pp-radius-card) 0 0; }
  html body #workflowBuilderView .workflow-canvas-stage { grid-area: stage; }
  html body #workflowBuilderView .workflow-config { grid-area: config; margin-left: 16px; border-radius: var(--pp-radius-card); }
}
@media (max-width: 1180px) {
  html body #workflowBuilderView .workflow-workspace { display: flex; flex-direction: column; overflow: visible; }
  html body #workflowBuilderView .workflow-canvas-stage { min-height: 560px; }
  html body #workflowBuilderView .workflow-config { max-height: none; border-radius: 0; }
}
html body #workflowBuilderView .workflow-palette > button[data-workflow-type="condition"] { background: var(--pp-butter-bg); color: var(--pp-butter-fg); }
html body #workflowBuilderView .workflow-palette > button[data-workflow-type="send"] { background: var(--pp-lilac-bg); color: var(--pp-lilac-fg); }
html body #workflowBuilderView .workflow-palette > button[data-workflow-type="delay"] { background: var(--pp-sky-bg); color: var(--pp-sky-fg); }
html body #workflowBuilderView .workflow-palette > button[data-workflow-type="update"] { background: var(--pp-mint-bg); color: var(--pp-mint-fg); }
html body #workflowBuilderView .workflow-palette > button[data-workflow-type="customer_action"] { background: var(--pp-peach-bg); color: var(--pp-peach-fg); }
html body #workflowBuilderView .workflow-palette > button[data-workflow-type="gamification"] { background: var(--pp-rose-bg); color: var(--pp-rose-fg); }
html body #workflowBuilderView .workflow-palette > button[data-workflow-type="offer"] { background: var(--pp-lilac-bg); color: var(--pp-lilac-fg); }
html body #workflowBuilderView .workflow-palette > button[data-workflow-type="end"] { background: var(--pp-grey-bg); color: var(--pp-grey-fg); }
html body #workflowBuilderView .workflow-palette > button:hover { filter: brightness(.97); box-shadow: 0 0 0 2px rgba(108, 71, 255, .25); }

/* Thẻ bước trên sơ đồ */
html body #workflowBuilderView .workflow-node-main { border: 0; border-radius: 11px; background: #FFFFFF; box-shadow: 0 6px 18px rgba(60, 40, 140, .08); }
html body #workflowBuilderView .workflow-node-head { border: 0; background: transparent; }
html body #workflowBuilderView .workflow-node-number { border-radius: 6px; background: var(--pp-ink); color: #FFFFFF; }
html body #workflowBuilderView .workflow-node-icon { width: 36px; height: 36px; border-radius: 7px; box-shadow: none; }
html body #workflowBuilderView .workflow-node-icon .app-icon { width: 18px; height: 18px; }
html body #workflowBuilderView .workflow-node.fixed-start .workflow-node-icon { background: var(--pp-lilac-bg); color: var(--pp-lilac-fg); }
html body #workflowBuilderView .workflow-node.condition .workflow-node-main { background: var(--pp-butter-bg); }
html body #workflowBuilderView .workflow-node.condition .workflow-node-icon { background: #FFFFFF; color: var(--pp-butter-fg); }
html body #workflowBuilderView .workflow-node.send .workflow-node-icon { background: var(--pp-violet); color: #FFFFFF; }
html body #workflowBuilderView .workflow-node.delay .workflow-node-main { background: var(--pp-sky-bg); }
html body #workflowBuilderView .workflow-node.delay .workflow-node-icon { background: #FFFFFF; color: var(--pp-sky-fg); }
html body #workflowBuilderView .workflow-node.update .workflow-node-main { background: var(--pp-mint-bg); }
html body #workflowBuilderView .workflow-node.update .workflow-node-icon { background: #FFFFFF; color: var(--pp-mint-fg); }
html body #workflowBuilderView .workflow-node.lookup .workflow-node-main { background: var(--pp-sky-bg); }
html body #workflowBuilderView .workflow-node.lookup .workflow-node-icon { background: #FFFFFF; color: var(--pp-sky-fg); }
html body #workflowBuilderView .workflow-node.customer_action .workflow-node-main { background: var(--pp-peach-bg); }
html body #workflowBuilderView .workflow-node.customer_action .workflow-node-icon { background: #FFFFFF; color: var(--pp-peach-fg); }
html body #workflowBuilderView .workflow-node.gamification .workflow-node-main { background: var(--pp-rose-bg); }
html body #workflowBuilderView .workflow-node.gamification .workflow-node-icon { background: #FFFFFF; color: var(--pp-rose-fg); }
html body #workflowBuilderView .workflow-node.offer .workflow-node-main { background: var(--pp-lilac-bg); }
html body #workflowBuilderView .workflow-node.offer .workflow-node-icon { background: #FFFFFF; color: var(--pp-lilac-fg); }
html body #workflowBuilderView .workflow-node.end .workflow-node-icon { background: var(--pp-grey-bg); color: var(--pp-grey-fg); }
html body #workflowBuilderView .workflow-node.selected .workflow-node-main { box-shadow: 0 0 0 3px var(--pp-violet), 0 10px 24px rgba(108, 71, 255, .25); }
html body #workflowBuilderView .workflow-fixed-badge { border-radius: 999px; background: var(--pp-lilac-bg); color: var(--pp-lilac-fg); }
html body #workflowBuilderView .workflow-node-report { border: 0; border-radius: 10px; background: #FFFFFF; box-shadow: 0 4px 12px rgba(60, 40, 140, .06); }
html body #workflowBuilderView .workflow-node-report button { border: 0; border-radius: 999px; background: var(--pp-violet-soft); color: var(--pp-violet-pressed); font-weight: 700; }
html body #workflowBuilderView .workflow-node-progress i { background: var(--pp-violet); }
html body #workflowBuilderView .workflow-node-outputs button { border: 0; border-radius: 999px; background: #FFFFFF; color: var(--pp-violet-pressed); font-weight: 700; box-shadow: 0 0 0 1px var(--pp-line-strong); }
html body #workflowBuilderView .workflow-node-outputs button.active { background: var(--pp-violet); color: #FFFFFF; }

/* Đường nối */
html body #workflowBuilderView .workflow-line { stroke: #B8AEE0; stroke-width: 3; stroke-linecap: round; }
html body #workflowBuilderView .workflow-line.yes { stroke: #12805A; }
html body #workflowBuilderView .workflow-line.no { stroke: #C0395F; stroke-dasharray: 7 7; }
html body #workflowBuilderView .workflow-line-label { fill: var(--pp-muted); font-size: 12px; font-weight: 700; stroke: #FBFAFF; }
html body #workflowBuilderView .workflow-line-label.yes { fill: var(--pp-mint-fg); stroke: none; }
html body #workflowBuilderView .workflow-line-label.no { fill: var(--pp-rose-fg); stroke: none; }
html body #workflowBuilderView .workflow-line-pill.yes { fill: var(--pp-mint-bg); }
html body #workflowBuilderView .workflow-line-pill.no { fill: var(--pp-rose-bg); }

html body #workflowBuilderView .workflow-viewport-controls { border: 0; border-radius: 999px; background: #FFFFFF; box-shadow: var(--pp-shadow); }
html body #workflowBuilderView .workflow-readonly-banner { border: 0; border-radius: 999px; background: #FFFFFF; color: var(--pp-ink-2); }

/* ===== Trang Ưu đãi & mã theo thiết kế 09 =====
   3 tab: Ưu đãi (thẻ màu 3 cột + khung "Kho mã còn lại") · Kho mã · Mã đã phát (trước là mục menu "Kho mã khuyến mãi"). */
html body :is(#miniAppOffersArea, #miniAppPromotionsArea, #miniAppGamesArea) .of-header { display: flex; align-items: center; gap: 12px; margin: 0 0 8px; padding: 0; border: 0; background: transparent; box-shadow: none; }
html body :is(#miniAppOffersArea, #miniAppPromotionsArea, #miniAppGamesArea) .of-header p { margin: 0; color: var(--pp-muted); font-size: 14px; }
/* Phương án A (05/10/2026, giống Cài đặt): tab gạch chân căn trái; ô nút cố định cuối hàng (Thêm ưu đãi / Tạo kho mã / trống) */
html body :is(#miniAppOffersArea, #miniAppPromotionsArea, #miniAppGamesArea) .of-tabbar { display: flex; align-items: flex-end; gap: 12px; margin: 0 0 18px; border-bottom: 1px solid var(--pp-line-strong); }
html body :is(#miniAppOffersArea, #miniAppPromotionsArea, #miniAppGamesArea) .of-tabs { display: flex; gap: 4px; min-width: 0; }
html body :is(#miniAppOffersArea, #miniAppPromotionsArea, #miniAppGamesArea) .of-tabs button { position: relative; height: 46px; padding: 0 16px; border: 0; background: transparent; color: var(--pp-muted); font: inherit; font-size: 14.5px; font-weight: 700; white-space: nowrap; cursor: pointer; }
html body :is(#miniAppOffersArea, #miniAppPromotionsArea, #miniAppGamesArea) .of-tabs button::after { content: ""; position: absolute; right: 10px; bottom: -1px; left: 10px; height: 3px; border-radius: 3px 3px 0 0; background: transparent; }
html body :is(#miniAppOffersArea, #miniAppPromotionsArea, #miniAppGamesArea) .of-tabs button:hover, html body :is(#miniAppOffersArea, #miniAppPromotionsArea, #miniAppGamesArea) .of-tabs button.active { color: var(--pp-ink); }
html body :is(#miniAppOffersArea, #miniAppPromotionsArea, #miniAppGamesArea) .of-tabs button.active::after { background: var(--pp-violet); }
html body :is(#miniAppOffersArea, #miniAppPromotionsArea, #miniAppGamesArea) .of-action-slot { display: flex; min-width: 190px; height: 52px; box-sizing: border-box; align-items: center; justify-content: flex-end; margin-left: auto; padding-bottom: 6px; }
html body :is(#miniAppOffersArea, #miniAppPromotionsArea, #miniAppGamesArea) .of-action-slot .primary-button { height: 40px; padding: 0 18px; border-radius: 999px; white-space: nowrap; }
html body :is(#miniAppOffersArea, #miniAppPromotionsArea, #miniAppGamesArea) .of-action-slot .primary-button[hidden] { display: none; }
html body #miniAppPromotionsArea #promotionCodeKpis[hidden] { display: none; }

html body #miniAppOffersArea .of-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
html body #miniAppOffersArea .of-layout[hidden] { display: none; }
html body #miniAppOffersArea .of-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
html body #miniAppOffersArea .of-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
html body #miniAppOffersArea .of-status { display: flex; gap: 6px; padding: 0; border: 0; }
html body #miniAppOffersArea .of-status button { height: 40px; padding: 0 14px; border: 0; box-shadow: none; border-radius: 999px; background: #FFFFFF; color: var(--pp-ink-2); font-size: 13.5px; font-weight: 600; }
html body #miniAppOffersArea .of-status button.active { background: var(--pp-ink); color: #FFFFFF; font-weight: 700; }
html body #miniAppOffersArea .of-status button span { margin-left: 4px; }
html body #miniAppOffersArea .of-tools .search-box { flex: 1 1 200px; border: 0; border-radius: 999px; background: #FFFFFF; }
html body #miniAppOffersArea .of-tools .select-control { flex: 0 1 190px; width: auto; border: 0; border-radius: 999px; background-color: #FFFFFF; }
html body #miniAppOffersArea .of-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
html body #miniAppOffersArea .of-grid:empty { display: none; }
html body #miniAppOffersArea .of-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 18px; border-radius: 14px; }
html body #miniAppOffersArea .of-card.lilac { background: var(--pp-lilac-bg); color: #2E1D86; }
html body #miniAppOffersArea .of-card.mint { background: var(--pp-mint-bg); color: #0B3D28; }
html body #miniAppOffersArea .of-card.peach { background: var(--pp-peach-bg); color: #4A1D0A; }
html body #miniAppOffersArea .of-card.sky { background: var(--pp-sky-bg); color: #163A78; }
html body #miniAppOffersArea .of-card-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
html body #miniAppOffersArea .of-chip { padding: 4px 10px; border-radius: 999px; background: #FFFFFF; font-size: 12px; font-weight: 700; }
html body #miniAppOffersArea .of-vis { margin-left: auto; padding: 4px 10px; border: 0; border-radius: 999px; background: transparent; box-shadow: inset 0 0 0 2px currentColor; color: inherit; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
html body #miniAppOffersArea span.of-vis { cursor: default; }
html body #miniAppOffersArea .of-vis.on { background: var(--pp-ink); box-shadow: none; color: #FFFFFF; }
html body #miniAppOffersArea .of-value { font-size: 40px; font-weight: 750; line-height: 1; }
html body #miniAppOffersArea .of-card h3 { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.3; }
html body #miniAppOffersArea .of-facts { display: flex; flex-direction: column; gap: 8px; margin: auto 0 0; padding: 12px; border-radius: 9px; background: rgba(255, 255, 255, .72); }
html body #miniAppOffersArea .of-facts div { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
html body #miniAppOffersArea .of-facts dt { flex: 0 0 auto; }
html body #miniAppOffersArea .of-facts dd { margin: 0; overflow: hidden; font-weight: 700; text-align: right; white-space: nowrap; text-overflow: ellipsis; }
html body #miniAppOffersArea .of-card-actions { display: flex; gap: 8px; }
html body #miniAppOffersArea .of-card-actions button { flex: 1; height: 36px; border: 0; border-radius: 999px; background: #FFFFFF; color: var(--pp-ink); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
html body #miniAppOffersArea .of-card-actions button.danger { flex: 0 0 auto; padding: 0 14px; color: #A3163A; }

html body #miniAppOffersArea .of-pools { display: flex; flex-direction: column; gap: 14px; padding: 20px; border-radius: var(--pp-radius-card); background: #FFFFFF; box-shadow: var(--pp-shadow); }
html body #miniAppOffersArea .of-pools h3 { margin: 0; font-size: 18px; font-weight: 700; }
html body #miniAppOffersArea .of-pool { display: flex; flex-direction: column; gap: 6px; }
html body #miniAppOffersArea .of-pool > span { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
html body #miniAppOffersArea .of-pool strong { overflow: hidden; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; }
html body #miniAppOffersArea .of-pool > span small { flex: 0 0 auto; color: var(--pp-muted); font-size: 12.5px; }
html body #miniAppOffersArea .of-pool i { display: block; height: 10px; overflow: hidden; border-radius: 999px; background: var(--pp-grey-bg); }
html body #miniAppOffersArea .of-pool b { display: block; height: 100%; border-radius: 999px; }
html body #miniAppOffersArea .of-pool b.ok { background: #12805A; }
html body #miniAppOffersArea .of-pool b.mid { background: var(--pp-violet); }
html body #miniAppOffersArea .of-pool b.low { background: #C0395F; }
html body #miniAppOffersArea .of-pool > small { color: var(--pp-muted); font-size: 12px; font-weight: 600; }
html body #miniAppOffersArea .of-pool > small.warn { color: #8C1D3A; }
html body #miniAppOffersArea .of-unused { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; padding: 16px; border: 0; border-radius: 11px; background: var(--pp-peach-bg); color: #4A1D0A; font: inherit; text-align: left; cursor: pointer; }
html body #miniAppOffersArea .of-unused strong { font-size: 14px; }
html body #miniAppOffersArea .of-unused span { font-size: 12.5px; line-height: 1.5; }
html body #miniAppOffersArea .of-muted { margin: 0; color: var(--pp-muted); font-size: 13px; }

@media (max-width: 1280px) {
  html body #miniAppOffersArea .of-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  html body #miniAppOffersArea .of-layout { grid-template-columns: 1fr; }
  html body :is(#miniAppOffersArea, #miniAppPromotionsArea, #miniAppGamesArea) .of-header { flex-wrap: wrap; }
  html body :is(#miniAppOffersArea, #miniAppPromotionsArea, #miniAppGamesArea) .of-header .section-title-block { flex: 0 1 auto; width: 100%; min-width: 0; }
}
@media (max-width: 780px) {
  html body :is(#miniAppOffersArea, #miniAppPromotionsArea, #miniAppGamesArea) .of-tabbar { flex-wrap: wrap; }
  html body :is(#miniAppOffersArea, #miniAppPromotionsArea, #miniAppGamesArea) .of-tabs { width: 100%; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  html body :is(#miniAppOffersArea, #miniAppPromotionsArea, #miniAppGamesArea) .of-tabs button { padding: 0 10px; }
  html body :is(#miniAppOffersArea, #miniAppPromotionsArea, #miniAppGamesArea) .of-action-slot { width: 100%; min-height: 0; height: auto; padding: 8px 0; }
  html body :is(#miniAppOffersArea, #miniAppPromotionsArea, #miniAppGamesArea) .of-action-slot .primary-button { width: 100%; justify-content: center; }
  html body #miniAppOffersArea .of-grid { grid-template-columns: 1fr; }
  html body #miniAppOffersArea .of-tools :is(.search-box, .select-control) { flex: 1 1 100%; }
}

/* ===== Trang Biểu mẫu theo thiết kế 10 (đổi hình thức; khung soạn giữ cấu trúc cũ) =====
   Thẻ biểu mẫu: đang chọn nền tím; nhãn Đang chạy (bạc hà) / Nháp (vàng); "Ghi vào: bảng"; 3 số lượt mở / đã gửi / hoàn tất.
   Khung soạn: tab dạng viên thuốc, thành phần theo nhóm màu (Zalo bạc hà · dữ liệu tím · nội dung đào), điện thoại viền tối. */
html body #miniAppFormsArea .bm-header { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; padding: 0; border: 0; background: transparent; box-shadow: none; }
html body #miniAppFormsArea .bm-header p { margin: 0; color: var(--pp-muted); font-size: 14px; }
html body #miniAppFormsArea .bm-header .primary-button { margin-left: auto; height: 46px; padding: 0 22px; }
html body #miniAppFormsArea .dynamic-page-sidebar { border: 0; border-radius: var(--pp-radius-card); background: transparent; box-shadow: none; padding: 0; }
html body #miniAppFormsArea .dynamic-page-sidebar-head { border: 0; padding: 0 4px 4px; }
html body #miniAppFormsArea .dynamic-page-sidebar-head strong { font-size: 15px; }
html body #miniAppFormsArea .dynamic-page-sidebar-head small { color: var(--pp-muted); font-size: 12.5px; }
html body #miniAppFormsArea .dynamic-page-list { gap: 12px; }
html body #miniAppFormsArea .dynamic-page-list .dynamic-form-card { min-height: 0; gap: 10px; padding: 16px; border: 0; border-radius: 13px; background: #FFFFFF; color: var(--pp-ink); box-shadow: var(--pp-shadow); transform: none; }
html body #miniAppFormsArea .dynamic-page-list .dynamic-form-card:hover { box-shadow: 0 0 0 2px #CFC3FF; }
html body #miniAppFormsArea .dynamic-page-list .dynamic-form-card.active { background: var(--pp-violet); color: #FFFFFF; }
html body #miniAppFormsArea .dynamic-form-card-top strong { overflow: hidden; font-size: 16px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
html body #miniAppFormsArea .dynamic-form-card-top em { flex: 0 0 auto; padding: 3px 9px; border-radius: 999px; background: var(--pp-butter-bg); color: var(--pp-butter-fg); font-size: 11.5px; }
html body #miniAppFormsArea .dynamic-form-card-top em.live { background: var(--pp-mint-bg); color: var(--pp-mint-fg); }
html body #miniAppFormsArea .dynamic-form-card-copy i { margin: 0; color: inherit; font-size: 12.5px; }
html body #miniAppFormsArea .dynamic-form-card-copy small { color: inherit; font-size: 11.5px; opacity: .7; }
html body #miniAppFormsArea .dynamic-form-card-stats { padding: 0; border: 0; }
html body #miniAppFormsArea .dynamic-form-card-stats > span { text-align: left; }
html body #miniAppFormsArea .dynamic-form-card-stats > span + span { border: 0; }
html body #miniAppFormsArea .dynamic-form-card-stats b { color: inherit; font-size: 18px; font-weight: 750; }
html body #miniAppFormsArea .dynamic-form-card-stats small { color: inherit; font-size: 11.5px; opacity: .8; }
html body #miniAppFormsArea .dynamic-page-list .dynamic-form-card-actions > button { min-height: 36px; border: 0; border-radius: 999px; background: var(--pp-subtle); color: var(--pp-ink); font-size: 12.5px; font-weight: 700; }
html body #miniAppFormsArea .dynamic-page-list .dynamic-form-card.active .dynamic-form-card-actions > button { background: rgba(255, 255, 255, .9); }
html body #miniAppFormsArea .dynamic-page-list .dynamic-form-card-actions .dynamic-form-card-open { background: var(--pp-violet-soft); color: var(--pp-violet-pressed); }
html body #miniAppFormsArea .dynamic-page-welcome { border: 0; border-radius: var(--pp-radius-card); }

html body #miniAppFormsArea .dynamic-page-builder { border: 0; border-radius: var(--pp-radius-card); box-shadow: var(--pp-shadow); }
html body #miniAppFormsArea .dynamic-builder-head { border: 0; }
html body #miniAppFormsArea .dynamic-builder-head strong { font-size: 20px; font-weight: 700; }
html body #miniAppFormsArea .dynamic-builder-back { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--pp-subtle); }
html body #miniAppFormsArea .dynamic-builder-head :is(.secondary-button, .primary-button) { height: 44px; padding: 0 20px; border-radius: 999px; }
html body #miniAppFormsArea .dynamic-builder-head .secondary-button { border: 0; background: var(--pp-violet-soft); }
html body #miniAppFormsArea .dynamic-builder-tabs { gap: 4px; width: max-content; max-width: 100%; margin: 0 16px 12px; padding: 4px; border: 0; border-radius: 999px; background: var(--pp-subtle); overflow-x: auto; }
html body #miniAppFormsArea .dynamic-builder-tabs button { height: 34px; padding: 0 14px; border-radius: 999px; color: var(--pp-ink-2); font-size: 13px; font-weight: 600; }
html body #miniAppFormsArea .dynamic-builder-tabs button.active { background: #FFFFFF; color: var(--pp-ink); font-weight: 700; box-shadow: 0 1px 4px rgba(60, 40, 140, .12); }
html body #miniAppFormsArea .dynamic-builder-tabs button.active::after { display: none; }
html body #miniAppFormsArea .dynamic-component-palette button { border: 0; border-radius: 10px; }
html body #miniAppFormsArea .dynamic-palette-group:nth-of-type(1) button { background: var(--pp-mint-bg); color: var(--pp-mint-fg); }
html body #miniAppFormsArea .dynamic-palette-group:nth-of-type(2) button { background: var(--pp-lilac-bg); color: var(--pp-lilac-fg); }
html body #miniAppFormsArea .dynamic-palette-group:nth-of-type(3) button { background: var(--pp-peach-bg); color: var(--pp-peach-fg); }
html body #miniAppFormsArea .dynamic-component-palette button b { border: 0; border-radius: 7px; background: rgba(255, 255, 255, .75); color: inherit; }
html body #miniAppFormsArea .dynamic-component-palette button:hover { box-shadow: 0 0 0 2px rgba(108, 71, 255, .25); }
html body #miniAppFormsArea .dynamic-phone-preview { background: var(--pp-subtle); }
html body #miniAppFormsArea .dynamic-phone-frame { border-color: var(--pp-ink); border-radius: 26px; background: #FBFAFF; box-shadow: 0 16px 34px rgba(60, 40, 140, .16); }
html body #miniAppFormsArea .dynamic-phone-status i { background: var(--pp-ink); }
html body #miniAppFormsArea :is(.dynamic-control-section, .dynamic-layer-item) { border: 0; border-radius: 10px; background: var(--pp-subtle); }
html body #miniAppFormsArea .dynamic-layer-item.active { background: var(--pp-violet-soft); box-shadow: inset 0 0 0 2px var(--pp-violet); }
html body #miniAppFormsArea .dynamic-layer-select b { border-radius: 6px; background: #FFFFFF; color: var(--pp-violet-pressed); }
html body #miniAppFormsArea .dynamic-inspector-delete { border: 0; border-radius: 999px; background: var(--pp-rose-bg); color: var(--pp-rose-fg); }
@media (max-width: 780px) {
  html body #miniAppFormsArea .bm-header { flex-wrap: wrap; }
  html body #miniAppFormsArea .bm-header .primary-button { width: 100%; margin-left: 0; justify-content: center; }
}

/* ===== Trang Báo cáo theo thiết kế 12 =====
   Bộ lọc gọn trên đầu (OA, chiến dịch, phạm vi, khoảng thời gian dạng nút) · 5 thẻ số liệu màu
   · Tin gửi mỗi ngày (tím = thành công, cam = lỗi) · vòng tròn tỷ trọng tin gửi theo OA · bảng so sánh chiến dịch. */
html body #reports-view .rp-header { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 16px; padding: 0; border: 0; background: transparent; box-shadow: none; }
html body #reports-view .rp-header p { margin: 0; color: var(--pp-muted); font-size: 14px; }
html body #reports-view .rp-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 0 auto; padding: 0; border: 0; background: transparent; box-shadow: none; }
html body #reports-view .rp-filters .select-control { width: auto; height: 42px; border: 0; border-radius: 999px; background-color: #FFFFFF; font-weight: 600; }
html body #reports-view .rp-period-select { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); opacity: 0; pointer-events: none; }
html body #reports-view .rp-period { display: flex; padding: 4px; border-radius: 999px; background: #FFFFFF; }
html body #reports-view .rp-period button { height: 34px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: var(--pp-ink-2); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
html body #reports-view .rp-period button.active { background: var(--pp-violet); color: #FFFFFF; font-weight: 700; }
html body #reports-view .rp-filters .text-button { color: var(--pp-muted); font-weight: 600; }
html body #reports-view .rp-export { display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--pp-ink); color: #FFFFFF; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
html body #reports-view .rp-export .app-icon { width: 16px; height: 16px; }

html body #reports-view .rp-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
html body #reports-view .rp-kpis article { display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 4px; min-height: 0; padding: 14px 16px; border: 0; border-radius: 11px; box-shadow: none; }
html body #reports-view .rp-kpis small { color: inherit; font-size: 13px; font-weight: 600; }
html body #reports-view .rp-kpis strong { margin: 0; color: inherit; font-size: 28px; font-weight: 750; line-height: 1.1; }
html body #reports-view .rp-kpis em { margin: 0; color: inherit; font-size: 12.5px; font-weight: 600; opacity: .85; white-space: normal; }
html body #reports-view .rp-kpis .lilac { background: var(--pp-lilac-bg); color: #2E1D86; }
html body #reports-view .rp-kpis .mint { background: var(--pp-mint-bg); color: #0B3D28; }
html body #reports-view .rp-kpis .butter { background: var(--pp-butter-bg); color: #4A3600; }
html body #reports-view .rp-kpis .sky { background: var(--pp-sky-bg); color: #163A78; }
html body #reports-view .rp-kpis .peach { background: var(--pp-peach-bg); color: #4A1D0A; }

html body #reports-view .rp-card { min-width: 0; padding: 20px 22px; border: 0; border-radius: var(--pp-radius-card); background: #FFFFFF; box-shadow: var(--pp-shadow); }
html body #reports-view .rp-card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
html body #reports-view .rp-card-head h3 { margin: 0; font-size: 18px; font-weight: 700; }
html body #reports-view .rp-card-head > strong { margin-left: auto; color: var(--pp-muted); font-size: 13px; }
html body #reports-view .aggregate-legend { margin-left: auto; color: var(--pp-ink-2); font-size: 12.5px; }
html body #reports-view .aggregate-legend i { width: 12px; height: 12px; border-radius: 4px; }
html body #reports-view .aggregate-legend i.success { background: var(--pp-violet); }
html body #reports-view .aggregate-legend i.failed { background: #FF9C7A; }
html body #reports-view .rp-charts { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; margin-bottom: 16px; }
html body #reports-view .aggregate-trend-chart { display: flex; align-items: flex-end; gap: 8px; min-height: 230px; padding: 0; border: 0; background: transparent; }
html body #reports-view .aggregate-day { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; }
html body #reports-view .aggregate-day > strong { color: var(--pp-muted); font-size: 11px; }
html body #reports-view .aggregate-bar { display: flex; flex-direction: column; gap: 3px; width: 100%; max-width: 30px; height: auto; border: 0; background: transparent; }
html body #reports-view .aggregate-bar i { display: block; width: 100%; border-radius: 4px; }
html body #reports-view .aggregate-bar i.success { background: var(--pp-violet); }
html body #reports-view .aggregate-bar i.failed { background: #FF9C7A; }
html body #reports-view .aggregate-day > span { color: var(--pp-muted); font-size: 11px; }
html body #reports-view .aggregate-chart-empty { display: grid; place-items: center; width: 100%; min-height: 200px; color: var(--pp-muted); }
html body #reports-view .rp-donut { display: flex; justify-content: center; margin-bottom: 10px; }
html body #reports-view .rp-donut text { fill: var(--pp-ink); font-size: 24px; font-weight: 750; }
html body #reports-view .aggregate-oa-list { display: flex; flex-direction: column; gap: 6px; }
html body #reports-view .rp-oa { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--pp-ink); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; box-shadow: none; }
html body #reports-view .rp-oa:hover { background: var(--pp-subtle); }
html body #reports-view .rp-oa.selected { background: var(--pp-violet-soft); }
html body #reports-view .rp-oa i { width: 12px; height: 12px; flex: 0 0 auto; border-radius: 4px; }
html body #reports-view .rp-oa span { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

html body #reports-view .rp-table { width: 100%; min-width: 0; table-layout: fixed; border-collapse: separate; border-spacing: 0 4px; }
html body #reports-view .rp-table :is(th, td) { padding: 8px 12px; border: 0; background: transparent; vertical-align: middle; }
html body #reports-view .rp-table th { color: var(--pp-muted); font-size: 12px; font-weight: 700; letter-spacing: .05em; text-align: left; text-transform: uppercase; }
html body #reports-view .rp-table td { background: #FBFAFF; font-size: 14px; }
html body #reports-view .rp-table td:first-child { border-radius: 8px 0 0 8px; }
html body #reports-view .rp-table td:last-child { border-radius: 0 8px 8px 0; }
html body #reports-view .rp-table td strong { display: block; overflow: hidden; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
html body #reports-view .rp-table td small { display: block; color: var(--pp-muted); font-size: 12px; }
html body #reports-view .rp-table :is(th, td):nth-child(2), html body #reports-view .rp-table :is(th, td):nth-child(3) { width: 100px; }
html body #reports-view .rp-table :is(th, td):nth-child(4) { width: 26%; }
html body #reports-view .rp-table :is(th, td):nth-child(5) { width: 120px; }
html body #reports-view .rp-table :is(th, td):nth-child(6) { width: 90px; }
html body #reports-view .rp-num { text-align: right !important; font-variant-numeric: tabular-nums; }
html body #reports-view .rp-rate { display: flex; align-items: center; gap: 8px; }
html body #reports-view .rp-rate i { display: block; flex: 1; height: 8px; overflow: hidden; border-radius: 999px; background: var(--pp-grey-bg); }
html body #reports-view .rp-rate u { display: block; height: 100%; border-radius: 999px; background: var(--pp-violet); text-decoration: none; }
html body #reports-view .rp-rate u.high { background: #12805A; }
html body #reports-view .rp-rate b { width: 40px; font-size: 13px; }
html body #reports-view .rp-table .status-badge { padding: 4px 10px; border: 0; font-size: 12px; font-weight: 700; }
html body #reports-view .rp-table .status-badge::before { display: none; }
html body #reports-view .rp-table .status-badge.success { background: var(--pp-mint-bg); color: var(--pp-mint-fg); }
html body #reports-view .rp-table .status-badge.failed { background: var(--pp-rose-bg); color: var(--pp-rose-fg); }
html body #reports-view .rp-table .status-badge.draft { background: var(--pp-butter-bg); color: var(--pp-butter-fg); }
html body #reports-view .rp-table .zbs-row-action { border: 0; border-radius: 999px; background: var(--pp-violet-soft); color: var(--pp-violet-pressed); font-weight: 700; }

@media (max-width: 1280px) {
  html body #reports-view .rp-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  html body #reports-view .rp-filters { margin-left: 0; }
}
@media (max-width: 1050px) {
  html body #reports-view .rp-charts { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  html body #reports-view .rp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html body #reports-view .rp-filters :is(.select-control, .rp-period, .rp-export) { flex: 1 1 100%; }
  html body #reports-view .rp-period button { flex: 1; padding: 0 6px; }
  html body #reports-view .rp-export { justify-content: center; }
  html body #reports-view .rp-table { min-width: 780px; }
  html body #reports-view .rp-card { padding: 16px; }
  html body #reports-view .rp-card-head { flex-wrap: wrap; gap: 6px 14px; }
  html body #reports-view .aggregate-legend { margin-left: 0; }
  html body #reports-view .aggregate-trend-chart { gap: 3px; min-height: 200px; }
  html body #reports-view .aggregate-day { min-width: 0; }
  html body #reports-view .aggregate-day > strong { font-size: 9.5px; }
  html body #reports-view .aggregate-day > span { font-size: 9px; writing-mode: vertical-rl; transform: rotate(180deg); }
}

/* ---------- Bảng Dữ liệu: làm lại giao diện bảng (khách hàng chọn phương án A, 29/09/2026) ---------- */
html body #datahub-view #dataHubRecordsTable { border-collapse: separate; border-spacing: 0; }
/* Dòng tiêu đề nổi bật: nền tím nhạt, chữ đậm màu tối, viền dưới tím; cùng một nền cho mọi cột kể cả 2 cột cố định bên trái */
html body #datahub-view #dataHubRecordsTable thead th { height: 46px; background: #EEE9FF; color: #2A2350; font-size: 13px; font-weight: 700; white-space: nowrap; border-bottom: 2px solid #CFC2FF; }
/* Tiêu đề "Thao tác" cố định ở mép phải giống các ô bên dưới */
html body #datahub-view #dataHubRecordsTable th.datahub-actions-column { position: sticky; right: 0; z-index: 6; }
/* Dòng dữ liệu: nền trắng xen kẽ tím rất nhạt, rê chuột tô tím nhạt (áp dụng cả cột cố định) */
html body #datahub-view #dataHubRecordsTable tbody td { padding-top: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--pp-line); background: #FFFFFF; }
html body #datahub-view #dataHubRecordsTable tbody tr:nth-child(even) td { background: #FBFAFF; }
html body #datahub-view #dataHubRecordsTable tbody tr:hover td { background: #F4F0FF; }
/* Cột Row ID: bỏ chữ phụ "Row ID" lặp lại tên cột */
html body #datahub-view #dataHubRecordsTable .datahub-row-identity small { display: none; }

/* ---------- Chú thích icon menu khi thanh điều hướng thu gọn (app.js: initializeSidebarTooltips) ---------- */
.sidebar-tooltip {
  position: fixed; z-index: 1000; padding: 7px 11px; border-radius: 8px;
  background: #1F1A33; color: #FFFFFF; box-shadow: 0 10px 24px rgba(31, 26, 51, .22);
  font-size: 13px; font-weight: 600; line-height: 1.2; white-space: nowrap;
  transform: translate(-4px, -50%); opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .12s ease, transform .12s ease;
}
.sidebar-tooltip::before {
  content: ""; position: absolute; top: 50%; left: -5px; width: 10px; height: 10px;
  border-radius: 2px; background: inherit; transform: translateY(-50%) rotate(45deg);
}
.sidebar-tooltip.visible { opacity: 1; visibility: visible; transform: translate(0, -50%); }
@media (prefers-reduced-motion: reduce) { .sidebar-tooltip { transition: none; } }

/* ---------- Bảng Dữ liệu: tab, chọn nhiều dòng, sắp xếp, tab Trường dữ liệu, ngăn chi tiết (app.js: initializeDataHubTableUi) ---------- */
/* Tab Dữ liệu / Trường dữ liệu */
html body #datahub-view .dh-tabs { display: flex; align-items: center; gap: 4px; padding: 10px 16px 0; border-bottom: 1px solid var(--pp-line); }
html body #datahub-view .dh-tabs .dh-tree-toggle { width: 34px; height: 34px; margin: 0 8px 8px 0; border: 1px solid var(--pp-line-strong); background: #FFFFFF; color: var(--pp-ink-2); cursor: pointer; }
html body #datahub-view .dh-tabs .dh-tree-toggle .app-icon { transition: transform .15s ease; }
html body #datahub-view.dh-tree-collapsed .dh-tabs .dh-tree-toggle .app-icon { transform: scaleX(-1); }
html body #datahub-view .dh-tabs .dh-tree-toggle[data-tooltip]::after { left: 0; right: auto; transform: none; }
html body #datahub-view .dh-tab { display: inline-flex; align-items: center; gap: 6px; padding: 9px 12px 11px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--pp-muted); font: inherit; font-size: 14px; font-weight: 650; cursor: pointer; }
html body #datahub-view .dh-tab:hover { color: var(--pp-ink); }
html body #datahub-view .dh-tab.active { color: var(--pp-violet-pressed, #5A36F0); border-bottom-color: var(--pp-violet, #6C47FF); }
html body #datahub-view .dh-tab-count { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: #F0EEF5; color: var(--pp-muted); font-size: 11.5px; font-weight: 700; text-align: center; }
html body #datahub-view .dh-tab.active .dh-tab-count { background: #EEE9FF; color: var(--pp-violet-pressed, #5A36F0); }
html body #datahub-view .dh-tabs-meta { margin-left: auto; padding-bottom: 8px; color: var(--pp-muted); font-size: 12px; }

/* Thu gọn danh sách bảng: vùng bảng chiếm toàn bộ chiều ngang */
html body #datahub-view.dh-tree-collapsed .datahub-workspace { grid-template-columns: minmax(0, 1fr); }
html body #datahub-view.dh-tree-collapsed .datahub-tree-panel { display: none; }

/* Toàn màn hình */
html body #datahub-view .table-panel.dh-fullscreen { position: fixed; inset: 12px; z-index: 900; display: flex; flex-direction: column; margin: 0; overflow: hidden; box-shadow: 0 30px 80px rgba(31, 26, 51, .28); }
html body #datahub-view .table-panel.dh-fullscreen #dataHubDataPane:not([hidden]),
html body #datahub-view .table-panel.dh-fullscreen #dataHubFieldsPane:not([hidden]) { display: flex; flex: 1; min-height: 0; flex-direction: column; }
html body #datahub-view .table-panel.dh-fullscreen .table-wrap { flex: 1; max-height: none; }
body.dh-fullscreen-open { overflow: hidden; }

/* Nhãn điều kiện lọc / sắp xếp đang áp dụng */
html body #datahub-view .dh-filter-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 0 16px 10px; font-size: 12.5px; }
html body #datahub-view .dh-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 5px 4px 11px; border-radius: 999px; background: #EEE9FF; color: #2A2350; font-weight: 600; }
html body #datahub-view .dh-chip.is-sort { background: #DCEBFF; color: #1F4E96; }
html body #datahub-view .dh-chip button { display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: #FFFFFF; color: inherit; cursor: pointer; }
html body #datahub-view .dh-chip button .app-icon { width: 11px; height: 11px; }
html body #datahub-view .dh-chip-note { color: var(--pp-muted); font-weight: 600; }
html body #datahub-view .dh-chip-add { display: inline-flex; align-items: center; gap: 4px; padding: 4px 11px; border: 1px dashed #CFC2FF; border-radius: 999px; background: #FFFFFF; color: var(--pp-violet-pressed, #5A36F0); font: inherit; font-weight: 650; cursor: pointer; }
html body #datahub-view .dh-chip-add .app-icon { width: 12px; height: 12px; }

/* Thanh thao tác khi chọn nhiều dòng */
html body #datahub-view .dh-bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 16px 10px; padding: 8px 10px 8px 14px; border-radius: 12px; background: #1F1A33; color: #FFFFFF; font-size: 13px; }
html body #datahub-view .dh-bulk-bar[hidden] { display: none; }
html body #datahub-view .dh-bulk-bar strong { margin-right: 6px; }
html body #datahub-view .dh-bulk-bar button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border: 0; border-radius: 8px; background: rgba(255, 255, 255, .12); color: #FFFFFF; font: inherit; font-weight: 600; cursor: pointer; }
html body #datahub-view .dh-bulk-bar button:hover { background: rgba(255, 255, 255, .22); }
html body #datahub-view .dh-bulk-bar button .app-icon { width: 14px; height: 14px; }
html body #datahub-view .dh-bulk-bar .dh-bulk-clear { margin-left: auto; background: transparent; }

/* Lưới dữ liệu: tiêu đề dính khi cuộn dọc, cột chọn + 2 cột đầu ghim trái */
html body #datahub-view #dataHubRecordsTable thead th { position: sticky; top: 0; z-index: 5; }
html body #datahub-view #dataHubRecordsTable :is(th, td).dh-select-col { position: sticky; left: 0; z-index: 3; width: 44px; min-width: 44px; max-width: 44px; padding: 0; text-align: center; }
html body #datahub-view #dataHubRecordsTable thead th.dh-select-col { z-index: 8; }
html body #datahub-view #dataHubRecordsTable :is(th, td).datahub-sticky-col-1 { left: var(--dh-select-width, 44px); }
html body #datahub-view #dataHubRecordsTable :is(th, td).datahub-sticky-col-2 { left: calc(var(--dh-select-width, 44px) + var(--datahub-sticky-first-width, 128px)); }
html body #datahub-view #dataHubRecordsTable thead th:is(.datahub-sticky-col-1, .datahub-sticky-col-2, .datahub-actions-column) { z-index: 8; }
html body #datahub-view #dataHubRecordsTable input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: #6C47FF; cursor: pointer; }
html body #datahub-view #dataHubRecordsTable tbody tr { cursor: pointer; }
html body #datahub-view #dataHubRecordsTable tbody tr:focus-visible { outline: 2px solid #6C47FF; outline-offset: -2px; }
html body #datahub-view #dataHubRecordsTable tbody tr.is-selected td { background: #EAE3FF; }
html body #datahub-view #dataHubRecordsTable tbody tr.is-active td { background: #E4DCFF; }
html body #datahub-view #dataHubRecordsTable tbody tr.is-active td.dh-select-col { box-shadow: inset 3px 0 0 #6C47FF; }
html body #datahub-view #dataHubRecordsTable.dh-dense tbody td { padding-top: 7px; padding-bottom: 7px; }
html body #datahub-view #dataHubRecordsTable.dh-dense .customer-avatar { width: 24px; height: 24px; font-size: 10px; }
html body #datahub-view #dataHubRecordsTable .dh-num { text-align: right; font-variant-numeric: tabular-nums; }
html body #datahub-view #dataHubRecordsTable .dh-num .dh-sort-button { flex-direction: row-reverse; }
html body #datahub-view .dh-mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; letter-spacing: .01em; }
html body #datahub-view .dh-empty { color: #B3AEC4; }
html body #datahub-view .dh-row-id { font-variant-numeric: tabular-nums; }
html body #datahub-view .dh-bool { display: inline-block; padding: 2px 10px; border-radius: 999px; background: #F0EEF5; color: var(--pp-muted); font-size: 12px; font-weight: 650; }
html body #datahub-view .dh-bool.is-true { background: #D5F5E6; color: #12805A; }

/* Tiêu đề cột: biểu tượng kiểu dữ liệu + bấm để sắp xếp */
html body #datahub-view .dh-sort-button { display: flex; align-items: center; gap: 6px; width: 100%; min-width: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
html body #datahub-view .dh-sort-button .datahub-column-heading { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html body #datahub-view .dh-type-badge { display: inline-grid; flex: 0 0 auto; place-items: center; width: 18px; height: 18px; border-radius: 5px; background: #FFFFFF; color: #5A36F0; font-size: 10.5px; font-weight: 800; line-height: 1; }
html body #datahub-view .dh-sort-icon { flex: 0 0 auto; color: #6C47FF; font-size: 10px; opacity: .35; }
html body #datahub-view th.is-sorted .dh-sort-icon,
html body #datahub-view .dh-sort-button:hover .dh-sort-icon { opacity: 1; }

/* Tab Trường dữ liệu */
html body #datahub-view .dh-fields-tools { justify-content: space-between; }
html body #datahub-view .dh-fields-tools .search-box { flex: 0 1 360px; }
html body #datahub-view .dh-fields-table { width: 100%; min-width: 760px; border-collapse: separate; border-spacing: 0; }
html body #datahub-view .dh-fields-table thead th { position: sticky; top: 0; z-index: 2; height: 44px; padding: 0 14px; background: #EEE9FF; color: #2A2350; font-size: 13px; font-weight: 700; text-align: left; white-space: nowrap; border-bottom: 2px solid #CFC2FF; }
html body #datahub-view .dh-fields-table td { padding: 10px 14px; border-bottom: 1px solid var(--pp-line); background: #FFFFFF; vertical-align: middle; }
html body #datahub-view .dh-fields-table tbody tr:hover td { background: #F8F6FF; }
html body #datahub-view .dh-fields-table tr.is-hidden td:not(:nth-last-child(-n+2)) { opacity: .55; }
html body #datahub-view .dh-fields-table .dh-field-order { width: 90px; }
html body #datahub-view .dh-fields-table .dh-field-actions { width: 90px; text-align: center; }
html body #datahub-view .dh-field-name { display: inline-flex; align-items: center; gap: 8px; }
html body #datahub-view .dh-field-name .dh-type-badge { background: #EEE9FF; }
html body #datahub-view .dh-field-lock .app-icon { width: 13px; height: 13px; color: var(--pp-muted); }
html body #datahub-view .dh-field-code { padding: 2px 7px; border-radius: 6px; background: #F6F4FB; color: var(--pp-ink-2); font-size: 12.5px; }
html body #datahub-view .dh-field-index { color: var(--pp-muted); font-variant-numeric: tabular-nums; }
html body #datahub-view .dh-rule { display: inline-block; margin: 2px 4px 2px 0; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 650; white-space: nowrap; }
html body #datahub-view .dh-rule.tone-grey { background: #F0EEF5; color: #5E5877; }
html body #datahub-view .dh-rule.tone-lilac { background: #EEE9FF; color: #5A36F0; }
html body #datahub-view .dh-rule.tone-sky { background: #DCEBFF; color: #1F4E96; }
html body #datahub-view .dh-rule.tone-butter { background: #FFF1C7; color: #8A6300; }
html body #datahub-view .dh-field-switch { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border: 0; border-radius: 999px; background: #F0EEF5; color: var(--pp-muted); font: inherit; font-size: 12.5px; font-weight: 650; cursor: pointer; white-space: nowrap; }
html body #datahub-view .dh-field-switch i { position: relative; width: 30px; height: 18px; border-radius: 999px; background: #CFCAE0; transition: background .12s ease; }
html body #datahub-view .dh-field-switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #FFFFFF; transition: transform .12s ease; }
html body #datahub-view .dh-field-switch.is-on { background: #EEE9FF; color: #5A36F0; }
html body #datahub-view .dh-field-switch.is-on i { background: #6C47FF; }
html body #datahub-view .dh-field-switch.is-on i::after { transform: translateX(12px); }
html body #datahub-view .dh-field-switch.is-locked { padding-left: 10px; cursor: default; }
html body #datahub-view .dh-field-switch.is-locked .app-icon { width: 13px; height: 13px; }
html body #datahub-view .dh-field-switch:disabled { cursor: not-allowed; opacity: .6; }
html body #datahub-view .dh-field-delete:disabled { opacity: .3; cursor: not-allowed; }
html body #datahub-view .dh-fields-empty { padding: 28px; color: var(--pp-muted); text-align: center; }
html body #datahub-view .dh-fields-note { margin: 0; padding: 12px 16px 16px; color: var(--pp-muted); font-size: 12.5px; }

/* Ngăn chi tiết bên phải */
.dh-drawer-backdrop { position: fixed; inset: 0; z-index: 950; background: rgba(31, 26, 51, .28); }
.dh-drawer-backdrop[hidden] { display: none; }
.dh-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 951; display: flex; flex-direction: column; width: min(460px, 100vw); background: #FFFFFF; box-shadow: -24px 0 60px rgba(31, 26, 51, .20); color: #1F1A33; transform: translateX(105%); visibility: hidden; transition: transform .2s ease, visibility .2s; }
.dh-drawer.open { transform: none; visibility: visible; }
.dh-drawer-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid #ECE8F6; }
.dh-drawer-head > div:first-child { flex: 1; min-width: 0; }
.dh-drawer-path { margin: 0 0 4px; color: #6E6887; font-size: 12px; }
.dh-drawer-head h2 { margin: 0; overflow: hidden; font-size: 20px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.dh-drawer-sub { display: block; margin-top: 4px; color: #6E6887; font-size: 12.5px; }
.dh-drawer-nav { display: flex; gap: 6px; }
.dh-drawer .dh-tool-icon { position: relative; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid #DDD6F3; border-radius: 10px; background: #FFFFFF; color: #3B3556; cursor: pointer; }
.dh-drawer .dh-tool-icon:hover:not(:disabled) { background: #F4F0FF; }
.dh-drawer .dh-tool-icon:disabled { opacity: .35; cursor: default; }
.dh-drawer .dh-tool-icon .app-icon { width: 16px; height: 16px; }
.dh-drawer #dataHubDrawerPrev .app-icon { transform: rotate(180deg); }
.dh-drawer .dh-tool-icon[data-tooltip]:is(:hover, :focus-visible)::after { content: attr(data-tooltip); position: absolute; top: calc(100% + 6px); right: 0; z-index: 2; padding: 5px 9px; border-radius: 8px; background: #1F1A33; color: #FFFFFF; font-size: 12px; font-weight: 600; white-space: nowrap; }
.dh-drawer-body { flex: 1; overflow: auto; padding: 4px 20px 16px; }
.dh-kv-list { margin: 0; }
.dh-kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid #F1EEF8; font-size: 13.5px; }
.dh-kv dt { display: flex; align-items: center; gap: 7px; color: #6E6887; font-weight: 600; }
.dh-kv dt em { margin-left: 2px; padding: 1px 6px; border-radius: 999px; background: #F0EEF5; color: #8A849E; font-size: 10.5px; font-style: normal; font-weight: 650; }
.dh-kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.dh-kv .dh-type-badge { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; background: #EEE9FF; color: #5A36F0; font-size: 10.5px; font-weight: 800; }
.dh-kv .dh-empty { color: #B3AEC4; }
.dh-kv .dh-mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; }
.dh-kv .dh-bool { display: inline-block; padding: 2px 10px; border-radius: 999px; background: #F0EEF5; color: #6E6887; font-size: 12px; font-weight: 650; }
.dh-kv .dh-bool.is-true { background: #D5F5E6; color: #12805A; }
.dh-kv-extra { margin-top: 14px; }
.dh-kv-extra summary { color: #5A36F0; font-size: 13px; font-weight: 650; cursor: pointer; }
.dh-drawer-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid #ECE8F6; }
@media (max-width: 520px) { .dh-kv { grid-template-columns: 1fr; gap: 4px; } }
@media (prefers-reduced-motion: reduce) { .dh-drawer { transition: none; } }
/* Bảng Trường dữ liệu: vừa khung, tên/mã không xuống dòng, quy tắc được xuống dòng */
html body #datahub-view .dh-fields-wrap .dh-fields-table { min-width: 720px; }
html body #datahub-view .dh-fields-table :is(th, td) { min-width: 0; }
html body #datahub-view .dh-fields-table td:nth-child(2) { min-width: 180px; white-space: nowrap; }
html body #datahub-view .dh-fields-table td:nth-child(3),
html body #datahub-view .dh-fields-table td:nth-child(5) { white-space: nowrap; }
html body #datahub-view .dh-fields-table td:nth-child(4) { min-width: 150px; white-space: normal; }
html body #datahub-view .dh-fields-wrap .dh-fields-table th.dh-field-visibility { min-width: 0; }
html body #datahub-view .dh-field-title { display: flex; flex-direction: column; line-height: 1.25; }
html body #datahub-view .dh-field-title small { color: var(--pp-muted); font-size: 11.5px; font-weight: 500; }
html body #datahub-view .dh-fields-table .dh-field-order,
html body #datahub-view .dh-fields-table .dh-field-actions { width: 76px; min-width: 76px; }
html body #datahub-view .dh-fields-wrap .dh-fields-table :is(th, td):nth-last-child(2) { min-width: 0; width: 96px; }

/* ---------- Chiến dịch: điều kiện kích hoạt, lịch chạy, thời gian chạy, kịch bản mẫu ---------- */
html body .workflow-config-form .cmp-schedule-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
html body .workflow-config-form .cmp-weekdays,
html body .workflow-config-form .cmp-watch-fields { display: flex; flex-wrap: wrap; gap: 6px; }
html body .workflow-config-form :is(.cmp-weekdays, .cmp-watch-fields) label { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border: 1px solid var(--pp-line-strong); border-radius: 999px; background: #FFFFFF; color: var(--pp-ink-2); font-size: 12.5px; font-weight: 600; cursor: pointer; }
html body .workflow-config-form :is(.cmp-weekdays, .cmp-watch-fields) label.on { border-color: #CFC2FF; background: #EEE9FF; color: #5A36F0; }
html body .workflow-config-form :is(.cmp-weekdays, .cmp-watch-fields) input { position: absolute; opacity: 0; pointer-events: none; }
html body .workflow-config-form :is(.cmp-weekdays, .cmp-watch-fields) label:focus-within { outline: 2px solid #6C47FF; outline-offset: 1px; }
html body .workflow-config-form .cmp-rules { display: grid; gap: 8px; }
/* Khung cấu hình hẹp: dòng 1 chọn trường + nút xóa, dòng 2 phép so sánh + giá trị */
html body .workflow-config-form .cmp-rule { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .8fr) 30px; grid-template-areas: "field field remove" "operator value value"; align-items: center; gap: 6px; padding: 8px; border: 1px solid var(--pp-line); border-radius: 10px; background: #FBFAFF; }
html body .workflow-config-form .cmp-rule > [data-cond-field] { grid-area: field; }
html body .workflow-config-form .cmp-rule > [data-cond-operator] { grid-area: operator; }
html body .workflow-config-form .cmp-rule > :nth-child(3) { grid-area: value; }
html body .workflow-config-form .cmp-rule > [data-cond-remove] { grid-area: remove; }
html body .workflow-config-form .cmp-rule:has(> span:nth-child(3):empty) > [data-cond-operator] { grid-column: 1 / -1; }
html body .workflow-config-form .cmp-rule.is-missing { border-color: #F2C28B; background: #FFF8EC; }
html body .workflow-config-form .cmp-rule :is(select, input) { width: 100%; min-width: 0; }
html body .workflow-config-form .cmp-rule-value { display: flex; align-items: center; gap: 4px; min-width: 0; }
html body .workflow-config-form .cmp-rule-value em { color: var(--pp-muted); font-size: 12px; font-style: normal; }
html body .workflow-config-form .cmp-add-rule { justify-self: start; }
html body .workflow-config-form .cmp-muted { color: var(--pp-muted); font-size: 12.5px; }
html body .workflow-config-form .cmp-check { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
html body .workflow-config-form .cmp-check input { width: 16px; height: 16px; accent-color: #6C47FF; }

/* Thẻ chiến dịch: dòng lịch chạy / thời gian */
html body #campaigns-view .cp-schedule { display: inline-flex; align-items: center; gap: 6px; margin-top: 2px; color: #5A36F0; font-size: 12px; font-weight: 600; }
html body #campaigns-view .cp-schedule .app-icon { width: 13px; height: 13px; }

/* Kịch bản mẫu: lọc theo mục đích */
body .campaign-starter-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
body .campaign-starter-filters button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--pp-line-strong); border-radius: 999px; background: #FFFFFF; color: var(--pp-ink-2); font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; }
body .campaign-starter-filters button b { min-width: 20px; padding: 0 6px; border-radius: 999px; background: #F0EEF5; color: var(--pp-muted); font-size: 11px; }
body .campaign-starter-filters button.active { border-color: #1F1A33; background: #1F1A33; color: #FFFFFF; }
body .campaign-starter-filters button.active b { background: rgba(255, 255, 255, .18); color: #FFFFFF; }
body .campaign-starter-grid { max-height: min(460px, calc(100vh - 400px)); min-height: 200px; overflow: auto; padding-right: 2px; }

/* Khởi tạo chiến dịch: 2 tab "Nguồn kích hoạt" / "Kịch bản mẫu" */
body .campaign-source-step .cc-tabs { display: flex; gap: 4px; margin: 0 0 16px; border-bottom: 1px solid var(--pp-line); }
body .campaign-source-step .cc-tabs button { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px 12px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--pp-muted); font: inherit; font-size: 14.5px; font-weight: 650; cursor: pointer; }
body .campaign-source-step .cc-tabs button .app-icon { width: 17px; height: 17px; }
body .campaign-source-step .cc-tabs button:hover { color: var(--pp-ink); }
body .campaign-source-step .cc-tabs button.active { color: #5A36F0; border-bottom-color: #6C47FF; }
body .campaign-source-step .cc-tabs button b { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: #F0EEF5; color: var(--pp-muted); font-size: 11.5px; text-align: center; }
body .campaign-source-step .cc-tabs button.active b { background: #EEE9FF; color: #5A36F0; }
body .campaign-source-step .cc-pane[hidden] { display: none; }
body .campaign-source-step .cc-pane > .campaign-create-intro { margin-bottom: 12px; }
body .campaign-source-step .cc-template-tools { display: flex; margin: 0 0 10px; }
body .campaign-source-step .cc-template-tools .search-box { flex: 1; max-width: 420px; border-radius: 999px; }
body .campaign-source-step .cc-template-empty { margin: 12px 0 0; padding: 24px; border: 1px dashed var(--pp-line-strong); border-radius: 12px; color: var(--pp-muted); text-align: center; }
/* Mẫu công ty (Chủ hệ thống lưu từ chiến dịch): viền tím nhạt, nút sửa/xóa ở góc */
body .campaign-starter-grid button[data-campaign-template].company { border-color: #D9CCF5; background: linear-gradient(145deg, #FFFFFF, #FAF7FF); }
body .campaign-starter-grid button[data-campaign-template].company em { color: #6B4FD8; }
body .campaign-starter-filters button.company:not(.active) { border-color: #D9CCF5; color: #5B3FC4; background: #FAF7FF; }
body .campaign-starter-grid .cc-tpl-item { position: relative; display: grid; min-width: 0; }
body .campaign-starter-grid .cc-tpl-item > button[data-campaign-template] { padding-right: 64px; }
body .campaign-starter-grid .cc-tpl-actions { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; }
body .campaign-starter-grid .cc-tpl-actions button { width: 26px; height: 26px; display: grid; place-items: center; padding: 0; border: 1px solid var(--pp-line); border-radius: 8px; background: #FFFFFF; color: var(--pp-ink-2); cursor: pointer; }
body .campaign-starter-grid .cc-tpl-actions button:hover { border-color: #B9A6EE; color: #5B3FC4; }
body .campaign-starter-grid .cc-tpl-actions button.danger:hover { border-color: #F2B8B8; color: #C0392B; }
body .campaign-starter-grid .cc-tpl-actions .app-icon { width: 14px; height: 14px; }
body #campaignTemplateForm { display: grid; gap: 12px; }
body #campaignTemplateForm :is(select, textarea) { width: 100%; border: 1px solid var(--pp-line-strong); border-radius: 9px; background: #FFFFFF; color: var(--pp-ink); font: inherit; font-size: 12px; }
body #campaignTemplateForm select { height: 43px; padding: 0 12px; }
body #campaignTemplateForm textarea { min-height: 76px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
body #campaignTemplateForm :is(select, textarea):focus { border-color: #6C47FF; outline: none; box-shadow: 0 0 0 3px rgba(108, 71, 255, .12); }

/* ---------- Thêm / sửa trường Data Hub: ngăn 2 bước (phương án B) + hiển thị kiểu trường mới ---------- */
html body .dh-field-drawer { width: min(820px, 100vw); }
html body .dh-fd-steps { display: flex; gap: 6px; margin-top: 10px; }
html body .dh-fd-steps span { padding: 3px 10px; border-radius: 999px; background: #F1EFF6; color: var(--pp-muted); font-size: 12px; font-weight: 650; }
html body .dh-fd-steps span.is-on { background: var(--pp-violet); color: #FFFFFF; }
html body .dh-fd-body { padding: 16px 22px 20px; }
html body .dh-fd-foot { align-items: center; }
html body .dh-fd-foot .dh-fd-back { margin-right: auto; }
html body .dh-fd-error { color: #B3261E; font-size: 12.5px; font-weight: 600; }
html body .dh-fd-foot .dh-fd-error { flex: 1; text-align: right; }
html body .dh-fd-suggest { display: grid; gap: 8px; margin-bottom: 14px; padding: 12px; border: 1px solid var(--pp-line); border-radius: 12px; background: #FAF8FF; }
html body .dh-fd-suggest > strong { font-size: 13px; }
html body .dh-fd-chips { display: flex; flex-wrap: wrap; gap: 6px; }
html body .dh-fd-chips button { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--pp-line-strong); border-radius: 999px; background: #FFFFFF; color: var(--pp-ink-2); font: inherit; font-size: 12.5px; cursor: pointer; }
html body .dh-fd-chips button b { color: var(--pp-violet); font-size: 11px; }
html body .dh-fd-chips button.is-fn { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: #F7F5FF; }
html body .dh-fd-chips button:hover { border-color: var(--pp-violet); color: var(--pp-violet); }
html body .dh-fd-search { width: 100%; margin: 0; }
html body .dh-fd-search input { width: 100%; }
html body .dh-fd-groups { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
html body .dh-fd-groups button { padding: 5px 12px; border: 1px solid var(--pp-line-strong); border-radius: 999px; background: #FFFFFF; color: var(--pp-ink-2); font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; }
html body .dh-fd-groups button.is-on { border-color: #1F1A33; background: #1F1A33; color: #FFFFFF; }
html body .dh-fd-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
html body .dh-fd-card { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; align-items: start; padding: 12px; border: 1px solid var(--pp-line-strong); border-radius: 13px; background: #FFFFFF; color: var(--pp-ink); font: inherit; text-align: left; cursor: pointer; }
html body .dh-fd-card:hover, html body .dh-fd-card:focus-visible { border-color: var(--pp-violet); box-shadow: 0 6px 18px rgba(108, 71, 255, .12); outline: none; }
html body .dh-fd-card strong { display: block; font-size: 13.5px; }
html body .dh-fd-card small { display: block; color: var(--pp-muted); font-size: 12px; line-height: 1.4; }
html body .dh-fd-card em { display: block; margin-top: 4px; color: var(--pp-lilac-fg); font-size: 11.5px; font-style: normal; }
html body .dh-fd-glyph { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; font-size: 14px; font-weight: 800; }
html body .dh-fd-glyph.tone-grey { background: var(--pp-grey-bg); color: var(--pp-grey-fg); }
html body .dh-fd-glyph.tone-sky { background: var(--pp-sky-bg); color: var(--pp-sky-fg); }
html body .dh-fd-glyph.tone-mint { background: var(--pp-mint-bg); color: var(--pp-mint-fg); }
html body .dh-fd-glyph.tone-peach { background: var(--pp-peach-bg); color: var(--pp-peach-fg); }
html body .dh-fd-glyph.tone-lilac { background: var(--pp-lilac-bg); color: var(--pp-lilac-fg); }
html body .dh-fd-glyph.tone-butter { background: var(--pp-butter-bg); color: var(--pp-butter-fg); }
html body .dh-fd-glyph.tone-rose { background: var(--pp-rose-bg); color: var(--pp-rose-fg); }
html body .dh-fd-config { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 290px); gap: 18px; align-items: start; }
html body .dh-fd-main { display: grid; gap: 14px; min-width: 0; }
html body .dh-fd-side { position: sticky; top: 0; min-width: 0; }
html body .dh-fd-picked { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: #F4F0FF; }
html body .dh-fd-picked > div { flex: 1; min-width: 0; }
html body .dh-fd-picked strong { display: block; }
html body .dh-fd-picked small { color: var(--pp-muted); }
html body .dh-fd-field { display: grid; gap: 6px; min-width: 0; }
html body .dh-fd-field > span { color: var(--pp-ink-2); font-size: 12.5px; font-weight: 650; }
html body .dh-fd-field > span small { color: var(--pp-muted); font-weight: 500; }
html body .dh-fd-field :is(input, textarea), html body .dh-fd-paste, html body .dh-fd-option input { width: 100%; min-width: 0; padding: 0 11px; border: 1px solid var(--pp-line-strong); border-radius: 10px; background: #FFFFFF; color: var(--pp-ink); font: inherit; font-size: 13px; }
html body .dh-fd-field input, html body .dh-fd-option input { height: 38px; }
html body .dh-fd-field textarea, html body .dh-fd-paste { padding: 9px 11px; resize: vertical; line-height: 1.5; }
html body .dh-fd-field input[readonly] { background: #F7F5FF; color: var(--pp-muted); }
html body .dh-fd-field :is(input, textarea):focus, html body .dh-fd-paste:focus, html body .dh-fd-option input:focus { border-color: var(--pp-violet); outline: none; box-shadow: 0 0 0 3px rgba(108, 71, 255, .14); }
html body .dh-fd-settings { display: grid; gap: 12px; padding: 12px; border: 1px solid var(--pp-line); border-radius: 12px; background: #FAF8FF; }
html body .dh-fd-settings > strong { color: var(--pp-lilac-fg); font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; }
html body .dh-fd-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
html body .dh-fd-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
html body .dh-fd-seg { display: inline-flex; flex-wrap: wrap; justify-self: start; overflow: hidden; border: 1px solid var(--pp-line-strong); border-radius: 10px; background: #FFFFFF; }
html body .dh-fd-seg button { padding: 7px 12px; border: 0; background: transparent; color: var(--pp-ink-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
html body .dh-fd-seg button.is-on { background: var(--pp-violet); color: #FFFFFF; }
html body .dh-fd-check { display: flex; align-items: flex-start; gap: 8px; color: var(--pp-ink-2); font-size: 13px; }
html body .dh-fd-check input { margin-top: 3px; accent-color: var(--pp-violet); }
html body .dh-fd-note { margin: 0; color: var(--pp-muted); font-size: 12.5px; line-height: 1.5; }
html body .dh-fd-note.warning { padding: 8px 10px; border-radius: 10px; background: var(--pp-peach-bg); color: var(--pp-peach-fg); }
html body .dh-fd-readable { margin: -6px 0 0; color: var(--pp-ink-2); font-size: 12.5px; }
html body .dh-fd-readable:empty, html body p.dh-fd-error:empty { display: none; }
html body p.dh-fd-error { margin: -6px 0 0; }
html body .dh-fd-options { display: grid; gap: 6px; }
html body .dh-fd-option { display: grid; grid-template-columns: 30px minmax(0, 1fr) 30px 30px 30px; gap: 6px; align-items: center; }
html body .dh-fd-dot { width: 30px; height: 30px; border: 1px solid var(--pp-line-strong); border-radius: 50%; font-size: 14px; cursor: pointer; }
html body .dh-fd-mini { width: 30px; height: 30px; border: 1px solid var(--pp-line-strong); border-radius: 8px; background: #FFFFFF; color: var(--pp-ink-2); font-size: 12px; cursor: pointer; }
html body .dh-fd-mini:disabled { opacity: .35; cursor: default; }
html body .dh-fd-palette { grid-column: 1 / -1; display: flex; gap: 6px; padding: 6px; border: 1px solid var(--pp-line-strong); border-radius: 10px; background: #FFFFFF; }
html body .dh-fd-palette button { width: 26px; height: 26px; border: 1px solid var(--pp-line-strong); border-radius: 50%; font-size: 13px; cursor: pointer; }
html body .dh-fd-links { display: flex; flex-wrap: wrap; gap: 14px; }
html body .dh-fd-links button { padding: 2px 0; border: 0; background: none; color: var(--pp-violet); font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; }
html body .dh-fd-paste-ok { justify-self: start; }
html body .dh-fd-preview { display: grid; gap: 8px; padding: 12px; border: 1px dashed #CFC2FF; border-radius: 12px; background: #FFFFFF; }
html body .dh-fd-preview > strong { color: var(--pp-muted); font-size: 12px; }
html body .dh-fd-preview > small { color: var(--pp-muted); font-size: 11.5px; }
html body #dataHubFieldDrawer .dh-fd-preview table { width: 100%; min-width: 0; max-width: 100%; border-collapse: collapse; table-layout: fixed; }
html body .dh-fd-preview :is(th, td) { padding: 7px 8px; border-bottom: 1px solid var(--pp-line); font-size: 12.5px; text-align: left; overflow-wrap: anywhere; }
html body .dh-fd-preview th { background: #EEE9FF; color: #2A2350; font-weight: 700; }
html body .dh-fd-preview th .dh-type-badge { margin-right: 5px; }
@media (max-width: 760px) {
  html body .dh-fd-cards { grid-template-columns: 1fr 1fr; }
  html body .dh-fd-config { grid-template-columns: 1fr; }
  html body .dh-fd-side { position: static; }
  html body .dh-fd-row2, html body .dh-fd-row3 { grid-template-columns: 1fr; }
}
@media (max-width: 480px) { html body .dh-fd-cards { grid-template-columns: 1fr; } }

/* Ô dữ liệu theo kiểu mới */
html body .dh-option-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
html body .dh-option-chip { display: inline-flex; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap; }
html body .dh-stars { color: #F5A623; letter-spacing: 1px; white-space: nowrap; }
html body .dh-stars i { color: #DAD5E8; font-style: normal; }
html body .dh-link { color: var(--pp-violet); text-decoration: underline; text-underline-offset: 2px; }
html body .dh-files { display: inline-flex; flex-wrap: wrap; gap: 4px; }
html body .dh-file { padding: 2px 8px; border-radius: 8px; background: #F1EFF6; color: var(--pp-ink-2); font-size: 12px; text-decoration: none; }
html body .dh-longtext { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html body .dh-formula-error { color: #B3261E; font-size: 12px; font-weight: 600; }
html body .dh-sort-button.is-static { cursor: default; }
html body th.datahub-actions-column .dh-add-field-plus { width: 24px; height: 24px; margin-right: 8px; border: 1px dashed var(--pp-violet); border-radius: 8px; background: #FFFFFF; color: var(--pp-violet); font-size: 15px; font-weight: 700; line-height: 1; vertical-align: middle; cursor: pointer; }
html body th.datahub-actions-column .dh-add-field-plus:hover { border-style: solid; background: var(--pp-violet); color: #FFFFFF; }
html body .datahub-columns-add { justify-self: start; margin-top: 4px; }
/* Form bản ghi: chọn nhiều và ô chỉ đọc */
html body .dh-multi-field { margin: 0; padding: 0; border: 0; min-width: 0; }
html body .dh-multi-field legend { margin-bottom: 6px; padding: 0; color: var(--pp-ink-2); font-size: 12.5px; font-weight: 650; }
html body .dh-multi-field > div { display: flex; flex-wrap: wrap; gap: 6px; }
html body .dh-multi-option { position: relative; display: inline-flex; cursor: pointer; }
html body .dh-multi-option input { position: absolute; opacity: 0; pointer-events: none; }
html body .dh-multi-option span { padding: 5px 12px; border: 1px solid var(--pp-line-strong); border-radius: 999px; background: #FFFFFF; color: var(--pp-ink-2); font-size: 13px; font-weight: 600; }
html body .dh-multi-option input:checked + span { border-color: transparent; background: var(--opt-bg); color: var(--opt-fg); box-shadow: inset 0 0 0 1px var(--opt-fg); }
html body .dh-multi-option input:focus-visible + span { outline: 2px solid var(--pp-violet); outline-offset: 2px; }
html body .dh-readonly-field { display: flex; align-items: center; min-height: 42px; padding: 0 12px; border: 1px dashed var(--pp-line-strong); border-radius: 10px; background: #F7F5FF; color: var(--pp-muted); font-size: 13px; }

/* ---------- Biểu mẫu: thêm nhanh từ cột, lựa chọn lấy từ cột, xem trước kiểu mới ---------- */
html body .dynamic-palette-columns .dynamic-palette-hint { grid-column: 1 / -1; color: var(--pp-muted); font-size: 12px; line-height: 1.45; }
html body .dynamic-palette-columns button { border-style: dashed; }
html body .dynamic-column-options { display: grid; gap: 6px; }
html body .dynamic-column-options > span { color: var(--pp-ink-2); font-size: 12.5px; font-weight: 650; }
html body .dynamic-column-options > div { display: flex; flex-wrap: wrap; gap: 5px; }
html body .dynamic-column-options em { padding: 2px 9px; border-radius: 999px; background: var(--pp-lilac-bg); color: var(--pp-lilac-fg); font-size: 12px; font-style: normal; font-weight: 650; }
html body .dynamic-column-options small, html body .dynamic-inspector-note { margin: 0; color: var(--pp-muted); font-size: 12px; }
html body .dynamic-preview-chips { display: flex; flex-wrap: wrap; gap: 5px; border: 0 !important; background: none !important; padding: 0 !important; }
html body .dynamic-preview-chips i { padding: 4px 10px; border: 1px solid #D9D2F2; border-radius: 999px; background: #FFFFFF; font-size: 11px; font-style: normal; }
html body .dynamic-preview-stars { color: #F5A623; font-size: 18px; letter-spacing: 3px; border: 0 !important; background: none !important; padding: 0 !important; }

/* ---------- Biểu mẫu · giao diện A: banner, nhóm thẻ, nút gửi cố định, màn cảm ơn ---------- */
html body #dynamicPhonePreview { position: relative; }
html body #dynamicPhonePreview.has-sticky-submit { padding-bottom: 76px; }
html body .dynamic-preview-banner { display: block; width: calc(100% + 32px); max-width: none; margin: -16px -16px 12px; height: 128px; object-fit: cover; }
html body .dynamic-preview-banner.is-missing { display: grid; place-items: center; background: #F1EFF6; color: var(--pp-muted); font-size: 11px; }
html body .dynamic-preview-section { margin: 0 0 12px; padding: 12px 11px 2px; border-radius: 14px; background: #FFFFFF; box-shadow: 0 1px 3px rgba(20, 20, 60, .07); }
html body .dynamic-preview-section.is-plain { padding: 0; background: none; box-shadow: none; }
html body .dynamic-preview-section-title { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; color: #24364A; font-size: 12.5px; font-weight: 700; cursor: pointer; border-radius: 8px; }
html body .dynamic-preview-section-title i { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 6px; background: color-mix(in srgb, var(--dynamic-accent, #0068ff) 12%, #fff); color: var(--dynamic-accent, #0068ff); font-size: 10px; font-style: normal; }
html body .dynamic-preview-section-title.is-selected { outline: 2px solid var(--pp-violet); outline-offset: 3px; }
html body .dynamic-preview-sticky { position: sticky; bottom: 0; margin: 0 -16px -16px; padding: 10px 14px 14px; background: linear-gradient(transparent, rgba(255, 255, 255, .92) 35%); }
html body .dynamic-preview-sticky .dynamic-preview-submit { width: 100%; margin: 0; }
html body .dynamic-swatch-row { display: grid; gap: 6px; }
html body .dynamic-swatch-row > span { color: var(--pp-ink-2); font-size: 12.5px; font-weight: 650; }
html body .dynamic-swatch-row > div { display: flex; gap: 8px; }
html body .dynamic-swatch-row button { width: 28px; height: 28px; padding: 0; border: 2px solid #FFFFFF; border-radius: 50%; box-shadow: 0 0 0 1px var(--pp-line-strong); cursor: pointer; }
html body .dynamic-swatch-row button.active { box-shadow: 0 0 0 2px var(--pp-violet); }
html body .dynamic-inline-check { display: flex !important; flex-direction: row !important; align-items: flex-start; gap: 8px; }
html body .dynamic-inline-check input { width: auto !important; height: auto !important; margin-top: 3px; accent-color: var(--pp-violet); }
html body .dynamic-inline-check span { display: grid; gap: 2px; }
html body .dynamic-inline-check small, html body .dynamic-look-section label small, html body .dynamic-thanks-section label small { color: var(--pp-muted); font-size: 11.5px; font-weight: 500; }

/* ---------- Biểu mẫu · kênh truy cập dạng thẻ (phương án B) ---------- */
html body .dynamic-channels { display: grid; gap: 12px; margin-top: 16px; }
html body .dynamic-channels-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
html body .dynamic-channels-head h3 { margin: 0; font-size: 16px; }
html body .dynamic-channels-head small { color: var(--pp-muted); font-size: 12.5px; }
html body .dynamic-limit-rule { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--pp-line); border-radius: 12px; background: #FAF8FF; color: var(--pp-ink-2); font-size: 13px; }
html body .dynamic-limit-rule label { display: flex; align-items: center; gap: 6px; font-weight: 650; }
html body .dynamic-limit-rule input[type=checkbox] { accent-color: var(--pp-violet); }
html body .dynamic-limit-rule input[type=number] { width: 64px; height: 32px; padding: 0 8px; border: 1px solid var(--pp-line-strong); border-radius: 8px; text-align: center; font: inherit; }
html body .dynamic-channels-note { margin: 0; padding: 8px 12px; border-radius: 10px; background: var(--pp-butter-bg); color: var(--pp-butter-fg); font-size: 12.5px; }
html body .dynamic-channel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
html body .dynamic-channel-card { display: grid; gap: 10px; align-content: start; padding: 14px; border: 1px solid var(--pp-line); border-radius: 16px; background: #FFFFFF; box-shadow: var(--pp-shadow); }
html body .dynamic-channel-card.is-off { opacity: .62; }
html body .dynamic-channel-card header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
html body .dynamic-channel-card header strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
html body .dynamic-channel-switch { position: relative; flex: none; width: 38px; height: 22px; padding: 0; border: 0; border-radius: 999px; background: #D9D2F2; cursor: pointer; }
html body .dynamic-channel-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #FFFFFF; transition: left .15s; }
html body .dynamic-channel-switch.is-on { background: var(--pp-violet); }
html body .dynamic-channel-switch.is-on::after { left: 19px; }
html body .dynamic-channel-qr { justify-self: center; width: 132px; height: 132px; padding: 6px; border: 1px solid var(--pp-line); border-radius: 12px; background: #FFFFFF; }
html body .dynamic-channel-qr.is-missing { display: grid; place-items: center; color: var(--pp-muted); font-size: 11px; text-align: center; }
html body .dynamic-channel-meta { display: flex; flex-wrap: wrap; gap: 6px; }
html body .dynamic-channel-period { color: var(--pp-muted); font-size: 12px; }
html body .dynamic-channel-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; text-align: center; }
html body .dynamic-channel-stats span { padding: 6px; border-radius: 10px; background: #FAF8FF; }
html body .dynamic-channel-stats b { display: block; font-size: 15px; }
html body .dynamic-channel-stats small { color: var(--pp-muted); font-size: 11px; }
html body .dynamic-channel-card footer { display: flex; flex-wrap: wrap; gap: 6px; }
html body .dynamic-channel-card footer .compact { text-decoration: none; }
html body .dynamic-channel-card.is-add { min-height: 280px; place-items: center; align-content: center; gap: 4px; border: 2px dashed var(--pp-line-strong); background: transparent; box-shadow: none; color: var(--pp-violet); font: inherit; cursor: pointer; }
html body .dynamic-channel-card.is-add b { font-size: 26px; }
html body .dynamic-channel-card.is-add span { font-weight: 700; }
html body .dynamic-channel-card.is-add small { color: var(--pp-muted); }
html body .dynamic-channel-empty { padding: 20px; border: 1px dashed var(--pp-line-strong); border-radius: 12px; color: var(--pp-muted); text-align: center; }
html body .dynamic-channel-kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
html body .dynamic-channel-kinds label { display: flex; align-items: flex-start; gap: 8px; padding: 10px; border: 1px solid var(--pp-line-strong); border-radius: 12px; cursor: pointer; }
html body .dynamic-channel-kinds label:has(input:checked) { border-color: var(--pp-violet); background: #FAF8FF; }
html body .dynamic-channel-kinds input { margin-top: 3px; accent-color: var(--pp-violet); }
html body .dynamic-channel-kinds span { display: grid; gap: 2px; font-size: 13px; }
html body .dynamic-channel-kinds small { color: var(--pp-muted); font-size: 12px; }
html body .dynamic-channel-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
html body .dynamic-channel-dates label { display: grid; gap: 6px; }
html body .dynamic-channel-dates small { color: var(--pp-muted); font-size: 11.5px; }
@media (max-width: 560px) { html body .dynamic-channel-kinds, html body .dynamic-channel-dates { grid-template-columns: 1fr; } }
html body .dynamic-channel-chip { display: inline-flex; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap; }
html body .dynamic-channel-chip.tone-mint { background: var(--pp-mint-bg); color: var(--pp-mint-fg); }
html body .dynamic-channel-chip.tone-sky { background: var(--pp-sky-bg); color: var(--pp-sky-fg); }
html body .dynamic-channel-chip.tone-peach { background: var(--pp-peach-bg); color: var(--pp-peach-fg); }
html body .dynamic-channel-chip.tone-butter { background: var(--pp-butter-bg); color: var(--pp-butter-fg); }
html body .dynamic-channel-chip.tone-grey { background: var(--pp-grey-bg); color: var(--pp-grey-fg); }
html body .dynamic-channel-action { display: inline-flex; align-items: center; height: 30px; padding: 0 11px; border: 1px solid var(--pp-line-strong); border-radius: 999px; background: #FFFFFF; color: var(--pp-ink-2); font: inherit; font-size: 12.5px; font-weight: 650; text-decoration: none; white-space: nowrap; cursor: pointer; }
html body .dynamic-channel-action:hover { border-color: var(--pp-violet); color: var(--pp-violet); }

/* ---------- Nhập file 4 bước (phương án A) ---------- */
html body .data-import-modal { width: min(1000px, calc(100vw - 32px)); max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
html body .data-import-steps { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
html body .data-import-steps span { padding: 4px 11px; border-radius: 999px; background: #F1EFF6; color: var(--pp-muted); font-size: 12px; font-weight: 650; }
html body .data-import-steps span.is-on { background: var(--pp-violet); color: #FFFFFF; }
html body .data-import-steps span.is-done { background: var(--pp-lilac-bg); color: var(--pp-lilac-fg); }
html body .data-import-body { flex: 1; overflow: auto; padding: 4px 2px 8px; }
html body .data-import-foot { align-items: center; flex-wrap: wrap; }
html body .data-import-spacer { flex: 1; }
html body .data-import-drop { display: grid; place-items: center; gap: 6px; padding: 34px 16px; border: 2px dashed var(--pp-line-strong); border-radius: 16px; background: #FAF8FF; text-align: center; cursor: pointer; }
html body .data-import-drop:hover, html body .data-import-drop.is-over, html body .data-import-drop:focus-visible { border-color: var(--pp-violet); background: #F4F0FF; outline: none; }
html body .data-import-drop.is-loading { cursor: progress; opacity: .7; }
html body .data-import-drop strong { font-size: 15px; }
html body .data-import-drop small { color: var(--pp-muted); }
html body .data-import-tip { display: grid; gap: 6px; justify-items: start; margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--pp-butter-bg); color: var(--pp-butter-fg); font-size: 12.5px; }
html body .data-import-file { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 10px; padding: 10px 12px; border: 1px solid var(--pp-line); border-radius: 12px; background: #FAF8FF; font-size: 13px; }
html body .data-import-file small { color: var(--pp-muted); }
html body .data-import-file label { display: flex; align-items: center; gap: 6px; color: var(--pp-ink-2); }
html body .data-import-file select { height: 32px; padding: 0 8px; border: 1px solid var(--pp-line-strong); border-radius: 8px; background: #FFFFFF; font: inherit; }
html body .data-import-file [data-import-reset] { margin-left: auto; }
html body .data-import-action { display: inline-flex; align-items: center; min-height: 32px; padding: 4px 13px; border: 1px solid var(--pp-line-strong); border-radius: 999px; background: #FFFFFF; color: var(--pp-ink-2); font: inherit; font-size: 12.5px; font-weight: 650; line-height: 1.35; text-align: left; cursor: pointer; }
html body .data-import-action:hover { border-color: var(--pp-violet); color: var(--pp-violet); }
html body .data-import-pill { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; background: #F1EFF6; color: var(--pp-grey-fg); font-size: 12px; font-weight: 650; white-space: nowrap; }
html body .data-import-pill.is-strong { background: var(--pp-lilac-bg); color: var(--pp-lilac-fg); }
html body .data-import-pill.is-ok { background: var(--pp-mint-bg); color: var(--pp-mint-fg); }
html body .data-import-pill.is-new { background: var(--pp-lilac-bg); color: var(--pp-lilac-fg); }
html body .data-import-pill.is-update { background: var(--pp-sky-bg); color: var(--pp-sky-fg); }
html body .data-import-pill.is-skip { background: var(--pp-peach-bg); color: var(--pp-peach-fg); }
html body .data-import-pill.is-fix { background: var(--pp-butter-bg); color: var(--pp-butter-fg); }
html body .data-import-pill.is-bad { background: var(--pp-rose-bg); color: var(--pp-rose-fg); }
html body .data-import-lead { margin: 0 0 4px; color: var(--pp-muted); font-size: 12.5px; }
html body .data-import-map { display: grid; grid-template-columns: minmax(0, 1.1fr) 22px minmax(0, 1.4fr) minmax(0, .9fr); gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--pp-line); }
html body .data-import-source strong { display: block; }
html body .data-import-source small { display: block; overflow: hidden; color: var(--pp-muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
html body .data-import-arrow { color: var(--pp-muted); text-align: center; }
html body .data-import-map select, html body .data-import-newfield input { width: 100%; height: 36px; padding: 0 9px; border: 1px solid var(--pp-line-strong); border-radius: 10px; background: #FFFFFF; font: inherit; font-size: 13px; }
html body .data-import-newfield { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
html body .data-import-hint { display: block; margin-top: 4px; color: var(--pp-muted); font-size: 11.5px; }
html body .data-import-missing { display: grid; gap: 6px; margin-top: 14px; padding: 12px; border: 1px solid var(--pp-line); border-radius: 12px; background: #FAF8FF; font-size: 13px; }
html body .data-import-missing em { color: var(--pp-muted); font-size: 12px; font-style: normal; }
html body .data-import-missing em.is-danger { color: #B3261E; font-weight: 650; }
html body .data-import-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
html body .data-import-stats div { padding: 12px; border: 1px solid var(--pp-line); border-radius: 14px; background: #FAF8FF; }
html body .data-import-stats b { display: block; font-size: 22px; }
html body .data-import-stats small { color: var(--pp-muted); }
html body .data-import-stats .is-new b { color: var(--pp-mint-fg); }
html body .data-import-stats .is-update b { color: var(--pp-sky-fg); }
html body .data-import-stats .is-skip b { color: var(--pp-peach-fg); }
html body .data-import-stats .is-fix b { color: var(--pp-butter-fg); }
html body .data-import-box { display: grid; gap: 8px; margin-bottom: 12px; padding: 12px 14px; border: 1px solid var(--pp-line); border-radius: 14px; }
html body .data-import-box h4 { margin: 0; font-size: 14px; }
html body .data-import-box.is-clean { background: var(--pp-mint-bg); border-color: transparent; color: var(--pp-mint-fg); }
html body .data-import-box.is-campaign { border-color: #F7C7B0; background: #FFF7F2; }
html body .data-import-warn { color: var(--pp-peach-fg); }
html body .data-import-radio { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; }
html body .data-import-radio input { margin-top: 3px; accent-color: var(--pp-violet); }
html body .data-import-issue { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; }
html body .data-import-subhead { margin: 6px 0; font-size: 14px; }
html body .data-import-legend { margin-bottom: 8px; color: var(--pp-muted); font-size: 12px; }
html body .data-import-table { overflow: auto; border: 1px solid var(--pp-line); border-radius: 12px; }
html body #dataImportModal .data-import-table table { width: 100%; min-width: 0; border-collapse: separate; border-spacing: 0; }
html body .data-import-table :is(th, td) { padding: 8px 10px; border-bottom: 1px solid var(--pp-line); font-size: 12.5px; text-align: left; white-space: nowrap; }
html body .data-import-table th { position: static; background: #EEE9FF; color: #2A2350; font-weight: 700; }
html body .data-import-table td.is-fix { background: #FFF8E6; }
html body .data-import-table td.is-bad { background: #FFF1F1; color: #A09AB5; }
html body .data-import-table tr.is-skip td:not(:first-child):not(.data-import-reason) { color: #A09AB5; text-decoration: line-through; }
html body .data-import-reason { color: var(--pp-muted); font-size: 12px; }
html body .data-import-loading { padding: 40px; color: var(--pp-muted); text-align: center; }
html body .data-import-confirm { display: grid; gap: 2px; flex: 1; min-width: 240px; padding: 8px 12px; border-radius: 12px; background: #FFF1F1; color: #8C1D3A; font-size: 12.5px; }
html body .primary-button.is-danger { background: #C0392B; }
html body .data-import-result { display: grid; justify-items: center; gap: 6px; padding: 24px 12px; text-align: center; }
html body .data-import-result h3 { margin: 6px 0 0; }
html body .data-import-result p { margin: 0; color: var(--pp-ink-2); }
html body .data-import-result small { color: var(--pp-muted); }
html body .data-import-ok { width: 60px; height: 60px; display: grid; place-items: center; border-radius: 20px; background: #138552; color: #FFFFFF; font-size: 28px; }
html body .data-import-error { margin-bottom: 10px; }
@media (max-width: 760px) {
  html body .data-import-map { grid-template-columns: 1fr; }
  html body .data-import-arrow { display: none; }
  html body .data-import-stats { grid-template-columns: 1fr 1fr; }
}

/* Đổi tên Nhóm Hub / Data Hub / Table trong cây thư mục */
html body #datahub-view .dh-tree-actions { position: absolute; right: 4px; display: flex; gap: 4px; }
html body #datahub-view .dh-tree-actions .dh-tree-add { position: static; }
html body #datahub-view .dh-tree-row:focus-within .dh-tree-add { opacity: 1; }
html body #datahub-view .dh-tree-rename .app-icon { width: 13px; height: 13px; }
html body .dh-rename-note { margin: 0; padding: 8px 10px; border-radius: 8px; background: var(--pp-subtle); color: var(--pp-ink-2); font-size: 12.5px; }

/* Hạn mức tin ZBS hôm nay theo từng OA (trang Kết nối Zalo) */
html body #zalo-view .zc-oa-quota { display: flex; flex-direction: column; gap: 6px; width: 100%; font-size: 12.5px; }
html body #zalo-view .zc-oa-quota.tone-none { color: var(--pp-muted); }
html body #zalo-view .zc-oa-quota.tone-warn strong { color: var(--pp-peach-fg); }
html body #zalo-view .zc-oa-quota.tone-bad strong { color: var(--pp-rose-fg); }
html body #zalo-view .is-selected .zc-oa-quota, html body #zalo-view .is-selected .zc-oa-quota strong { color: #FFFFFF; }
html body #zalo-view .zc-quota-bar { display: block; width: 100%; height: 6px; overflow: hidden; border-radius: 999px; background: var(--pp-subtle); }
html body #zalo-view .zc-quota-bar i { display: block; height: 100%; border-radius: inherit; background: #12805A; }
html body #zalo-view .tone-warn .zc-quota-bar i, html body #zalo-view .zc-quota-main.tone-warn ~ .zc-quota-bar i { background: #D9822B; }
html body #zalo-view .tone-bad .zc-quota-bar i, html body #zalo-view .zc-quota-main.tone-bad ~ .zc-quota-bar i { background: #C0395F; }
html body #zalo-view .is-selected .zc-quota-bar { background: rgba(255, 255, 255, .3); }
html body #zalo-view .is-selected .zc-quota-bar i { background: #FFFFFF; }
html body #zalo-view .zc-quota { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; border-radius: 12px; background: var(--pp-subtle); }
html body #zalo-view .zc-quota[hidden] { display: none; }
html body #zalo-view .zc-quota .zc-quota-bar { background: #FFFFFF; height: 8px; }
html body #zalo-view .zc-quota-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
html body #zalo-view .zc-quota-head > span { display: flex; flex-direction: column; gap: 2px; }
html body #zalo-view .zc-quota-head strong { font-size: 14.5px; }
html body #zalo-view .zc-quota-head small, html body #zalo-view .zc-quota > small { color: var(--pp-muted); font-size: 12.5px; }
html body #zalo-view .zc-quota-head .secondary-button { flex: 0 0 auto; min-height: 34px; padding: 6px 14px; }
html body #zalo-view .zc-quota-main { display: flex; align-items: baseline; gap: 8px; }
html body #zalo-view .zc-quota-main strong { font-size: 26px; font-weight: 800; color: var(--pp-ink); }
html body #zalo-view .zc-quota-main.tone-warn strong { color: var(--pp-peach-fg); }
html body #zalo-view .zc-quota-main.tone-bad strong { color: var(--pp-rose-fg); }
html body #zalo-view .zc-quota-main span { color: var(--pp-ink-2); font-size: 13.5px; }
html body #zalo-view .zc-quota-empty { margin: 0; color: var(--pp-muted); font-size: 13px; }
html body #zalo-view .zc-quota-empty.is-error { color: var(--pp-rose-fg); }
html body #zalo-view .zc-quota-hint { margin: 0; padding: 8px 10px; border-radius: 8px; font-size: 12.5px; }
html body #zalo-view .zc-quota-hint.tone-warn { background: var(--pp-peach-bg); color: var(--pp-peach-fg); }
html body #zalo-view .zc-quota-hint.tone-bad { background: var(--pp-rose-bg); color: var(--pp-rose-fg); }

html body #templates-view .tp-oa-dot { display: inline-block; width: 9px; height: 9px; flex: 0 0 auto; margin-right: 4px; border-radius: 50%; vertical-align: 0; }
html body #templates-view .tp-oa-dot[hidden] { display: none; }
html body #templates-view .tp-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
html body #templates-view .tp-zero { color: #A39DB8; }
html body #templates-view .tp-name small.tp-approval b { color: var(--pp-ink, inherit); font-weight: 600; }
html body #templates-view .tp-name small .tp-oa-dot { width: 7px; height: 7px; margin-right: 3px; }
/* Mẫu tin ZBS · giao diện Zorbit (MKT chốt 22/10/2026): 4 thẻ thống kê + bảng 9 cột, lọc OA bằng ô chọn */
html body #templates-view .tp-eyebrow { display: block; margin: 0 0 4px; color: var(--pp-violet-pressed); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
html body #templates-view .tp-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 0 0 18px; }
html body #templates-view .tp-stats article { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 16px 18px; border-radius: var(--pp-radius-card); background: #FFFFFF; box-shadow: var(--pp-shadow); }
html body #templates-view .tp-stats small { color: var(--pp-ink-2); font-size: 13px; font-weight: 650; }
html body #templates-view .tp-stats strong { font-size: 28px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
html body #templates-view .tp-stats span { overflow: hidden; color: var(--pp-muted); font-size: 12.5px; white-space: nowrap; text-overflow: ellipsis; }
html body #templates-view .tp-list .tp-tabs { margin: 0 0 12px; }
html body #templates-view .tp-list .tp-tabs button { height: 36px; padding: 0 13px; background: var(--pp-subtle); }
html body #templates-view .tp-list .tp-tabs button.active { background: var(--pp-ink); }
html body #templates-view .tp-list .tp-tabs button[hidden] { display: none; }
html body #templates-view .zbs-template-table { min-width: 980px; }
html body #templates-view .zbs-template-table :is(th, td):nth-child(2) { width: 130px; }
html body #templates-view .zbs-template-table :is(th, td):nth-child(3) { width: 140px; }
html body #templates-view .zbs-template-table :is(th, td):nth-child(4) { width: 170px; }
html body #templates-view .zbs-template-table :is(th, td):nth-child(5),
html body #templates-view .zbs-template-table :is(th, td):nth-child(6) { width: 100px; }
html body #templates-view .zbs-template-table :is(th, td):nth-child(7) { width: 80px; }
html body #templates-view .zbs-template-table :is(th, td):nth-child(8) { width: 96px; }
html body #templates-view .zbs-template-table :is(th, td):nth-child(9) { width: 72px; }
html body #templates-view .tp-oa-cell { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
html body #templates-view .tp-price { font-weight: 700; }
html body #templates-view .tp-view-button { height: 30px; padding: 0 12px; border: 1px solid #DCD3FF; border-radius: 8px; background: var(--pp-violet-soft); color: var(--pp-violet-pressed); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
html body #templates-view .tp-row:hover .tp-view-button { background: var(--pp-violet); color: #FFFFFF; }
html body #templates-view .zbs-status.inactive { background: var(--pp-subtle); color: var(--pp-muted); }
html body #templates-view .tp-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 4px 0; color: var(--pp-muted); font-size: 13px; }
html body #templates-view .tp-pager[hidden] { display: none; }
html body #templates-view .tp-pager > div { display: flex; gap: 8px; }
html body #templates-view .tp-pager .secondary-button { height: 36px; padding: 0 14px; }
/* Hộp chi tiết mẫu: chiến dịch đang dùng mẫu (trước ở khung xem trước bên phải) */
html body #templatePreviewModal .zbs-status.inactive { background: var(--pp-subtle); color: var(--pp-muted); }
html body #templatePreviewModal .zbs-preview-usage { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; font-size: 13px; }
html body #templatePreviewModal .zbs-preview-usage > span { color: var(--pp-muted); }
html body #templatePreviewModal .tp-usage-link { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; border: 0; border-radius: 8px; background: var(--pp-subtle); color: var(--pp-violet-pressed); font: inherit; font-weight: 650; text-align: left; cursor: pointer; }
html body #templatePreviewModal .tp-usage-link small { flex: 0 0 auto; color: var(--pp-muted); font-weight: 500; }
html body #templatePreviewModal .tp-usage-link:hover { background: var(--pp-violet-soft); }
@media (max-width: 1100px) {
  html body #templates-view .tp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  html body #templates-view .tp-stats { grid-template-columns: 1fr; }
}

/* Trang đăng nhập · phương án A "Hai cột giới thiệu" (chốt 01/10/2026; chữ giới thiệu sẽ được khách sửa sau) */
html body .ag-gate { display: flex; align-items: stretch; padding: 0; overflow: auto; background: #FFFFFF; }
html body .ag-side { position: relative; flex: 1 1 55%; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; min-height: 100vh; padding: 44px 52px; overflow: hidden; color: #FFFFFF;
  background: radial-gradient(1200px 600px at -10% -20%, #8E6BFF 0, transparent 60%), radial-gradient(800px 500px at 120% 120%, #3E22C9 0, transparent 55%), linear-gradient(140deg, #6C47FF, #4B2FD6); }
html body .ag-brand { display: flex; align-items: center; gap: 12px; }
html body .ag-logo { display: block; width: 46px; height: 46px; flex: 0 0 auto; overflow: hidden; border-radius: 12px; background: #FFF7EA; box-shadow: 0 6px 16px rgba(20, 10, 80, .25); }
html body .ag-logo img { display: block; width: 100%; height: 100%; object-fit: cover; }
html body .ag-brand strong { display: block; font-size: 17px; }
html body .ag-brand small { display: block; color: rgba(255, 255, 255, .75); font-size: 12.5px; }
html body .ag-pitch { max-width: 520px; }
html body .ag-pitch h2 { margin: 0; font-size: clamp(28px, 3vw, 40px); line-height: 1.15; letter-spacing: -.02em; text-wrap: balance; }
html body .ag-pitch > p { max-width: 470px; margin: 14px 0 0; color: rgba(255, 255, 255, .84); font-size: 15.5px; line-height: 1.55; }
html body .ag-feats { display: grid; gap: 12px; max-width: 470px; margin: 26px 0 0; padding: 0; list-style: none; }
html body .ag-feats li { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, .1); }
html body .ag-feats b { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; border-radius: 10px; background: rgba(255, 255, 255, .18); }
html body .ag-feats b .app-icon { width: 17px; height: 17px; }
html body .ag-feats strong { display: block; font-size: 14px; }
html body .ag-feats small { color: rgba(255, 255, 255, .8); font-size: 12.5px; }
html body .ag-foot { margin: 0; color: rgba(255, 255, 255, .7); font-size: 12px; }
html body .ag-main { flex: 1 1 45%; display: flex; align-items: center; justify-content: center; padding: 40px; background: #FFFFFF; }
html body .ag-card { width: 100%; max-width: 380px; }
html body .ag-loading { padding: 24px 0; color: var(--pp-muted); font-size: 14px; }
html body .ag-form { display: flex; flex-direction: column; gap: 14px; }
html body .ag-form[hidden] { display: none; }
html body .ag-form h1 { margin: 0; font-size: 28px; line-height: 1.2; letter-spacing: -.01em; }
html body .ag-eyebrow { margin: 0 0 6px; color: var(--pp-violet); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
html body .ag-sub { margin: 6px 0 0; color: var(--pp-muted); font-size: 14px; line-height: 1.5; }
html body .ag-field { display: flex; flex-direction: column; gap: 6px; }
html body .ag-field[hidden] { display: none; }
html body .ag-field > span:first-child { color: var(--pp-ink-2); font-size: 13px; font-weight: 650; }
html body .ag-field small { color: var(--pp-muted); font-size: 12px; font-weight: 400; }
html body .ag-field .ag-caps { color: #9A3F18; font-weight: 650; }
html body .ag-input { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 6px 0 14px; border: 1.5px solid var(--pp-line-strong); border-radius: 12px; background: #FFFFFF; transition: border-color .15s, box-shadow .15s; }
html body .ag-input:focus-within { border-color: var(--pp-violet); box-shadow: 0 0 0 4px rgba(108, 71, 255, .14); }
html body .ag-input > .app-icon { width: 18px; height: 18px; flex: 0 0 auto; color: #8A84A3; }
html body .ag-input input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: transparent; box-shadow: none; color: var(--pp-ink); font: inherit; font-size: 15px; }
html body .ag-input input:focus { border: 0; box-shadow: none; }
html body .ag-eye { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 auto; padding: 0; border: 0; border-radius: 9px; background: transparent; color: #8A84A3; cursor: pointer; }
html body .ag-eye:hover { background: var(--pp-subtle); color: var(--pp-ink-2); }
html body .ag-eye .app-icon { width: 18px; height: 18px; }
html body .ag-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
html body .ag-check { display: flex; align-items: center; gap: 8px; color: var(--pp-ink-2); cursor: pointer; }
html body .ag-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--pp-violet); }
html body .ag-link { padding: 0; border: 0; background: none; color: var(--pp-violet); font: inherit; font-weight: 650; cursor: pointer; }
html body .ag-help { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--pp-subtle); color: var(--pp-ink-2); font-size: 13px; line-height: 1.5; }
html body .ag-help[hidden], html body .ag-alert[hidden] { display: none; }
html body .ag-alert { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--pp-rose-bg); color: var(--pp-rose-fg); font-size: 13px; line-height: 1.5; }
html body .ag-alert.is-lock { background: var(--pp-butter-bg); color: var(--pp-butter-fg); }
html body .ag-submit { width: 100%; height: 50px; margin-top: 2px; border-radius: 999px; font-size: 15px; font-weight: 700; box-shadow: 0 10px 24px rgba(108, 71, 255, .28); }
html body .ag-submit.is-loading { cursor: progress; opacity: .75; }
html body .ag-secure { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--pp-muted); font-size: 12px; }
html body .ag-secure i { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: #12805A; box-shadow: 0 0 0 3px rgba(18, 128, 90, .15); }
@media (max-width: 820px) {
  html body .ag-gate { flex-direction: column; }
  html body .ag-side { flex: 0 0 auto; min-height: 0; gap: 14px; padding: 24px 22px 26px; }
  html body .ag-pitch h2 { font-size: 24px; }
  html body .ag-pitch > p, html body .ag-feats, html body .ag-foot { display: none; }
  html body .ag-main { flex: 1 0 auto; align-items: flex-start; padding: 26px 22px 34px; }
}

/* Chiến dịch · phương án A: chọn OA trước (01/10/2026) */
html body #campaignLibraryView .cp-oa-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
html body #campaignLibraryView .cp-oa-rail { position: sticky; top: 100px; display: flex; flex-direction: column; gap: 10px; }
html body #campaignLibraryView .cp-oa-card { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; width: 100%; padding: 13px 14px; border: 0; border-radius: 13px; background: #FFFFFF; color: var(--pp-ink); box-shadow: var(--pp-shadow); font: inherit; text-align: left; cursor: pointer; }
html body #campaignLibraryView .cp-oa-card:hover { box-shadow: 0 0 0 2px #CFC3FF; }
html body #campaignLibraryView .cp-oa-card.is-selected { background: var(--pp-violet); color: #FFFFFF; box-shadow: none; }
html body #campaignLibraryView .cp-oa-card:focus-visible { outline: 2px solid var(--pp-violet); outline-offset: 2px; }
html body #campaignLibraryView .cp-oa-card-name { display: flex; align-items: center; gap: 6px; min-width: 0; width: 100%; }
html body #campaignLibraryView .cp-oa-card-name strong { overflow: hidden; font-size: 14.5px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
html body #campaignLibraryView .cp-oa-card-chips { display: flex; flex-wrap: wrap; gap: 5px; }
html body #campaignLibraryView .cp-chip { padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap; }
html body #campaignLibraryView .cp-chip.active { background: var(--pp-mint-bg); color: var(--pp-mint-fg); }
html body #campaignLibraryView .cp-chip.paused { background: var(--pp-peach-bg); color: var(--pp-peach-fg); }
html body #campaignLibraryView .cp-chip.draft { background: var(--pp-grey-bg); color: var(--pp-grey-fg); }
html body #campaignLibraryView .cp-oa-card.is-selected .cp-chip { background: rgba(255, 255, 255, .22); color: #FFFFFF; }
html body #campaignLibraryView .cp-oa-card-meta { display: flex; flex-direction: column; gap: 5px; width: 100%; color: var(--pp-muted); font-size: 12px; }
html body #campaignLibraryView .cp-oa-card.is-selected .cp-oa-card-meta { color: rgba(255, 255, 255, .88); }
html body #campaignLibraryView .cp-oa-bar, html body #campaignLibraryView .cp-bar { display: block; height: 5px; overflow: hidden; border-radius: 999px; background: var(--pp-subtle); }
html body #campaignLibraryView :is(.cp-oa-bar, .cp-bar) i { display: block; height: 100%; border-radius: inherit; background: #12805A; }
html body #campaignLibraryView .tone-warn .cp-oa-bar i, html body #campaignLibraryView .cp-bar.warn i { background: #D9822B; }
html body #campaignLibraryView .tone-bad .cp-oa-bar i, html body #campaignLibraryView .cp-bar.bad i { background: #C0395F; }
html body #campaignLibraryView .cp-oa-card.is-selected .cp-oa-bar { background: rgba(255, 255, 255, .3); }
html body #campaignLibraryView .cp-oa-card.is-selected .cp-oa-bar i { background: #FFFFFF; }
html body #campaignLibraryView .cp-oa-card-alert { color: #C0395F; font-size: 12px; font-weight: 700; }
html body #campaignLibraryView .cp-oa-card.is-selected .cp-oa-card-alert { color: #FFD9E1; }
html body #campaignLibraryView .cp-oa-dot { display: inline-block; width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; }
html body #campaignLibraryView .cp-oa-dot[hidden] { display: none; }
html body #campaignLibraryView .cp-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
html body #campaignLibraryView .cp-attention { padding: 14px 16px; border-radius: var(--pp-radius-card); background: #FFFFFF; box-shadow: var(--pp-shadow); }
html body #campaignLibraryView .cp-attention[hidden] { display: none; }
html body #campaignLibraryView .cp-attention-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-bottom: 10px; }
html body #campaignLibraryView .cp-attention-head b { padding: 1px 8px; border-radius: 999px; background: var(--pp-rose-bg); color: var(--pp-rose-fg); font-size: 12px; }
html body #campaignLibraryView .cp-attention-head small { color: var(--pp-muted); font-size: 12.5px; }
html body #campaignLibraryView .cp-attention-list { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
html body #campaignLibraryView .cp-attention-item { display: flex; flex: 0 0 auto; flex-direction: column; gap: 3px; width: 240px; padding: 10px 12px; border: 1px solid var(--pp-line); border-left: 4px solid #C0395F; border-radius: 12px; background: #FFFFFF; font: inherit; text-align: left; cursor: pointer; }
html body #campaignLibraryView .cp-attention-item.warn { border-left-color: #D9822B; }
html body #campaignLibraryView .cp-attention-item:hover { background: var(--pp-subtle); }
html body #campaignLibraryView .cp-attention-item strong { overflow: hidden; font-size: 13px; white-space: nowrap; text-overflow: ellipsis; }
html body #campaignLibraryView .cp-attention-item small { color: var(--pp-muted); font-size: 12px; }
html body #campaignLibraryView .cp-attention-item > span { display: flex; flex-wrap: wrap; gap: 4px; }
html body #campaignLibraryView .cp-panel { padding: 16px; border: 0; border-radius: var(--pp-radius-card); }
html body #campaignLibraryView .cp-oa-head-title { display: flex; align-items: center; gap: 8px; }
html body #campaignLibraryView .cp-oa-head-title strong { font-size: 19px; font-weight: 700; }
html body #campaignLibraryView .cp-oa-head-title .cp-oa-dot { width: 12px; height: 12px; }
html body #campaignLibraryView .cp-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
html body #campaignLibraryView .cp-kpis span { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 12px; background: var(--pp-subtle); }
html body #campaignLibraryView .cp-kpis strong { font-size: 20px; font-variant-numeric: tabular-nums; }
html body #campaignLibraryView .cp-kpis small { color: var(--pp-muted); font-size: 12px; }
html body #campaignLibraryView .cp-kpis .is-alert strong { color: #C0395F; }
html body #campaignLibraryView .cp-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
html body #campaignLibraryView .cp-tabs button { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 13px; border: 0; border-radius: 999px; background: var(--pp-subtle); color: var(--pp-ink-2); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
html body #campaignLibraryView .cp-tabs button.active { background: var(--pp-ink); color: #FFFFFF; }
html body #campaignLibraryView .cp-tabs b { padding: 0 7px; border-radius: 999px; background: #FFFFFF; color: var(--pp-violet-pressed); font-size: 12px; }
html body #campaignLibraryView .cp-tabs button.active b { background: var(--pp-violet); color: #FFFFFF; }
html body #campaignLibraryView .cp-table-wrap { position: relative; overflow-x: auto; }
html body #campaignLibraryView .cp-table { width: 100%; min-width: 600px; border-collapse: separate; border-spacing: 0 4px; table-layout: fixed; }
html body #campaignLibraryView .cp-table th { padding: 6px 8px; color: var(--pp-muted); font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-align: left; text-transform: uppercase; white-space: nowrap; }
html body #campaignLibraryView .cp-table :is(th, td):nth-child(2) { width: 92px; }
html body #campaignLibraryView .cp-table :is(th, td):nth-child(3) { width: 64px; }
html body #campaignLibraryView .cp-table :is(th, td):nth-child(4) { width: 100px; }
html body #campaignLibraryView .cp-table :is(th, td):nth-child(5) { width: 108px; }
html body #campaignLibraryView .cp-table :is(th, td):nth-child(6) { width: 76px; }
html body #campaignLibraryView .cp-table :is(th, td):nth-child(7) { width: 40px; }
html body #campaignLibraryView .cp-table td { padding: 10px 8px; background: transparent; font-size: 13.5px; vertical-align: middle; }
html body #campaignLibraryView .cp-row { cursor: pointer; }
html body #campaignLibraryView .cp-row td:first-child { border-radius: 9px 0 0 9px; }
html body #campaignLibraryView .cp-row td:last-child { border-radius: 0 9px 9px 0; }
html body #campaignLibraryView .cp-row:hover td { background: var(--pp-subtle); }
html body #campaignLibraryView .cp-row.selected td { background: var(--pp-violet-soft); }
html body #campaignLibraryView .cp-row:focus-visible { outline: 2px solid var(--pp-violet); outline-offset: -2px; }
html body #campaignLibraryView .cp-name { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
html body #campaignLibraryView .cp-name strong { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 14px; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }
html body #campaignLibraryView .cp-name small { display: flex; flex-wrap: wrap; gap: 4px 8px; color: var(--pp-muted); font-size: 12px; }
html body #campaignLibraryView .cp-oa-chip { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 1px 8px; border-radius: 999px; background: var(--pp-subtle); color: var(--pp-ink-2); font-size: 12px; font-weight: 600; white-space: nowrap; }
html body #campaignLibraryView .cp-row.selected .cp-oa-chip { background: #FFFFFF; }
html body #campaignLibraryView .cp-issue { display: inline-flex; align-self: flex-start; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; background: var(--pp-rose-bg); color: var(--pp-rose-fg); font-size: 12px; font-weight: 650; line-height: 1.4; }
html body #campaignLibraryView .cp-issue::before { content: "●"; font-size: 9px; }
html body #campaignLibraryView .cp-issue.warn { background: var(--pp-butter-bg); color: var(--pp-butter-fg); }
html body #campaignLibraryView .cp-issue.warn::before { content: "⚠"; font-size: 11px; }
html body #campaignLibraryView .cp-switch { position: relative; display: block; width: 38px; height: 22px; margin-bottom: 4px; padding: 0; border: 0; border-radius: 999px; background: #CFC8E4; cursor: pointer; transition: background .15s; }
html body #campaignLibraryView .cp-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: left .15s; }
html body #campaignLibraryView .cp-switch.on { background: #12805A; }
html body #campaignLibraryView .cp-switch.on::after { left: 19px; }
html body #campaignLibraryView .cp-switch:disabled { opacity: .45; cursor: not-allowed; }
html body #campaignLibraryView .cp-switch:focus-visible { outline: 2px solid var(--pp-violet); outline-offset: 2px; }
html body #campaignLibraryView .cp-table .status-badge { font-size: 11.5px; }
html body #campaignLibraryView .cp-num { padding-right: 12px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
html body #campaignLibraryView .cp-num small { display: block; color: var(--pp-muted); font-size: 11.5px; }
html body #campaignLibraryView .cp-budget { display: flex; flex-direction: column; gap: 4px; font-size: 12px; white-space: nowrap; }
html body #campaignLibraryView .cp-muted { color: #A39DB8; }
html body #campaignLibraryView .cp-when { color: var(--pp-ink-2); font-size: 12.5px; }
html body #campaignLibraryView .cp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
html body #campaignLibraryView .cp-empty { padding: 36px 16px; }
html body #campaignLibraryView .cp-side { position: sticky; top: 100px; display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: var(--pp-radius-card); background: #FFFFFF; box-shadow: var(--pp-shadow); }
html body #campaignLibraryView .cp-side-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 36px 8px; color: var(--pp-muted); text-align: center; }
html body #campaignLibraryView .cp-side-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
html body #campaignLibraryView .cp-side-head h3 { margin: 0; font-size: 17px; line-height: 1.3; overflow-wrap: anywhere; }
html body #campaignLibraryView .cp-facts { display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; font-size: 13px; }
html body #campaignLibraryView .cp-facts > span { color: var(--pp-muted); }
html body #campaignLibraryView .cp-facts > strong { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
html body #campaignLibraryView .cp-side .cp-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin: 0; font-size: 12px; }
html body #campaignLibraryView .cp-side .cp-flow span { padding: 3px 9px; border-radius: 8px; background: var(--pp-subtle); font-weight: 600; }
html body #campaignLibraryView .cp-side .cp-flow i { color: var(--pp-muted); font-style: normal; }
html body #campaignLibraryView .cp-minis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
html body #campaignLibraryView .cp-minis span { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 10px; background: var(--pp-subtle); }
html body #campaignLibraryView .cp-minis strong { font-size: 17px; font-variant-numeric: tabular-nums; }
html body #campaignLibraryView .cp-minis small, html body #campaignLibraryView .cp-side-block > small { color: var(--pp-muted); font-size: 12px; }
html body #campaignLibraryView .cp-side-block { display: flex; flex-direction: column; gap: 6px; }
html body #campaignLibraryView .cp-spark { display: flex; align-items: flex-end; gap: 3px; height: 46px; }
html body #campaignLibraryView .cp-spark i { flex: 1; border-radius: 3px 3px 0 0; background: #CFC3FF; }
html body #campaignLibraryView .cp-side-actions { display: flex; flex-wrap: wrap; gap: 8px; }
html body #campaignLibraryView .cp-side-actions .primary-button { flex: 1 1 100%; height: 44px; }
html body #campaignLibraryView .cp-side-actions .secondary-button { flex: 1 1 0; height: 40px; border: 0; background: var(--pp-violet-soft); }
html body #campaignLibraryView .cp-side-close { display: none; flex: 0 0 auto; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 9px; background: var(--pp-subtle); color: var(--pp-ink-2); cursor: pointer; place-items: center; }
html body #campaignLibraryView .cp-side-close .app-icon { width: 16px; height: 16px; }
@media (max-width: 1599px) {
  html body #campaignLibraryView .cp-oa-layout { grid-template-columns: 210px minmax(0, 1fr); }
  html body #campaignLibraryView .cp-side { position: fixed; top: 84px; right: 16px; z-index: 60; display: none; width: min(360px, calc(100vw - 32px)); max-height: calc(100vh - 100px); overflow-y: auto; box-shadow: 0 24px 60px rgba(40, 20, 110, .22); }
  html body #campaignLibraryView .cp-side.is-open { display: flex; }
  html body #campaignLibraryView .cp-side-close { display: grid; }
}
@media (max-width: 860px) {
  html body #campaignLibraryView .cp-oa-layout { grid-template-columns: minmax(0, 1fr); }
  html body #campaignLibraryView .cp-oa-rail { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  html body #campaignLibraryView .cp-oa-card { flex: 0 0 210px; }
  html body #campaignLibraryView .cp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Báo cáo · phương án B: chọn OA trước (01/10/2026) */
html body #reports-view .rp-oa-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
html body #reports-view .rp-oa-rail { position: sticky; top: 100px; display: flex; flex-direction: column; gap: 10px; }
html body #reports-view .rp-oa-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; width: 100%; padding: 13px 14px; border: 0; border-radius: 13px; background: #FFFFFF; color: var(--pp-ink); box-shadow: var(--pp-shadow); font: inherit; text-align: left; cursor: pointer; }
html body #reports-view .rp-oa-card:hover { box-shadow: 0 0 0 2px #CFC3FF; }
html body #reports-view .rp-oa-card.is-selected { background: var(--pp-violet); color: #FFFFFF; box-shadow: none; }
html body #reports-view .rp-oa-card:focus-visible { outline: 2px solid var(--pp-violet); outline-offset: 2px; }
html body #reports-view .rp-oa-card-name { display: flex; align-items: center; gap: 6px; min-width: 0; width: 100%; }
html body #reports-view .rp-oa-card-name strong { overflow: hidden; font-size: 14px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
html body #reports-view .rp-oa-card-cost { font-size: 19px; font-weight: 750; font-variant-numeric: tabular-nums; }
html body #reports-view .rp-oa-card small { color: var(--pp-muted); font-size: 12px; }
html body #reports-view .rp-oa-card.is-selected small { color: rgba(255, 255, 255, .85); }
html body #reports-view .rp-oa-dot { display: inline-block; width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; }
html body #reports-view .rp-oa-dot[hidden] { display: none; }
html body #reports-view .rp-main { min-width: 0; }
html body #reports-view .rp-oa-head { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
html body #reports-view .rp-oa-head strong { font-size: 20px; font-weight: 750; }
html body #reports-view .rp-oa-head .rp-oa-dot { width: 12px; height: 12px; }
html body #reports-view .rp-charts { grid-template-columns: minmax(0, 1fr) 340px; }
html body #reports-view .aggregate-bar.stacked { gap: 1px; }
html body #reports-view .aggregate-bar.stacked i { border-radius: 2px; }
html body #reports-view .aggregate-legend .rp-legend-oa { display: inline-flex; align-items: center; gap: 5px; margin-right: 8px; }
html body #reports-view .aggregate-legend .rp-legend-oa i { display: inline-block; width: 10px; height: 10px; margin: 0; border-radius: 3px; }
html body #reports-view .aggregate-legend .rp-legend-oa i.failed { background: #FF9C7A; }
html body #reports-view .rp-card-head-gap { margin-top: 18px; }
html body #reports-view .rp-card-head small { color: var(--pp-muted); font-size: 12.5px; }
html body #reports-view .rp-split { display: flex; height: 12px; overflow: hidden; border-radius: 999px; background: var(--pp-subtle); }
html body #reports-view .rp-split i { display: block; height: 100%; }
html body #reports-view :is(.rp-split, .rp-split-legend) i.uid { background: var(--pp-violet); }
html body #reports-view :is(.rp-split, .rp-split-legend) i.phone { background: #C9BCFF; }
html body #reports-view .rp-split-legend { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; font-size: 12.5px; color: var(--pp-ink-2); }
html body #reports-view .rp-split-legend span { display: flex; align-items: center; gap: 6px; }
html body #reports-view .rp-split-legend i { display: inline-block; width: 10px; height: 10px; flex: 0 0 auto; border-radius: 3px; }
html body #reports-view .rp-hint { margin: 8px 0 0; color: var(--pp-muted); font-size: 12px; line-height: 1.5; }
html body #reports-view .rp-reasons { display: flex; flex-direction: column; gap: 9px; }
html body #reports-view .rp-reason { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px; font-size: 13px; }
html body #reports-view .rp-reason span { min-width: 0; overflow-wrap: anywhere; }
html body #reports-view .rp-reason b { font-variant-numeric: tabular-nums; }
html body #reports-view .rp-reason i { grid-column: 1 / -1; display: block; height: 6px; border-radius: 999px; background: #C0395F; }
html body #reports-view .rp-reason.recipient i { background: #F2A7B8; }
html body #reports-view .rp-tag { padding: 1px 7px; border-radius: 999px; font-size: 11.5px; font-weight: 650; }
html body #reports-view .rp-tag.recipient { background: #FBE3E9; color: #8C1D3A; }
html body #reports-view .rp-tag.system { background: #C0395F; color: #FFFFFF; }
html body #reports-view .rp-oa-compare { margin-bottom: 16px; }
html body #reports-view .rp-oa-compare[hidden] { display: none; }
html body #reports-view .rp-compare-wrap { overflow-x: auto; }
html body #reports-view .rp-compare { width: 100%; min-width: 760px; }
html body #reports-view .rp-compare-row { cursor: pointer; }
html body #reports-view .rp-compare-row:hover td { background: var(--pp-subtle); }
html body #reports-view .rp-compare-name { display: inline-flex; align-items: center; gap: 7px; font-weight: 650; }
html body #reports-view .rp-compare td small { color: var(--pp-muted); font-size: 11.5px; }
html body #reports-view .rp-compare-total td { font-weight: 750; }
html body #reports-view .rp-rate { display: flex; align-items: center; gap: 8px; min-width: 130px; }
html body #reports-view .rp-rate > span:first-child { flex: 0 0 auto; min-width: 48px; font-variant-numeric: tabular-nums; }
html body #reports-view .rp-bar { display: block; flex: 1; height: 7px; overflow: hidden; border-radius: 999px; background: var(--pp-subtle); }
html body #reports-view .rp-bar i { display: block; height: 100%; border-radius: inherit; background: #12805A; }
html body #reports-view .rp-bar.warn i { background: #D9822B; }
@media (max-width: 1180px) {
  html body #reports-view .rp-charts { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  html body #reports-view .rp-oa-layout { grid-template-columns: minmax(0, 1fr); }
  html body #reports-view .rp-oa-rail { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  html body #reports-view .rp-oa-card { flex: 0 0 190px; }
}
html body #reports-view .rp-compare th { white-space: normal; line-height: 1.3; vertical-align: bottom; }
html body #reports-view .rp-range { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 4px 6px 4px 12px; border-radius: 999px; background: #FFFFFF; }
html body #reports-view .rp-range[hidden] { display: none; }
html body #reports-view .rp-range label { display: inline-flex; align-items: center; gap: 6px; color: var(--pp-muted); font-size: 13px; font-weight: 600; }
html body #reports-view .rp-range input { height: 34px; padding: 0 10px; border: 1px solid var(--pp-line-strong); border-radius: 999px; background: #FFFFFF; color: var(--pp-ink); font: inherit; font-size: 13.5px; }
html body #reports-view .rp-range input:focus { border-color: var(--pp-violet); outline: 0; box-shadow: 0 0 0 3px rgba(108, 71, 255, .14); }
html body #reports-view .aggregate-trend-chart { gap: 4px; }

/* Hộp xác nhận trong phần mềm (thay window.confirm) */
html body #appConfirmModal { z-index: 1200; }
html body .app-confirm { width: min(440px, calc(100vw - 32px)); padding: 22px 22px 18px; }
html body .app-confirm-body { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
html body .app-confirm-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto; border-radius: 12px; background: var(--pp-lilac-bg); color: var(--pp-lilac-fg); }
html body .app-confirm.is-danger .app-confirm-icon { background: var(--pp-rose-bg); color: var(--pp-rose-fg); }
html body .app-confirm-icon .app-icon { width: 20px; height: 20px; }
html body .app-confirm h2 { margin: 0 0 6px; font-size: 17px; line-height: 1.35; overflow-wrap: anywhere; }
html body .app-confirm p { margin: 0; color: var(--pp-ink-2); font-size: 14px; line-height: 1.55; white-space: pre-line; }
html body .app-confirm .modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin: 0; padding: 0; border: 0; }
html body .app-confirm .primary-button.is-danger { background: #C0395F; box-shadow: none; }
html body .app-confirm .primary-button.is-danger:hover { background: #A52E50; }

/* Bước Gửi ZBS: 3 mục, xem trước mẫu tin, ví dụ giá trị biến, hộp chọn mẫu (02/10/2026) */
html body .wf-sec { border: 1px solid var(--pp-line); border-radius: 12px; background: #FFFFFF; }
html body .wf-sec + .wf-sec { margin-top: 10px; }
html body .wf-sec > summary { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 12px; background: var(--pp-subtle); list-style: none; cursor: pointer; font-weight: 700; }
html body .wf-sec[open] > summary { border-radius: 12px 12px 0 0; }
html body .wf-sec > summary::-webkit-details-marker { display: none; }
html body .wf-sec > summary b { display: grid; place-items: center; width: 22px; height: 22px; flex: 0 0 auto; border-radius: 7px; background: var(--pp-violet); color: #FFFFFF; font-size: 12px; }
html body .wf-sec > summary span { flex: 0 0 auto; }
html body .wf-sec > summary small { min-width: 0; margin-left: auto; overflow: hidden; color: var(--pp-muted); font-size: 12px; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
html body .wf-sec > summary::after { content: "▾"; flex: 0 0 auto; color: var(--pp-muted); transition: transform .15s; }
html body .wf-sec:not([open]) > summary::after { transform: rotate(-90deg); }
html body .wf-sec-body { display: flex; flex-direction: column; gap: 12px; padding: 12px; }
html body .wf-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
/* Hộp hướng dẫn xử lý lỗi Zalo (showZaloError) */
html body .zalo-help-steps { display: grid; gap: 8px; margin: 4px 0 14px; padding-left: 22px; font-size: 13.5px; line-height: 1.5; }
html body .zalo-help-links { display: grid; gap: 6px; }
html body .zalo-help-links a { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }

/* Theo dõi phản hồi tin: thống kê ở đầu bước Gửi tin và ô link đích của "Link theo dõi lượt bấm" */
html body .wf-engage { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-bottom: 10px; padding: 10px 12px; border: 1px solid var(--pp-line); border-radius: 12px; font-size: 12.5px; color: var(--pp-muted); }
html body .wf-engage b { width: 100%; color: inherit; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
html body .wf-engage strong { color: var(--ink, inherit); font-size: 14px; }
html body .wf-track-box { display: grid; gap: 8px; margin-top: 10px; padding: 10px 12px; border: 1px dashed var(--pp-line-strong); border-radius: 12px; }
html body .wf-track-box label { display: grid; gap: 4px; }
html body .wf-tpl-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; color: var(--pp-muted); font-size: 12.5px; }
html body .wf-tpl-meta .zbs-status { padding: 3px 9px; border-radius: 999px; font-size: 12px; }
html body .wf-tpl-meta .zbs-status.approved { background: var(--pp-mint-bg); color: var(--pp-mint-fg); }
html body .wf-tpl-meta .zbs-status.review { background: var(--pp-sky-bg); color: var(--pp-sky-fg); }
html body .wf-tpl-meta .zbs-status.rejected { background: var(--pp-rose-bg); color: var(--pp-rose-fg); }
html body .wf-tpl-browse { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--pp-violet-soft); color: var(--pp-violet-pressed); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
html body .wf-tpl-browse .app-icon { width: 14px; height: 14px; }
html body .wf-tpl-browse:disabled { opacity: .5; cursor: not-allowed; }
html body .wf-tpl-preview { display: flex; flex-direction: column; gap: 10px; padding: 14px 12px; border-radius: 14px; background: #EEF2F8; }
html body .wf-tpl-preview .zbs-official-preview .zbs-preview-viewport { border-radius: 10px; }
html body .wf-var { padding: 0 3px; border-radius: 4px; background: #E7F0FF; color: #0050C8; font-weight: 650; }
html body .wf-var.is-missing { background: var(--pp-rose-bg); color: var(--pp-rose-fg); }
html body .wf-preview-rows { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin-top: 8px; font-size: 12.5px; }
html body .wf-preview-rows span:nth-child(odd) { color: #6B7280; }
html body .wf-sample select { width: 100%; }
html body .wf-map-row { display: grid !important; grid-template-columns: minmax(0, 120px) minmax(0, 1fr); gap: 4px 8px; align-items: center; padding: 8px; border-radius: 10px; background: var(--pp-subtle); }
html body .wf-map-row code { overflow: hidden; color: var(--pp-violet); font-size: 12px; font-weight: 700; text-overflow: ellipsis; }
html body .wf-map-row select { min-width: 0; }
html body .wf-map-row small { grid-column: 2; color: var(--pp-muted); font-size: 11.5px; overflow-wrap: anywhere; }
html body .wf-map-row.is-missing { background: #FFF4F6; }
html body .wf-map-row.is-missing small { color: var(--pp-rose-fg); font-weight: 600; }
html body .wf-map-row.is-missing select { border-color: #E8A3B5; }
/* Hộp chọn mẫu tin */
html body .wf-picker { display: grid; grid-template-columns: minmax(0, 1fr) 360px; grid-template-rows: minmax(0, 1fr); width: min(980px, calc(100vw - 32px)); height: min(88vh, 760px); max-height: calc(100dvh - 40px); padding: 0; overflow: hidden; }
html body .wf-picker-list { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
html body .wf-picker-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 18px 18px 8px; }
html body .wf-picker-head h2 { margin: 0; font-size: 18px; }
html body .wf-picker-head p { margin: 2px 0 0; color: var(--pp-muted); font-size: 13px; }
html body .wf-picker-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 0 18px 10px; border-bottom: 1px solid var(--pp-line); }
html body .wf-picker-tools .search-box { flex: 1 1 220px; }
html body .wf-picker-toggle { display: inline-flex; align-items: center; gap: 6px; color: var(--pp-ink-2); font-size: 13px; }
html body .wf-picker-items { display: flex; flex-direction: column; gap: 4px; flex: 1 1 auto; min-height: 0; padding: 8px; overflow-y: auto; overscroll-behavior: contain; }
html body .wf-picker-item { display: flex; flex-direction: column; gap: 3px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--pp-ink); font: inherit; text-align: left; cursor: pointer; }
html body .wf-picker-item:hover { background: var(--pp-subtle); }
html body .wf-picker-item.is-selected { background: var(--pp-violet-soft); box-shadow: inset 3px 0 0 var(--pp-violet); }
html body .wf-picker-item-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
html body .wf-picker-item-top strong { min-width: 0; overflow-wrap: anywhere; }
html body .wf-picker-item small { color: var(--pp-muted); font-size: 12px; }
html body :is(.wf-picker-item, .wf-picker-preview) .zbs-status { flex: 0 0 auto; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; }
html body :is(.wf-picker-item, .wf-picker-preview) .zbs-status::before { display: none; }
html body :is(.wf-picker-item, .wf-picker-preview) .zbs-status.approved { background: var(--pp-mint-bg); color: var(--pp-mint-fg); }
html body :is(.wf-picker-item, .wf-picker-preview) .zbs-status.review { background: var(--pp-sky-bg); color: var(--pp-sky-fg); }
html body :is(.wf-picker-item, .wf-picker-preview) .zbs-status.rejected { background: var(--pp-rose-bg); color: var(--pp-rose-fg); }
html body :is(.wf-picker-item, .wf-picker-preview) .zbs-status.draft { background: var(--pp-butter-bg); color: var(--pp-butter-fg); }
html body .wf-picker-empty { padding: 28px 14px; color: var(--pp-muted); text-align: center; }
html body .wf-picker-preview { display: flex; flex-direction: column; min-height: 0; overflow: hidden; background: var(--pp-subtle); }
html body .wf-picker-preview > .wf-picker-empty { margin: auto 0; }
html body .wf-picker-preview-body { display: flex; flex-direction: column; gap: 12px; flex: 1 1 auto; min-height: 0; padding: 18px; overflow-y: auto; overscroll-behavior: contain; }
html body .wf-picker-preview-foot { flex: 0 0 auto; padding: 12px 18px 16px; border-top: 1px solid var(--pp-line); background: var(--pp-subtle); }
html body .wf-picker-preview-foot .primary-button { width: 100%; }
html body .wf-picker-preview-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
html body .wf-picker-preview .tp-phone { display: flex; flex-direction: column; gap: 10px; width: 100%; padding: 16px 12px; border-radius: 16px; background: #EEF2F8; }
html body .wf-picker-params small { color: var(--pp-muted); font-size: 12px; }
html body .wf-picker-params > div { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
html body .wf-picker-params code { padding: 2px 7px; border-radius: 6px; background: var(--pp-lilac-bg); color: var(--pp-lilac-fg); font-size: 12px; font-weight: 700; }
html body .wf-picker-warning { margin: 0; color: var(--pp-rose-fg); font-size: 12.5px; }
html body .wf-picker-preview .primary-button { height: 44px; }
@media (max-width: 820px) {
  html body .wf-picker { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; height: auto; max-height: calc(100dvh - 24px); overflow-y: auto; }
  html body .wf-picker-list { overflow: visible; }
  html body .wf-picker-items { max-height: 40vh; }
  html body .wf-picker-preview { overflow: visible; }
  html body .wf-picker-preview-body { overflow: visible; }
  html body .wf-picker-preview-foot { position: sticky; bottom: 0; z-index: 1; box-shadow: 0 -6px 14px rgba(40, 24, 110, .08); }
}
html body #workflowConfigPanel .workflow-config-form { grid-template-columns: minmax(0, 1fr); }
html body .wf-sec { min-width: 0; }

/* ===== Trình thiết kế chiến dịch · chế độ toàn màn hình (phương án B, 02/10/2026) =====
   Khi mở một chiến dịch: ẩn thanh điều hướng và tiêu đề trang, đầu trang 1 hàng,
   sơ đồ bên trái, khung cấu hình ~một nửa bề rộng, nút thêm bước thành thanh nổi phía dưới sơ đồ. */
html body.workflow-focus .sidebar,
html body.workflow-focus .topbar { display: none; }
html body.workflow-focus { overflow: hidden; }
html body.workflow-focus #workflowBuilderView { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; width: auto; height: auto; max-height: none; margin: 0; min-height: 0; background: var(--bg); }
html body.workflow-focus #workflowBuilderView[hidden] { display: none; }
/* Đầu trang 1 hàng */
html body.workflow-focus #workflowBuilderView .workflow-toolbar { display: flex; flex-wrap: nowrap; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--pp-line); background: #FFFFFF; }
html body.workflow-focus #workflowBuilderView #workflowBackButton { flex: 0 0 auto; width: auto; height: 38px; padding: 0 14px; gap: 6px; white-space: nowrap; border: 1px solid var(--pp-line-strong); border-radius: 999px; font-size: 13.5px; font-weight: 650; }
html body.workflow-focus #workflowBuilderView #workflowBackButton .app-icon { width: 16px; height: 16px; }
html body.workflow-focus #workflowBuilderView .workflow-name-field { flex: 0 1 340px; min-width: 160px; margin: 0; }
html body.workflow-focus #workflowBuilderView .workflow-name-field > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
html body.workflow-focus #workflowBuilderView .workflow-name-control { display: flex; align-items: center; gap: 6px; }
html body.workflow-focus #workflowBuilderView .workflow-name-field input { min-height: 38px; height: 38px; padding: 0 10px; border: 1px solid transparent; border-radius: 10px; background: transparent; font-size: 17px; font-weight: 750; }
html body.workflow-focus #workflowBuilderView .workflow-name-field input:hover { border-color: var(--pp-line-strong); }
html body.workflow-focus #workflowBuilderView .workflow-name-field input:focus { border-color: var(--pp-violet); background: #FFFFFF; outline: 0; box-shadow: 0 0 0 3px rgba(108, 71, 255, .14); }
html body.workflow-focus #workflowBuilderView .workflow-name-control .secondary-button { height: 34px; padding: 0 12px; }
html body.workflow-focus #workflowBuilderView .workflow-context-tabs { display: flex; flex: 0 0 auto; gap: 2px; margin: 0; padding: 3px; border: 0; border-radius: 999px; background: var(--pp-subtle); }
html body.workflow-focus #workflowBuilderView .workflow-context-tabs button { height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: var(--pp-muted); font-size: 13px; font-weight: 650; white-space: nowrap; }
html body.workflow-focus #workflowBuilderView .workflow-context-tabs button.active { background: #FFFFFF; color: var(--pp-ink); box-shadow: 0 1px 3px rgba(60, 40, 140, .12); }
html body.workflow-focus #workflowBuilderView .workflow-toolbar-actions { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; margin-left: auto; }
html body.workflow-focus #workflowBuilderView .workflow-toolbar-actions :is(.secondary-button, .primary-button) { height: 38px; padding: 0 14px; font-size: 13.5px; }
html body.workflow-focus #workflowBuilderView .workflow-toolbar-actions .secondary-button { border: 1px solid var(--pp-line-strong); }
/* Vùng làm việc: sơ đồ | cấu hình */
html body.workflow-focus #workflowBuilderView .workflow-workspace { position: relative; display: grid; flex: 1; min-height: 0; grid-template-columns: minmax(0, 3fr) minmax(400px, 2fr); grid-template-rows: minmax(0, 1fr); grid-template-areas: "stage config"; overflow: hidden; }
html body.workflow-focus #workflowBuilderView .workflow-canvas-stage { grid-area: stage; position: relative; min-height: 0; height: auto; }
html body.workflow-focus #workflowBuilderView .workflow-config { grid-area: config; max-height: none; height: auto; min-height: 0; margin: 0; overflow-y: auto; border-left: 1px solid var(--pp-line); border-radius: 0; padding: 16px 18px 24px; }
/* Thanh thêm bước nổi phía dưới sơ đồ */
html body.workflow-focus #workflowBuilderView .workflow-palette { grid-area: stage; align-self: end; justify-self: center; z-index: 5; display: flex; flex-wrap: nowrap; gap: 2px; max-width: calc(100% - 24px); margin: 0 0 14px; padding: 6px; overflow-x: auto; border-radius: 16px; background: #FFFFFF; box-shadow: 0 14px 40px rgba(40, 20, 110, .18); }
html body.workflow-focus #workflowBuilderView .workflow-palette > div { display: none; }
html body.workflow-focus #workflowBuilderView .workflow-palette > button { flex-direction: column; justify-content: center; gap: 3px; height: auto; min-width: 66px; padding: 6px 8px; border-radius: 11px; background: transparent !important; color: var(--pp-ink-2) !important; font-weight: 650; }
html body.workflow-focus #workflowBuilderView .workflow-palette > button strong { font-size: 11.5px; white-space: nowrap; }
html body.workflow-focus #workflowBuilderView .workflow-palette > button strong::before { content: ""; }
html body.workflow-focus #workflowBuilderView .workflow-palette > button b { width: 30px; height: 30px; border-radius: 9px; }
html body.workflow-focus #workflowBuilderView .workflow-palette > button[data-workflow-type="condition"] b { background: var(--pp-butter-bg); color: var(--pp-butter-fg); }
html body.workflow-focus #workflowBuilderView .workflow-palette > button[data-workflow-type="send"] b { background: var(--pp-lilac-bg); color: var(--pp-lilac-fg); }
html body.workflow-focus #workflowBuilderView .workflow-palette > button[data-workflow-type="delay"] b { background: var(--pp-sky-bg); color: var(--pp-sky-fg); }
html body.workflow-focus #workflowBuilderView .workflow-palette > button[data-workflow-type="update"] b { background: var(--pp-mint-bg); color: var(--pp-mint-fg); }
html body.workflow-focus #workflowBuilderView .workflow-palette > button[data-workflow-type="customer_action"] b { background: var(--pp-peach-bg); color: var(--pp-peach-fg); }
html body.workflow-focus #workflowBuilderView .workflow-palette > button[data-workflow-type="gamification"] b { background: var(--pp-rose-bg); color: var(--pp-rose-fg); }
html body.workflow-focus #workflowBuilderView .workflow-palette > button[data-workflow-type="offer"] b { background: var(--pp-lilac-bg); color: var(--pp-lilac-fg); }
html body.workflow-focus #workflowBuilderView .workflow-palette > button[data-workflow-type="end"] b { background: var(--pp-grey-bg); color: var(--pp-grey-fg); }
html body.workflow-focus #workflowBuilderView .workflow-palette > button:hover { background: var(--pp-subtle) !important; box-shadow: none; filter: none; }
html body.workflow-focus #workflowBuilderView .workflow-palette.connecting { box-shadow: 0 0 0 2px var(--pp-violet), 0 14px 40px rgba(40, 20, 110, .18); }
html body.workflow-focus #workflowBuilderView.read-only .workflow-palette { display: none; }
/* Nút thu phóng lên góc trên phải của sơ đồ để không đè thanh thêm bước */
html body.workflow-focus #workflowBuilderView .workflow-viewport-controls { top: 12px; right: 12px; bottom: auto; }
html body.workflow-focus #workflowBuilderView .workflow-pan-hint { display: none; }
@media (max-width: 1100px) {
  html body.workflow-focus #workflowBuilderView .workflow-toolbar { flex-wrap: wrap; }
  html body.workflow-focus #workflowBuilderView .workflow-toolbar-actions { flex-wrap: wrap; margin-left: 0; }
}
@media (max-width: 860px) {
  html body.workflow-focus { overflow: auto; }
  html body.workflow-focus #workflowBuilderView { position: static; min-height: 100vh; }
  html body.workflow-focus #workflowBuilderView .workflow-workspace { display: flex; flex-direction: column; overflow: visible; }
  html body.workflow-focus #workflowBuilderView .workflow-canvas-stage { height: 62vh; min-height: 420px; }
  html body.workflow-focus #workflowBuilderView .workflow-palette { position: sticky; bottom: 10px; order: 2; align-self: center; }
  html body.workflow-focus #workflowBuilderView .workflow-config { order: 3; border-left: 0; border-top: 1px solid var(--pp-line); overflow: visible; }
  html body.workflow-focus .main-content, html body.workflow-focus .view { margin: 0; padding: 0; }
}

/* Canh cột số (02/10/2026): tiêu đề cột số canh phải và cùng khoảng đệm với con số bên dưới.
   Quy tắc tiêu đề bảng (th) cụ thể hơn lớp .tp-num / .cp-num nên trước đây tiêu đề vẫn canh trái. */
html body #templates-view .zbs-template-table th.tp-num { text-align: right; }
html body #campaignLibraryView .cp-table :is(th, td).cp-num { padding-right: 12px; text-align: right; }

/* ---------- Biểu mẫu · trình thiết kế phương án A (khách hàng chọn 02/10/2026) ----------
   Bỏ tab Luồng (thay bằng dòng tóm tắt). Thiết kế 3 cột: thành phần dạng hàng gọn · điện thoại có thanh công cụ trên mục đang chọn ·
   khung phải chia 3 tab. Lưu dữ liệu dạng bảng chữ lớn. Chia sẻ & QR: 1 thẻ đường dẫn + giới hạn, kênh QR dạng bảng. Đặc tả: docs/dac-ta-bieu-mau.md */
html body #miniAppFormsArea .bm-flowline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -6px 16px 12px 66px; color: var(--pp-muted); font-size: 12.5px; }
html body #miniAppFormsArea .bm-flowline span { padding: 4px 11px; border-radius: 999px; background: var(--pp-subtle); color: var(--pp-ink-2); font-weight: 600; }
html body #miniAppFormsArea .bm-flowline span.is-warn { background: var(--pp-rose-bg); color: var(--pp-rose-fg); }
html body #miniAppFormsArea .bm-flowline em { color: #B3ACCB; font-style: normal; }
html body #miniAppFormsArea .bm-tabs button { height: 36px; padding: 0 16px; font-size: 14px; }
html body #miniAppFormsArea .bm-tab-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--pp-rose-bg); color: var(--pp-rose-fg); font-size: 11.5px; font-weight: 750; }
html body #miniAppFormsArea .bm-tab-badge[hidden] { display: none; }

/* Thiết kế: 3 cột, mỗi cột cuộn riêng */
html body #miniAppFormsArea .bm-layout { display: grid; grid-template-columns: 244px minmax(0, 1fr) 400px; align-items: stretch; height: max(600px, calc(100vh - 320px)); min-height: 0; border-top: 1px solid var(--pp-line); background: #FFFFFF; }
html body #miniAppFormsArea .bm-palette { min-height: 0; overflow: auto; padding: 14px 12px 20px; border-right: 1px solid var(--pp-line); background: #FFFFFF; transition: box-shadow .2s; }
html body #miniAppFormsArea .bm-palette.is-flash { animation: bm-flash 1.1s ease; }
@keyframes bm-flash { 0%, 100% { box-shadow: none; } 30% { box-shadow: inset 0 0 0 3px rgba(108, 71, 255, .35); } }
html body #miniAppFormsArea .bm-palette > header { padding: 0 4px 10px; }
html body #miniAppFormsArea .bm-palette > header strong { color: var(--pp-ink); font-size: 15px; }
html body #miniAppFormsArea .bm-palette > header small { color: var(--pp-muted); font-size: 12.5px; line-height: 1.4; }
html body #miniAppFormsArea .bm-palette .dynamic-palette-group { display: block; padding-top: 12px; }
html body #miniAppFormsArea .bm-palette .dynamic-palette-group > span { display: block; margin: 0 4px 6px; color: var(--pp-muted); font-size: 11px; font-weight: 800; letter-spacing: .07em; }
html body #miniAppFormsArea .bm-palette .dynamic-palette-group button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 0; margin: 0 0 2px; padding: 6px 8px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: var(--pp-ink); text-align: left; transform: none; }
html body #miniAppFormsArea .bm-palette .dynamic-palette-group button:hover { border-color: var(--pp-line); background: var(--pp-subtle); box-shadow: none; }
html body #miniAppFormsArea .bm-palette .dynamic-palette-group button b { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 10px; background: var(--pp-peach-bg); color: var(--pp-peach-fg); font-size: 13px; }
html body #miniAppFormsArea .bm-palette .dynamic-palette-group:nth-of-type(1) button b { background: var(--pp-sky-bg); color: var(--pp-sky-fg); }
html body #miniAppFormsArea .bm-palette .dynamic-palette-columns button b { background: var(--pp-lilac-bg); color: var(--pp-lilac-fg); }
html body #miniAppFormsArea .bm-palette .dynamic-palette-group:last-of-type button b { background: var(--pp-grey-bg); color: var(--pp-grey-fg); }
html body #miniAppFormsArea .bm-palette .dynamic-palette-group button > span { display: grid; gap: 1px; min-width: 0; font-size: 13.5px; font-weight: 650; }
html body #miniAppFormsArea .bm-palette .dynamic-palette-group button > span small { color: var(--pp-muted); font-size: 11.5px; font-weight: 500; }
html body #miniAppFormsArea .bm-palette .dynamic-palette-columns button { border-style: solid; }
html body #miniAppFormsArea .bm-palette .dynamic-palette-columns button i { overflow: hidden; color: var(--pp-ink); font-size: 13.5px; font-style: normal; font-weight: 650; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
html body #miniAppFormsArea .bm-stage { position: static; display: flex; flex-direction: column; align-items: center; min-height: 0; overflow: auto; padding: 16px 16px 28px; border: 0; background: var(--pp-subtle) radial-gradient(#E2DCF5 1px, transparent 1px) 0 0 / 18px 18px; }
html body #miniAppFormsArea .bm-stage .dynamic-phone-frame { flex: 0 0 auto; width: 344px; min-height: 620px; }
html body #miniAppFormsArea .bm-stage .dynamic-phone-content { min-height: 590px; }
html body #miniAppFormsArea .bm-stage > small { margin-top: 12px; color: var(--pp-muted); font-size: 12px; text-align: center; }
html body #miniAppFormsArea .bm-preview-toggle { display: inline-flex; gap: 3px; margin-bottom: 12px; padding: 3px; border-radius: 999px; background: #FFFFFF; box-shadow: var(--pp-shadow); }
html body #miniAppFormsArea .bm-preview-toggle button { height: 32px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; color: var(--pp-muted); font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; }
html body #miniAppFormsArea .bm-preview-toggle button.active { background: var(--pp-ink); color: #FFFFFF; }
/* Thanh công cụ trên mục đang chọn ở điện thoại */
html body #miniAppFormsArea .dynamic-preview-section-title { position: relative; }
html body #miniAppFormsArea .dynamic-phone-content .bm-item-tools { position: absolute; top: -15px; right: -4px; z-index: 3; display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--pp-ink); box-shadow: 0 6px 16px rgba(20, 10, 60, .22); color: #FFFFFF; font-size: 12px; font-weight: 600; line-height: 1; }
html body #miniAppFormsArea .dynamic-phone-content .bm-item-tools button { width: 26px; height: 24px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: #FFFFFF; font: inherit; font-size: 12px; cursor: pointer; }
html body #miniAppFormsArea .dynamic-phone-content .bm-item-tools button:hover:not(:disabled) { background: rgba(255, 255, 255, .18); }
html body #miniAppFormsArea .dynamic-phone-content .bm-item-tools button:disabled { opacity: .35; cursor: default; }
html body #miniAppFormsArea .bm-insert { position: relative; height: 8px; margin: -3px 0 3px; }
html body #miniAppFormsArea .bm-insert button { position: absolute; top: -9px; left: 50%; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: var(--pp-violet); color: #FFFFFF; font-size: 15px; line-height: 1; opacity: 0; transform: translateX(-50%); transition: opacity .15s; cursor: pointer; }
html body #miniAppFormsArea .dynamic-phone-content:hover .bm-insert button { opacity: .45; }
html body #miniAppFormsArea .bm-insert:hover button, html body #miniAppFormsArea .bm-insert button:focus-visible { opacity: 1; }
html body #miniAppFormsArea .bm-thanks { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 540px; padding: 24px 10px; text-align: center; }
html body #miniAppFormsArea .bm-thanks-ok { display: grid; place-items: center; width: 60px; height: 60px; margin-bottom: 6px; border-radius: 50%; color: #FFFFFF; font-size: 28px; }
html body #miniAppFormsArea .bm-thanks strong { font-size: 17px; }
html body #miniAppFormsArea .bm-thanks p { margin: 0; color: #4B5565; font-size: 12.5px; }
html body #miniAppFormsArea .bm-thanks-gift { width: 100%; margin-top: 14px; padding: 12px; border: 1px dashed #F0C35A; border-radius: 14px; background: #FFF6E0; font-size: 12.5px; }
html body #miniAppFormsArea .bm-thanks-gift small { display: block; margin-top: 3px; color: var(--pp-muted); }
/* Khung phải 3 tab */
html body #miniAppFormsArea .bm-inspector { display: flex; flex-direction: column; max-height: none; min-height: 0; overflow: auto; padding: 0; border-left: 1px solid var(--pp-line); background: #FFFFFF; }
html body #miniAppFormsArea .bm-insp-tabs { position: sticky; top: 0; z-index: 2; display: flex; gap: 4px; padding: 10px 12px; border-bottom: 1px solid var(--pp-line); background: #FFFFFF; }
html body #miniAppFormsArea .bm-insp-tabs button { flex: 1; height: 36px; padding: 0 6px; border: 0; border-radius: 10px; background: transparent; color: var(--pp-muted); font: inherit; font-size: 13.5px; font-weight: 650; white-space: nowrap; cursor: pointer; }
html body #miniAppFormsArea .bm-insp-tabs button.active { background: var(--pp-violet-soft); color: var(--pp-violet-pressed); }
html body #miniAppFormsArea .bm-insp-panel { display: grid; gap: 12px; padding: 14px; }
html body #miniAppFormsArea .bm-insp-panel[hidden] { display: none; }
html body #miniAppFormsArea .bm-insp-panel .dynamic-control-section { margin: 0; padding: 14px; }
html body #miniAppFormsArea .bm-insp-panel .dynamic-control-heading strong { font-size: 15px; }
html body #miniAppFormsArea .bm-insp-panel :is(.dynamic-control-grid, .dynamic-component-fields) label > span { color: var(--pp-ink-2); font-size: 13px; font-weight: 700; }
html body #miniAppFormsArea .bm-insp-panel :is(.dynamic-control-grid, .dynamic-component-fields) :is(input:not([type=checkbox]), select) { height: 44px; padding: 0 12px; border-radius: 12px; font-size: 14.5px; }
html body #miniAppFormsArea .bm-insp-panel :is(.dynamic-control-grid, .dynamic-component-fields) textarea { padding: 10px 12px; border-radius: 12px; font-size: 14.5px; }
html body #miniAppFormsArea .bm-insp-panel .dynamic-component-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
html body #miniAppFormsArea .bm-insp-panel .dynamic-component-fields label { display: grid; gap: 6px; }
html body #miniAppFormsArea .bm-typehead { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 12px; border-radius: 14px; background: #FFFFFF; }
html body #miniAppFormsArea .bm-typehead b { display: grid; place-items: center; flex: 0 0 auto; width: 38px; height: 38px; border-radius: 11px; background: var(--pp-lilac-bg); color: var(--pp-lilac-fg); font-size: 14px; }
html body #miniAppFormsArea .bm-typehead span { display: grid; flex: 1; min-width: 0; }
html body #miniAppFormsArea .bm-typehead strong { font-size: 15px; }
html body #miniAppFormsArea .bm-typehead small { color: var(--pp-muted); font-size: 12px; }
html body #miniAppFormsArea .bm-typehead .dynamic-inspector-delete { height: 32px; padding: 0 14px; font-size: 13px; font-weight: 650; cursor: pointer; }
html body #miniAppFormsArea .bm-insp-panel .dynamic-component-fields label.bm-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border-radius: 12px; background: #FFFFFF; cursor: pointer; }
html body #miniAppFormsArea .bm-insp-panel .bm-switch-row > span { display: grid; gap: 2px; }
html body #miniAppFormsArea .bm-insp-panel .bm-switch-row strong { color: var(--pp-ink); font-size: 14px; }
html body #miniAppFormsArea .bm-insp-panel .bm-switch-row small { color: var(--pp-muted); font-size: 12px; font-weight: 500; }
html body #miniAppFormsArea .bm-insp-panel .bm-switch-row input { flex: 0 0 auto; width: 20px; height: 20px; accent-color: var(--pp-violet); }
html body #miniAppFormsArea .bm-map-field small { color: var(--pp-muted); font-size: 12.5px; line-height: 1.45; }
html body #miniAppFormsArea .bm-map-field small.is-warn { color: var(--pp-rose-fg); font-weight: 650; }
html body #miniAppFormsArea .bm-insp-panel .dynamic-inspector-note { color: var(--pp-muted); font-size: 12.5px; }

/* Lưu dữ liệu: chữ lớn, dạng bảng */
html body #miniAppFormsArea .dynamic-builder-tab[data-dynamic-panel="data"] .dynamic-data-panel { max-width: 1120px; margin: 0 auto; padding: 22px; gap: 16px; }
html body #miniAppFormsArea .dynamic-data-readiness { padding: 16px 18px; border-radius: 16px; }
html body #miniAppFormsArea .dynamic-data-readiness strong { font-size: 16px; }
html body #miniAppFormsArea .dynamic-data-readiness small { font-size: 14px; }
html body #miniAppFormsArea .dynamic-data-panel label > span { color: var(--pp-ink-2); font-size: 14px; font-weight: 700; }
html body #miniAppFormsArea .dynamic-data-panel label small { color: var(--pp-muted); font-size: 12.5px; }
html body #miniAppFormsArea .dynamic-data-chooser select { height: 50px; padding: 0 14px; border-radius: 12px; font-size: 15.5px; }
html body #miniAppFormsArea .dynamic-data-chooser .secondary-button { height: 50px; align-self: center; }
html body #miniAppFormsArea .dynamic-map-heading strong { font-size: 17px; }
html body #miniAppFormsArea .dynamic-map-heading small { font-size: 13px; }
html body #miniAppFormsArea #dynamicColumnMapSummary { display: block; max-width: none; margin: 0; }
html body #miniAppFormsArea #dynamicColumnMapSummary > .bm-map-table { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 0; border: 0; background: none; }
html body #miniAppFormsArea :is(.bm-map-head, .bm-map-row) { display: grid; grid-template-columns: minmax(190px, 1.25fr) 22px minmax(220px, 1.3fr) minmax(110px, 1fr) minmax(150px, auto); align-items: center; gap: 14px; }
html body #miniAppFormsArea .bm-map-head { padding: 0 16px; color: var(--pp-muted); font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
html body #miniAppFormsArea .bm-map-row { padding: 14px 16px; border: 1px solid var(--pp-line); border-radius: 14px; background: #FFFFFF; }
html body #miniAppFormsArea .bm-map-row.is-missing { border-color: #F7C9D4; background: #FFF8FA; }
html body #miniAppFormsArea .bm-map-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
html body #miniAppFormsArea .bm-map-name b { display: grid; place-items: center; flex: 0 0 auto; width: 38px; height: 38px; border-radius: 11px; background: var(--pp-lilac-bg); color: var(--pp-lilac-fg); font-size: 14px; }
html body #miniAppFormsArea .bm-map-name span { display: grid; min-width: 0; }
html body #miniAppFormsArea .bm-map-name strong { overflow: hidden; font-size: 15.5px; text-overflow: ellipsis; white-space: nowrap; }
html body #miniAppFormsArea .bm-map-name small { color: var(--pp-muted); font-size: 12.5px; }
html body #miniAppFormsArea .bm-map-row > i { color: #9A93B5; font-size: 18px; font-style: normal; }
html body #miniAppFormsArea .bm-map-target { display: grid; gap: 6px; justify-items: start; min-width: 0; }
html body #miniAppFormsArea .bm-map-target select { width: 100%; height: 46px; padding: 0 12px; border-radius: 12px; font-size: 15px; }
html body #miniAppFormsArea .bm-map-sample { overflow: hidden; color: var(--pp-ink-2); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
html body #miniAppFormsArea .bm-map-status { justify-self: start; min-width: 0; }
html body #miniAppFormsArea .bm-chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 650; white-space: nowrap; }
html body #miniAppFormsArea .bm-chip.ok { background: var(--pp-mint-bg); color: var(--pp-mint-fg); }
html body #miniAppFormsArea .bm-chip.warn { background: var(--pp-rose-bg); color: var(--pp-rose-fg); }
html body #miniAppFormsArea .bm-chip.sys { background: var(--pp-violet-soft); color: var(--pp-violet-pressed); }
html body #miniAppFormsArea .bm-create-column { max-width: 220px; height: 36px; overflow: hidden; padding: 0 14px; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
html body #miniAppFormsArea .bm-autocols { display: grid; gap: 8px; margin-top: 6px; }
html body #miniAppFormsArea .bm-autocols strong { font-size: 15px; }
html body #miniAppFormsArea .bm-autocols > div { display: flex; flex-wrap: wrap; gap: 8px; }
html body #miniAppFormsArea .bm-autocols span { padding: 7px 12px; border-radius: 12px; background: var(--pp-subtle); color: var(--pp-ink-2); font-size: 13.5px; }

/* Chia sẻ & QR */
html body #miniAppFormsArea :is(.bm-access, .bm-insight) { display: grid; gap: 18px; max-width: 1180px; margin: 0 auto; padding: 20px 22px 28px; }
html body #miniAppFormsArea .bm-label { display: block; color: var(--pp-muted); font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
html body #miniAppFormsArea .bm-link-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); overflow: hidden; border: 1px solid var(--pp-line); border-radius: 18px; background: #FFFFFF; }
html body #miniAppFormsArea .bm-link-card > div { min-width: 0; padding: 20px; }
html body #miniAppFormsArea .bm-link-card > div + div { border-left: 1px solid var(--pp-line); background: #FCFBFF; }
html body #miniAppFormsArea #dynamicAccessPath { display: block; margin: 8px 0 6px; font: 650 18px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }
html body #miniAppFormsArea .bm-link-main > small { display: block; color: var(--pp-muted); font-size: 13px; line-height: 1.5; }
html body #miniAppFormsArea .bm-link-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
html body #miniAppFormsArea .bm-limit-toggle { display: flex; align-items: flex-start; gap: 10px; margin: 12px 0; cursor: pointer; }
html body #miniAppFormsArea .bm-limit-toggle input { flex: 0 0 auto; width: 20px; height: 20px; margin-top: 2px; accent-color: var(--pp-violet); }
html body #miniAppFormsArea .bm-limit-toggle strong { display: block; font-size: 14.5px; }
html body #miniAppFormsArea .bm-limit-toggle small { color: var(--pp-muted); font-size: 12.5px; }
html body #miniAppFormsArea .bm-limit-value { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-left: 30px; color: var(--pp-ink-2); font-size: 14px; }
html body #miniAppFormsArea .bm-limit-value input { width: 70px; height: 38px; padding: 0 8px; border: 1px solid var(--pp-line-strong); border-radius: 10px; font: inherit; font-size: 15px; text-align: center; }
html body #miniAppFormsArea .bm-limit-value .secondary-button { min-height: 38px; height: 38px; padding: 0 16px; }
html body #miniAppFormsArea .bm-channels { display: grid; gap: 10px; padding: 16px 8px 8px; border: 1px solid var(--pp-line); border-radius: 18px; background: #FFFFFF; }
html body #miniAppFormsArea .bm-channels > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 0 12px; }
html body #miniAppFormsArea .bm-channels h3 { margin: 0; font-size: 16px; }
html body #miniAppFormsArea .bm-channels > header small { color: var(--pp-muted); font-size: 12.5px; }
html body #miniAppFormsArea .bm-channels > header .primary-button { flex: 0 0 auto; height: 40px; min-height: 40px; padding: 0 18px; }
html body #miniAppFormsArea .bm-channels .dynamic-channels-note { margin: 0 12px; }
html body #miniAppFormsArea .bm-channel-table { overflow-x: auto; }
html body #miniAppFormsArea :is(.bm-channel-table, .bm-insight-card) table { width: 100%; border-collapse: collapse; }
html body #miniAppFormsArea :is(.bm-channel-table, .bm-insight-card) th { padding: 10px 12px; border-bottom: 1px solid var(--pp-line); color: var(--pp-muted); font-size: 12px; font-weight: 800; letter-spacing: .05em; text-align: left; text-transform: uppercase; white-space: nowrap; }
html body #miniAppFormsArea :is(.bm-channel-table, .bm-insight-card) td { padding: 12px; border-bottom: 1px solid var(--pp-line); font-size: 14.5px; vertical-align: middle; }
html body #miniAppFormsArea :is(.bm-channel-table, .bm-insight-card) tr:last-child td { border-bottom: 0; }
html body #miniAppFormsArea :is(.bm-channel-table, .bm-insight-card) .num { text-align: right; white-space: nowrap; }
html body #miniAppFormsArea .bm-channel-table tr.is-off td { opacity: .6; }
html body #miniAppFormsArea .bm-channel-name { display: flex; align-items: center; gap: 12px; min-width: 230px; }
html body #miniAppFormsArea .bm-channel-name .dynamic-channel-qr { flex: 0 0 auto; width: 52px; height: 52px; padding: 3px; border-radius: 8px; }
html body #miniAppFormsArea .bm-channel-name .dynamic-channel-qr.is-missing { font-size: 9.5px; line-height: 1.2; }
html body #miniAppFormsArea .bm-channel-name span { display: grid; min-width: 0; }
html body #miniAppFormsArea .bm-channel-name strong { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
html body #miniAppFormsArea .bm-channel-name small { color: var(--pp-muted); font-size: 12.5px; }
html body #miniAppFormsArea .bm-channel-actions { display: flex; flex-wrap: nowrap; justify-content: flex-end; gap: 6px; }
html body #miniAppFormsArea .bm-channel-actions .dynamic-channel-action { white-space: nowrap; text-decoration: none; }
html body #miniAppFormsArea .bm-channel-table .dynamic-channel-empty { padding: 18px 12px; color: var(--pp-muted); font-size: 14px; }

/* Hiệu quả */
html body #miniAppFormsArea .bm-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; padding: 0; }
html body #miniAppFormsArea .bm-kpis > div { display: grid; gap: 2px; padding: 16px 18px; border: 1px solid var(--pp-line); border-radius: 16px; background: #FFFFFF; }
html body #miniAppFormsArea .bm-kpis span { color: var(--pp-muted); font-size: 13px; font-weight: 650; }
html body #miniAppFormsArea .bm-kpis strong { font-size: 28px; font-weight: 750; }
html body #miniAppFormsArea .bm-kpis small { color: var(--pp-muted); font-size: 12.5px; }
html body #miniAppFormsArea .bm-insight-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
html body #miniAppFormsArea .bm-insight-card { min-width: 0; padding: 16px 18px; border: 1px solid var(--pp-line); border-radius: 18px; background: #FFFFFF; }
html body #miniAppFormsArea .bm-insight-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
html body #miniAppFormsArea .bm-insight-card h3 { margin: 0; font-size: 16px; }
html body #miniAppFormsArea .bm-insight-card header small { color: var(--pp-muted); font-size: 12.5px; }
html body #miniAppFormsArea .bm-insight-card header .secondary-button { flex: 0 0 auto; height: 36px; min-height: 36px; padding: 0 14px; font-size: 13px; }
html body #miniAppFormsArea .bm-insight-card th:first-child, html body #miniAppFormsArea .bm-insight-card td:first-child { padding-left: 0; }
html body #miniAppFormsArea .bm-row-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--pp-line); font-size: 14px; }
html body #miniAppFormsArea .bm-row-item:last-child { border-bottom: 0; }
html body #miniAppFormsArea .bm-row-item > span:nth-child(2) { display: grid; flex: 1; min-width: 0; }
html body #miniAppFormsArea .bm-row-item small { color: var(--pp-muted); font-size: 12.5px; }
html body #miniAppFormsArea .bm-avatar { display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; background: var(--pp-peach-bg); color: var(--pp-peach-fg); font-size: 13px; font-weight: 800; }
html body #miniAppFormsArea .bm-empty { margin: 8px 0; color: var(--pp-muted); font-size: 13.5px; }

@media (max-width: 1280px) {
  html body #miniAppFormsArea .bm-layout { grid-template-columns: 220px minmax(0, 1fr) 340px; }
  html body #miniAppFormsArea .bm-stage .dynamic-phone-frame { width: 316px; }
}
@media (max-width: 1100px) {
  html body #miniAppFormsArea .bm-layout { grid-template-columns: minmax(0, 1fr); height: auto; }
  html body #miniAppFormsArea .bm-palette { max-height: 300px; border-right: 0; border-bottom: 1px solid var(--pp-line); }
  html body #miniAppFormsArea .bm-palette .dynamic-palette-group { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 2px 6px; }
  html body #miniAppFormsArea .bm-palette .dynamic-palette-group > span { grid-column: 1 / -1; }
  html body #miniAppFormsArea .dynamic-builder-layout-v2 .dynamic-phone-preview, html body #miniAppFormsArea .bm-stage { display: flex; }
  html body #miniAppFormsArea .bm-inspector { border-left: 0; border-top: 1px solid var(--pp-line); }
  html body #miniAppFormsArea :is(.bm-map-head) { display: none; }
  html body #miniAppFormsArea .bm-map-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  html body #miniAppFormsArea .bm-map-row > i { display: none; }
  html body #miniAppFormsArea .bm-link-card, html body #miniAppFormsArea .bm-insight-grid { grid-template-columns: minmax(0, 1fr); }
  html body #miniAppFormsArea .bm-link-card > div + div { border-top: 1px solid var(--pp-line); border-left: 0; }
  html body #miniAppFormsArea .bm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html body #miniAppFormsArea .bm-flowline { margin-left: 16px; }
}
@media (max-width: 520px) {
  html body #miniAppFormsArea .bm-stage .dynamic-phone-frame { width: 100%; max-width: 344px; }
  html body #miniAppFormsArea .bm-channels > header { flex-direction: column; }
}

/* ---------- Mini App › Hạng thành viên (phương án B, khách hàng chọn 02/10/2026; docs/dac-ta-hang-thanh-vien.md) ----------
   Cột trái: thẻ các hạng xếp theo mốc điểm; bên phải: chỉnh hạng đang chọn theo 3 tab, có thẻ xem trước. */
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-header { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 0; border: 0; background: transparent; box-shadow: none; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-header p { margin: 0; color: var(--pp-muted); font-size: 14px; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-header .section-title-block { margin-right: auto; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-header :is(.primary-button, .secondary-button) { height: 44px; padding: 0 18px; border-radius: 999px; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-dirty { padding: 4px 11px; border-radius: 999px; background: var(--pp-butter-bg); color: var(--pp-butter-fg); font-size: 12.5px; font-weight: 700; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-dirty[hidden], html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-header button[hidden] { display: none; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-rule { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; padding: 12px 16px; border-radius: var(--pp-radius-card); background: #FFFFFF; box-shadow: var(--pp-shadow); }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-rule > span { display: grid; place-items: center; flex: 0 0 auto; width: 36px; height: 36px; border-radius: 11px; background: var(--pp-mint-bg); color: var(--pp-mint-fg); font-weight: 800; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-rule strong { display: block; font-size: 14.5px; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-rule small { color: var(--pp-muted); font-size: 12.5px; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-rule-chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-left: auto; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-rule-chips em { padding: 4px 11px; border-radius: 999px; color: #FFFFFF; font-size: 12.5px; font-style: normal; font-weight: 700; white-space: nowrap; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-layout { display: grid; grid-template-columns: 330px minmax(0, 1fr); align-items: start; gap: 14px; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) :is(.ht-ladder, .ht-editor) { border-radius: var(--pp-radius-card); background: #FFFFFF; box-shadow: var(--pp-shadow); }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-ladder { display: grid; gap: 4px; padding: 16px 14px; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-ladder header { display: grid; gap: 2px; margin-bottom: 6px; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-ladder header strong { font-size: 15px; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-ladder header small { color: var(--pp-muted); font-size: 12.5px; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-rung { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; padding: 6px 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-rail { display: flex; flex-direction: column; align-items: center; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-rail b { display: grid; place-items: center; width: 26px; height: 26px; border: 2px solid var(--pp-line-strong); border-radius: 50%; background: var(--pp-subtle); font-size: 11.5px; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-rail i { flex: 1; width: 2px; margin-top: 4px; background: var(--pp-line-strong); }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-rung.active .ht-rail b { border-color: var(--pp-violet); background: var(--pp-violet); color: #FFFFFF; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-rung.active .ht-card { outline: 3px solid var(--pp-violet); outline-offset: 3px; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-rung-body { display: grid; gap: 6px; min-width: 0; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-rung-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--pp-muted); font-size: 12.5px; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-add-rung { margin: 8px 0 0 38px; padding: 12px; border: 2px dashed var(--pp-line-strong); border-radius: 14px; background: transparent; color: var(--pp-violet-pressed); font: inherit; font-weight: 700; cursor: pointer; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-card { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; min-height: 92px; overflow: hidden; padding: 12px 14px; border-radius: 16px; color: #FFFFFF; box-shadow: 0 8px 20px rgba(20, 10, 60, .18); }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-card::after { content: ""; position: absolute; top: -40px; right: -30px; width: 140px; height: 140px; border-radius: 50%; background: rgba(255, 255, 255, .1); }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-card-icon { font-size: 19px; line-height: 1; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-card strong { display: block; font-size: 17px; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-card small { display: block; font-size: 12px; opacity: .88; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-card.is-large { min-height: 170px; padding: 18px; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-card.is-large strong { font-size: 22px; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-editor { display: flex; flex-direction: column; min-width: 0; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-tabs { display: flex; align-items: center; gap: 4px; padding: 12px 16px; border-bottom: 1px solid var(--pp-line); }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-tabs > button:not(.ht-delete) { height: 38px; padding: 0 14px; border: 0; border-radius: 10px; background: transparent; color: var(--pp-muted); font: inherit; font-size: 14px; font-weight: 650; cursor: pointer; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-tabs > button.active { background: var(--pp-violet-soft); color: var(--pp-violet-pressed); }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-tabs > span { flex: 1; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-delete { height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--pp-rose-bg); color: var(--pp-rose-fg); font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; gap: 24px; padding: 20px; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-form { display: grid; gap: 4px; min-width: 0; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-two { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 14px; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-field { display: grid; gap: 7px; margin-bottom: 14px; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-field > span { color: var(--pp-muted); font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-field small { color: var(--pp-muted); font-size: 12.5px; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-field > input, html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-benefits input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--pp-line-strong); border-radius: 12px; background: #FFFFFF; font: inherit; font-size: 14.5px; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-field > input:disabled { background: var(--pp-subtle); color: var(--pp-muted); }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-members { display: flex; align-items: center; gap: 8px; font-size: 14px; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-members b { font-size: 18px; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-colors, html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-icons, html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-offers { display: flex; flex-wrap: wrap; gap: 6px; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-colors button { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px 0 5px; border: 1px solid var(--pp-line); border-radius: 999px; background: #FFFFFF; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-colors button i { display: inline-block; width: 22px; height: 22px; border-radius: 50%; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-colors input[type=color] { width: 44px; height: 34px; padding: 0; border: 0; background: none; cursor: pointer; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-icons button { width: 40px; height: 40px; border: 1px solid var(--pp-line); border-radius: 11px; background: #FFFFFF; font-size: 17px; cursor: pointer; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-offers button { height: 34px; padding: 0 12px; border: 1px solid var(--pp-line-strong); border-radius: 999px; background: #FFFFFF; color: var(--pp-ink-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) :is(.ht-colors, .ht-icons) button.active { border-color: var(--pp-violet); background: var(--pp-violet-soft); box-shadow: 0 0 0 2px rgba(108, 71, 255, .18); }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-offers button.active { border-color: #F0D27A; background: var(--pp-butter-bg); color: var(--pp-butter-fg); }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-offers button small { font-size: 11.5px; font-weight: 600; opacity: .85; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-offers button small.warn { color: #8C1D3A; opacity: 1; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) :is(.ht-colors, .ht-icons, .ht-offers) button:disabled { cursor: default; opacity: .7; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-benefits { display: grid; gap: 6px; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-benefits > div { display: flex; gap: 6px; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-remove { flex: 0 0 auto; width: 44px; height: 44px; border: 1px solid var(--pp-line); border-radius: 12px; background: #FFFFFF; color: var(--pp-muted); cursor: pointer; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-add-benefit { justify-self: start; padding: 5px 14px; border: 1px dashed var(--pp-line-strong); border-radius: 999px; background: #FFFFFF; color: var(--pp-violet-pressed); font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-preview { position: sticky; top: 12px; display: grid; gap: 10px; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-preview-label { color: var(--pp-muted); font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-preview > small { color: var(--pp-muted); font-size: 12.5px; }
@media (max-width: 1180px) {
  html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-layout { grid-template-columns: minmax(0, 1fr); }
  html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-ladder { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-ladder header, html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-add-rung { grid-column: 1 / -1; }
  html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-add-rung { margin-left: 0; }
}
@media (max-width: 760px) {
  html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-header { flex-wrap: wrap; }
  html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-header .section-title-block { flex-basis: 100%; }
  html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-rule { flex-wrap: wrap; }
  html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-rule-chips { justify-content: flex-start; margin-left: 0; }
  html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-body, html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-two { grid-template-columns: minmax(0, 1fr); }
  html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-tabs { flex-wrap: wrap; }
  html body :is(#miniAppTiersArea, #miniAppEarningArea, #miniAppBenefitsArea) .ht-preview { position: static; }
}

/* ---------- Dữ liệu · xóa an toàn và Thùng rác (02/10/2026, docs/dac-ta-xoa-du-lieu.md) ---------- */
html body #datahub-view .dh-tree-delete .app-icon { width: 13px; height: 13px; }
html body #datahub-view .dh-tree-delete:hover { background: var(--pp-rose-bg); color: var(--pp-rose-fg); }
html body #datahub-view .dh-trash-button { display: flex; align-items: center; gap: 8px; width: 100%; margin: 8px 0 0; padding: 9px 12px; border: 1px dashed var(--pp-line-strong); border-radius: 12px; background: #FFFFFF; color: var(--pp-ink-2); font: inherit; font-size: 13.5px; font-weight: 650; cursor: pointer; }
html body #datahub-view .dh-trash-button[hidden] { display: none; }
html body #datahub-view .dh-trash-button:hover { border-color: var(--pp-violet); color: var(--pp-violet-pressed); }
html body #datahub-view .dh-trash-button .app-icon { width: 16px; height: 16px; }
html body #datahub-view .dh-trash-button b { margin-left: auto; min-width: 20px; padding: 1px 7px; border-radius: 999px; background: var(--pp-rose-bg); color: var(--pp-rose-fg); font-size: 11.5px; text-align: center; }
html body #datahub-view .dh-trash-button b:empty { display: none; }
html body #dataHubTrashModal .modal { width: min(760px, calc(100vw - 32px)); }
html body .dh-trash-list { display: grid; gap: 10px; max-height: min(60vh, 520px); overflow: auto; }
html body .dh-trash-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--pp-line); border-radius: 14px; background: #FFFFFF; }
html body .dh-trash-item .dh-tile { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; }
html body .dh-trash-item .dh-tile .app-icon { width: 17px; height: 17px; }
html body .dh-trash-item > div { display: grid; gap: 2px; min-width: 0; }
html body .dh-trash-item strong { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
html body .dh-trash-item small { color: var(--pp-muted); font-size: 12.5px; }
html body .dh-trash-item em { font-style: normal; font-weight: 650; color: var(--pp-ink-2); }
html body .dh-trash-item em.is-soon { color: var(--pp-rose-fg); }
html body .dh-trash-actions { display: flex; align-items: center; gap: 8px; }
html body .dh-trash-actions .primary-button { min-height: 38px; height: 38px; padding: 0 16px; }
html body .dh-trash-purge { height: 38px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: var(--pp-rose-fg); font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; }
html body .dh-trash-purge:hover { background: var(--pp-rose-bg); }
html body .dh-trash-empty { padding: 28px 12px; color: var(--pp-muted); text-align: center; }
html body .dh-trash-note { margin: 12px 0 0; color: var(--pp-muted); font-size: 12.5px; line-height: 1.5; }
@media (max-width: 640px) {
  html body .dh-trash-item { grid-template-columns: auto minmax(0, 1fr); }
  html body .dh-trash-actions { grid-column: 1 / -1; justify-content: flex-end; }
}
html body #dataHubTrashModal .dh-tile.space { background: var(--pp-butter-bg); color: var(--pp-butter-fg); }
html body #dataHubTrashModal .dh-tile.hub { background: var(--pp-sky-bg); color: var(--pp-sky-fg); }
html body #dataHubTrashModal .dh-tile.table { background: var(--pp-mint-bg); color: var(--pp-mint-fg); }

/* ---------- Mini App › Quy tắc tích điểm (phương án B, khách hàng chọn 05/10/2026; docs/dac-ta-tich-diem.md) ----------
   Dùng chung khung với trang Hạng thành viên (ht-*). Trái: biểu phí; giữa: chỉnh 3 tab; phải: điện thoại xem trước. */
html body #miniAppEarningArea .er-rule .er-stats { display: flex; gap: 18px; margin-left: auto; text-align: right; }
html body #miniAppEarningArea .er-stats b { display: block; font-size: 20px; }
html body #miniAppEarningArea .er-stats small { font-size: 11.5px; }
html body #miniAppEarningArea .er-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr) 300px; align-items: start; gap: 14px; }
html body #miniAppEarningArea .er-editor .ht-tabs > button { padding: 0 11px; white-space: nowrap; }
html body #miniAppEarningArea .er-rule .er-stats small { white-space: nowrap; }
html body #miniAppEarningArea .er-layout.is-empty { grid-template-columns: minmax(0, 1fr) 300px; }
html body #miniAppEarningArea .er-list { display: grid; gap: 8px; padding: 16px 14px; border-radius: var(--pp-radius-card); background: #FFFFFF; box-shadow: var(--pp-shadow); }
html body #miniAppEarningArea .er-list header { display: grid; gap: 2px; margin-bottom: 4px; }
html body #miniAppEarningArea .er-list header strong { font-size: 15px; }
html body #miniAppEarningArea .er-list header small { color: var(--pp-muted); font-size: 12.5px; }
html body #miniAppEarningArea .er-list .ht-add-rung { margin-left: 0; }
html body #miniAppEarningArea .er-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border: 1px solid var(--pp-line); border-radius: 14px; background: #FFFFFF; color: inherit; font: inherit; text-align: left; cursor: pointer; }
html body #miniAppEarningArea .er-item.active { border-color: var(--pp-violet); box-shadow: 0 0 0 3px rgba(108, 71, 255, .14); }
html body #miniAppEarningArea .er-item.is-off { opacity: .6; }
html body #miniAppEarningArea .er-item > span:not(.er-icon) { display: grid; flex: 1; min-width: 0; }
html body #miniAppEarningArea .er-item strong { overflow: hidden; font-size: 14.5px; text-overflow: ellipsis; white-space: nowrap; }
html body #miniAppEarningArea .er-item small { overflow: hidden; color: var(--pp-muted); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
html body #miniAppEarningArea .er-item em { flex: 0 0 auto; font-style: normal; text-align: right; }
html body #miniAppEarningArea .er-item em b { display: block; color: var(--pp-violet-pressed); font-size: 15px; }
html body #miniAppEarningArea .er-icon { display: grid; place-items: center; flex: 0 0 auto; width: 38px; height: 38px; border-radius: 11px; font-size: 17px; font-style: normal; }
html body #miniAppEarningArea .er-icon.tone-rose { background: var(--pp-rose-bg); }
html body #miniAppEarningArea .er-icon.tone-sky { background: var(--pp-sky-bg); }
html body #miniAppEarningArea .er-icon.tone-peach { background: var(--pp-peach-bg); }
html body #miniAppEarningArea .er-icon.tone-mint { background: var(--pp-mint-bg); }
html body #miniAppEarningArea .er-icon.tone-lilac { background: var(--pp-lilac-bg); }
html body #miniAppEarningArea .er-icon.tone-butter { background: var(--pp-butter-bg); }
html body #miniAppEarningArea .er-icon.tone-grey { background: var(--pp-grey-bg); }
html body #miniAppEarningArea .er-body { padding: 20px; }
html body #miniAppEarningArea .er-body .ht-field select { width: 100%; height: 44px; padding: 0 10px; border: 1px solid var(--pp-line-strong); border-radius: 12px; background: #FFFFFF; font: inherit; font-size: 14.5px; }
html body #miniAppEarningArea .er-body .ht-field small.is-warn { color: var(--pp-rose-fg); font-weight: 650; }
html body #miniAppEarningArea .er-cats { display: flex; flex-wrap: wrap; gap: 6px; }
html body #miniAppEarningArea .er-cats button { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px 0 5px; border: 1px solid var(--pp-line); border-radius: 999px; background: #FFFFFF; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
html body #miniAppEarningArea .er-cats button .er-icon { width: 26px; height: 26px; border-radius: 8px; font-size: 13px; }
html body #miniAppEarningArea .er-cats button.active { border-color: var(--pp-violet); background: var(--pp-violet-soft); }
html body #miniAppEarningArea .er-switch { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: var(--pp-subtle); cursor: pointer; }
html body #miniAppEarningArea .er-switch input { width: 20px; height: 20px; accent-color: var(--pp-violet); }
html body #miniAppEarningArea .er-switch span { display: grid; }
html body #miniAppEarningArea .er-switch small { color: var(--pp-muted); font-size: 12.5px; }
html body #miniAppEarningArea .er-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
html body #miniAppEarningArea .er-modes button { display: grid; gap: 3px; padding: 12px 14px; border: 1px solid var(--pp-line-strong); border-radius: 14px; background: #FFFFFF; font: inherit; text-align: left; cursor: pointer; }
html body #miniAppEarningArea .er-modes button.active { border-color: var(--pp-violet); background: var(--pp-violet-soft); }
html body #miniAppEarningArea .er-modes small { color: var(--pp-muted); font-size: 12.5px; }
html body #miniAppEarningArea .er-calc { padding: 12px 14px; border-radius: 14px; background: var(--pp-subtle); font-size: 13.5px; line-height: 1.6; }
html body #miniAppEarningArea .er-calc b { color: var(--pp-violet-pressed); }
html body #miniAppEarningArea .er-calc.is-warn { background: var(--pp-rose-bg); color: var(--pp-rose-fg); }
html body #miniAppEarningArea .er-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--pp-muted); font-size: 12.5px; }
html body #miniAppEarningArea .er-flow span { padding: 4px 10px; border: 1px solid var(--pp-line); border-radius: 999px; background: #FFFFFF; color: var(--pp-ink-2); font-weight: 600; }
html body #miniAppEarningArea .er-flow i { font-style: normal; }
html body :is(#miniAppEarningArea, #miniAppBenefitsArea) .er-empty { display: grid; justify-items: center; gap: 8px; padding: 48px 24px; border-radius: var(--pp-radius-card); background: #FFFFFF; box-shadow: var(--pp-shadow); text-align: center; }
html body :is(#miniAppEarningArea, #miniAppBenefitsArea) .er-empty > span { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--pp-mint-bg); color: var(--pp-mint-fg); }
html body :is(#miniAppEarningArea, #miniAppBenefitsArea) .er-empty h3 { margin: 4px 0 0; font-size: 18px; }
html body :is(#miniAppEarningArea, #miniAppBenefitsArea) .er-empty p { max-width: 460px; margin: 0; color: var(--pp-muted); }
html body :is(#miniAppEarningArea, #miniAppBenefitsArea) .er-empty div { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
html body :is(#miniAppEarningArea, #miniAppBenefitsArea) .er-phone-wrap { position: sticky; top: 12px; display: grid; justify-items: center; gap: 8px; }
html body :is(#miniAppEarningArea, #miniAppBenefitsArea) .er-phone { width: 290px; padding: 10px; border-radius: 38px; background: var(--pp-ink); box-shadow: 0 18px 50px rgba(40, 20, 110, .18); }
html body :is(#miniAppEarningArea, #miniAppBenefitsArea) .er-screen { display: flex; flex-direction: column; height: 580px; overflow: hidden; border-radius: 29px; background: #F5F7FB; }
html body :is(#miniAppEarningArea, #miniAppBenefitsArea) .er-status { display: flex; align-items: center; justify-content: space-between; padding: 9px 18px 4px; font-size: 11px; font-weight: 700; }
html body :is(#miniAppEarningArea, #miniAppBenefitsArea) .er-status i { width: 70px; height: 18px; border-radius: 999px; background: var(--pp-ink); }
html body :is(#miniAppEarningArea, #miniAppBenefitsArea) .er-mhead { padding: 10px 14px; background: #A71925; color: #FFFFFF; font-size: 14px; font-weight: 700; }
html body :is(#miniAppEarningArea, #miniAppBenefitsArea) .er-mbody { flex: 1; overflow: auto; padding: 12px; }
html body #miniAppEarningArea .er-mrow { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding: 10px; border-radius: 12px; background: #FFFFFF; }
html body #miniAppEarningArea .er-mrow .er-icon { width: 32px; height: 32px; font-size: 15px; }
html body #miniAppEarningArea .er-mrow > div { display: grid; min-width: 0; }
html body #miniAppEarningArea .er-mrow strong { font-size: 12.5px; }
html body #miniAppEarningArea .er-mrow small { color: #6B7280; font-size: 11px; }
html body #miniAppEarningArea .er-mrow b { margin-top: 4px; color: #A71925; font-size: 12.5px; }
html body :is(#miniAppEarningArea, #miniAppBenefitsArea) :is(.er-mnote, .er-mempty) { margin: 6px 0 0; color: #6B7280; font-size: 11px; }
@media (max-width: 1320px) {
  html body #miniAppEarningArea .er-layout { grid-template-columns: 300px minmax(0, 1fr); }
  html body :is(#miniAppEarningArea, #miniAppBenefitsArea) .er-phone-wrap { position: static; grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  html body #miniAppEarningArea :is(.er-layout, .er-layout.is-empty) { grid-template-columns: minmax(0, 1fr); }
  html body #miniAppEarningArea .er-rule { flex-wrap: wrap; }
  html body #miniAppEarningArea .er-rule .er-stats { margin-left: 0; text-align: left; }
  html body #miniAppEarningArea .er-modes { grid-template-columns: minmax(0, 1fr); }
  html body :is(#miniAppEarningArea, #miniAppBenefitsArea) .er-phone { width: min(300px, 100%); }
}

/* ---------- Mini App › Quyền lợi & quy chế (phương án B, khách hàng chọn 05/10/2026; docs/dac-ta-quyen-loi-quy-che.md) ---------- */
html body #miniAppBenefitsArea .bn-tabs { display: flex; gap: 4px; margin-bottom: 12px; }
html body #miniAppBenefitsArea .bn-tabs button { height: 38px; padding: 0 16px; border: 0; border-radius: 999px; background: #FFFFFF; color: var(--pp-muted); box-shadow: var(--pp-shadow); font: inherit; font-size: 14px; font-weight: 650; cursor: pointer; }
html body #miniAppBenefitsArea .bn-tabs button.active { background: var(--pp-ink); color: #FFFFFF; }
html body #miniAppBenefitsArea .bn-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; gap: 14px; }
html body #miniAppBenefitsArea .bn-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; }
html body #miniAppBenefitsArea .bn-main > * { min-width: 0; }
html body #miniAppBenefitsArea .bn-hint { margin: 0; padding: 11px 14px; border-radius: 12px; background: #FFFFFF; box-shadow: var(--pp-shadow); color: var(--pp-ink-2); font-size: 13px; line-height: 1.55; }
html body #miniAppBenefitsArea .bn-hint b { color: var(--pp-violet-pressed); }
html body #miniAppBenefitsArea .bn-hint .text-button { margin-left: 6px; font-weight: 700; }
html body #miniAppBenefitsArea .bn-warn { padding: 11px 14px; border: 1px solid #F0D27A; border-radius: 12px; background: var(--pp-butter-bg); color: var(--pp-butter-fg); font-size: 13px; }
html body #miniAppBenefitsArea .bn-warn ul { margin: 4px 0 0; padding-left: 18px; }
html body #miniAppBenefitsArea :is(.bn-group, .bn-section, .bn-effective) { padding: 14px 16px; border-radius: var(--pp-radius-card); background: #FFFFFF; box-shadow: var(--pp-shadow); }
html body #miniAppBenefitsArea .bn-group > header, html body #miniAppBenefitsArea .bn-section > header { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
html body #miniAppBenefitsArea .bn-group > header input { width: min(320px, 100%); padding: 4px 8px; border: 1px solid transparent; border-radius: 8px; background: transparent; font: inherit; font-size: 16px; font-weight: 750; }
html body #miniAppBenefitsArea .bn-group > header input:hover { border-color: var(--pp-line); }
html body #miniAppBenefitsArea .bn-group > header input:focus { border-color: var(--pp-violet); outline: 0; background: #FFFFFF; }
html body #miniAppBenefitsArea .bn-group > header > span { flex: 1; }
html body #miniAppBenefitsArea .ib { display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid var(--pp-line); border-radius: 9px; background: #FFFFFF; color: var(--pp-ink-2); font-size: 12px; cursor: pointer; }
html body #miniAppBenefitsArea .ib:disabled { opacity: .35; cursor: default; }
html body #miniAppBenefitsArea .ib.is-danger { color: var(--pp-rose-fg); }
html body #miniAppBenefitsArea .bn-table-wrap { overflow-x: auto; }
html body #miniAppBenefitsArea .bn-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
html body #miniAppBenefitsArea .bn-table th { padding: 8px 6px; border-bottom: 1px solid var(--pp-line); color: var(--pp-muted); font-size: 11.5px; font-weight: 800; letter-spacing: .05em; text-align: left; text-transform: uppercase; white-space: nowrap; }
html body #miniAppBenefitsArea .bn-table th.tier { text-align: center; }
html body #miniAppBenefitsArea .bn-table th.tier i { display: inline-block; width: 9px; height: 9px; margin-right: 5px; border-radius: 50%; }
html body #miniAppBenefitsArea .bn-table td { padding: 8px 6px; border-bottom: 1px solid var(--pp-line); vertical-align: middle; }
html body #miniAppBenefitsArea .bn-table tr:last-child td { border-bottom: 0; }
html body #miniAppBenefitsArea .bn-table tr.is-hidden td { background: #FBFAFF; }
html body #miniAppBenefitsArea .bn-table tr.is-hidden .bn-name input:first-child { color: var(--pp-muted); text-decoration: line-through; }
html body #miniAppBenefitsArea .bn-name { min-width: 0; }
html body #miniAppBenefitsArea .bn-name input { width: 100%; padding: 3px 6px; border: 1px solid transparent; border-radius: 7px; background: transparent; font: inherit; font-size: 14px; font-weight: 650; }
html body #miniAppBenefitsArea .bn-name input.bn-caption { color: var(--pp-muted); font-size: 12.5px; font-weight: 500; }
html body #miniAppBenefitsArea .bn-name input:hover { border-color: var(--pp-line); }
html body #miniAppBenefitsArea .bn-name input:focus { border-color: var(--pp-violet); outline: 0; background: #FFFFFF; }
html body #miniAppBenefitsArea .bn-flags { display: flex; flex-wrap: wrap; gap: 4px; margin: 3px 0 0 4px; }
html body #miniAppBenefitsArea .bn-flags button { height: 22px; padding: 0 8px; border: 1px dashed var(--pp-line-strong); border-radius: 999px; background: transparent; color: var(--pp-muted); font: inherit; font-size: 11px; font-weight: 650; cursor: pointer; }
html body #miniAppBenefitsArea .bn-flags button.active { border-style: solid; border-color: var(--pp-line-strong); background: var(--pp-grey-bg); color: var(--pp-ink-2); }
html body #miniAppBenefitsArea .bn-flags button.is-manual { border-color: #F0D27A; background: var(--pp-butter-bg); color: var(--pp-butter-fg); }
html body #miniAppBenefitsArea .bn-cell { text-align: center; }
html body #miniAppBenefitsArea .bn-cell input { width: 100%; max-width: 112px; height: 36px; padding: 0 6px; border: 1px solid var(--pp-line-strong); border-radius: 10px; background: #FFFFFF; font: inherit; font-size: 14px; text-align: center; }
html body #miniAppBenefitsArea .bn-cell input.is-check { border-color: #BDEBD3; background: #F1FBF6; color: var(--pp-mint-fg); font-weight: 800; }
html body #miniAppBenefitsArea .bn-actions { white-space: nowrap; text-align: right; }
html body #miniAppBenefitsArea .bn-group .ht-add-benefit { margin-top: 8px; }
html body #miniAppBenefitsArea .bn-add-group { margin: 0; }
html body #miniAppBenefitsArea .bn-effective { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
html body #miniAppBenefitsArea .bn-effective label { display: grid; gap: 6px; }
html body #miniAppBenefitsArea .bn-effective span { color: var(--pp-muted); font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
html body #miniAppBenefitsArea .bn-effective input { height: 42px; padding: 0 10px; border: 1px solid var(--pp-line-strong); border-radius: 12px; font: inherit; }
html body #miniAppBenefitsArea .bn-effective small { padding-bottom: 10px; color: var(--pp-muted); font-size: 12.5px; }
html body #miniAppBenefitsArea .bn-section > header b { display: grid; place-items: center; flex: 0 0 auto; width: 26px; height: 26px; border-radius: 8px; background: var(--pp-ink); color: #FFFFFF; font-size: 12px; }
html body #miniAppBenefitsArea .bn-section > header input { flex: 1; min-width: 0; height: 38px; padding: 0 10px; border: 1px solid var(--pp-line-strong); border-radius: 10px; font: inherit; font-size: 14.5px; font-weight: 700; }
html body #miniAppBenefitsArea .bn-section textarea { width: 100%; min-height: 92px; padding: 10px 12px; border: 1px solid var(--pp-line-strong); border-radius: 12px; font: inherit; font-size: 13.5px; line-height: 1.55; resize: vertical; }
html body #miniAppBenefitsArea .bn-section.is-auto { border: 1px dashed var(--pp-line-strong); background: #FBFAFF; box-shadow: none; }
html body #miniAppBenefitsArea .bn-section.is-auto strong { flex: 1; }
html body #miniAppBenefitsArea .bn-section.is-auto em { padding: 3px 9px; border-radius: 999px; background: var(--pp-mint-bg); color: var(--pp-mint-fg); font-size: 11.5px; font-style: normal; font-weight: 800; white-space: nowrap; }
html body #miniAppBenefitsArea .bn-section.is-auto ul { margin: 4px 0 0; padding-left: 20px; color: var(--pp-ink-2); font-size: 13.5px; }
html body #miniAppBenefitsArea .bn-mtiers { display: flex; gap: 5px; margin-bottom: 10px; overflow-x: auto; }
html body #miniAppBenefitsArea .bn-mtiers button { flex: 0 0 auto; padding: 5px 11px; border: 0; border-radius: 999px; color: #FFFFFF; font: inherit; font-size: 11.5px; font-weight: 700; opacity: .55; cursor: pointer; }
html body #miniAppBenefitsArea .bn-mtiers button.active { opacity: 1; box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 4px var(--pp-ink); }
html body #miniAppBenefitsArea .bn-mgroup { margin-bottom: 8px; padding: 10px 12px; border-radius: 12px; background: #FFFFFF; font-size: 12px; }
html body #miniAppBenefitsArea .bn-mgroup h4 { margin: 0 0 4px; font-size: 12.5px; }
html body #miniAppBenefitsArea .bn-mgroup ul { margin: 0; padding-left: 16px; }
html body #miniAppBenefitsArea .bn-mline { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid #F0EEF6; }
html body #miniAppBenefitsArea .bn-mline:last-child { border-bottom: 0; }
html body #miniAppBenefitsArea .bn-mline small { display: block; color: #6B7280; font-size: 10.5px; }
html body #miniAppBenefitsArea .bn-mline b { white-space: nowrap; }
html body #miniAppBenefitsArea .bn-mline b.ok { color: #0E9F6E; }
html body #miniAppBenefitsArea .bn-mline b.no { color: #B3ACCB; }
html body #miniAppBenefitsArea .bn-meffective { margin: 0 0 8px; color: #6B7280; font-size: 11px; font-style: italic; }
html body #miniAppTiersArea .ht-benefit-list { margin: 0; padding: 10px 12px 10px 28px; border-radius: 12px; background: var(--pp-subtle); color: var(--pp-ink-2); font-size: 13.5px; }
html body #miniAppTiersArea .ht-benefit-list li.is-empty { margin-left: -16px; list-style: none; color: var(--pp-muted); }
html body #miniAppTiersArea .ht-field .text-button { justify-self: start; font-weight: 700; }
html body #miniAppTiersArea .ht-field small.is-warn { color: var(--pp-rose-fg); font-weight: 650; } /* PT Club (Lane U): cảnh báo tên hạng dài */
@media (max-width: 1180px) {
  html body #miniAppBenefitsArea .bn-layout { grid-template-columns: minmax(0, 1fr); }
  html body #miniAppBenefitsArea .er-phone-wrap { position: static; }
}

/* ----- Mini App › Quà đổi điểm (phương án A: bảng + ngăn sửa trượt bên phải) ----- */
html body #miniAppRewardsArea .rw-header { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 0; border: 0; background: transparent; box-shadow: none; }
html body #miniAppRewardsArea .rw-header p { margin: 0; color: var(--pp-muted); font-size: 14px; }
html body #miniAppRewardsArea .rw-header .section-title-block { margin-right: auto; }
html body #miniAppRewardsArea .rw-header .primary-button { height: 44px; padding: 0 18px; border-radius: 999px; white-space: nowrap; }
html body #miniAppRewardsArea .rw-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
html body #miniAppRewardsArea .rw-stats > div { padding: 12px 16px; border-radius: var(--pp-radius-card); background: #FFFFFF; box-shadow: var(--pp-shadow); }
html body #miniAppRewardsArea .rw-stats small { color: var(--pp-muted); font-size: 12.5px; font-weight: 650; }
html body #miniAppRewardsArea .rw-stats strong { display: block; margin-top: 2px; color: var(--pp-ink); font-size: 24px; }
html body #miniAppRewardsArea .rw-stats .warn strong { color: var(--pp-peach-fg); }
html body #miniAppRewardsArea .rw-tabs { display: flex; gap: 4px; margin-bottom: 12px; }
html body #miniAppRewardsArea .rw-tabs button { height: 38px; padding: 0 16px; border: 0; border-radius: 999px; background: #FFFFFF; color: var(--pp-muted); box-shadow: var(--pp-shadow); font: inherit; font-size: 14px; font-weight: 650; cursor: pointer; }
html body #miniAppRewardsArea .rw-tabs button.active { background: var(--pp-ink); color: #FFFFFF; }
html body #miniAppRewardsArea .rw-tabs button span { margin-left: 4px; padding: 1px 7px; border-radius: 999px; background: var(--pp-butter-bg); color: var(--pp-butter-fg); font-size: 12px; }
html body #miniAppRewardsArea .rw-card { padding: 14px 18px; border-radius: var(--pp-radius-card); background: #FFFFFF; box-shadow: var(--pp-shadow); }
html body #miniAppRewardsArea .rw-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: space-between; margin-bottom: 6px; }
html body #miniAppRewardsArea .rw-toolbar > small { color: var(--pp-muted); }
html body #miniAppRewardsArea .rw-filters { display: flex; flex-wrap: wrap; gap: 6px; }
html body #miniAppRewardsArea .rw-filters button { height: 34px; padding: 0 13px; border: 1px solid var(--pp-line-strong); border-radius: 999px; background: #FFFFFF; color: var(--pp-ink-2); font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; white-space: nowrap; }
html body #miniAppRewardsArea .rw-filters button.active { border-color: var(--pp-ink); background: var(--pp-ink); color: #FFFFFF; }
html body #miniAppRewardsArea .rw-search { width: min(320px, 100%); }
html body #miniAppRewardsArea .rw-hint { margin: 6px 0 4px; padding: 9px 12px; border-radius: 12px; background: var(--pp-subtle); color: var(--pp-ink-2); font-size: 13px; }
html body #miniAppRewardsArea .rw-table-wrap { overflow-x: auto; }
html body #miniAppRewardsArea .rw-table { width: 100%; border-collapse: collapse; }
html body #miniAppRewardsArea .rw-table th { padding: 11px 8px; border-bottom: 1px solid var(--pp-line); color: var(--pp-muted); font-size: 11.5px; font-weight: 800; letter-spacing: .05em; text-align: left; text-transform: uppercase; white-space: nowrap; }
html body #miniAppRewardsArea .rw-table td { padding: 10px 8px; border-bottom: 1px solid var(--pp-line); color: var(--pp-ink); font-size: 14px; vertical-align: middle; }
html body #miniAppRewardsArea .rw-table tbody tr:last-child td { border-bottom: 0; }
html body #miniAppRewardsArea .rw-table tr[data-rw-open] { cursor: pointer; }
html body #miniAppRewardsArea .rw-table tr[data-rw-open]:hover td, html body #miniAppRewardsArea .rw-table tr.selected td { background: var(--pp-violet-soft); }
html body #miniAppRewardsArea .rw-table .num { text-align: right; font-weight: 750; }
html body #miniAppRewardsArea .rw-table .rw-none { padding: 26px 8px; color: var(--pp-muted); text-align: center; }
html body #miniAppRewardsArea .rw-name strong { display: block; font-size: 14.5px; }
html body #miniAppRewardsArea .rw-name small, html body #miniAppRewardsArea .rw-stock small, html body #miniAppRewardsArea .rw-voucher-reward small, html body #miniAppRewardsArea .rw-by { display: block; margin-top: 2px; color: var(--pp-muted); font-size: 12.5px; }
html body #miniAppRewardsArea .rw-stock { white-space: nowrap; }
html body #miniAppRewardsArea .rw-warns { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
html body #miniAppRewardsArea .rw-warns em { padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-style: normal; font-weight: 700; }
html body #miniAppRewardsArea :is(.rw-warns em, .rw-chip).butter { background: var(--pp-butter-bg); color: var(--pp-butter-fg); }
html body #miniAppRewardsArea :is(.rw-warns em, .rw-chip).rose { background: var(--pp-rose-bg); color: var(--pp-rose-fg); }
html body #miniAppRewardsArea .rw-chip { display: inline-flex; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 750; white-space: nowrap; }
html body #miniAppRewardsArea .rw-chip.mint { background: var(--pp-mint-bg); color: var(--pp-mint-fg); }
html body #miniAppRewardsArea .rw-chip.grey { background: var(--pp-grey-bg); color: var(--pp-grey-fg); }
html body #miniAppRewardsArea .rw-chip.sky { background: var(--pp-sky-bg); color: var(--pp-sky-fg); }
html body #miniAppRewardsArea .rw-actions { white-space: nowrap; text-align: right; }
html body #miniAppRewardsArea .rw-actions .icon-button { display: inline-grid; width: 36px; height: 36px; margin-left: 6px; border: 1px solid var(--pp-line); background: #FFFFFF; }
html body #miniAppRewardsArea .rw-actions .icon-button.danger { color: var(--pp-rose-fg); }
html body #miniAppRewardsArea .rw-actions .compact { height: 34px; margin-left: 6px; padding: 0 12px; border-radius: 999px; font-size: 13px; }
html body #miniAppRewardsArea .rw-actions .secondary-button.danger { color: var(--pp-rose-fg); }
html body #miniAppRewardsArea .rw-code { padding: 3px 8px; border-radius: 8px; background: var(--pp-subtle); font-size: 13px; font-weight: 700; letter-spacing: .04em; }
html body #miniAppRewardsArea .rw-voucher-reward { display: flex; align-items: center; gap: 10px; min-width: 220px; }
html body #miniAppRewardsArea .rw-voucher-reward strong { display: block; }
html body #miniAppRewardsArea .rw-thumb { position: relative; display: grid; flex: 0 0 auto; width: 64px; height: 64px; overflow: hidden; border-radius: 14px; place-items: center; font-size: 30px; }
html body #miniAppRewardsArea .rw-thumb.small { width: 46px; height: 46px; border-radius: 11px; font-size: 22px; }
html body #miniAppRewardsArea .rw-thumb.discount { background: linear-gradient(145deg, #D9A84A, #9C7225); }
html body #miniAppRewardsArea .rw-thumb.gift { background: #F4F1EA; }
html body #miniAppRewardsArea .rw-thumb img { width: 100%; height: 100%; object-fit: cover; }
html body #miniAppRewardsArea .rw-thumb b { position: absolute; right: 3px; bottom: 3px; left: 3px; padding: 1px 0; border-radius: 6px; background: rgba(0, 0, 0, .5); color: #FFFFFF; font-size: 10px; font-weight: 800; line-height: 1.3; text-align: center; }
html body #miniAppRewardsArea .rw-thumb.small b { font-size: 9px; }
html body #miniAppRewardsArea .rw-empty { padding: 40px 20px; text-align: center; }
html body #miniAppRewardsArea .rw-empty-icon { font-size: 40px; }
html body #miniAppRewardsArea .rw-empty h3 { margin: 8px 0 4px; }
html body #miniAppRewardsArea .rw-empty p { max-width: 520px; margin: 0 auto 14px; color: var(--pp-muted); }
html body #miniAppRewardsArea .rw-empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
html body :is(#miniAppRewardsArea, #miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #settingsDealersPanel, #miniAppOffersArea, #miniAppGamesArea) .rw-shade { position: fixed; inset: 0; z-index: 90; background: rgba(29, 26, 46, .28); }
html body :is(#miniAppRewardsArea, #miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #settingsDealersPanel, #miniAppOffersArea, #miniAppGamesArea) .rw-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 91; display: flex; width: min(560px, 100vw); flex-direction: column; background: #FFFFFF; box-shadow: -20px 0 50px rgba(30, 20, 80, .18); }
html body :is(#miniAppRewardsArea, #miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #settingsDealersPanel, #miniAppOffersArea, #miniAppGamesArea) .rw-drawer > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--pp-line); }
html body :is(#miniAppRewardsArea, #miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #settingsDealersPanel, #miniAppOffersArea, #miniAppGamesArea) .rw-drawer > header strong { font-size: 18px; }
html body :is(#miniAppRewardsArea, #miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #settingsDealersPanel, #miniAppOffersArea, #miniAppGamesArea) .rw-drawer > header .compact { height: 36px; padding: 0 14px; border-radius: 999px; }
html body :is(#miniAppRewardsArea, #miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #settingsDealersPanel, #miniAppOffersArea, #miniAppGamesArea) .rw-drawer-body { flex: 1; overflow: auto; padding: 16px 20px 24px; }
html body :is(#miniAppRewardsArea, #miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #settingsDealersPanel, #miniAppOffersArea, #miniAppGamesArea) .rw-drawer > footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--pp-line); }
html body :is(#miniAppRewardsArea, #miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #settingsDealersPanel, #miniAppOffersArea, #miniAppGamesArea) .rw-drawer > footer button { height: 42px; padding: 0 18px; border-radius: 999px; }
html body :is(#miniAppRewardsArea, #miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #settingsDealersPanel, #miniAppOffersArea, #miniAppGamesArea) .rw-preview { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; padding: 12px; border-radius: 14px; background: var(--pp-subtle); }
html body :is(#miniAppRewardsArea, #miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #settingsDealersPanel, #miniAppOffersArea, #miniAppGamesArea) .rw-preview strong { display: block; }
html body :is(#miniAppRewardsArea, #miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #settingsDealersPanel, #miniAppOffersArea, #miniAppGamesArea) .rw-preview small { color: var(--pp-muted); }
html body :is(#miniAppRewardsArea, #miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #settingsDealersPanel, #miniAppOffersArea, #miniAppGamesArea) .rw-drawer h4 { margin: 18px 0 10px; color: var(--pp-ink); font-size: 15px; }
html body :is(#miniAppRewardsArea, #miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #settingsDealersPanel, #miniAppOffersArea, #miniAppGamesArea) .rw-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
html body :is(#miniAppRewardsArea, #miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #settingsDealersPanel, #miniAppOffersArea, #miniAppGamesArea) .rw-grid .wide { grid-column: 1 / -1; }
html body :is(#miniAppRewardsArea, #miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #settingsDealersPanel, #miniAppOffersArea, #miniAppGamesArea) .rw-grid > label, html body :is(#miniAppRewardsArea, #miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #settingsDealersPanel, #miniAppOffersArea, #miniAppGamesArea) .rw-grid > .rw-media { display: flex; min-width: 0; flex-direction: column; gap: 6px; }
html body :is(#miniAppRewardsArea, #miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #settingsDealersPanel, #miniAppOffersArea, #miniAppGamesArea) .rw-grid > label > span:first-child, html body #miniAppRewardsArea .rw-media > span, html body :is(#miniAppRewardsArea, #miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #settingsDealersPanel, #miniAppOffersArea, #miniAppGamesArea) .rw-grid legend { color: var(--pp-muted); font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
html body :is(#miniAppRewardsArea, #miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #settingsDealersPanel, #miniAppOffersArea, #miniAppGamesArea) .rw-grid small { color: var(--pp-muted); font-size: 12px; }
html body :is(#miniAppRewardsArea, #miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #settingsDealersPanel, #miniAppOffersArea, #miniAppGamesArea) .rw-grid :is(input:not([type="checkbox"]), select, textarea) { width: 100%; min-height: 42px; padding: 8px 11px; border: 1px solid var(--pp-line-strong); border-radius: 11px; background: #FFFFFF; color: var(--pp-ink); font: inherit; font-size: 14px; }
html body :is(#miniAppRewardsArea, #miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #settingsDealersPanel, #miniAppOffersArea, #miniAppGamesArea) .rw-grid textarea { resize: vertical; line-height: 1.5; }
html body :is(#miniAppRewardsArea, #miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #settingsDealersPanel, #miniAppOffersArea, #miniAppGamesArea) .rw-inline { display: flex; gap: 6px; }
html body :is(#miniAppRewardsArea, #miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #settingsDealersPanel, #miniAppOffersArea, #miniAppGamesArea) .rw-inline input { width: 86px !important; flex: 0 0 auto; }
html body :is(#miniAppRewardsArea, #miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #settingsDealersPanel, #miniAppOffersArea, #miniAppGamesArea) .rw-icons { display: flex; flex-wrap: wrap; gap: 6px; }
html body :is(#miniAppRewardsArea, #miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #settingsDealersPanel, #miniAppOffersArea, #miniAppGamesArea) .rw-icons button { width: 38px; height: 38px; border: 1px solid var(--pp-line-strong); border-radius: 10px; background: #FFFFFF; font-size: 18px; cursor: pointer; }
html body :is(#miniAppRewardsArea, #miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #settingsDealersPanel, #miniAppOffersArea, #miniAppGamesArea) .rw-icons button.active { border-color: var(--pp-violet); box-shadow: 0 0 0 2px var(--pp-violet-soft); }
html body :is(#miniAppRewardsArea, #miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #settingsDealersPanel, #miniAppOffersArea, #miniAppGamesArea) .rw-image-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; }
html body :is(#miniAppRewardsArea, #miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #settingsDealersPanel, #miniAppOffersArea, #miniAppGamesArea) .rw-image-row .compact { height: 34px; padding: 0 12px; border-radius: 999px; font-size: 13px; }
html body :is(#miniAppRewardsArea, #miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #settingsDealersPanel, #miniAppOffersArea, #miniAppGamesArea) .rw-grid fieldset { margin: 0; padding: 0; border: 0; }
html body :is(#miniAppRewardsArea, #miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #settingsDealersPanel, #miniAppOffersArea, #miniAppGamesArea) .rw-tiers { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
html body :is(#miniAppRewardsArea, #miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #settingsDealersPanel, #miniAppOffersArea, #miniAppGamesArea) .rw-tiers label { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--pp-line-strong); border-radius: 999px; font-size: 13px; font-weight: 650; cursor: pointer; }
html body :is(#miniAppRewardsArea, #miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #settingsDealersPanel, #miniAppOffersArea, #miniAppGamesArea) .rw-tiers label.active { border-color: var(--pp-violet); background: var(--pp-violet-soft); }
html body :is(#miniAppRewardsArea, #miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #settingsDealersPanel, #miniAppOffersArea, #miniAppGamesArea) label.rw-switch { flex-direction: row; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--pp-line); border-radius: 12px; cursor: pointer; }
html body :is(#miniAppRewardsArea, #miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #settingsDealersPanel, #miniAppOffersArea, #miniAppGamesArea) label.rw-switch input { width: 18px; height: 18px; accent-color: var(--pp-violet); }
html body :is(#miniAppRewardsArea, #miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #settingsDealersPanel, #miniAppOffersArea, #miniAppGamesArea) label.rw-switch b { display: block; font-size: 14px; }
@media (max-width: 900px) {
  html body #miniAppRewardsArea .rw-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html body #miniAppRewardsArea .rw-header { flex-wrap: wrap; }
}
@media (max-width: 560px) {
  html body :is(#miniAppRewardsArea, #miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #settingsDealersPanel, #miniAppOffersArea, #miniAppGamesArea) .rw-grid { grid-template-columns: minmax(0, 1fr); }
  html body #miniAppRewardsArea .rw-card { padding: 12px; }
}
html body #miniAppRewardsArea .rw-table td.nowrap { white-space: nowrap; }
html body #miniAppRewardsArea .rw-table td.rw-name { min-width: 150px; }
html body #miniAppRewardsArea .rw-voucher-reward strong { min-width: 150px; }
html body #miniAppRewardsArea .rw-actions.stacked button { display: flex; width: 100%; min-width: 148px; justify-content: center; margin: 0 0 6px; }
html body #miniAppRewardsArea .rw-actions.stacked button:last-child { margin-bottom: 0; }

/* ----- Mini App › Tin tức & khuyến mãi (phương án A: bảng + ngăn sửa; dùng chung kiểu ngăn sửa với Quà đổi điểm) ----- */
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-header { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 0; border: 0; background: transparent; box-shadow: none; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-header p { margin: 0; color: var(--pp-muted); font-size: 14px; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-header .section-title-block { margin-right: auto; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-header .primary-button { height: 44px; padding: 0 18px; border-radius: 999px; white-space: nowrap; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-stats > div { padding: 12px 16px; border-radius: var(--pp-radius-card); background: #FFFFFF; box-shadow: var(--pp-shadow); }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-stats small { color: var(--pp-muted); font-size: 12.5px; font-weight: 650; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-stats strong { display: block; margin-top: 2px; color: var(--pp-ink); font-size: 24px; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-stats .warn strong { color: var(--pp-peach-fg); }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-notice { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 10px 14px; border: 1px solid #F0D58A; border-radius: 12px; background: var(--pp-butter-bg); color: var(--pp-butter-fg); font-size: 13.5px; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-card { padding: 14px 18px; border-radius: var(--pp-radius-card); background: #FFFFFF; box-shadow: var(--pp-shadow); }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-empty { padding: 40px 20px; text-align: center; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-empty > span { font-size: 40px; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-empty p { max-width: 520px; margin: 4px auto 14px; color: var(--pp-muted); }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-toolbar > small { color: var(--pp-muted); }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-filters { display: flex; flex-wrap: wrap; gap: 6px; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-filters button { height: 34px; padding: 0 13px; border: 1px solid var(--pp-line-strong); border-radius: 999px; background: #FFFFFF; color: var(--pp-ink-2); font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; white-space: nowrap; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-filters button.active { border-color: var(--pp-ink); background: var(--pp-ink); color: #FFFFFF; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-table-wrap { overflow-x: auto; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-table { width: 100%; border-collapse: collapse; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-table th { padding: 11px 8px; border-bottom: 1px solid var(--pp-line); color: var(--pp-muted); font-size: 11.5px; font-weight: 800; letter-spacing: .05em; text-align: left; text-transform: uppercase; white-space: nowrap; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-table td { padding: 10px 8px; border-bottom: 1px solid var(--pp-line); color: var(--pp-ink); font-size: 14px; vertical-align: middle; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-table tbody tr:last-child td { border-bottom: 0; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-table tr[data-nw-open] { cursor: pointer; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-table tr[data-nw-open]:hover td, html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-table tr.selected td { background: var(--pp-violet-soft); }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-table td.nowrap { white-space: nowrap; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-table td small { display: block; margin-top: 2px; color: var(--pp-muted); font-size: 12.5px; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-table .nw-none { padding: 26px 8px; color: var(--pp-muted); text-align: center; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-title { min-width: 260px; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-title strong { display: block; font-size: 14.5px; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-pin { margin-right: 4px; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-overdue { color: var(--pp-rose-fg); font-weight: 750; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-num { color: var(--pp-ink-2); }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-warns { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-warns.block { margin: 0 0 6px; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-warns em { padding: 2px 8px; border-radius: 999px; background: var(--pp-butter-bg); color: var(--pp-butter-fg); font-size: 11.5px; font-style: normal; font-weight: 700; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-chip { display: inline-flex; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 750; white-space: nowrap; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-chip.rose { background: var(--pp-rose-bg); color: var(--pp-rose-fg); }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-chip.butter { background: var(--pp-butter-bg); color: var(--pp-butter-fg); }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-chip.sky { background: var(--pp-sky-bg); color: var(--pp-sky-fg); }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-chip.mint { background: var(--pp-mint-bg); color: var(--pp-mint-fg); }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-chip.grey { background: var(--pp-grey-bg); color: var(--pp-grey-fg); }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-actions { text-align: right; white-space: nowrap; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-actions .icon-button { display: inline-grid; width: 36px; height: 36px; margin-left: 6px; border: 1px solid var(--pp-line); background: #FFFFFF; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-actions .icon-button.danger { color: var(--pp-rose-fg); }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-cover { position: relative; display: grid; flex: 0 0 auto; overflow: hidden; place-items: center; color: #FFFFFF; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-cover img { width: 100%; height: 100%; object-fit: cover; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-cover.promo { background: linear-gradient(135deg, #E2475E, #9E1B32); }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-cover.event { background: linear-gradient(135deg, #F2B04A, #B4561B); }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-cover.car { background: linear-gradient(135deg, #4C8DF0, #1E4DA1); }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-cover.photo { background: #EEEDF3; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-cover.small { width: 72px; height: 48px; border-radius: 9px; font-size: 20px; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-cover.large { width: 150px; height: 96px; border-radius: 12px; font-size: 34px; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-cover.card { width: 78px; height: 60px; border-radius: 9px; font-size: 22px; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-cover.banner { width: 100%; height: 140px; border-radius: 12px; font-size: 48px; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-drawer { width: min(600px, 100vw); }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-drawer > header { gap: 10px; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-drawer > header strong { margin-right: auto; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-drawer > footer .nw-spacer { flex: 1; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-cover-field { display: flex; flex-direction: column; gap: 6px; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-cover-field > span { color: var(--pp-muted); font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-cover-row { display: flex; align-items: center; gap: 12px; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-cover-row small { color: var(--pp-muted); font-size: 12px; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-cover-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-cover-buttons .compact { height: 34px; padding: 0 12px; border-radius: 999px; font-size: 13px; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-stat-line { padding: 9px 12px; border-radius: 12px; background: var(--pp-subtle); color: var(--pp-ink-2); font-size: 13px; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-campaign { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--pp-line); border-radius: 12px; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-campaign span { flex: 1; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-campaign b { display: block; font-size: 14px; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-campaign small { color: var(--pp-muted); font-size: 12px; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-campaign .compact { height: 34px; padding: 0 12px; border-radius: 999px; white-space: nowrap; }
/* Điện thoại xem trước, đặt bên trái ngăn sửa */
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-preview { position: fixed; top: 50%; right: min(624px, 100vw); z-index: 92; transform: translateY(-50%); }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-preview-tabs { display: flex; gap: 4px; justify-content: center; margin-bottom: 8px; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-preview-tabs button { height: 30px; padding: 0 11px; border: 0; border-radius: 999px; background: #FFFFFF; color: var(--pp-ink-2); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-preview-tabs button.active { background: var(--pp-ink); color: #FFFFFF; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-phone { width: 300px; padding: 10px; border-radius: 38px; background: #1D1A2E; box-shadow: 0 18px 50px rgba(40, 20, 110, .3); }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-screen { display: flex; height: min(600px, 74vh); flex-direction: column; overflow: hidden; border-radius: 29px; background: #F5F7FB; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-m-head { padding: 22px 14px 10px; background: #A71925; color: #FFFFFF; font-size: 14px; font-weight: 700; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-m-body { flex: 1; overflow: auto; padding: 10px; font-size: 12px; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-m-body h5 { margin: 4px 0 6px; font-size: 12px; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-m-banner { position: relative; overflow: hidden; border-radius: 12px; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-m-banner .nw-cover.banner { border-radius: 0; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-m-banner b { position: absolute; right: 0; bottom: 0; left: 0; padding: 18px 10px 8px; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); color: #FFFFFF; font-size: 12px; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-m-dots { display: flex; justify-content: center; gap: 4px; margin: 6px 0 10px; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-m-dots i { width: 6px; height: 6px; border-radius: 50%; background: #C9C3D6; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-m-dots i.on { width: 14px; border-radius: 4px; background: #A71925; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-m-card { display: flex; gap: 8px; margin-bottom: 7px; padding: 7px; border-radius: 12px; background: #FFFFFF; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-m-card.current { outline: 2px solid var(--pp-violet); }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-m-card b { display: block; max-height: 30px; overflow: hidden; font-size: 11.5px; line-height: 1.3; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-m-card small { display: block; margin-top: 2px; color: #888888; font-size: 10px; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-m-card em, html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-m-tags em { display: inline-block; margin-top: 3px; padding: 1px 6px; border-radius: 999px; background: #FFE0E6; color: #A71925; font-size: 10px; font-style: normal; font-weight: 800; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-m-chips { display: flex; gap: 5px; margin-bottom: 8px; overflow-x: auto; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-m-chips span { padding: 4px 9px; border-radius: 999px; background: #FFFFFF; font-size: 11px; font-weight: 700; white-space: nowrap; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-m-chips span.on { background: #A71925; color: #FFFFFF; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-m-detail h3 { margin: 4px 0; font-size: 15px; line-height: 1.3; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-m-detail p { margin: 0 0 8px; line-height: 1.55; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-m-detail .nw-cover.banner { margin-bottom: 8px; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-m-tags { display: flex; align-items: center; gap: 6px; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-m-tags span { padding: 1px 7px; border-radius: 999px; background: var(--pp-violet-soft); font-size: 10px; font-weight: 800; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-m-meta { color: #777777; font-size: 11px; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-m-note { padding: 6px 8px; border-radius: 8px; background: var(--pp-butter-bg); color: var(--pp-butter-fg); font-size: 11px; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-m-empty { color: #888888; }
html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-m-detail button { width: 100%; margin-top: 6px; padding: 10px; border: 0; border-radius: 999px; background: #A71925; color: #FFFFFF; font: inherit; font-size: 13px; font-weight: 800; }
@media (max-width: 1240px) { html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-preview { right: auto; left: 12px; } }
@media (max-width: 900px) {
  html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-header { flex-wrap: wrap; }
  html body :is(#miniAppNewsArea, #miniAppRemindersArea, #miniAppFeedbackArea, #miniAppUsageArea) .nw-preview { top: 12px; left: 50%; z-index: 95; transform: translateX(-50%); }
}

/* ----- Cài đặt › Hệ thống đại lý (phương án B: bảng + ngăn sửa + điện thoại xem trước; dùng chung kiểu ngăn sửa với Quà đổi điểm) ----- */
html body #settingsDealersPanel .dl-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
html body #settingsDealersPanel .dl-stats > div { padding: 12px 16px; border-radius: var(--pp-radius-card); background: #FFFFFF; box-shadow: var(--pp-shadow); }
html body #settingsDealersPanel .dl-stats small { color: var(--pp-muted); font-size: 12.5px; font-weight: 650; }
html body #settingsDealersPanel .dl-stats strong { display: block; margin-top: 2px; color: var(--pp-ink); font-size: 24px; }
html body #settingsDealersPanel .dl-stats .warn strong { color: var(--pp-rose-fg); }
html body #settingsDealersPanel .dl-alert { display: flex; gap: 10px; margin-bottom: 12px; padding: 10px 14px; border: 1px solid #F3B8C6; border-radius: 12px; background: var(--pp-rose-bg); color: var(--pp-rose-fg); font-size: 13.5px; }
html body #settingsDealersPanel .dl-card { padding: 14px 18px; border-radius: var(--pp-radius-card); background: #FFFFFF; box-shadow: var(--pp-shadow); }
html body #settingsDealersPanel .dl-empty { padding: 40px 20px; text-align: center; }
html body #settingsDealersPanel .dl-empty > span { font-size: 40px; }
html body #settingsDealersPanel .dl-empty p { max-width: 560px; margin: 4px auto 14px; color: var(--pp-muted); }
html body #settingsDealersPanel .dl-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 6px; }
html body #settingsDealersPanel .dl-toolbar > small { color: var(--pp-muted); }
html body #settingsDealersPanel .dl-toolbar .compact { height: 34px; padding: 0 13px; border-radius: 999px; font-size: 13px; }
html body #settingsDealersPanel .dl-spacer { flex: 1; }
html body #settingsDealersPanel .dl-filters { display: flex; flex-wrap: wrap; gap: 6px; }
html body #settingsDealersPanel .dl-filters button { height: 34px; padding: 0 13px; border: 1px solid var(--pp-line-strong); border-radius: 999px; background: #FFFFFF; color: var(--pp-ink-2); font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; white-space: nowrap; }
html body #settingsDealersPanel .dl-filters button.active { border-color: var(--pp-ink); background: var(--pp-ink); color: #FFFFFF; }
html body #settingsDealersPanel .dl-brands-editor { margin: 6px 0 10px; padding: 12px 14px; border: 1px dashed var(--pp-line-strong); border-radius: 14px; background: var(--pp-subtle); }
html body #settingsDealersPanel .dl-brands-editor p { margin: 0 0 8px; color: var(--pp-muted); font-size: 13px; }
html body #settingsDealersPanel .dl-brand-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
html body #settingsDealersPanel .dl-brand-row input[type="color"] { width: 38px; height: 34px; padding: 2px; border: 1px solid var(--pp-line-strong); border-radius: 9px; background: #FFFFFF; }
html body #settingsDealersPanel .dl-brand-row input:not([type="color"]) { width: 220px; height: 34px; padding: 0 10px; border: 1px solid var(--pp-line-strong); border-radius: 9px; font: inherit; }
html body #settingsDealersPanel .dl-brand-row small { width: 70px; color: var(--pp-muted); }
html body #settingsDealersPanel .dl-brand-row .icon-button { width: 34px; height: 34px; color: var(--pp-rose-fg); }
html body #settingsDealersPanel .dl-brand-row .icon-button:disabled { opacity: .35; cursor: not-allowed; }
html body #settingsDealersPanel .dl-brand-actions { display: flex; gap: 8px; margin-top: 8px; }
html body #settingsDealersPanel .dl-brand-actions .compact { height: 34px; padding: 0 13px; border-radius: 999px; font-size: 13px; }
html body #settingsDealersPanel .dl-table-wrap { overflow-x: auto; }
html body #settingsDealersPanel .dl-table { width: 100%; border-collapse: collapse; }
html body #settingsDealersPanel .dl-table th { padding: 11px 8px; border-bottom: 1px solid var(--pp-line); color: var(--pp-muted); font-size: 11.5px; font-weight: 800; letter-spacing: .05em; text-align: left; text-transform: uppercase; white-space: nowrap; }
html body #settingsDealersPanel .dl-table td { padding: 10px 8px; border-bottom: 1px solid var(--pp-line); color: var(--pp-ink); font-size: 14px; vertical-align: middle; }
html body #settingsDealersPanel .dl-table tbody tr:last-child td { border-bottom: 0; }
html body #settingsDealersPanel .dl-table tr[data-dl-open] { cursor: pointer; }
html body #settingsDealersPanel .dl-table tr[data-dl-open]:hover td, html body #settingsDealersPanel .dl-table tr.selected td { background: var(--pp-violet-soft); }
html body #settingsDealersPanel .dl-table td.nowrap { white-space: nowrap; }
html body #settingsDealersPanel .dl-table .dl-none { padding: 26px 8px; color: var(--pp-muted); text-align: center; }
html body #settingsDealersPanel .dl-name { min-width: 220px; }
html body #settingsDealersPanel .dl-name strong { font-size: 14.5px; }
html body #settingsDealersPanel .dl-name code { margin-left: 6px; padding: 1px 6px; border-radius: 6px; background: var(--pp-subtle); color: var(--pp-ink-2); font-size: 11.5px; }
html body #settingsDealersPanel .dl-name small { display: block; margin-top: 2px; color: var(--pp-muted); font-size: 12.5px; }
html body #settingsDealersPanel .dl-address { min-width: 220px; max-width: 340px; color: var(--pp-ink-2); font-size: 13px !important; }
html body #settingsDealersPanel .dl-usage { color: var(--pp-muted); font-size: 12.5px !important; }
html body #settingsDealersPanel .dl-usage b { color: var(--pp-ink-2); }
html body #settingsDealersPanel .dl-brand { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; white-space: nowrap; }
html body #settingsDealersPanel .dl-brand i { display: grid; width: 22px; height: 22px; border-radius: 6px; color: #FFFFFF; font-size: 10px; font-style: normal; font-weight: 900; place-items: center; }
html body #settingsDealersPanel .dl-warns { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
html body #settingsDealersPanel .dl-warns em { padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-style: normal; font-weight: 700; }
html body #settingsDealersPanel .dl-warns em.butter, html body #settingsDealersPanel .dl-chip.butter { background: var(--pp-butter-bg); color: var(--pp-butter-fg); }
html body #settingsDealersPanel .dl-warns em.rose { background: var(--pp-rose-bg); color: var(--pp-rose-fg); }
html body #settingsDealersPanel .dl-chip { display: inline-flex; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 750; white-space: nowrap; }
html body #settingsDealersPanel .dl-chip.mint { background: var(--pp-mint-bg); color: var(--pp-mint-fg); }
html body #settingsDealersPanel .dl-chip.grey { background: var(--pp-grey-bg); color: var(--pp-grey-fg); }
html body #settingsDealersPanel .dl-drawer > header strong { margin-right: auto; }
html body #settingsDealersPanel .dl-drawer > footer .danger { color: var(--pp-rose-fg); }
html body #settingsDealersPanel .dl-drawer input.is-bad { border-color: #E2475E !important; background: #FFF6F8 !important; }
html body #settingsDealersPanel .dl-drawer small.bad { color: var(--pp-rose-fg) !important; font-weight: 700; }
html body #settingsDealersPanel .dl-usage-line { padding: 9px 12px; border-radius: 12px; background: var(--pp-subtle); color: var(--pp-ink-2); font-size: 13px; }
/* Điện thoại xem trước, bên trái ngăn sửa */
html body #settingsDealersPanel .dl-preview { position: fixed; top: 50%; right: min(584px, 100vw); z-index: 92; transform: translateY(-50%); }
html body #settingsDealersPanel .dl-preview-tabs { display: flex; gap: 4px; justify-content: center; margin-bottom: 8px; }
html body #settingsDealersPanel .dl-preview-tabs button { height: 30px; padding: 0 11px; border: 0; border-radius: 999px; background: #FFFFFF; color: var(--pp-ink-2); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
html body #settingsDealersPanel .dl-preview-tabs button.active { background: var(--pp-ink); color: #FFFFFF; }
html body #settingsDealersPanel .dl-phone { width: 300px; padding: 10px; border-radius: 38px; background: #1D1A2E; box-shadow: 0 18px 50px rgba(40, 20, 110, .3); }
html body #settingsDealersPanel .dl-screen { display: flex; height: min(600px, 74vh); flex-direction: column; overflow: hidden; border-radius: 29px; background: #F5F7FB; }
html body #settingsDealersPanel .dl-m-head { padding: 22px 14px 10px; background: #A71925; color: #FFFFFF; font-size: 14px; font-weight: 700; }
html body #settingsDealersPanel .dl-m-body { flex: 1; overflow: auto; padding: 10px; font-size: 11.5px; }
html body #settingsDealersPanel .dl-m-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
html body #settingsDealersPanel .dl-m-chips span { padding: 4px 9px; border-radius: 999px; background: #FFFFFF; font-size: 11px; font-weight: 700; cursor: pointer; }
html body #settingsDealersPanel .dl-m-chips span.on { background: #A71925; color: #FFFFFF; }
html body #settingsDealersPanel .dl-m-card { margin-bottom: 7px; padding: 9px 10px; border-radius: 12px; background: #FFFFFF; }
html body #settingsDealersPanel .dl-m-card.current, html body #settingsDealersPanel .dl-m-radio.current { outline: 2px solid var(--pp-violet); }
html body #settingsDealersPanel .dl-m-card b, html body #settingsDealersPanel .dl-m-radio b { display: block; font-size: 12.5px; }
html body #settingsDealersPanel .dl-m-card small, html body #settingsDealersPanel .dl-m-radio small { display: block; margin-top: 2px; color: #777777; }
html body #settingsDealersPanel .dl-m-actions { display: flex; gap: 6px; margin-top: 7px; }
html body #settingsDealersPanel .dl-m-actions em { flex: 1; padding: 5px; border-radius: 999px; background: #FFE0E6; color: #A71925; font-size: 11px; font-style: normal; font-weight: 800; text-align: center; }
html body #settingsDealersPanel .dl-m-actions em.go { background: #A71925; color: #FFFFFF; }
html body #settingsDealersPanel .dl-m-step { margin: 4px 0 6px; color: #777777; font-size: 11px; font-weight: 700; }
html body #settingsDealersPanel .dl-m-radio { display: flex; gap: 8px; margin-bottom: 7px; padding: 9px 10px; border-radius: 12px; background: #FFFFFF; }
html body #settingsDealersPanel .dl-m-radio i { width: 14px; height: 14px; flex: 0 0 auto; margin-top: 2px; border: 2px solid #A71925; border-radius: 50%; }
html body #settingsDealersPanel .dl-m-radio.current i { background: #A71925; box-shadow: inset 0 0 0 2px #FFFFFF; }
html body #settingsDealersPanel .dl-m-note { padding: 6px 8px; border-radius: 8px; background: var(--pp-butter-bg); color: var(--pp-butter-fg); }
html body #settingsDealersPanel .dl-m-empty { color: #888888; }
@media (max-width: 1240px) { html body #settingsDealersPanel .dl-preview { right: auto; left: 12px; } }
@media (max-width: 900px) {
  html body #settingsDealersPanel .dl-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html body #settingsDealersPanel .dl-preview { display: none; }
}

/* Ưu đãi & mã: ghi chú dưới ô (không đổi bằng điểm) */
html body .miniapp-offer-editor .offer-form-grid label small { display: block; margin-top: 4px; color: var(--pp-muted); font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: 0; }

/* ----- Mini App › Ưu đãi & mã › tab Ưu đãi (phương án A: bảng + ngăn sửa trượt; dùng chung kiểu ngăn sửa với Quà đổi điểm) ----- */
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-stats > div { padding: 12px 16px; border-radius: var(--pp-radius-card); background: #FFFFFF; box-shadow: var(--pp-shadow); }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-stats small { color: var(--pp-muted); font-size: 12.5px; font-weight: 650; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-stats strong { display: block; margin-top: 2px; color: var(--pp-ink); font-size: 24px; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-stats strong span { color: var(--pp-muted); font-size: 13px; font-weight: 650; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-stats .warn strong { color: var(--pp-peach-fg); }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-card { padding: 14px 18px; border-radius: var(--pp-radius-card); background: #FFFFFF; box-shadow: var(--pp-shadow); }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-empty { padding: 40px 20px; text-align: center; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-empty > span { font-size: 40px; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-empty p { max-width: 560px; margin: 4px auto 14px; color: var(--pp-muted); }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-toolbar > small, html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-muted { color: var(--pp-muted); font-size: 13px; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-filters { display: flex; flex-wrap: wrap; gap: 6px; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-filters button { height: 34px; padding: 0 13px; border: 1px solid var(--pp-line-strong); border-radius: 999px; background: #FFFFFF; color: var(--pp-ink-2); font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; white-space: nowrap; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-filters button.active { border-color: var(--pp-ink); background: var(--pp-ink); color: #FFFFFF; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-table-wrap { overflow-x: auto; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-table { width: 100%; border-collapse: collapse; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-table th { padding: 11px 8px; border-bottom: 1px solid var(--pp-line); color: var(--pp-muted); font-size: 11.5px; font-weight: 800; letter-spacing: .05em; text-align: left; text-transform: uppercase; white-space: nowrap; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-table td { padding: 10px 8px; border-bottom: 1px solid var(--pp-line); color: var(--pp-ink); font-size: 14px; vertical-align: middle; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-table tbody tr:last-child td { border-bottom: 0; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-table tr[data-od-open] { cursor: pointer; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-table tr[data-od-open]:hover td, html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-table tr.selected td { background: var(--pp-violet-soft); }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-table .od-none { padding: 26px 8px; color: var(--pp-muted); text-align: center; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-title { min-width: 220px; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-title strong { display: block; font-size: 14.5px; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-title small, html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-pool small, html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-funnel small { display: block; margin-top: 2px; color: var(--pp-muted); font-size: 12px; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-sources { max-width: 280px; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-value { display: inline-grid; min-width: 58px; height: 40px; padding: 0 8px; border-radius: 11px; background: linear-gradient(135deg, #7C5CFF, #4B2FD1); color: #FFFFFF; font-size: 14px; font-weight: 900; place-items: center; white-space: nowrap; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-value.small { min-width: 48px; height: 34px; font-size: 12.5px; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-src { display: inline-flex; margin: 2px 4px 2px 0; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-src.tier { background: var(--pp-butter-bg); color: var(--pp-butter-fg); }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-src.camp { background: var(--pp-sky-bg); color: var(--pp-sky-fg); }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-src.form { background: var(--pp-mint-bg); color: var(--pp-mint-fg); }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-src.game { background: var(--pp-peach-bg); color: var(--pp-peach-fg); }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-src.none { background: var(--pp-grey-bg); color: var(--pp-grey-fg); }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-pool { min-width: 150px; font-size: 13px; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-pool b { display: block; font-size: 13px; }
html body #miniAppOffersArea :is(.od-pool, .od-funnel) i { display: block; height: 6px; margin: 4px 0 2px; overflow: hidden; border-radius: 999px; background: #EEEAF8; }
html body #miniAppOffersArea :is(.od-pool, .od-funnel) em { display: block; height: 100%; border-radius: 999px; background: #22A06B; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-pool em.low { background: #E8A33D; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-funnel { min-width: 140px; font-size: 13px; white-space: nowrap; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-funnel em { background: var(--pp-violet); }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-chip { display: inline-flex; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 750; white-space: nowrap; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-chip.mint { background: var(--pp-mint-bg); color: var(--pp-mint-fg); }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-chip.butter { background: var(--pp-butter-bg); color: var(--pp-butter-fg); }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-chip.rose { background: var(--pp-rose-bg); color: var(--pp-rose-fg); }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-chip.sky { background: var(--pp-sky-bg); color: var(--pp-sky-fg); }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-chip.grey { background: var(--pp-grey-bg); color: var(--pp-grey-fg); }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-drawer { width: min(600px, 100vw); }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-drawer > header { gap: 10px; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-drawer > header strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-drawer > footer .od-spacer { flex: 1; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-drawer > footer .danger { color: var(--pp-rose-fg); }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-row-actions, html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-newpool-actions { display: flex; flex-wrap: wrap; gap: 8px; }
html body #miniAppOffersArea :is(.od-row-actions, .od-newpool-actions, .od-use) .compact { height: 34px; padding: 0 13px; border-radius: 999px; font-size: 13px; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-newpool { padding: 12px 14px; border: 1px dashed var(--pp-line-strong); border-radius: 14px; background: var(--pp-subtle); }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-newpool > b { display: block; margin-bottom: 8px; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-newpool-actions { justify-content: flex-end; margin-top: 10px; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-modes label { display: flex; gap: 8px; padding: 9px 11px; border: 1.5px solid var(--pp-line-strong); border-radius: 12px; background: #FFFFFF; cursor: pointer; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-modes label.active { border-color: var(--pp-violet); background: var(--pp-violet-soft); }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-modes b { display: block; font-size: 13.5px; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-modes small { color: var(--pp-muted); font-size: 12px; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-uses { display: flex; flex-direction: column; gap: 8px; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-use { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid var(--pp-line); border-radius: 12px; font-size: 13px; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-use > b { flex: 1; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-use > small { width: 100%; color: var(--pp-muted); font-size: 12px; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-use .rw-tiers { margin: 0; }
/* Giới hạn số lần dùng ưu đãi theo hạng: bảng hạng + ô số lần trong ngăn sửa, dòng tóm tắt trong bảng */
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-use-tier { align-items: flex-start; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-limit-box { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 8px; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-limit-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-limit-head label { display: inline-flex; align-items: center; gap: 6px; color: var(--pp-muted); font-size: 12.5px; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-limit-head select { height: 32px; padding: 0 8px; border: 1px solid var(--pp-line-strong); border-radius: 9px; background: #FFFFFF; font: inherit; font-size: 13px; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-limit-table { width: 100%; min-width: 0; border-collapse: collapse; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-limit-table tbody tr:hover { background: transparent; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-limit-table td { padding: 5px 4px; border-top: 1px solid var(--pp-line); }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-limit-table td:last-child { width: 1%; white-space: nowrap; color: var(--pp-muted); }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-limit-table label { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; cursor: pointer; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-limit-table tr.off label { color: var(--pp-muted); font-weight: 500; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-limit-table input[type="number"] { width: 64px; height: 32px; padding: 0 6px; border: 1px solid var(--pp-line-strong); border-radius: 9px; background: #FFFFFF; font: inherit; font-weight: 700; text-align: center; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-limit-table input[type="number"]:disabled { opacity: .45; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-limit-box > small { color: var(--pp-muted); font-size: 12px; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-sources .od-limit { display: block; margin-top: 4px; color: var(--pp-muted); font-size: 12px; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-sources .od-limit.warn { color: var(--pp-butter-fg); font-weight: 650; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-warn { margin: 0; padding: 8px 10px; border-radius: 10px; background: var(--pp-rose-bg); color: var(--pp-rose-fg); font-size: 13px; font-weight: 650; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-preview { position: fixed; top: 50%; right: min(624px, 100vw); z-index: 92; transform: translateY(-50%); }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-phone { width: 300px; padding: 10px; border-radius: 38px; background: #1D1A2E; box-shadow: 0 18px 50px rgba(40, 20, 110, .3); }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-screen { display: flex; height: min(600px, 74vh); flex-direction: column; overflow: hidden; border-radius: 29px; background: #F5F7FB; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-m-head { padding: 22px 14px 10px; background: #A71925; color: #FFFFFF; font-size: 14px; font-weight: 700; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-m-body { flex: 1; overflow: auto; padding: 10px; font-size: 12px; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-m-card { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding: 10px; border-radius: 12px; background: #FFFFFF; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-m-card.current { outline: 2px solid var(--pp-violet); }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-m-card b { display: block; font-size: 12.5px; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-m-card small { display: block; color: #777777; font-size: 10.5px; }
html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-m-note { padding: 6px 8px; border-radius: 8px; background: var(--pp-butter-bg); color: var(--pp-butter-fg); font-size: 11px; }
@media (max-width: 1240px) { html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-preview { right: auto; left: 12px; } }
@media (max-width: 900px) {
  html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-preview { display: none; }
  html body :is(#miniAppOffersArea, #miniAppGamesArea, #miniAppApprovalsArea, #unitsPage) .od-modes { grid-template-columns: 1fr; }
}
/* Khung trang Ưu đãi là lưới: cho phép cột co lại để bảng tự cuộn ngang thay vì đẩy cả trang tràn */
html body #miniAppOffersArea { grid-template-columns: minmax(0, 1fr); }
html body #miniAppOffersArea > * { min-width: 0; }


/* Trang Mini Game · phương án A (docs/dac-ta-mini-game.md mục 7): bảng game + ngăn sửa 4 tab, xem trước chơi thử 3 hình thức.
   Dùng chung khung bảng / ngăn sửa với Ưu đãi & mã (od-*, rw-*). */
html body #miniAppGamesArea .mg-type { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
html body #miniAppGamesArea .mg-type.scratch_card { background: #E1F1FF; color: #0B5CAD; }
html body #miniAppGamesArea .mg-type.lucky_wheel { background: #FFE9D6; color: #9A4A00; }
html body #miniAppGamesArea .mg-type.mystery_gift { background: #F7E3FF; color: #7A2AA0; }
html body #miniAppGamesArea .mg-type-counts { display: flex; gap: 6px; }
html body #miniAppGamesArea .mg-gname { display: flex; align-items: center; gap: 10px; min-width: 0; }
html body #miniAppGamesArea .mg-gname strong { display: block; }
html body #miniAppGamesArea .mg-gname small, html body #miniAppGamesArea .mg-table td small { display: block; color: var(--pp-muted); font-size: 12px; }
html body #miniAppGamesArea .mg-gicon { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto; border-radius: 12px; font-size: 20px; }
html body #miniAppGamesArea .mg-table tr[data-mg-open] { cursor: pointer; }
html body #miniAppGamesArea .mg-table tr[data-mg-open]:hover td, html body #miniAppGamesArea .mg-table tr.selected td { background: var(--pp-violet-soft); }
html body #miniAppGamesArea .mg-warn-text { display: block; margin-top: 3px; color: var(--pp-butter-fg); font-size: 12px; font-weight: 600; }
html body #miniAppGamesArea .mg-danger-text { display: block; margin-top: 3px; color: #B42343; font-size: 12px; font-weight: 600; }
html body #miniAppGamesArea .od-chip.sky { background: #DCEBFF; color: #1E4DA1; }
html body #miniAppGamesArea .mg-drawer { width: min(700px, 100vw); }
html body #miniAppGamesArea .mg-drawer > header { position: relative; }
html body #miniAppGamesArea .mg-drawer-title { flex: 1; min-width: 0; }
html body #miniAppGamesArea .mg-drawer-title strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html body #miniAppGamesArea .mg-drawer-title div { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; }
html body #miniAppGamesArea .mg-drawer .mg-pause { background: var(--pp-butter-bg); color: var(--pp-butter-fg); border: 0; }
html body #miniAppGamesArea .mg-more-pop { top: 44px; }
html body #miniAppGamesArea .mg-dtabs { display: flex; gap: 2px; padding: 0 14px; border-bottom: 1px solid var(--pp-line); }
html body #miniAppGamesArea .mg-dtabs button { position: relative; height: 44px; padding: 0 12px; border: 0; background: transparent; color: var(--pp-muted); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap; }
html body #miniAppGamesArea .mg-dtabs button.active { color: var(--pp-ink); }
html body #miniAppGamesArea .mg-dtabs button.active::after { content: ""; position: absolute; right: 8px; bottom: -1px; left: 8px; height: 3px; border-radius: 3px 3px 0 0; background: var(--pp-violet); }
html body #miniAppGamesArea .mg-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
html body #miniAppGamesArea .mg-label { display: block; margin-bottom: 6px; color: var(--pp-muted); font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
html body #miniAppGamesArea .rw-grid > div > small, html body #miniAppGamesArea .rw-grid > div.wide > small { display: block; margin-top: 5px; color: var(--pp-muted); font-size: 12px; }
html body #miniAppGamesArea .mg-opts { display: flex; flex-wrap: wrap; gap: 6px; }
html body #miniAppGamesArea .mg-opts button { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 1.5px solid var(--pp-line-strong); border-radius: 12px; background: #FFFFFF; color: var(--pp-ink-2); font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; }
html body #miniAppGamesArea .mg-opts button.active { border-color: var(--pp-violet); background: var(--pp-violet-soft); color: var(--pp-ink); }
html body #miniAppGamesArea .mg-opts button:disabled { opacity: .45; cursor: not-allowed; }
html body #miniAppGamesArea .mg-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 50%; }
html body #miniAppGamesArea .mg-oa-list { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 13.5px; }
html body #miniAppGamesArea .mg-oa-list label { display: inline-flex; align-items: center; gap: 6px; }
html body #miniAppGamesArea input[type="color"] { padding: 3px !important; }
html body #miniAppGamesArea .mg-prize { display: grid; grid-template-columns: 38px minmax(0, 1.4fr) minmax(0, 1.3fr) 76px 78px 64px 24px; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--pp-line); }
html body #miniAppGamesArea .mg-prize.head { padding-top: 0; color: var(--pp-muted); font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
html body #miniAppGamesArea .mg-prize :is(input, select) { width: 100%; min-width: 0; height: 36px; padding: 0 8px; border: 1px solid var(--pp-line-strong); border-radius: 10px; background: #FFFFFF; font: inherit; font-size: 13px; }
html body #miniAppGamesArea .mg-prize-img { display: grid; place-items: center; width: 38px; height: 38px; overflow: hidden; padding: 0; border: 1px dashed var(--pp-line-strong); border-radius: 10px; background: var(--pp-subtle); font-size: 18px; cursor: pointer; }
html body #miniAppGamesArea .mg-prize-img img { width: 100%; height: 100%; object-fit: cover; }
html body #miniAppGamesArea .mg-prize.lose .mg-prize-img { background: #EEEDF3; cursor: default; }
html body #miniAppGamesArea .mg-pct { position: relative; }
html body #miniAppGamesArea .mg-pct input { padding-right: 20px !important; }
html body #miniAppGamesArea .mg-pct i { position: absolute; top: 9px; right: 8px; color: var(--pp-muted); font-size: 12.5px; font-style: normal; }
html body #miniAppGamesArea .mg-dash { color: var(--pp-muted); text-align: center; }
html body #miniAppGamesArea .mg-num { display: block; min-width: 0; }
html body #miniAppGamesArea .mg-num span { display: none; }
html body #miniAppGamesArea .mg-prize-x { border: 0; background: transparent; color: var(--pp-muted); font-size: 18px; cursor: pointer; }
html body #miniAppGamesArea .mg-prize-sub { grid-column: 2 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: -2px; color: var(--pp-muted); font-size: 12px; }
html body #miniAppGamesArea .mg-prize-sub .mg-danger-text { margin: 0; }
html body #miniAppGamesArea .mg-prize-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
html body #miniAppGamesArea .mg-prize-actions .od-spacer { flex: 1; }
html body #miniAppGamesArea .mg-bar { display: flex; height: 12px; margin: 12px 0 8px; overflow: hidden; border-radius: 999px; background: #EEEDF3; }
html body #miniAppGamesArea .mg-bar b { display: block; height: 100%; }
html body #miniAppGamesArea .mg-help { margin: 8px 0 0; color: var(--pp-muted); font-size: 12.5px; line-height: 1.5; }
html body #miniAppGamesArea .mg-sim { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--pp-subtle); font-size: 13px; }
html body #miniAppGamesArea .mg-sim table { width: 100%; margin-top: 6px; border-collapse: collapse; }
html body #miniAppGamesArea .mg-sim td { padding: 3px 4px; }
html body #miniAppGamesArea .mg-sim td:last-child { color: var(--pp-muted); font-size: 12px; }
html body #miniAppGamesArea .mg-bg { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
html body #miniAppGamesArea .mg-bg img { width: 56px; height: 72px; border-radius: 10px; object-fit: cover; }
html body #miniAppGamesArea .mg-bg-empty { color: var(--pp-muted); font-size: 13px; }
html body #miniAppGamesArea .mg-funnel { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
html body #miniAppGamesArea .mg-funnel > div { padding: 10px 12px; border-radius: 12px; background: var(--pp-subtle); }
html body #miniAppGamesArea .mg-funnel small { display: block; color: var(--pp-muted); font-size: 12px; }
html body #miniAppGamesArea .mg-funnel b { font-size: 20px; }
html body #miniAppGamesArea .mg-funnel em { margin-left: 6px; color: #0E7A4A; font-size: 12px; font-style: normal; font-weight: 700; }
html body #miniAppGamesArea .mg-preview-float { right: min(724px, 100vw); }
html body #miniAppGamesArea .mg-picker { position: fixed; top: 50%; left: 50%; z-index: 95; width: min(820px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; padding: 20px 22px; border-radius: 20px; background: #FFFFFF; box-shadow: 0 30px 80px rgba(0, 0, 0, .3); transform: translate(-50%, -50%); }
html body #miniAppGamesArea .mg-picker h3 { margin: 0 0 4px; font-size: 19px; }
html body #miniAppGamesArea .mg-picker > p { margin: 0; color: var(--pp-muted); font-size: 13.5px; }
html body #miniAppGamesArea .mg-picker-types { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
html body #miniAppGamesArea .mg-picker-types button { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 2px solid var(--pp-line-strong); border-radius: 18px; background: #FFFFFF; font: inherit; text-align: left; cursor: pointer; }
html body #miniAppGamesArea .mg-picker-types button:hover, html body #miniAppGamesArea .mg-picker-types button:focus-visible { border-color: var(--pp-violet); background: var(--pp-violet-soft); }
html body #miniAppGamesArea .mg-picker-types b { font-size: 15px; }
html body #miniAppGamesArea .mg-picker-types small { color: var(--pp-muted); font-size: 12.5px; }
html body #miniAppGamesArea .mg-picker-art { display: grid; place-items: center; height: 104px; border-radius: 14px; font-size: 44px; }
html body #miniAppGamesArea .mg-picker-foot { text-align: right; }
html body #miniAppGamesArea .mg-phone { width: 290px; height: 600px; padding: 10px; border-radius: 38px; background: #111111; box-shadow: 0 18px 50px rgba(30, 20, 80, .28); }
html body #miniAppGamesArea .mg-screen { position: relative; display: flex; height: 100%; flex-direction: column; overflow: hidden; border-radius: 30px; }
html body #miniAppGamesArea .mg-zbar { display: flex; justify-content: space-between; padding: 24px 14px 8px; background: rgba(0, 0, 0, .18); color: #FFFFFF; font-size: 13px; font-weight: 700; }
html body #miniAppGamesArea .mg-stage { display: flex; flex: 1; flex-direction: column; align-items: center; gap: 10px; overflow: hidden; padding: 12px 14px; color: #FFFFFF; text-align: center; }
html body #miniAppGamesArea .mg-stage h5 { margin: 4px 0 0; font-size: 19px; line-height: 1.2; text-shadow: 0 2px 6px rgba(0, 0, 0, .2); }
html body #miniAppGamesArea .mg-stage p { margin: 0; font-size: 12px; opacity: .92; }
html body #miniAppGamesArea .mg-plays { padding: 3px 12px; border-radius: 999px; background: rgba(255, 255, 255, .22); font-size: 12px; font-weight: 700; }
html body #miniAppGamesArea .mg-phone-btns { display: flex; gap: 6px; width: 100%; margin-top: auto; }
html body #miniAppGamesArea .mg-phone-btns button { flex: 1; padding: 10px 6px; border: 0; border-radius: 999px; background: #FFFFFF; color: var(--pp-ink); font: inherit; font-size: 12.5px; font-weight: 800; white-space: nowrap; cursor: pointer; }
html body #miniAppGamesArea .mg-phone-btns button:first-child { flex: 1.6; }
html body #miniAppGamesArea .mg-phone-btns .ghost { background: rgba(255, 255, 255, .2); color: #FFFFFF; cursor: default; }
html body #miniAppGamesArea .mg-phone-cap { display: block; max-width: 290px; margin: 6px auto 0; color: var(--pp-muted); font-size: 12px; text-align: center; }
html body #miniAppGamesArea .mg-scratch { position: relative; display: grid; place-items: center; width: 236px; height: 150px; overflow: hidden; border-radius: 16px; background: #FFFFFF; color: var(--pp-ink); box-shadow: 0 8px 20px rgba(0, 0, 0, .18); }
html body #miniAppGamesArea .mg-scratch-under { display: grid; place-items: center; gap: 4px; padding: 10px; font-size: 28px; }
html body #miniAppGamesArea .mg-scratch-under b { font-size: 16px; }
html body #miniAppGamesArea .mg-scratch-under img, html body #miniAppGamesArea .mg-gift img { max-width: 64px; max-height: 64px; border-radius: 8px; }
html body #miniAppGamesArea .mg-scratch canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
html body #miniAppGamesArea .mg-wheel { position: relative; width: 236px; height: 236px; }
html body #miniAppGamesArea .mg-wheel svg { width: 236px; height: 236px; filter: drop-shadow(0 8px 16px rgba(0, 0, 0, .25)); }
html body #miniAppGamesArea .mg-wheel-g { transform-origin: 118px 118px; transition: transform 4s cubic-bezier(.12, .75, .12, 1); }
html body #miniAppGamesArea .mg-wheel-ptr { position: absolute; top: -6px; left: 50%; width: 0; height: 0; border-top: 26px solid #FFFFFF; border-right: 13px solid transparent; border-left: 13px solid transparent; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .3)); transform: translateX(-50%); }
html body #miniAppGamesArea .mg-wheel-hub { position: absolute; top: 50%; left: 50%; display: grid; place-items: center; width: 54px; height: 54px; border: 0; border-radius: 50%; background: #FFFFFF; color: var(--pp-ink); font: inherit; font-size: 12px; font-weight: 900; box-shadow: 0 3px 10px rgba(0, 0, 0, .25); transform: translate(-50%, -50%); cursor: pointer; }
html body #miniAppGamesArea .mg-boxes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: 236px; }
html body #miniAppGamesArea .mg-gift { position: relative; display: grid; place-items: center; aspect-ratio: 1; padding: 0; border: 0; border-radius: 14px; background: var(--bx, #9B5CFF); box-shadow: 0 6px 14px rgba(0, 0, 0, .2); cursor: pointer; transition: transform .2s; }
html body #miniAppGamesArea .mg-gift::before { content: ""; position: absolute; top: 0; bottom: 0; left: 44%; width: 12%; background: var(--rb, #FFD27A); }
html body #miniAppGamesArea .mg-gift::after { content: ""; position: absolute; top: 40%; right: 0; left: 0; height: 12%; background: var(--rb, #FFD27A); }
html body #miniAppGamesArea .mg-gift:hover { transform: translateY(-3px); }
html body #miniAppGamesArea .mg-gift.shake { animation: mgShake .5s 2; }
html body #miniAppGamesArea .mg-gift.open { background: #FFFFFF; }
html body #miniAppGamesArea .mg-gift.open::before, html body #miniAppGamesArea .mg-gift.open::after { display: none; }
html body #miniAppGamesArea .mg-gift.open span { position: relative; z-index: 1; padding: 4px; color: var(--pp-ink); font-size: 10.5px; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
html body #miniAppGamesArea .mg-gift.dim { opacity: .45; }
@keyframes mgShake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }
html body #miniAppGamesArea .mg-result { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: rgba(10, 10, 30, .55); }
html body #miniAppGamesArea .mg-result > div { width: 230px; padding: 18px; border-radius: 20px; background: #FFFFFF; color: var(--pp-ink); text-align: center; }
html body #miniAppGamesArea .mg-result b { display: block; margin: 6px 0; font-size: 16px; }
html body #miniAppGamesArea .mg-result small { display: block; color: var(--pp-muted); font-size: 12px; }
html body #miniAppGamesArea .mg-result-big { font-size: 40px; }
html body #miniAppGamesArea .mg-result-code { margin: 8px 0; padding: 6px; border: 1.5px dashed #0068FF; border-radius: 10px; background: #F1F5FF; color: #0B3C8C; font-family: ui-monospace, Menlo, monospace; font-weight: 800; letter-spacing: .1em; }
html body #miniAppGamesArea .mg-result button { width: 100%; margin-top: 12px; padding: 10px; border: 0; border-radius: 999px; background: var(--pp-violet); color: #FFFFFF; font: inherit; font-weight: 800; cursor: pointer; }
@media (max-width: 780px) {
  html body #miniAppGamesArea .mg-prize { grid-template-columns: 38px minmax(0, 1fr) 76px 24px; }
  html body #miniAppGamesArea .mg-prize.head { display: none; }
  html body #miniAppGamesArea .mg-prize > select { grid-column: 2 / -1; grid-row: 2; }
  html body #miniAppGamesArea .mg-prize > .mg-dash { display: none; }
  html body #miniAppGamesArea .mg-num { display: flex; align-items: center; gap: 6px; grid-row: 3; grid-column: 2; }
  html body #miniAppGamesArea .mg-num + .mg-num { grid-column: 3 / -1; }
  html body #miniAppGamesArea .mg-num span { display: inline; color: var(--pp-muted); font-size: 12px; white-space: nowrap; }
  html body #miniAppGamesArea .mg-prize-sub { grid-row: 4; }
  html body #miniAppGamesArea .mg-drawer > footer button, html body #miniAppGamesArea .mg-drawer > header .compact { padding: 0 12px; white-space: nowrap; }
  html body #miniAppGamesArea .mg-funnel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html body #miniAppGamesArea .mg-picker-types { grid-template-columns: minmax(0, 1fr); }
  html body #miniAppGamesArea .mg-picker-art { height: 64px; font-size: 30px; }
  html body #miniAppGamesArea .mg-type-counts { display: none; }
}

/* ---------- Nhật ký lỗi + Bảo mật IP (Cài đặt) + cảnh báo trùng khi nhập file ---------- */
html body .error-log-actions { display: flex; gap: 8px; flex-wrap: wrap; }
html body .error-log-filters { grid-template-columns: minmax(260px, 1fr) minmax(180px, 260px); }
html body .error-log-list { border: 1px solid var(--pp-line); border-radius: var(--pp-radius-card); overflow: hidden; background: #fff; }
html body .error-log-list:empty { display: none; }
html body .error-log-item { border-bottom: 1px solid var(--pp-line); }
html body .error-log-item:last-child { border-bottom: 0; }
html body .error-log-item > summary { display: grid; grid-template-columns: 84px 84px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 14px; cursor: pointer; list-style: none; }
html body .error-log-item > summary::-webkit-details-marker { display: none; }
html body .error-log-item > summary:hover, html body .error-log-item[open] > summary { background: var(--pp-subtle); }
html body .error-log-item code, html body .ip-access code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; padding: 2px 6px; border-radius: 6px; background: var(--pp-grey-bg); color: var(--pp-ink); }
html body .error-log-source { justify-self: start; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--pp-rose-bg); color: var(--pp-rose-fg); white-space: nowrap; }
html body .error-log-source.is-worker { background: var(--pp-butter-bg); color: var(--pp-butter-fg); }
html body .error-log-source.is-system { background: var(--pp-sky-bg); color: var(--pp-sky-fg); }
html body .error-log-source.is-zalo { background: var(--pp-lilac-bg); color: var(--pp-lilac-fg); }
html body .error-log-source.is-miniapp { background: var(--pp-mint-bg); color: var(--pp-mint-fg); }
html body .error-log-main { display: grid; gap: 3px; min-width: 0; }
html body .error-log-main strong { font-size: 13px; font-weight: 650; color: var(--pp-ink); overflow-wrap: anywhere; }
html body .error-log-main small, html body .error-log-item time { color: var(--pp-muted); font-size: 11.5px; overflow-wrap: anywhere; }
html body .error-log-item time { white-space: nowrap; }
html body .error-log-item > p { margin: 0; padding: 4px 14px 0; color: var(--pp-ink-2); font-size: 12.5px; }
html body .error-log-item > pre { margin: 8px 14px 14px; padding: 12px; max-height: 320px; overflow: auto; border-radius: 10px; background: #1f2433; color: #e7eaf3; font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
html body .ip-access-form { display: grid; gap: 14px; }
html body .ip-access-current { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; color: var(--pp-ink-2); font-size: 13px; }
html body .ip-access-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
html body .ip-access-grid label { display: grid; gap: 6px; }
html body .ip-access-grid label > span { font-size: 12px; font-weight: 700; color: var(--pp-ink-2); }
html body .ip-access-grid textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--pp-line-strong); border-radius: var(--pp-radius-control); background: #fff; color: var(--pp-ink); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; line-height: 1.6; resize: vertical; }
html body .ip-access-hint { color: var(--pp-muted); font-size: 12px; line-height: 1.5; }
html body .ip-access-toggle { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--pp-line); border-radius: var(--pp-radius-card); background: var(--pp-butter-bg); color: var(--pp-ink-2); font-size: 13px; line-height: 1.5; cursor: pointer; }
html body .ip-access-toggle input { margin-top: 3px; flex: 0 0 auto; }
html body .ip-access-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
html body .ip-access-actions span { color: var(--pp-muted); font-size: 12px; }
html body .ip-access-blocked { margin-top: 20px; }
html body .ip-access-blocked h4 { margin: 0 0 8px; font-size: 13px; }
html body .ip-access-none { margin: 0; color: var(--pp-muted); font-size: 12.5px; }
html body .ip-access-blocked-list { border: 1px solid var(--pp-line); border-radius: var(--pp-radius-card); overflow: hidden; }
html body .ip-access-blocked-list > div { display: grid; grid-template-columns: minmax(120px, auto) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--pp-line); font-size: 12.5px; }
html body .ip-access-blocked-list > div:last-child { border-bottom: 0; }
html body .ip-access-blocked-list small, html body .ip-access-blocked-list time { color: var(--pp-muted); font-size: 11.5px; overflow-wrap: anywhere; }
html body .data-import-dup-warning { border-color: var(--pp-butter-fg); background: var(--pp-butter-bg); }
@media (max-width: 760px) {
  html body .error-log-filters, html body .ip-access-grid { grid-template-columns: 1fr; }
  html body .error-log-item > summary { grid-template-columns: auto auto minmax(0, 1fr); }
  html body .error-log-item .error-log-main { grid-column: 1 / -1; }
  html body .ip-access-blocked-list > div { grid-template-columns: 1fr; gap: 2px; }
}
html body .app-confirm:has(#appConfirmExtra:not([hidden])) { width: min(560px, calc(100vw - 32px)); }
html body .app-confirm .modal-actions { flex-wrap: wrap; }
html body .app-confirm .modal-actions button { white-space: nowrap; }

/* PT Club (Lane U) — bắt đầu: tab Cài đặt › PT Club, lỗi dưới ô ở ngăn chỉnh quà và ngăn Phát tặng */
html body #miniAppRewardsArea .rw-grid small.is-warn, html body #settingsClubPanel .pc-grid small.is-warn { color: var(--pp-rose-fg); font-weight: 650; }
html body #miniAppRewardsArea .rw-grid :is(input, select, textarea).is-invalid, html body #settingsClubPanel .pc-grid :is(input, textarea).is-invalid { border-color: var(--pp-rose-fg); }
html body #miniAppRewardsArea .rw-toolbar .primary-button.compact { height: 36px; padding: 0 14px; border-radius: 999px; }
html body #miniAppRewardsArea .rw-name small .rw-chip { margin-right: 4px; padding: 1px 8px; font-size: 11.5px; }
html body #settingsClubPanel .pc-panel { max-width: 860px; }
html body #settingsClubPanel .pc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 6px; }
html body #settingsClubPanel .pc-grid .wide { grid-column: 1 / -1; }
html body #settingsClubPanel .pc-grid > label { display: flex; min-width: 0; flex-direction: column; gap: 6px; }
html body #settingsClubPanel .pc-grid > label > span { color: var(--pp-muted); font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
html body #settingsClubPanel .pc-grid small, html body #settingsClubPanel .pc-note { color: var(--pp-muted); font-size: 12.5px; }
html body #settingsClubPanel .pc-grid :is(input, textarea) { width: 100%; min-height: 42px; padding: 8px 11px; border: 1px solid var(--pp-line-strong); border-radius: 11px; background: #FFFFFF; color: var(--pp-ink); font: inherit; font-size: 14px; }
html body #settingsClubPanel .pc-grid :is(input, textarea):disabled { background: var(--pp-subtle); color: var(--pp-muted); }
html body #settingsClubPanel .pc-grid textarea { resize: vertical; line-height: 1.5; }
html body #settingsClubPanel .pc-note { margin: 14px 0 0; }
html body #settingsClubPanel .pc-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--pp-line); }
html body #settingsClubPanel .pc-dirty { margin-right: auto; color: var(--pp-butter-fg); font-size: 13px; font-weight: 700; }
html body #settingsClubPanel .pc-actions [hidden] { display: none; }
@media (max-width: 900px) {
  html body #settingsClubPanel .pc-grid { grid-template-columns: minmax(0, 1fr); }
}
/* PT Club (Lane U) — kết thúc */

/* Lịch sử đăng nhập / thao tác / lỗi (Cài đặt → Nhật ký hoạt động) */
html body .audit-kind-tabs { display: flex; gap: 4px; margin: 0 0 12px; border-bottom: 1px solid var(--pp-line); overflow-x: auto; }
html body .audit-kind-tabs button { position: relative; height: 40px; padding: 0 14px; border: 0; background: transparent; color: var(--pp-muted); font: inherit; font-size: 13.5px; font-weight: 700; white-space: nowrap; cursor: pointer; }
html body .audit-kind-tabs button::after { content: ""; position: absolute; right: 10px; bottom: -1px; left: 10px; height: 3px; border-radius: 3px 3px 0 0; background: transparent; }
html body .audit-kind-tabs button:hover, html body .audit-kind-tabs button.active { color: var(--pp-ink); }
html body .audit-kind-tabs button.active::after { background: var(--pp-violet); }
html body .audit-entry-icon.error { background: var(--pp-rose-bg); color: var(--pp-rose-fg); }
html body .audit-entry-icon.miniapp { background: var(--pp-sky-bg); color: var(--pp-sky-fg); }

/* Tin đã gửi */
html body .sm-filters { grid-template-columns: minmax(260px, 1fr) repeat(5, minmax(130px, 170px)); }
html body .sm-list { border: 1px solid var(--pp-line); border-radius: var(--pp-radius-card); overflow: hidden; background: #fff; }
html body .sm-list:empty { display: none; }
html body .sm-item { border-bottom: 1px solid var(--pp-line); }
html body .sm-item:last-child { border-bottom: 0; }
html body .sm-item > summary { display: grid; grid-template-columns: 128px 96px 124px minmax(160px, 1fr) minmax(0, 1.4fr); gap: 12px; align-items: center; padding: 11px 14px; cursor: pointer; list-style: none; }
html body .sm-item > summary::-webkit-details-marker { display: none; }
html body .sm-item > summary:hover, html body .sm-item[open] > summary { background: var(--pp-subtle); }
html body .sm-item time { color: var(--pp-muted); font-size: 12px; white-space: nowrap; }
html body .sm-item .status-badge { justify-self: start; }
html body .sm-delivery { display: grid; gap: 1px; justify-self: start; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.3; white-space: nowrap; }
html body .sm-delivery small { font-size: 10.5px; font-weight: 500; opacity: .85; }
html body .sm-delivery.seen { background: var(--pp-mint-bg); color: var(--pp-mint-fg); border-radius: 10px; }
html body .sm-delivery.received { background: var(--pp-sky-bg); color: var(--pp-sky-fg); border-radius: 10px; }
html body .sm-delivery.pending { background: var(--pp-grey-bg); color: var(--pp-grey-fg); }
html body .sm-delivery.none { padding: 0; color: var(--pp-muted); font-weight: 400; }
html body .sm-timeline { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; margin: 0; }
html body .sm-timeline dt { color: var(--pp-muted); }
html body .sm-timeline dd { margin: 0; color: var(--pp-ink); }
html body .sm-recipient { display: grid; gap: 2px; min-width: 0; }
html body .sm-recipient strong { color: var(--pp-ink); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html body .sm-recipient small { color: var(--pp-muted); font-size: 12px; }
html body .sm-context { min-width: 0; color: var(--pp-ink-2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html body .sm-body { display: grid; gap: 8px; padding: 4px 14px 14px; font-size: 12.5px; color: var(--pp-ink-2); }
html body .sm-body p { margin: 0; overflow-wrap: anywhere; }
html body .sm-params { display: grid; grid-template-columns: minmax(120px, max-content) minmax(0, 1fr); gap: 4px 14px; margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--pp-grey-bg); }
html body .sm-params dt { color: var(--pp-muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }
html body .sm-params dd { margin: 0; color: var(--pp-ink); overflow-wrap: anywhere; }
html body .sm-muted { color: var(--pp-muted); }
@media (max-width: 900px) {
  html body .sm-filters { grid-template-columns: 1fr 1fr; }
  html body .sm-filters .audit-search { grid-column: 1 / -1; }
  html body .sm-item > summary { grid-template-columns: auto auto minmax(0, 1fr); }
  html body .sm-recipient, html body .sm-context { grid-column: 1 / -1; }
  html body .sm-params { grid-template-columns: minmax(0, 1fr); }
}
 }

/* ===== Đơn vị & duyệt ưu đãi (cách B, 06/10/2026; docs/dac-ta-don-vi-duyet-uu-dai.md) ===== */
html body .unit-chip { display: inline-flex; align-items: center; gap: 4px; margin: 3px 4px 0 0; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 750; white-space: nowrap; vertical-align: middle; }
html body .unit-chip.hq { background: #E6F0FF; color: #1E4DA1; }
html body .unit-chip.unit { background: #2B2B2B; color: #FFD27A; }
html body .od-approval { margin: 0 0 12px; padding: 9px 11px; border-radius: 12px; font-size: 13px; line-height: 1.45; }
html body .od-approval.pending { background: var(--pp-butter-bg); color: var(--pp-butter-fg); }
html body .od-approval.rejected { background: var(--pp-rose-bg); color: var(--pp-rose-fg); }
html body .od-lock { color: var(--pp-muted); font-size: 12.5px; }
html body .od-reject-note { display: block; color: var(--pp-rose-fg) !important; }
html body .od-title .od-chip { margin-left: 4px; }
html body .nav-item .nav-badge { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 999px; background: #E5484D; color: #FFFFFF; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; }
html body .ap-card, html body .bu-card { margin-bottom: 14px; padding: 16px 18px; border-radius: 18px; background: #FFFFFF; box-shadow: 0 1px 2px rgba(60, 40, 140, .04), 0 8px 24px rgba(60, 40, 140, .06); }
html body .ap-card h3, html body .bu-card h3 { margin: 0 0 4px; font-size: 16px; }
html body .ap-head, html body .bu-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
html body .ap-head small, html body .bu-head small { color: var(--pp-muted); font-size: 12.5px; }
html body .ap-list { display: grid; gap: 10px; }
html body .ap-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px; border: 1px solid var(--pp-line); border-radius: 14px; }
html body .ap-body { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
html body .ap-body small { color: var(--pp-muted); font-size: 12.5px; }
html body .ap-body textarea { margin-top: 6px; padding: 7px 9px; border: 1px solid var(--pp-line-strong); border-radius: 10px; font: inherit; }
html body .ap-diff { margin: 4px 0 0; padding-left: 18px; font-size: 13px; }
html body .ap-diff s { color: var(--pp-muted); }
html body .ap-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
@media (max-width: 720px) { html body .ap-item { grid-template-columns: 1fr; } html body .ap-actions { justify-content: flex-start; } }
html body .bu-form { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; padding: 14px; border: 2px solid var(--pp-violet); border-radius: 16px; }
html body .bu-form h4 { margin: 0; }
html body .bu-field { display: flex; flex-direction: column; gap: 5px; }
html body .bu-field > span { font-size: 12px; font-weight: 750; color: var(--pp-ink-2); }
html body .bu-field input:not([type]) , html body .bu-field input[data-bu-field] { height: 38px; padding: 0 10px; border: 1px solid var(--pp-line-strong); border-radius: 10px; font: inherit; }
html body .bu-field small { color: var(--pp-muted); font-size: 12px; }
html body .bu-checks { display: flex; flex-wrap: wrap; gap: 6px; }
html body .bu-checks label { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border: 1px solid var(--pp-line-strong); border-radius: 999px; background: #FFFFFF; font-size: 13px; cursor: pointer; }
html body .bu-checks label.on { border-color: var(--pp-violet); background: var(--pp-violet-soft); }
html body .bu-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
html body .staff-unit-empty { color: var(--pp-muted); font-size: 12.5px; }
html body [data-staff-scope-section].unit-locked .oa-scope-options, html body [data-staff-scope-section].unit-locked .staff-oa-list { opacity: .45; pointer-events: none; }
html body .staff-unit-note { margin: 0 0 6px; padding: 7px 10px; border-radius: 10px; background: var(--pp-violet-soft); color: #4B2FD1; font-size: 12.5px; font-weight: 650; }
html body .staff-role-options label.needs-unit { opacity: .55; }

/* Hướng dẫn sử dụng: nút "Hướng dẫn" cạnh tiêu đề trang + trang #/help/<chủ đề> */
html body .page-title-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
html body .page-help-button { display: inline-flex; align-items: center; gap: 5px; height: 28px; margin-top: 2px; padding: 0 10px 0 7px; border: 1px solid var(--pp-line-strong); border-radius: 999px; background: var(--surface); color: var(--pp-violet-pressed); font: inherit; font-size: 12px; font-weight: 650; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s; }
html body .page-help-button:hover { background: var(--pp-violet-soft); border-color: var(--pp-violet); }
html body .page-help-button:focus-visible { outline: 2px solid var(--pp-violet); outline-offset: 2px; }
html body .page-help-button .app-icon { width: 16px; height: 16px; }
html body .page-help-button[hidden] { display: none; }
html body .help-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; align-items: start; }
html body .help-toc { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 110px); overflow: auto; padding: 14px; }
html body .help-toc nav { display: flex; flex-direction: column; gap: 2px; }
html body .help-toc-group { margin: 10px 8px 4px; color: var(--pp-muted); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
html body .help-toc-group:first-child { margin-top: 0; }
html body .help-toc-item { width: 100%; padding: 8px 10px; border: 0; border-radius: var(--pp-radius-control); background: transparent; color: var(--pp-ink); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
html body .help-toc-item:hover { background: var(--pp-subtle); }
html body .help-toc-item.active { background: var(--pp-violet-soft); color: var(--pp-violet-pressed); font-weight: 650; }
html body .help-toc-empty { margin: 8px; color: var(--pp-muted); font-size: 13px; }
html body .help-article { padding: 26px 30px; max-width: 860px; }
html body .help-article-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 16px; margin-bottom: 6px; border-bottom: 1px solid var(--pp-line); }
html body .help-article-group { color: var(--pp-violet); font-size: 12px; font-weight: 700; }
html body .help-article-head h2 { margin: 2px 0 0; font-size: 22px; letter-spacing: -.01em; }
html body .help-article-head p { margin: 6px 0 0; color: var(--pp-muted); font-size: 14px; line-height: 1.55; }
html body .help-article-head .secondary-button { flex-shrink: 0; }
html body .help-section { padding-top: 16px; }
html body .help-section h3 { margin: 0 0 6px; font-size: 16px; }
html body .help-article p, html body .help-article li { color: var(--pp-ink); font-size: 14px; line-height: 1.6; }
html body .help-section p { margin: 0 0 6px; }
html body .help-article ol, html body .help-article ul { margin: 4px 0 6px; padding-left: 22px; }
html body .help-article li + li { margin-top: 4px; }
html body .help-article strong { font-weight: 650; }
html body .help-tips { margin-top: 20px; padding: 12px 16px; border-radius: 12px; background: var(--pp-butter-bg); }
html body .help-tips > strong { display: flex; align-items: center; gap: 6px; color: var(--pp-butter-fg); font-size: 13px; }
html body .help-tips .app-icon { width: 16px; height: 16px; }
html body .help-article-foot { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--pp-line); text-align: right; }
@media (max-width: 900px) {
  html body .help-layout { grid-template-columns: 1fr; }
  html body .help-toc { position: static; max-height: none; }
  html body .help-article { padding: 18px 16px; }
  html body .help-article-head { flex-direction: column; }
  html body .page-help-button span { display: none; }
  html body .page-help-button { width: 28px; padding: 0; justify-content: center; }
}

/* ----- Tin nhắc nhở (dac-ta-tin-nhac-nho.md): thẻ trong mục NHẮC NHỞ của Mini App, viền trái theo loại ----- */
html body #workflowBuilderView .workflow-palette > button[data-workflow-type="reminder"] { background: var(--pp-butter-bg); color: var(--pp-butter-fg); }
html body.workflow-focus #workflowBuilderView .workflow-palette > button[data-workflow-type="reminder"] b { background: var(--pp-butter-bg); color: var(--pp-butter-fg); }
html body #workflowBuilderView .workflow-node.reminder .workflow-node-main { background: var(--pp-butter-bg); }
html body #workflowBuilderView .workflow-node.reminder .workflow-node-icon { background: #FFFFFF; color: var(--pp-butter-fg); }
html body .rm-card { --rm-tone: #8B5CF6; display: flex; gap: 10px; padding: 11px 12px; border-left: 4px solid var(--rm-tone); border-radius: 10px; background: #FFFFFF; box-shadow: 0 3px 10px rgba(30, 20, 80, .07); text-align: left; }
html body .rm-card + .rm-card { margin-top: 8px; }
html body .rm-card.current { box-shadow: 0 0 0 2px var(--pp-violet), 0 3px 10px rgba(30, 20, 80, .07); }
html body .rm-card .rm-icon { display: inline-flex; flex: none; width: 30px; height: 30px; align-items: center; justify-content: center; border-radius: 50%; background: color-mix(in srgb, var(--rm-tone) 14%, #FFFFFF); color: var(--rm-tone); }
html body .rm-card .rm-icon .app-icon { width: 16px; height: 16px; }
html body .rm-card .rm-text { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 3px; }
html body .rm-card .rm-text b { color: var(--pp-ink); font-size: 13px; line-height: 1.3; }
html body .rm-card .rm-text p { margin: 0; color: #4B4766; font-size: 12px; line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; }
html body .rm-card .rm-text small { color: var(--pp-muted); font-size: 11px; }
html body .rm-card .rm-cta { align-self: flex-start; margin-top: 4px; padding: 4px 10px; border: 0; border-radius: 999px; background: var(--rm-tone); color: #FFFFFF; font-size: 11px; font-weight: 700; }
html body .rm-card mark.is-missing { padding: 0 3px; border-radius: 4px; background: var(--pp-rose-bg); color: var(--pp-rose-fg); }
html body .rm-tone-red { --rm-tone: #D92D20; }
html body .rm-tone-orange { --rm-tone: #E8590C; }
html body .rm-tone-blue { --rm-tone: #1F6FEB; }
html body .rm-tone-yellow { --rm-tone: #C99100; }
html body .rm-tone-purple { --rm-tone: #8B5CF6; }
html body .rm-section-title { margin: 6px 0 8px; color: #A71925; font-size: 12px; font-weight: 800; letter-spacing: .04em; }
html body .rm-preview-box { padding: 10px; border-radius: 12px; background: #F5F7FB; }
html body #miniAppRemindersArea .rm-vars { display: flex; flex-wrap: wrap; gap: 6px; }
html body #miniAppRemindersArea .rm-vars button { padding: 4px 9px; border: 1px dashed var(--pp-line); border-radius: 999px; background: #FFFFFF; color: var(--pp-ink); font-size: 12px; font-family: inherit; cursor: pointer; }
html body #miniAppRemindersArea .rm-vars button:hover { border-color: var(--pp-violet); color: var(--pp-violet); }
html body #miniAppRemindersArea .rm-samples { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
html body #miniAppRemindersArea .rm-samples label span code { font-size: 12px; }
html body #miniAppRemindersArea .rm-window { color: var(--pp-muted); font-size: 12px; }
html body #miniAppRemindersArea .nw-chip.rm-chip { background: color-mix(in srgb, var(--rm-tone) 14%, #FFFFFF); color: var(--rm-tone); }

/* Cảnh báo chế độ test nội bộ (Cài đặt › PT Club › kích hoạt bằng SĐT lạ = test): luôn nằm trên đầu trang */
html body .test-mode-banner { position: sticky; top: 0; z-index: 60; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0 0 12px; padding: 10px 16px; border-radius: 12px; background: #C62828; color: #FFFFFF; box-shadow: 0 4px 14px rgba(198, 40, 40, .35); font-size: 13.5px; line-height: 1.45; }
html body .test-mode-banner strong { font-size: 14px; letter-spacing: .4px; }
html body .test-mode-banner span { flex: 1 1 320px; }
html body .test-mode-banner .secondary-button { background: #FFFFFF; color: #C62828; border-color: #FFFFFF; }
/* "Xem như" tài khoản khác (chỉ xem) */
html body .view-as-banner { position: sticky; top: 0; z-index: 61; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0 0 12px; padding: 10px 16px; border-radius: 12px; background: #5B3FD6; color: #FFFFFF; box-shadow: 0 4px 14px rgba(91, 63, 214, .35); font-size: 13.5px; line-height: 1.45; }
html body .view-as-banner[hidden] { display: none; }
html body .view-as-banner strong { font-size: 14px; letter-spacing: .4px; }
html body .view-as-banner > span { flex: 1 1 320px; }
html body .view-as-banner .secondary-button { background: #FFFFFF; color: #5B3FD6; border-color: #FFFFFF; font-weight: 600; }

/* Tài khoản của tôi */
html body .my-account-modal { max-width: 520px; }
html body .my-account-section { padding: 18px 22px 4px; border-top: 1px solid var(--pp-line, #E5E7EB); }
html body .my-account-section:first-of-type { border-top: 0; }
html body .my-account-section h3 { margin: 0 0 4px; font-size: 15px; }
html body .my-account-section .staff-password-form { padding: 10px 0 0; }
html body .my-account-section .modal-actions { padding: 0 0 14px; }
html body .my-account-status { margin: 0; color: var(--pp-muted, #6B7280); font-size: 13px; }
html body .my-account-status.is-ok { color: #1B7F4B; font-weight: 600; }
html body .my-account-message { margin: 0; padding: 8px 12px; border-radius: 10px; background: #EAF6EE; color: #1B5E3A; font-size: 13px; }
html body .my-account-message.is-error { background: #FDECEC; color: #A4262C; }

/* Cài đặt › Hệ thống › Email gửi đi (SMTP) */
html body .email-settings-panel { grid-column: 1 / -1; }
html body .email-settings-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 16px; }
html body .email-settings-form label { display: grid; gap: 6px; font-size: 13px; }
html body .email-settings-form label.email-settings-check { display: flex; align-items: center; gap: 8px; }
html body .email-settings-form .my-account-message, html body .email-settings-form .email-settings-actions, html body .email-settings-form > small { grid-column: 1 / -1; }
html body .email-settings-form > small { color: var(--pp-muted, #6B7280); }
html body .email-settings-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
html body .email-settings-actions input { flex: 0 1 260px; min-width: 0; }

/* Lỗi & góp ý app (Mini App › Lỗi & góp ý app) + nút làm mới dữ liệu trên thanh đầu trang */
html body .topbar-refresh { width: 36px; height: 36px; border-radius: 999px; background: #FFFFFF; box-shadow: var(--pp-shadow); }
html body .topbar-refresh.is-loading .app-icon { animation: fb-spin .9s linear infinite; }
@keyframes fb-spin { to { transform: rotate(360deg); } }
html body #miniAppFeedbackArea .nw-toolbar { margin-bottom: 10px; }
html body #miniAppFeedbackArea .fb-search { flex: 1 1 240px; max-width: 360px; height: 36px; padding: 0 12px; border: 1px solid var(--pp-line-strong); border-radius: 999px; font: inherit; font-size: 13.5px; }
html body #miniAppFeedbackArea .fb-report { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
html body #miniAppFeedbackArea .fb-report label { display: flex; align-items: center; gap: 6px; color: var(--pp-muted); font-size: 13px; }
html body #miniAppFeedbackArea .fb-report input { height: 34px; padding: 0 8px; border: 1px solid var(--pp-line-strong); border-radius: 10px; font: inherit; font-size: 13px; }
html body #miniAppFeedbackArea .fb-report .secondary-button { height: 34px; }
html body #miniAppFeedbackArea .fb-muted { margin: 4px 0 10px; color: var(--pp-muted); font-size: 13px; }
html body #miniAppFeedbackArea [data-fb-open] { cursor: pointer; }
html body #miniAppFeedbackArea [data-fb-open]:hover td { background: var(--pp-subtle); }
html body #miniAppFeedbackArea [data-fb-more] { margin-top: 10px; }
html body #miniAppFeedbackArea .fb-drawer { width: min(680px, 100vw); }
html body #miniAppFeedbackArea .fb-drawer > header { gap: 8px; }
html body #miniAppFeedbackArea .fb-drawer > header strong { margin-right: auto; }
html body #miniAppFeedbackArea .fb-drawer > footer .nw-spacer { flex: 1; }
html body #miniAppFeedbackArea .fb-description { margin: 0; white-space: pre-wrap; font-size: 14.5px; line-height: 1.55; }
html body #miniAppFeedbackArea .fb-images { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
html body #miniAppFeedbackArea .fb-images img { display: block; width: 140px; height: 240px; object-fit: cover; border: 1px solid var(--pp-line); border-radius: 10px; }
html body #miniAppFeedbackArea .fb-info { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 6px 12px; margin: 0; font-size: 13.5px; }
html body #miniAppFeedbackArea .fb-info dt { color: var(--pp-muted); }
html body #miniAppFeedbackArea .fb-info dd { margin: 0; overflow-wrap: anywhere; }
html body #miniAppFeedbackArea .fb-api td { font-size: 13px; }
html body #miniAppFeedbackArea .fb-copy { padding: 2px 6px; border: 1px dashed var(--pp-line-strong); border-radius: 6px; background: #FFFFFF; cursor: pointer; }
html body #miniAppFeedbackArea .fb-actions { margin: 0; padding-left: 0; list-style: none; font-size: 13px; }
html body #miniAppFeedbackArea .fb-actions li { display: flex; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--pp-line); }
html body #miniAppFeedbackArea .fb-actions time { color: var(--pp-muted); font-variant-numeric: tabular-nums; }
html body #miniAppFeedbackArea .fb-actions span { min-width: 64px; color: var(--pp-violet); font-weight: 650; }
html body #miniAppFeedbackArea .fb-console { margin-top: 14px; }
html body #miniAppFeedbackArea .fb-console summary { cursor: pointer; font-weight: 650; }
html body #miniAppFeedbackArea .fb-console pre { max-height: 320px; overflow: auto; padding: 10px; border-radius: 10px; background: #1D1A2E; color: #E8E6F5; font-size: 12px; white-space: pre-wrap; }
@media (max-width: 780px) { html body #miniAppFeedbackArea .fb-info { grid-template-columns: 1fr; } }

/* ---------- Thu gọn / mở rộng nhóm menu (bấm nhãn nhóm) ---------- */
body .sidebar .nav-section-label[role="button"] {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  cursor: pointer; user-select: none; border-radius: 6px;
}
body .sidebar .nav-section-label[role="button"]:hover { color: var(--pp-ink); }
body .sidebar .nav-section-label[role="button"]:focus-visible { outline: 2px solid var(--pp-violet-soft); outline-offset: 2px; }
body .sidebar .nav-section-caret {
  width: 7px; height: 7px; margin-right: 4px; flex: none;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px); transition: transform .15s ease;
}
body .sidebar .nav-section-label.collapsed .nav-section-caret { transform: rotate(-45deg); }
body .sidebar .nav-item.nav-group-collapsed:not(.active) { display: none; }
/* Thanh điều hướng thu nhỏ còn icon: nhãn nhóm chỉ là vạch kẻ, không bấm được, nên luôn hiện đủ icon */
@media (min-width: 781px) {
  body.sidebar-collapsed .sidebar .nav-item.nav-group-collapsed:not(.active):not([hidden]) { display: flex; }
  body.sidebar-collapsed .sidebar .nav-section-label[role="button"] { display: block; pointer-events: none; }
  body.sidebar-collapsed .sidebar .nav-section-caret { display: none; }
}

/* Nút Xóa OA ở trang Kết nối Zalo OA */
html body #zalo-view .zc-actions .zc-delete-oa { color: var(--pp-rose-fg); }
html body #zalo-view .zc-actions .zc-delete-oa:hover:not(:disabled) { background: var(--pp-rose-bg); border-color: var(--pp-rose-bg); }

/* Khu "OA đã ngừng hoạt động" dưới danh sách OA */
html body #zalo-view .zc-archived { margin-top: 12px; border-top: 1px solid var(--pp-line, #e6e1f5); padding-top: 10px; }
html body #zalo-view .zc-archived[hidden] { display: none; }
html body #zalo-view .zc-archived summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--pp-ink-2); list-style: revert; }
html body #zalo-view .zc-archived summary span { display: inline-block; min-width: 20px; margin-left: 4px; padding: 0 6px; border-radius: 999px; background: var(--pp-subtle); text-align: center; font-size: 12px; }
html body #zalo-view .zc-archived-note { margin: 6px 0 8px; color: var(--pp-ink-2); font-size: 12px; line-height: 1.45; }
html body #zalo-view .zc-archived-list { display: grid; gap: 8px; }
html body #zalo-view .zc-archived-card { display: grid; gap: 6px; padding: 10px; border: 1px dashed var(--pp-line-strong, #d6cfee); border-radius: 12px; opacity: .85; }
html body #zalo-view .zc-archived-meta { color: var(--pp-ink-2); font-size: 12px; }
html body #zalo-view .zc-archived-actions { display: flex; gap: 6px; flex-wrap: wrap; }
html body #zalo-view .zc-archived-actions button { height: 32px; padding: 0 12px; font-size: 12.5px; }

/* ----- Khung hướng dẫn nổi (#helpFloat): không nền che, kéo tiêu đề để di chuyển, kéo góc để đổi cỡ ----- */
html body .help-float { position: fixed; top: 96px; right: 24px; z-index: 1100; display: flex; flex-direction: column; width: 420px; height: 70vh; min-width: 320px; min-height: 240px; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); overflow: hidden; resize: both; border: 1px solid var(--pp-line-strong, #d6cfee); border-radius: 16px; background: #FFFFFF; box-shadow: 0 18px 50px rgba(40, 28, 100, .22), 0 2px 6px rgba(40, 28, 100, .08); }
html body .help-float[hidden] { display: none; }
html body .help-float.dragging { user-select: none; opacity: .96; }
html body .help-float-head { display: flex; align-items: center; gap: 6px; flex-shrink: 0; padding: 8px 8px 8px 12px; border-bottom: 1px solid var(--pp-line); background: var(--pp-violet-soft); cursor: move; touch-action: none; }
html body .help-float-grip { display: grid; place-items: center; color: var(--pp-violet-pressed); }
html body .help-float-grip .app-icon { width: 18px; height: 18px; }
html body .help-float-head select { flex: 1; min-width: 0; height: 30px; padding: 0 8px; border: 1px solid var(--pp-line-strong, #d6cfee); border-radius: 8px; background: #FFFFFF; color: var(--pp-ink); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
html body .help-float-tool { display: grid; place-items: center; flex-shrink: 0; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--pp-ink-2); cursor: pointer; }
html body .help-float-tool:hover { background: #FFFFFF; color: var(--pp-violet-pressed); }
html body .help-float-tool:focus-visible { outline: 2px solid var(--pp-violet); outline-offset: 1px; }
html body .help-float-tool .app-icon { width: 17px; height: 17px; }
html body .help-float-body { flex: 1; min-height: 0; max-width: none; margin: 0; padding: 16px 18px 22px; overflow: auto; border-radius: 0; box-shadow: none; }
html body .help-float-body .help-article-head { flex-direction: column; gap: 10px; }
html body .help-float-body .help-article-head h2 { font-size: 18px; }
html body .help-float-body p, html body .help-float-body li { font-size: 13.5px; }
html body .help-float.minimized { height: auto !important; min-height: 0; resize: none; }
html body .help-float.minimized .help-float-body { display: none; }
html body .help-float.minimized .help-float-head { border-bottom: 0; }
html body .page-help-button[aria-expanded="true"] { background: var(--pp-violet-soft); border-color: var(--pp-violet); }
@media (max-width: 700px) {
  html body .help-float { top: auto !important; left: 8px !important; right: 8px !important; bottom: 8px; width: auto !important; height: 50vh !important; min-width: 0; resize: none; }
  html body .help-float.minimized { height: auto !important; }
  html body .help-float-head { cursor: default; }
}

/* ----- Mini App › Thống kê sử dụng (dùng chung kiểu nw-* của Tin tức) + khối "Hoạt động trên Mini App" trong hồ sơ C360 ----- */
html body #miniAppUsageArea .nw-card { margin-bottom: 12px; }
html body #miniAppUsageArea .nw-card h3 { margin: 0; font-size: 16px; }
html body #miniAppUsageArea .nw-toolbar small { color: var(--pp-muted); }
html body #miniAppUsageArea .us-controls { display: flex; flex-wrap: wrap; gap: 10px; }
html body #miniAppUsageArea .us-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
html body #miniAppUsageArea .us-grid .nw-card { margin-bottom: 12px; }
html body #miniAppUsageArea .us-grid .nw-table { min-width: 0; }
html body #miniAppUsageArea .us-members { min-width: 1080px; }
html body #miniAppUsageArea .us-chart { display: flex; align-items: stretch; gap: 2px; height: 200px; margin: 10px 0 4px; padding-top: 18px; border-bottom: 1px solid var(--pp-line); }
html body #miniAppUsageArea .us-bar { position: relative; display: flex; flex: 1 1 0; min-width: 0; flex-direction: column; justify-content: flex-end; align-items: center; outline: none; }
html body #miniAppUsageArea .us-bar-stack { display: flex; width: min(28px, 100%); min-height: 0; flex-direction: column; gap: 2px; }
html body #miniAppUsageArea .us-bar-stack i { display: block; min-height: 0; }
html body #miniAppUsageArea .us-bar-stack i:first-child { border-radius: 4px 4px 0 0; }
html body #miniAppUsageArea .us-bar-stack .us-guest[style*="flex-grow:0"] { display: none; }
html body #miniAppUsageArea .us-member, html body #miniAppUsageArea .us-legend .us-member { background: #6D5EF0; }
html body #miniAppUsageArea .us-guest, html body #miniAppUsageArea .us-legend .us-guest { background: #E08A3C; }
html body #miniAppUsageArea .us-bar:hover .us-bar-stack, html body #miniAppUsageArea .us-bar:focus .us-bar-stack { filter: brightness(.88); }
html body #miniAppUsageArea .us-bar-value { position: absolute; top: -16px; color: var(--pp-muted); font-size: 11px; font-weight: 700; opacity: 0; }
html body #miniAppUsageArea .us-bar:hover .us-bar-value, html body #miniAppUsageArea .us-bar:focus .us-bar-value { opacity: 1; }
html body #miniAppUsageArea .us-bar small { position: absolute; bottom: -20px; color: var(--pp-muted); font-size: 11px; white-space: nowrap; }
html body #miniAppUsageArea .us-legend { display: flex; gap: 16px; margin-top: 26px; color: var(--pp-ink-2); font-size: 12.5px; }
html body #miniAppUsageArea .us-legend span { display: inline-flex; align-items: center; gap: 6px; }
html body #miniAppUsageArea .us-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
html body #miniAppUsageArea .us-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
html body #miniAppUsageArea th.us-num { text-align: right; }
html body #miniAppUsageArea .us-zero { color: var(--pp-muted); }
html body :is(#miniAppUsageArea, #profileMiniAppUsage) .us-fail { color: var(--pp-rose-fg); font-style: normal; font-weight: 700; }
html body #miniAppUsageArea .us-meter-cell { width: 40%; }
html body #miniAppUsageArea .us-meter { display: block; height: 8px; border-radius: 4px; background: var(--pp-subtle); }
html body #miniAppUsageArea .us-meter i { display: block; height: 100%; border-radius: 4px; background: #6D5EF0; }
html body #miniAppUsageArea .us-screens { min-width: 180px; color: var(--pp-ink-2); font-size: 13px; }
html body #miniAppUsageArea .us-members tr.us-link { cursor: pointer; }
html body #miniAppUsageArea .us-members tr.us-link:hover td { background: var(--pp-violet-soft); }
html body #miniAppUsageArea .us-filter-label { align-self: center; margin-right: 2px; color: var(--pp-muted); font-size: 13px; font-weight: 650; }
html body #miniAppUsageArea .us-sort { display: inline-flex; align-items: center; gap: 6px; color: var(--pp-muted); font-size: 13px; }
html body #miniAppUsageArea .us-sort select { height: 34px; border-radius: 10px; }
html body #miniAppUsageArea [data-us-more] { margin-top: 10px; }
html body #profileMiniAppUsage .us-days { display: flex; align-items: flex-end; gap: 2px; height: 48px; margin: 12px 0; }
html body #profileMiniAppUsage .us-days i { flex: 1 1 0; border-radius: 3px 3px 0 0; background: #6D5EF0; }
html body #profileMiniAppUsage .us-days i.empty { background: var(--pp-line); }
html body #profileMiniAppUsage .us-actions { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
html body #profileMiniAppUsage .us-actions span { padding: 8px 10px; border-radius: 12px; background: var(--pp-subtle); }
html body #profileMiniAppUsage .us-actions span.muted { opacity: .6; }
html body #profileMiniAppUsage .us-actions small { display: block; color: var(--pp-muted); font-size: 12px; }
html body #profileMiniAppUsage .us-actions strong { font-size: 18px; }
html body #profileMiniAppUsage .us-actions em { display: block; font-size: 11.5px; }
html body #profileMiniAppUsage .profile-detail-grid small + small { display: block; color: var(--pp-muted); }
@media (max-width: 900px) {
  html body #miniAppUsageArea .us-grid { grid-template-columns: 1fr; }
  html body #miniAppUsageArea .nw-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html body #profileMiniAppUsage .us-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Nút đang gửi request lên máy chủ (submit-guard.js): ẩn nút, giữ chỗ, hiện vòng xoay ở giữa chỗ nút. */
html body [data-submit-busy] { visibility: hidden !important; pointer-events: none !important; }
html body [data-submit-busy="static"] { position: relative; }
html body button[data-submit-busy]::after {
  content: "";
  visibility: visible;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  box-sizing: border-box;
  border: 2px solid var(--pp-violet, #6C47FF);
  border-right-color: transparent;
  border-radius: 50%;
  animation: submit-guard-spin 0.7s linear infinite;
}
@keyframes submit-guard-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { html body button[data-submit-busy]::after { animation-duration: 2s; } }

/* ---------- Chống tấn công (Cài đặt › Bảo mật IP) ---------- */
html body .security-guard { margin-top: 16px; }
html body .security-guard-form { display: grid; gap: 14px; }
html body .sg-group { display: grid; gap: 10px; margin: 0; padding: 12px 14px 14px; border: 1px solid var(--pp-line); border-radius: var(--pp-radius-card); min-width: 0; }
html body .sg-group legend { padding: 0 6px; font-size: 13px; font-weight: 700; color: var(--pp-ink); }
html body .sg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
html body .sg-field { display: grid; gap: 4px; align-content: start; }
html body .sg-field > span { font-size: 12px; font-weight: 700; color: var(--pp-ink-2); }
html body .sg-field input, html body .sg-field textarea, html body .sg-filter { width: 100%; padding: 8px 10px; border: 1px solid var(--pp-line-strong); border-radius: var(--pp-radius-control); background: #fff; color: var(--pp-ink); font-size: 13px; }
html body .sg-field textarea { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; resize: vertical; }
html body .sg-field small { color: var(--pp-muted); font-size: 11.5px; }
html body .sg-check { display: flex; gap: 10px; align-items: flex-start; color: var(--pp-ink-2); font-size: 13px; line-height: 1.5; cursor: pointer; }
html body .sg-check input { margin-top: 3px; flex: 0 0 auto; }
html body .sg-recipients { margin: 0; font-size: 12.5px; color: var(--pp-ink-2); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
html body .sg-warn { color: var(--pp-butter-fg); font-weight: 600; }
html body .sg-buttons { display: inline-flex; gap: 8px; flex-wrap: wrap; }
html body .sg-section { margin-top: 20px; }
html body .sg-section-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
html body .sg-section-head h4 { margin: 0; font-size: 13px; }
html body .sg-section-head > span { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
html body .sg-section-head .sg-filter { width: 220px; max-width: 100%; }
html body .sg-list { border: 1px solid var(--pp-line); border-radius: var(--pp-radius-card); overflow: hidden; max-height: 520px; overflow-y: auto; }
html body .sg-row { display: grid; grid-template-columns: minmax(130px, 0.8fr) minmax(0, 1.6fr) minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--pp-line); font-size: 12.5px; }
html body .sg-row:last-child { border-bottom: 0; }
html body .sg-row > span { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
html body .sg-row small, html body .sg-row time { color: var(--pp-muted); font-size: 11.5px; }
html body .sg-actions { display: inline-flex !important; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
html body .sg-actions button { padding: 4px 10px; font-size: 12px; }
html body .sg-badge { justify-self: start; padding: 1px 8px; border-radius: 999px; background: var(--pp-rose-bg); color: var(--pp-rose-fg) !important; font-weight: 700; }
@media (max-width: 760px) {
  html body .sg-grid { grid-template-columns: 1fr; }
  html body .sg-row { grid-template-columns: 1fr; gap: 4px; }
  html body .sg-actions { justify-content: flex-start; }
}
html body .sg-row code { justify-self: start; }
html body .sg-row.sg-event { grid-template-columns: 110px minmax(0, 1fr) 170px 210px; }
html body .sg-row.sg-event > span:last-child { text-align: right; }
@media (max-width: 760px) {
  html body .sg-row.sg-event { grid-template-columns: 1fr; }
  html body .sg-row.sg-event > span:last-child { text-align: left; }
}

/* Nút "Báo lỗi" HUB (hub-feedback.js) + hộp báo lỗi kèm ảnh chụp màn hình */
html body .topbar-feedback { color: var(--pp-rose-fg); }
html body #hubFeedbackModal.hfb-capturing { opacity: 0 !important; pointer-events: none; transition: none; }
html body .hfb-modal .hfb-body { display: grid; gap: 14px; padding: 18px 22px; }
html body .hfb-modal .hfb-body > label, html body .hfb-modal .hfb-images-field { display: grid; gap: 6px; font-size: 13px; color: var(--pp-muted); }
html body .hfb-modal .hfb-body select, html body .hfb-modal .hfb-body textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--pp-line-strong); border-radius: 10px; font: inherit; font-size: 14px; color: var(--pp-ink, inherit); background: #FFFFFF; }
html body .hfb-modal .hfb-body textarea { resize: vertical; min-height: 110px; }
html body .hfb-modal .hfb-images { display: flex; flex-wrap: wrap; gap: 8px; }
html body .hfb-modal .hfb-images:empty { display: none; }
html body .hfb-modal .hfb-images figure { position: relative; margin: 0; width: 132px; height: 84px; border: 1px solid var(--pp-line); border-radius: 10px; overflow: hidden; background: var(--pp-subtle); }
html body .hfb-modal .hfb-images img { width: 100%; height: 100%; object-fit: cover; display: block; }
html body .hfb-modal .hfb-images figure button { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border: 0; border-radius: 50%; background: rgba(29, 26, 46, .7); color: #FFFFFF; font-size: 14px; line-height: 1; cursor: pointer; }
html body .hfb-modal .hfb-image-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
html body .hfb-modal .hfb-image-actions .secondary-button { height: 34px; display: inline-flex; align-items: center; cursor: pointer; }
html body .hfb-modal .hfb-image-actions .is-disabled { opacity: .45; pointer-events: none; }
html body .hfb-modal .hfb-error { margin: 0; padding: 8px 10px; border-radius: 10px; background: var(--pp-rose-bg, #FDECEF); color: var(--pp-rose-fg); font-size: 13px; }
html body #miniAppFeedbackArea .fb-images.is-hub img { width: 100%; height: auto; max-height: 420px; object-fit: contain; background: var(--pp-subtle); }
html body #miniAppFeedbackArea .fb-source { display: inline-block; margin-right: 6px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--pp-sky-bg); color: var(--pp-sky-fg); }
html body #miniAppFeedbackArea .fb-source.is-miniapp { background: var(--pp-violet-soft); color: var(--pp-violet-pressed); }
html body #miniAppFeedbackArea .fb-filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
html body #miniAppFeedbackArea .fb-filter-row select { height: 34px; padding: 0 8px; border: 1px solid var(--pp-line-strong); border-radius: 10px; font: inherit; font-size: 13px; background: #FFFFFF; }
@media (max-width: 760px) {
  html body .hfb-modal .hfb-body { padding: 14px 16px; }
  html body .hfb-modal .hfb-images figure { width: calc(50% - 4px); }
}

/* Mini App › Thống kê sử dụng: dòng giải thích phạm vi số liệu (theo Nhóm Hub được phân quyền) */
html body #miniAppUsageArea .us-scope-note { margin: 0 0 14px; padding: 10px 14px; border-radius: 10px; background: #F1EFFE; border: 1px solid #DCD7FB; color: var(--pp-ink-2, #4a4f63); font-size: 13px; line-height: 1.5; }
html body #miniAppUsageArea .us-scope-note strong { color: var(--pp-ink-1, #1f2433); }
html body #miniAppUsageArea .us-scope-note.is-scoped { background: #FFF6EC; border-color: #F5D9B8; }
