/* TRANG "Thông tin cá nhân" (#account-page, /tai-khoan), mở từ mục Tài khoản trong menu người
   dùng. Logic ở js/account.js.

   VIEW BÌNH THƯỜNG của site (chủ trang chốt 27/09/2026 — "không phải bảng nổi lên"): thanh
   đầu trang giữ nguyên, khung .products-page-panel nền kem mờ như trang Bác sĩ / Sản phẩm,
   nhãn + tiêu đề nghiêng như các mục trang chủ. Màu theo bộ màu của site (mực #522546, vàng
   #d4a64d) thay cho xám kiểu Google của bản popup trước. */

.ac-body {
  max-width: 560px;
  margin: 0 auto;
}

/* KHÔNG backdrop-filter cho khung trang này (khác .products-page-panel gốc): backdrop-filter
   biến khung thành khối chứa cho con position:fixed — thanh "Bỏ lưu / Thêm vào bộ sưu tập"
   của tab Đã lưu (.sv-actionbar) sẽ dính đáy KHUNG thay vì đáy màn hình. overflow visible
   cùng lẽ. Nền đặc hơn để bù phần mờ. */
#account-page .ac-panel {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  overflow: visible;
  background: rgba(255, 255, 255, .94);
}

/* ---- Dải 4 tab: MỘT HÀNG NGANG, trượt ngang được — viên thuốc viền mảnh nền trắng (chủ trang
   chốt theo ảnh mẫu 27/09/2026, thay lưới 2×2). Cùng khuôn chip lọc .sv-chip của tab Đã lưu. ---- */
.ac-tabs {
  display: flex;
  gap: 10px;
  /* KHÔNG tràn ra mép khung: tab đầu phải thẳng hàng với các thẻ bên dưới (chủ trang báo
     "thiếu padding left", 27/09/2026). */
  margin: -.5rem 0 1.25rem;
  padding: 2px 0 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}

.ac-tabs::-webkit-scrollbar {
  display: none;
}

.ac-tab {
  flex: 0 0 auto;
  padding: 10px 22px;
  border: 1.5px solid #e0d5db;
  border-radius: 999px;
  background: #fff;
  color: #522546;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  scroll-snap-align: start;
  -webkit-tap-highlight-color: transparent;
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}

.ac-tab.is-on {
  background: rgba(144, 30, 62, .07);
  border-color: var(--text-header, #8b1e3f);
  color: var(--text-header, #8b1e3f);
}

@media (min-width: 992px) {
  .ac-tabs {
    justify-content: center;
  }
}

.ac-pane[hidden] {
  display: none;
}

/* ---- Tab Nhiệm vụ / Điểm thưởng: dùng lại khuôn .ac-row ---- */
.ac-nhom {
  max-width: 560px;
  margin: 0 auto 1.4rem;
}

.ac-nhom:last-child {
  margin-bottom: 0;
}

.ac-nhom-dau {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 4px 10px;
}

.ac-nhom-dau h2 {
  margin: 0;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: #522546;
}

.ac-nhom-dau small {
  font-size: .8rem;
  color: #8a7b86;
}

.ac-diem {
  flex: 0 0 auto;
  font-weight: 700;
  font-size: .95rem;
  color: #8a6d1f;
  white-space: nowrap;
}

.ac-diem.is-am {
  color: #c0392b;
}

/* Thanh tiến độ trong thẻ nhiệm vụ / thẻ tóm tắt cấp. */
.ac-thanh {
  position: relative;
  height: 6px;
  margin-top: 6px;
  border-radius: 999px;
  background: #f3e9d6;
  overflow: hidden;
}

.ac-thanh > i {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #f6c95f, #d39a43);
}

/* Thanh tiến độ + số "1/3" ở cuối thanh (nhiệm vụ hằng ngày). */
.ac-tien {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.ac-tien .ac-thanh {
  flex: 1;
  margin-top: 0;
}

.ac-tien em {
  flex: 0 0 auto;
  font-style: normal;
  font-size: .78rem;
  font-weight: 700;
  color: #8a7b86;
}

.ac-row.is-xong .ac-row-ico {
  background: #e7f4e8;
  color: #2e7d32;
}

.ac-lam {
  flex: 0 0 auto;
  padding: 7px 12px;
  border: 1px solid #d8a34c;
  border-radius: 999px;
  background: #fffaf0;
  color: #4a2140;
  font-family: inherit;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.ac-xong {
  flex: 0 0 auto;
  color: #2e7d32;
  font-size: .85rem;
  font-weight: 700;
  white-space: nowrap;
}

/* Thẻ tóm tắt cấp độ ở đầu tab Điểm thưởng. */
.ac-tom-tat {
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(140deg, #fff8e1 0%, #fdeec4 100%);
  border: 1px solid rgba(212, 166, 77, .45);
  box-shadow: 0 14px 30px -22px rgba(120, 78, 20, .7);
  color: #522546;
}

.ac-tom-tat .ac-cap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.ac-tom-tat .ac-cap b {
  font-size: 1.35rem;
}

.ac-tom-tat .ac-cap span {
  font-size: 1.05rem;
  font-weight: 700;
  color: #8a6d1f;
}

.ac-tom-tat .ac-thanh {
  height: 9px;
  margin: 10px 0 8px;
  background: rgba(255, 255, 255, .7);
}

.ac-tom-tat p {
  margin: 0;
  font-size: .88rem;
  color: #6b4f63;
}

.ac-ghi-chu {
  margin: 10px 4px 0;
  font-size: .8rem;
  color: #8a7b86;
}

/* Lịch sử: dòng gọn hơn thẻ thường. */
.ac-row.ac-row--gon {
  min-height: 0;
  padding: 11px 16px;
  margin-bottom: 8px;
}

.ac-row--gon .ac-row-text b {
  font-size: .92rem;
}

.ac-nhan-nho {
  font-size: .72rem;
  font-weight: 600;
  color: #b3a7af;
}

/* Nút X góc trên phải của khung (.products-page-panel đã position:relative). Cùng khuôn nút
   đóng của hộp Đăng nhập: tròn, nền kem, viền vàng nhạt. */
.ac-dong {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(212, 166, 77, .38);
  border-radius: 50%;
  background: #fffaf0;
  color: #522546;
  font-size: 1.05rem;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease;
  -webkit-tap-highlight-color: transparent;
}

.ac-dong:hover {
  background: #fff;
}

.ac-dong:active {
  transform: scale(.94);
}

.ac-state {
  margin: 0;
  padding: 24px 8px;
  text-align: center;
  font-size: .92rem;
  color: #8a7b86;
}

.ac-state.is-error {
  color: #c0392b;
}

/* Mỗi dòng là một thẻ trắng riêng, viền vàng nhạt, cách nhau bằng khe hở. */
.ac-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
  padding: 14px 18px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(212, 166, 77, .28);
  box-shadow: 0 10px 24px -20px rgba(120, 78, 20, .55);
  min-height: 68px;
}

.ac-row:last-child {
  margin-bottom: 0;
}

/* display:flex ở trên đè thuộc tính hidden — phải khai lại (dòng "Mã tài khoản" đang ẩn). */
.ac-row[hidden] {
  display: none;
}

/* Danh sách tab Thông tin cá nhân: khoảng cách bằng gap chứ không bằng lề dưới từng dòng —
   dòng ẩn (Điện thoại, Địa chỉ, Mã tài khoản) không để lại lề thừa ở cuối. */
#ac-list:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#ac-list .ac-row {
  margin-bottom: 0;
}

/* Ô icon vàng kem, cùng kiểu ô icon của menu tài khoản (css/header-actions.css). */
.ac-row-ico {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #f6ecd9;
  font-size: 17px;
  color: #8a6d1f;
}

.ac-row-text {
  flex: 1;
  /* min-width:0 để chuỗi dài (email, địa chỉ) xuống dòng trong ô thay vì đẩy rộng thẻ. */
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ac-row-text small {
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: #8a7b86;
}

.ac-row-text b {
  font-weight: 600;
  font-size: 1rem;
  color: #522546;
  overflow-wrap: anywhere;
}

/* Chưa có dữ liệu thì js/account.js ghi "Chưa đặt" và gắn lớp này cho nhạt bớt. */
.ac-row-text b.is-empty {
  font-weight: 400;
  color: #b3a7af;
  font-style: italic;
}

/* Nút đổi ảnh nằm ngay dưới nhãn "Ảnh hồ sơ", trông như một liên kết chứ không như nút
   to — dòng này vốn chỉ để xem, nút to sẽ lấn át phần thông tin. */
.ac-avatar-btn {
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: none;
  color: #c0392b;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
}

.ac-avatar-btn:hover {
  text-decoration: underline;
}

.ac-avatar-btn:disabled {
  color: #b3a7af;
  cursor: default;
  text-decoration: none;
}

/* Ảnh đại diện. Chưa có ảnh thì js/account.js vẽ chữ cái đầu của tên vào đây; có ảnh thì
   chèn thẻ <img> lấp đầy hình tròn. */
.ac-avatar {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(140deg, #fff1a3 0%, #f6c95f 48%, #e3aa41 100%);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(212, 166, 77, .45);
  color: #522546;
  font-size: 1.35rem;
  font-weight: 700;
  text-transform: uppercase;
  overflow: hidden;
}

.ac-avatar img {
  width: 100%;
  height: 100%;
  /* cover để ảnh dọc/ngang đều lấp kín hình tròn, không méo và không chừa nền. */
  object-fit: cover;
  display: block;
}

/* ---- Tab Nạp tiền (js/vi-tien.js). Cùng bộ màu: mực #522546, vàng #d4a64d. ---- */
.vi-so-du {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border: 1px solid #ecd9b0;
  border-radius: 18px;
  background: linear-gradient(135deg, #fffaf0, #f7e7c2);
  color: #522546;
}
.vi-so-du span { font-size: .9rem; color: #7a5a6f; }
.vi-so-du b { font-size: 1.6rem; font-weight: 700; }

.vi-form { display: grid; gap: 12px; }
.vi-nhanh { display: flex; flex-wrap: wrap; gap: 8px; }
.vi-chip {
  padding: 8px 14px;
  border: 1.5px solid #e0d5db;
  border-radius: 999px;
  background: #fff;
  color: #522546;
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
}
.vi-chip:hover { border-color: #d4a64d; background: #fffaf0; }
.vi-o { display: grid; gap: 6px; margin: 0; }
.vi-o span { font-size: .82rem; color: #8a7b86; }
.vi-o input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #e0d5db;
  border-radius: 12px;
  font: inherit;
  font-size: 1.1rem;
  color: #522546;
  background: #fff;
}
.vi-o input:focus { outline: none; border-color: #d4a64d; box-shadow: 0 0 0 3px rgba(212, 166, 77, .2); }
.vi-loi { margin: 0; font-size: .85rem; color: #b42318; }

.vi-nut {
  padding: 11px 18px;
  border: 1.5px solid #e0d5db;
  border-radius: 999px;
  background: #fff;
  color: #522546;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.vi-nut--chinh { border-color: #522546; background: #522546; color: #fff; }
.vi-nut:disabled { opacity: .6; cursor: default; }
.vi-nut-hang { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

.vi-ck {
  padding: 16px;
  border: 1px solid #ecd9b0;
  border-radius: 18px;
  background: #fffdf8;
}
.vi-ck .ac-nhom-dau { flex-direction: column; align-items: flex-start; gap: 2px; }
.vi-ck-than { display: flex; gap: 16px; align-items: flex-start; }
.vi-qr { flex: 0 0 180px; text-align: center; }
.vi-qr svg { display: block; width: 180px; height: 180px; border-radius: 10px; border: 1px solid #eee; }
.vi-qr small { display: block; margin-top: 4px; font-size: .75rem; color: #8a7b86; }
.vi-ck-ds { flex: 1 1 auto; min-width: 0; display: grid; gap: 8px; }
.vi-dong {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "nhan nut" "gt nut";
  align-items: center;
  column-gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #f0e6ea;
}
.vi-dong-nhan { grid-area: nhan; font-size: .75rem; color: #8a7b86; }
.vi-dong-gt { grid-area: gt; color: #522546; font-size: .95rem; overflow-wrap: anywhere; }
.vi-chep {
  grid-area: nut;
  padding: 5px 10px;
  border: 1px solid #d8a34c;
  border-radius: 999px;
  background: #fffaf0;
  color: #4a2140;
  font: inherit;
  font-size: .78rem;
  cursor: pointer;
  white-space: nowrap;
}

.vi-ls.is-mo { cursor: pointer; }
.vi-tt {
  flex: 0 0 auto;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  white-space: nowrap;
  background: #f3eef1;
  color: #7a6a75;
}
.vi-tt--da-chuyen { background: #fff4d6; color: #8a5a00; }
.vi-tt--da-nhan { background: #e5f5ea; color: #1e7a3c; }
.vi-tt--tu-choi { background: #fde8e7; color: #b42318; }

@media (max-width: 520px) {
  .vi-ck { padding: 12px; }
  .vi-ck-than { flex-direction: column; align-items: stretch; }
  .vi-qr { flex-basis: auto; }
  .vi-qr svg { width: 220px; height: 220px; margin: 0 auto; }
  .vi-so-du b { font-size: 1.35rem; }
}
/* Tiêu đề nhóm không gãy dòng — dòng chú thích nhỏ bên phải tự xuống dòng thay. */
#ac-vi .ac-nhom-dau h2 { flex: 0 0 auto; white-space: nowrap; }
#ac-vi .ac-nhom-dau small { text-align: right; }
