/* Khung "Thiết lập trang" (bố cục kiểu VTPay, màu/phông của website). Dùng cho profile, bank-account, donations,
   overlay-settings, security. dashboard.js dựng thanh bên và bọc <main class="settings"> sẵn có — không đổi nội dung trang. */
.dash {
  --dash-side: clamp(260px, 16vw, 300px);
  display: grid; grid-template-columns: var(--dash-side) minmax(0, 1fr); gap: clamp(20px, 3vw, 36px);
  width: 100%; max-width: none; margin-inline: auto; padding: clamp(18px, 3vw, 32px) var(--gutter) clamp(48px, 6vw, 80px);
  align-items: start;
}

/* ---- Thanh bên ---- */
.dash-side {
  position: sticky; top: 88px; display: grid; align-content: start; gap: 6px; padding: 14px; border-radius: 22px;
  background: var(--slot); border: 1px solid rgba(20, 22, 26, 0.07);
  box-shadow: 0 1px 2px rgba(20, 22, 26, 0.04), 0 16px 40px -24px rgba(20, 22, 26, 0.25);
  max-height: calc(100vh - 110px); overflow-y: auto;
}
.dash-group-title {
  font: 700 0.78rem/1 var(--font-label); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3);
  padding: 14px 12px 6px;
}
.dash-group-title:first-child { padding-top: 6px; }
.dash-link {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 12px; border: 0;
  background: none; color: var(--ink-2); font: 500 0.97rem/1.2 var(--font-text); text-align: left; text-decoration: none; cursor: pointer;
  transition: background 0.18s, color 0.18s;
}
.dash-link:hover { background: var(--plate); color: var(--ink); }
.dash-link[aria-current="page"] { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: 0 0 0 1px rgba(20, 22, 26, 0.06), 0 6px 14px -8px rgba(20, 22, 26, 0.3); }
.dash-link[aria-current="page"] .dash-ic { color: var(--orange-deep); }
.dash-link.is-soon { color: var(--ink-3); cursor: default; }
.dash-link.is-soon:hover { background: none; }
.dash-ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dash-link .grow { flex: 1; }
.dash-pill { font: 600 0.72rem/1 var(--font-text); padding: 4px 8px; border-radius: 99px; background: var(--plate-2); color: var(--ink-3); }

/* Thẻ trang của bạn */
.dash-page-card {
  display: flex; align-items: center; gap: 12px; padding: 12px; margin: 2px 0 6px; border-radius: 16px;
  background: var(--surface); border: 1px solid rgba(20, 22, 26, 0.07); text-decoration: none; color: inherit;
}
.dash-avatar {
  width: 44px; height: 44px; border-radius: 50%; flex: none; object-fit: cover; display: grid; place-items: center;
  background: var(--orange); color: var(--ink); font: 800 1.1rem/1 var(--font-display); overflow: hidden;
}
.dash-page-meta { flex: 1; min-width: 0; display: grid; gap: 2px; }
.dash-page-meta strong { font: 700 0.98rem/1.2 var(--font-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-page-meta span { color: var(--ink-3); font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-view {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--ink-2); flex: none;
  background: var(--plate); text-decoration: none;
}
.dash-view:hover { background: var(--orange); color: var(--ink); }

/* Nhóm mở/đóng (Trang donate) */
.dash-sub { display: grid; gap: 2px; margin: 2px 0 4px 20px; padding-left: 12px; border-left: 2px solid var(--plate-2); }
.dash-sub .dash-link { padding: 9px 12px; font-size: 0.93rem; }
.dash-toggle .dash-chev { transition: transform 0.25s var(--ease-out); }
.dash-toggle[aria-expanded="false"] .dash-chev { transform: rotate(-90deg); }

/* ---- Nội dung ---- */
.dash-main { min-width: 0; display: grid; gap: 18px; }
.dash-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
  padding: 20px 24px; border-radius: 22px; background: var(--surface); border: 1px solid rgba(20, 22, 26, 0.07);
}
.dash-crumbs { color: var(--ink-3); font-size: 0.88rem; margin-bottom: 4px; }
.dash-head h1 { margin: 0; font: 800 clamp(1.4rem, 2.4vw, 1.9rem)/1.1 var(--font-display); letter-spacing: -0.02em; }
.dash-head p { margin: 6px 0 0; color: var(--ink-3); max-width: 60ch; }
.dash-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--plate); flex-wrap: wrap; }
.dash-tabs a {
  padding: 8px 14px; border-radius: 10px; font: 600 0.9rem/1 var(--font-text); color: var(--ink-2); text-decoration: none; white-space: nowrap;
}
.dash-tabs a:hover { background: rgba(255, 255, 255, 0.7); }
.dash-tabs a[aria-current="page"] { background: var(--orange); color: var(--ink); }
.dash-menu-btn { display: none; }
.dash-scrim { display: none; }

/* Trang cũ (<main class="settings">) nằm trong khung: bỏ khoảng đệm/độ rộng riêng của nó. */
.dash-main main.settings { min-height: 0; padding: 0; }
.dash-main main.settings .wrap { max-width: none; padding: 0; display: grid; gap: 18px; }
/* Màn rộng, trang Bảo mật (nhiều thẻ độc lập: 2FA, mật khẩu, email): xếp hai cột kiểu cột báo — thẻ chảy từ trên xuống
   nên không để lỗ khi hai thẻ cạnh nhau cao thấp khác nhau. Trang một thẻ lớn (Thanh toán...) giữ một cột rộng. */
@media (min-width: 1500px) {
  body[data-dash="security"] .dash-main main.settings .wrap { display: block; columns: 2; column-gap: 18px; }
  body[data-dash="security"] .dash-main main.settings .wrap > * { break-inside: avoid; margin-bottom: 18px; }
}
.dash-main .settings-card { margin: 0; max-width: none; }

@media (max-width: 960px) {
  .dash { grid-template-columns: 1fr; }
  .dash-side {
    position: fixed; z-index: 60; top: 0; left: 0; bottom: 0; width: min(86vw, 320px); max-height: none; border-radius: 0 22px 22px 0;
    transform: translateX(-104%); transition: transform 0.3s var(--ease-out);
  }
  .dash.is-open .dash-side { transform: none; }
  .dash-scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(20, 22, 26, 0.35); opacity: 0; pointer-events: none; transition: opacity 0.25s; }
  .dash.is-open .dash-scrim { opacity: 1; pointer-events: auto; }
  .dash-menu-btn {
    display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 12px; border: 1px solid rgba(20, 22, 26, 0.12);
    background: var(--surface); font: 600 0.92rem/1 var(--font-text); color: var(--ink); cursor: pointer;
  }
  .dash-head { padding: 16px 18px; }
}
.dash-page-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; color: inherit; text-decoration: none; }
/* Đầu trang của khung đã có tiêu đề: ẩn tiêu đề h1 cũ trong thẻ đầu tiên của từng trang. */
.dash-main .settings-card > h1.auth-title { display: none; }
/* Tiêu đề phụ trong thẻ (vd "Đổi mật khẩu"): nhỏ lại cho hợp khung thiết lập. */
.dash-main .settings-card h2.auth-title { font-size: clamp(1.25rem, 2vw, 1.5rem); letter-spacing: -0.01em; }
/* Thanh bên dạng hai thẻ (Cá nhân / Trang). */
.dash-side .acct-tabs { margin-bottom: 4px; }
.dash-pane { display: grid; gap: 4px; }
.dash-pane[hidden] { display: none; }
.dash-pane .dash-page-card { margin-top: 8px; }

/* ---- Thiết lập hồ sơ trang (profile.html + profile-editor.js), kiểu VTPay, màu website ---- */
.pe { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 18px; align-items: start; }
.pe[hidden] { display: none; }
.pe-main { display: grid; gap: 14px; min-width: 0; }
.pe-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface); border: 1px solid rgba(20, 22, 26, 0.07); overflow-x: auto; }
.pe-tab {
  flex: 1; white-space: nowrap; padding: 11px 14px; border: 0; border-radius: 10px; background: none; cursor: pointer;
  font: 600 0.93rem/1 var(--font-text); color: var(--ink-2);
}
.pe-tab:hover { background: var(--plate); }
.pe-tab[aria-selected="true"] { background: var(--orange); color: var(--ink); }
.pe-tab:focus-visible { outline: 2px solid var(--orange-deep); outline-offset: 2px; }
.pe-card { display: grid; gap: 16px; padding: 22px 24px; border-radius: 22px; background: var(--surface); border: 1px solid rgba(20, 22, 26, 0.07); }
.pe-card[hidden] { display: none; }
.pe-card .form-field { margin: 0; }
.pe-h { margin: 0; font: 800 1.2rem/1.2 var(--font-display); letter-spacing: -0.01em; }
.pe-sub { margin: -10px 0 0; color: var(--ink-3); font-size: 0.93rem; }
.pe-label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.pe-label { font-weight: 600; }
.pe-count { font-size: 0.82rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* Ảnh bìa + ảnh đại diện chồng lên như trang thật */
.pe-media { position: relative; padding-bottom: 44px; }
.pe-cover { aspect-ratio: 3 / 1; border-radius: 16px; overflow: hidden; background: linear-gradient(120deg, var(--plate-2), var(--plate)); border: 1px dashed rgba(20, 22, 26, 0.18); }
.pe-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pe-avatar-wrap { position: absolute; left: 20px; bottom: 0; }
.pe-avatar { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; border: 4px solid var(--surface); box-shadow: 0 6px 16px -8px rgba(20, 22, 26, 0.5); }
.pe-avatar-fallback { display: grid; place-items: center; background: var(--orange); color: var(--ink); font: 800 2rem/1 var(--font-display); }
.pe-avatar-fallback[hidden], .pe-avatar[hidden] { display: none; }
.pe-media-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.pe-media-actions > div { display: flex; flex-wrap: wrap; align-items: center; align-content: flex-start; gap: 6px; }
.pe-media-actions .form-hint { flex-basis: 100%; margin: 0; }

.pe-prefixed { display: flex; align-items: stretch; border-radius: 12px; border: 1px solid rgba(20, 22, 26, 0.16); background: var(--surface); overflow: hidden; }
.pe-prefixed:focus-within { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.18); }
.pe-prefix { display: flex; align-items: center; padding: 0 10px 0 12px; background: var(--plate); color: var(--ink-3); font-size: 0.9rem; white-space: nowrap; }
.pe-prefixed input { flex: 1; min-width: 0; border: 0 !important; box-shadow: none !important; background: transparent; }
.pe-prefixed input[readonly] { color: var(--ink-2); }
.pe-copy { border: 0; background: none; padding: 0 12px; color: var(--ink-2); cursor: pointer; }
.pe-copy:hover { color: var(--orange-deep); }
.pe-copy .ic { width: 20px; height: 20px; }

.pe-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.pe-tag { position: relative; }
.pe-tag input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pe-tag span {
  display: inline-block; padding: 8px 14px; border-radius: 99px; border: 1px solid rgba(20, 22, 26, 0.14); background: var(--surface);
  font: 500 0.9rem/1 var(--font-text); color: var(--ink-2); transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.pe-tag:hover span { border-color: var(--orange); }
.pe-tag input:checked + span { background: var(--orange); border-color: var(--orange); color: var(--ink); }
.pe-tag input:disabled + span { opacity: 0.45; }
.pe-tag input:focus-visible + span { outline: 2px solid var(--orange-deep); outline-offset: 2px; }
.pe-socials { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.pe-socials .form-field { margin: 0; }

/* Xem trước */
.pe-side { position: sticky; top: 88px; display: grid; gap: 12px; padding: 18px; border-radius: 22px; background: var(--surface); border: 1px solid rgba(20, 22, 26, 0.07); }
.pe-side-head { display: flex; justify-content: space-between; align-items: center; }
.pe-side .pe-sub { margin-top: -8px; }
.pv { border-radius: 18px; overflow: hidden; background: var(--plate); box-shadow: 0 0 0 1px var(--line); }
.pv-cover { aspect-ratio: 3 / 1; background-size: cover; background-position: center; }
.pv-cover.is-empty { background: linear-gradient(120deg, #ffb48f, var(--orange)); }
.pv-body { display: grid; justify-items: center; gap: 6px; padding: 0 16px 18px; text-align: center; }
.pv-avatar { width: 72px; height: 72px; margin-top: -36px; border-radius: 50%; border: 4px solid var(--plate); overflow: hidden; display: grid; place-items: center; background: var(--orange); color: var(--ink); font: 800 1.6rem/1 var(--font-display); }
.pv-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pv-name { font: 800 1.15rem/1.2 var(--font-display); overflow-wrap: anywhere; }
.pv-handle { color: var(--ink-3); font-size: 0.88rem; }
.pv-chip { padding: 4px 10px; border-radius: 99px; background: var(--surface); color: var(--orange-deep); font: 700 0.78rem/1 var(--font-text); }
.pv-chip[hidden] { display: none; }
.pv-bio { margin: 4px 0 0; white-space: pre-line; overflow-wrap: anywhere; color: var(--ink-2); font-size: 0.9rem; max-height: 9.5em; overflow: hidden; }
.pv-bio:empty { display: none; }
.pv-tags, .pv-socials { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.pv-tags span { font-size: 0.8rem; color: var(--ink-2); }
.pv-socials span { padding: 5px 10px; border-radius: 99px; background: var(--surface); font: 600 0.78rem/1 var(--font-text); box-shadow: 0 0 0 1px var(--line); }

/* Thanh lưu dính đáy */
.pe-bar {
  grid-column: 1 / -1; position: sticky; bottom: 12px; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 12px 14px 12px 20px; border-radius: 18px; background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(8px);
  border: 1px solid rgba(20, 22, 26, 0.08); box-shadow: 0 18px 40px -22px rgba(20, 22, 26, 0.45);
}
.pe-status { margin: 0 auto 0 0; color: var(--ink-3); font-size: 0.92rem; }
.pe-bar .form-error { margin: 0; flex-basis: 100%; order: 5; }

@media (max-width: 1100px) {
  .pe { grid-template-columns: 1fr; }
  .pe-side { position: static; order: 2; }
  .pe-bar { order: 3; }
}
@media (max-width: 560px) {
  .pe-card { padding: 18px 16px; }
  .pe-media-actions, .pe-socials { grid-template-columns: 1fr; }
  .pe-avatar { width: 72px; height: 72px; }
  .pe-media { padding-bottom: 36px; }
}
@media (max-width: 560px) {
  .pe-tab { padding: 10px 12px; font-size: 0.88rem; }
  .pe-bar { flex-wrap: nowrap; padding: 10px 10px 10px 14px; gap: 6px; }
  .pe-status { font-size: 0.82rem; min-width: 0; }
  .pe-bar .btn { padding-inline: 14px; flex: none; }
  .pe-bar .form-error { position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); padding: 10px 12px; border-radius: 12px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
}
@media (max-width: 560px) { .pe-bar { margin-left: 52px; } }

/* ---- Trang Thanh toán (bank-account.html) kiểu VTPay, màu website ---- */
.pay-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.pay-card { display: grid; gap: 14px; padding: 18px 20px; border-radius: 18px; background: var(--surface); border: 1px solid rgba(20, 22, 26, 0.08); }
.pay-card-top { display: flex; align-items: flex-start; gap: 14px; }
.pay-card-text { flex: 1; min-width: 0; }
.pay-ic { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; background: rgba(47, 107, 255, 0.1); color: var(--orange-deep); }
.pay-ic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pay-title { margin: 0; font: 800 1.08rem/1.2 var(--font-display); }
.pay-h2 { margin: 0; font: 800 1.15rem/1.2 var(--font-display); display: flex; align-items: center; gap: 8px; }
.pay-desc { margin: 4px 0 0; color: var(--ink-3); font-size: 0.9rem; }
.pay-foot { margin: 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 0.9rem; display: flex; align-items: center; gap: 8px; overflow-wrap: anywhere; }
.pay-foot a { color: var(--orange-deep); font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #1f9d55; flex: none; }
.dot.is-off { background: var(--ink-3); }
.dot.is-warn { background: var(--orange); }
.pay-count { font: 700 0.8rem/1 var(--font-text); padding: 4px 8px; border-radius: 99px; background: var(--plate-2); color: var(--ink-2); }
.pay-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }

/* Công tắc */
.switch { position: relative; width: 46px; height: 26px; flex: none; border: 0; border-radius: 99px; background: rgba(20, 22, 26, 0.2); cursor: pointer; transition: background 0.2s; }
.switch span { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.2s var(--ease-out); }
.switch[aria-checked="true"] { background: var(--orange); }
.switch[aria-checked="true"] span { transform: translateX(20px); }
.switch:focus-visible { outline: 2px solid var(--orange-deep); outline-offset: 2px; }
.switch:disabled { opacity: 0.6; }

/* Bảng phương thức */
.pay-table { border-radius: 18px; background: var(--surface); border: 1px solid rgba(20, 22, 26, 0.08); overflow: hidden; }
.pay-row { display: grid; grid-template-columns: 1.4fr 1.4fr 0.8fr auto; gap: 14px; align-items: center; padding: 16px 20px; }
.pay-row + .pay-row, #methodRows .pay-row { border-top: 1px solid var(--line); }
.pay-row-head { padding-block: 12px; background: var(--plate); color: var(--ink-3); font-size: 0.85rem; }
.pay-method { display: flex; align-items: center; gap: 12px; }
.pay-method strong, .pay-account strong, .pay-fee strong { display: block; font-weight: 700; }
.pay-method small { color: var(--ink-3); }
.pay-account { display: grid; gap: 4px; }
.pay-state { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; color: #1f7a45; }
.pay-state.is-wait { color: #9a5b00; }
.pay-state.is-wait .dot { background: #e0a100; }
.pay-actions-col { text-align: right; }
.pay-empty { margin: 0; padding: 22px 20px; color: var(--ink-3); border-top: 1px solid var(--line); }

.pay-panel { margin-top: 18px; padding: 20px 22px; border-radius: 18px; background: var(--surface); border: 1px solid rgba(20, 22, 26, 0.08); }
.pay-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }

/* Cửa sổ Thêm phương thức */
.pay-dialog { width: min(520px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 22px; background: var(--plate); color: var(--ink); box-shadow: 0 30px 70px -20px rgba(20, 22, 26, 0.55); }
.pay-dialog::backdrop { background: rgba(20, 22, 26, 0.45); }
.pay-dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 22px 16px; border-bottom: 1px solid var(--line); }
.pay-options { display: grid; gap: 10px; padding: 16px 22px 22px; }
.pay-option { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(20, 22, 26, 0.1); background: var(--surface); text-align: left; cursor: pointer; color: inherit; font: inherit; }
.pay-option:hover:not(:disabled) { border-color: var(--orange); }
.pay-option:disabled { cursor: not-allowed; background: var(--plate); }
.pay-option:disabled .pay-option-text strong { color: var(--ink-2); }
.pay-option-text { flex: 1; display: grid; gap: 2px; }
.pay-option-text small { color: var(--ink-3); font-size: 0.82rem; }
.pay-option-mark { font-size: 1.2rem; color: var(--orange-deep); }

@media (max-width: 760px) {
  .pay-cards { grid-template-columns: 1fr; }
  .pay-row-head { display: none; }
  .pay-row { grid-template-columns: 1fr auto; }
  .pay-account, .pay-fee { grid-column: 1 / -1; }
  .pay-actions-col { grid-row: 1; grid-column: 2; }
}

/* Khung thiết lập Ngân hàng · SePay (kiểu VTPay) */
.pay-panel-head { align-items: flex-start; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.pay-box { display: grid; gap: 14px; margin-top: 14px; padding: 18px 20px; border-radius: 16px; background: var(--plate); border: 1px solid var(--line); }
.pay-box .form-field { margin: 0; }
.pay-box-title { margin: 0; font: 700 1rem/1.2 var(--font-display); }
.pay-box .pe-prefixed input { padding-left: 12px; }
.pay-check {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-radius: 14px;
  background: var(--surface); border: 1px solid rgba(20, 22, 26, 0.1); cursor: pointer;
}
.pay-check:has(input:checked) { border-color: var(--orange); }
.pay-check span { display: grid; gap: 4px; }
.pay-check small { color: var(--ink-3); font-size: 0.86rem; line-height: 1.45; }
.pay-check input { width: 22px; height: 22px; flex: none; accent-color: var(--orange); cursor: pointer; }
#bankForm > .btn-submit { margin-top: 16px; }
.pay-box .link-btn { padding: 0; border: 0; background: none; color: var(--orange-deep); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.pe-copy.is-copied { color: #1f7a45; }
@media (max-width: 560px) { .pay-box { padding: 14px; } }

/* QR trang (hồ sơ) */
.pe-qr { display: grid; place-items: center; padding: 20px; border-radius: 18px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); justify-self: start; }
.pe-qr img { width: min(280px, 70vw); height: auto; display: block; } /* QR + dòng link bên dưới (ảnh dọc, không ép vuông) */
#pePanel4 > .btn { justify-self: start; }
/* Thanh thẻ hồ sơ (4 thẻ): khung soạn không đủ rộng cho 4 thẻ một hàng → lưới 2×2 cân đối (trước đây xuống dòng kiểu
   3 + 1, thẻ cuối nằm lẻ một mình). */
.pe-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; }
.pe-tab { flex: none; overflow: hidden; text-overflow: ellipsis; }
.dash-count { min-width: 22px; padding: 3px 7px; border-radius: 99px; background: var(--plate-2); color: var(--ink-2); font: 700 0.75rem/1 var(--font-text); text-align: center; font-variant-numeric: tabular-nums; }
.dash-count:empty { display: none; }
.dash-unread { background: var(--orange); color: var(--ink); }

/* ---------- Cắt ảnh trước khi tải lên (crop.js) ---------- */
.crop-dialog { width: min(640px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 0; border-radius: 24px; background: var(--plate); color: var(--ink); box-shadow: 0 0 0 1px var(--line), 0 40px 80px -30px rgba(0, 0, 0, 0.6); overflow: auto; }
.crop-dialog::backdrop { background: rgba(10, 11, 14, 0.62); }
.crop-head { display: flex; align-items: flex-start; gap: 14px; padding: 22px 22px 16px; border-bottom: 1px solid var(--line); }
.crop-badge { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--orange); color: #14161A; }
.crop-badge svg { width: 22px; height: 22px; }
.crop-titles { flex: 1; min-width: 0; }
.crop-title { margin: 2px 0 4px; font: 800 1.35rem/1.15 var(--font-display); letter-spacing: -0.02em; }
.crop-sub { margin: 0; color: var(--ink-2); font-size: 0.92rem; }
.crop-x { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 12px; background: transparent; color: var(--ink-2); cursor: pointer; }
.crop-x:hover { background: var(--plate-2); color: var(--ink); }
.crop-x svg { width: 20px; height: 20px; }
/* Sân khấu: nền ô caro cho thấy phần trong suốt; ngoài khung tối đi bằng bóng phủ lớn của khung. */
.crop-stage { position: relative; height: clamp(240px, 46dvh, 380px); margin: 18px 22px 0; border-radius: 18px; overflow: hidden; touch-action: none; cursor: grab; user-select: none;
  background: repeating-conic-gradient(#8a8f99 0 25%, #6f747e 0 50%) 0 0 / 22px 22px; }
.crop-stage:active { cursor: grabbing; }
.crop-stage:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.crop-img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; pointer-events: none; will-change: transform; }
.crop-frame { position: absolute; border: 2px solid #fff; border-radius: 6px; box-shadow: 0 0 0 9999px rgba(10, 11, 14, 0.58); pointer-events: none; }
.is-round .crop-frame { border-radius: 22%; }
/* Lưới một phần ba giúp căn bố cục. */
.crop-frame i { position: absolute; background: rgba(255, 255, 255, 0.45); }
.crop-frame i:nth-child(1), .crop-frame i:nth-child(2) { top: 0; bottom: 0; width: 1px; }
.crop-frame i:nth-child(1) { left: 33.333%; }
.crop-frame i:nth-child(2) { left: 66.666%; }
.crop-frame i:nth-child(3), .crop-frame i:nth-child(4) { left: 0; right: 0; height: 1px; }
.crop-frame i:nth-child(3) { top: 33.333%; }
.crop-frame i:nth-child(4) { top: 66.666%; }
.crop-zoom { display: flex; align-items: center; gap: 12px; padding: 16px 22px; }
.crop-range { flex: 1; min-width: 0; accent-color: var(--orange); }
.crop-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 20px; border-top: 1px solid var(--line); }
@media (max-width: 560px) {
  .crop-head { padding: 18px 16px 12px; }
  .crop-stage { margin: 14px 14px 0; }
  .crop-zoom { padding: 14px; gap: 8px; }
  .crop-zoom .btn { padding-inline: 10px; font-size: 0; gap: 0; }
  .crop-zoom .btn .ic { font-size: 1rem; }
  .crop-foot { padding: 12px 14px 16px; }
  .crop-foot .btn { flex: 1; }
}

/* Mục kiểm tra quan trọng (từ khóa VTPAY) + hộp thoại ảnh hướng dẫn, nút ĐÃ LÀM */
.pay-check.is-important { border-color: #E5484D; background: color-mix(in srgb, #E5484D 7%, var(--plate)); }
.pay-check.is-important:has(input:checked) { border-color: var(--orange); background: var(--plate); }
.pay-badge { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: #E5484D; color: #fff; font: 700 0.7rem/1.4 var(--font-text); font-style: normal; letter-spacing: .04em; text-transform: uppercase; vertical-align: 2px; }
.kw-dialog { width: min(640px, calc(100vw - 32px)); }
.kw-dialog-body { display: grid; gap: 14px; padding: 16px 22px 22px; }
.kw-dialog-body img { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.kw-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- Phí dịch vụ (fees.html) + cảnh báo chạm mốc ở mọi trang thiết lập ---------- */
.fee-warn { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 16px; padding: 12px 16px; border-radius: 14px;
  background: #FDE8E8; color: #8A1C1C; border: 1.5px solid #E5484D; font-weight: 600; }
.fee { display: grid; gap: 16px; }
.fee-alert { margin: 0; padding: 12px 16px; border-radius: 14px; background: #FDE8E8; color: #8A1C1C; border: 1.5px solid #E5484D; font-weight: 600; }
.fee-card { display: grid; gap: 14px; }
.fee-badge { justify-self: start; padding: 4px 12px; border-radius: 999px; background: var(--ink); color: #fff; font: 700 .85rem/1.4 var(--font-text); }
.fee-badge.is-free { background: #1F9D55; }
.fee-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.fee-stat { padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.fee-stat span { display: block; color: var(--ink-3); font-size: .9rem; }
.fee-stat strong { display: block; margin-top: 4px; font: 800 1.6rem/1.2 var(--font-display); }
.fee-stat.is-main strong { color: var(--orange-deep, #C2410C); }
.fee-stat p { margin: 4px 0 0; color: var(--ink-3); font-size: .85rem; }
.fee-progress { height: 14px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.fee-progress i { position: relative; display: block; height: 100%; width: 0; border-radius: inherit; overflow: hidden;
  background: linear-gradient(90deg, #FF8A3D, var(--orange, #2F6BFF));
  box-shadow: 0 0 12px rgba(47, 107, 255, .55); transition: width 1.4s cubic-bezier(.22, 1, .36, 1); }
/* Sọc chéo chạy liên tục + vệt sáng quét ngang: thanh luôn "đang chạy". */
.fee-progress i::before { content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(-45deg, rgba(255,255,255,.22) 0 8px, transparent 8px 16px);
  background-size: 22.6px 100%; animation: fee-stripes .8s linear infinite; }
.fee-progress i::after { content: ''; position: absolute; top: 0; bottom: 0; left: -40%; width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent); animation: fee-shine 2.2s ease-in-out infinite; }
.fee-progress i.is-full { background: linear-gradient(90deg, #FF6B6E, #E5484D); box-shadow: 0 0 14px rgba(229, 72, 77, .7); animation: fee-pulse 1.2s ease-in-out infinite; }
@keyframes fee-stripes { to { background-position: 22.6px 0; } }
@keyframes fee-shine { 0% { left: -40%; } 60%, 100% { left: 110%; } }
@keyframes fee-pulse { 50% { box-shadow: 0 0 22px rgba(229, 72, 77, 1); } }
@media (prefers-reduced-motion: reduce) { .fee-progress i, .fee-progress i::before, .fee-progress i::after { animation: none; transition: none; } }
.fee-due { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; border-radius: 14px; border: 1.5px dashed var(--line); }
.fee-due span { color: var(--ink-3); font-size: .9rem; }
.fee-due strong { display: block; font: 800 1.9rem/1.2 var(--font-display); }
.fee-due .pe-sub { margin: 2px 0 0; }
.fee-rules { margin: 0; padding-left: 20px; display: grid; gap: 6px; line-height: 1.5; }
.fee-dialog { width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: 22px; background: var(--surface); color: var(--ink); box-shadow: 0 30px 70px -20px rgba(20, 22, 26, .55); overflow: auto; }
.fee-dialog::backdrop { background: rgba(20, 22, 26, .45); }
.fee-dialog .vp-dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.fee-dialog .vp-dialog-head .pe-h { margin: 0; }
.fee-dialog .fee-pay, .fee-dialog .fee-err { padding: 18px 22px 22px; }
.fee-pay { display: grid; gap: 12px; justify-items: center; }
.fee-qr { width: 240px; height: 240px; border-radius: 12px; background: #fff; padding: 8px; border: 1px solid var(--line); }
.fee-info { width: 100%; margin: 0; display: grid; gap: 8px; }
.fee-info div { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.fee-info dt { color: var(--ink-3); }
.fee-info dd { margin: 0; text-align: right; font-weight: 600; overflow-wrap: anywhere; }
.fee-wait { margin: 0; font-weight: 700; color: var(--ink-2); }
.fee-wait.is-ok { color: #1F9D55; }

/* Chọn cổng báo giao dịch: SePay | Pay2S (trang Thanh toán). */
.pv-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px 0 16px; }
.pv-opt { display: grid; gap: 4px; text-align: left; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); cursor: pointer; font: inherit; }
.pv-opt strong { font-size: .98rem; }
.pv-opt small { color: var(--ink-3); font-size: .82rem; line-height: 1.35; }
.pv-opt[aria-checked="true"] { border-color: var(--orange, #2F6BFF); box-shadow: 0 0 0 3px rgba(47, 107, 255, .15); }
.pv-opt:focus-visible { outline: 2px solid var(--orange, #2F6BFF); outline-offset: 2px; }
@media (max-width: 560px) { .pv-switch { grid-template-columns: 1fr; } }
#pay2sFields .pay-state { margin: 0 0 10px; }
.pv-switch[hidden] { display: none; }
/* Công tắc bật/tắt từng cổng trên bảng phương thức. */
.pay-row .pay-actions-col { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.pay-state.is-off { color: var(--ink-3); }
.pay-state.is-off .dot { background: rgba(20, 22, 26, .3); }
.pay-row.is-off .pay-method { opacity: .6; }
.pay-fee strong { white-space: nowrap; }
.pay-option-mark .ic { width: 20px; height: 20px; }

/* "Cài đặt Donate" có menu con: chữ là link, nút mũi tên riêng bên phải (vùng bấm 40px) xổ 4 thẻ. */
.dash-sub-row { display: flex; align-items: center; gap: 2px; }
.dash-sub-row .dash-link { flex: 1; min-width: 0; }
.dash-sub-toggle {
  flex: none; width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 10px;
  background: none; color: var(--ink-3); cursor: pointer; transition: background 0.18s, color 0.18s;
}
.dash-sub-toggle:hover { background: var(--plate); color: var(--ink); }
.dash-sub-toggle:focus-visible { outline: 2px solid var(--orange-deep); outline-offset: 1px; }
/* Đóng: ∨ (chỉ xuống); mở: quay 180° thành ^. */
.dash-sub-toggle .dash-chev { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.25s var(--ease-out, ease-out); }
.dash-has-sub.is-open .dash-sub-toggle .dash-chev { transform: rotate(180deg); }
.dash-ds-sub[hidden] { display: none; }
.dash-has-sub.is-open .dash-ds-sub { animation: dash-sub-in 0.22s var(--ease-out, ease-out); }
.dash-ds-sub .dash-link[aria-current="true"] { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: 0 0 0 1px rgba(20, 22, 26, 0.06); }
@keyframes dash-sub-in { from { opacity: 0; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .dash-has-sub.is-open .dash-ds-sub { animation: none; } .dash-sub-toggle .dash-chev { transition: none; } }
