:root {
  --primary: #ff6b01;
  --bg: #f2f4f8;
  --text: #2d3436;
  --white: #fff;
  --shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* KHÓA CHẶT BODY */
html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-x pan-y;
  -webkit-text-size-adjust: 100%;
}
.hidden {
  display: none !important;
}

/* LOGIN */
#login-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--white);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 25px;
}
.login-content {
  width: 100%;
  max-width: 400px;
  text-align: center;
}
.brand-logo {
  font-size: 65px;
  color: var(--primary);
  margin-bottom: 15px;
  filter: drop-shadow(0 5px 10px rgba(255, 107, 1, 0.2));
}
.input-group {
  position: relative;
  margin-bottom: 15px;
  background: #f9f9f9;
  border-radius: 14px;
  border: 1px solid #eee;
}
.input-group i {
  position: absolute;
  top: 16px;
  left: 16px;
  color: #999;
}
.input-group input {
  width: 100%;
  padding: 16px 16px 16px 48px;
  border: none;
  background: transparent;
  outline: none;
  font-size: 16px;
}
.btn-login {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #ff6b01, #ff9f43);
  color: var(--white);
  border: none;
  border-radius: 14px;
  font-weight: 700;
  font-size: 16px;
  margin-top: 15px;
  cursor: pointer;
}

/* LAYOUT */
#home-screen {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  width: 100%;
  position: relative;
}

/* HEADER */
.fixed-header {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  z-index: 100;
  padding: 15px 15px 8px;
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
  box-shadow: var(--shadow);
  padding-top: max(15px, env(safe-area-inset-top));
}
.user-card {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  gap: 10px;
}
.avatar-container {
  position: relative;
}
#user-avatar-img {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary);
  padding: 2px;
  background: #fff;
}
.user-info {
  flex: 1;
  min-width: 0;
}
.user-info h3 {
  margin: 0 0 4px;
  color: var(--primary);
  font-size: 18px;
  font-weight: 800;
}
.info-row {
  font-size: 13px;
  color: #666;
  margin: 2px 0;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.highlight {
  color: #2c3e50;
  font-weight: 600;
}
.time {
  color: #e67e22;
  font-style: italic;
  font-weight: 500;
}

.header-actions {
  display: grid;
  grid-template-columns: 1fr 1fr; /* 2 cột */
  gap: 6px;
  margin-left: 8px;
  flex-shrink: 0;
}
.icon-btn {
  width: 37px;
  height: 37px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  margin: 0;
}
/* Thêm vào chỗ các nút icon-btn */
.refresh-btn {
  background: #e8f5e9;
  color: #2e7d32;
}

/* Hiệu ứng xoay khi đang load */
.spin-anim {
  animation: spin 1s linear infinite;
}
.edit-btn {
  background: #e3f2fd;
  color: #2196f3;
}
.logout-btn {
  background: #ffebee;
  color: #ef5350;

  /* QUAN TRỌNG: Để nút này nằm giữa hàng dưới */
  grid-column: span 2;
  justify-self: center;
  width: 37px;
}

/* TABS */
.tabs-container {
  display: flex;
  background: #f1f2f6;
  padding: 5px;
  border-radius: 14px;
}
.tab {
  flex: 1;
  text-align: center;
  padding: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #888;
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  transition: 0.3s;
}
.tab.active {
  background: var(--white);
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.badge-count {
  position: absolute;
  top: 8px;
  right: 12px;
  background: #ff4757;
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
}

/* LIST */
#list-container {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  padding-bottom: 90px;
  -webkit-overflow-scrolling: touch;
}
#list-container::-webkit-scrollbar {
  width: 0;
}

/* CARD */
.group-card {
  background: var(--white);
  border-radius: 18px;
  padding: 15px;
  margin-bottom: 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  display: flex;
  gap: 12px;
  animation: slideUp 0.4s ease;
  border: 1px solid #f0f0f0;
}
@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
.group-img {
  width: 75px;
  height: 75px;
  border-radius: 12px;
  object-fit: cover;
  background: #eee;
  flex-shrink: 0;
  cursor: pointer;
}
.group-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.codes {
  font-weight: 800;
  color: #333;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60%;
}
.status {
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.st-pending {
  background: #fff8e1;
  color: #f39c12;
}
.st-shipping {
  background: #e3f2fd;
  color: #2980b9;
}
.st-done {
  background: #e8f5e9;
  color: #27ae60;
}

/* LAYOUT HÀNG GIỮA (TRACKING + NÚT) */
.middle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
  gap: 8px;
}
.tracking-list {
  flex: 1;
}
.tracking-item {
  font-family: monospace;
  font-size: 13px;
  color: #555;
  background: #f8f9fa;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 4px;
  display: inline-block;
}

.mini-pay-btn {
  background: #27ae60;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(39, 174, 96, 0.3);
  margin: 0;
}
.mini-pay-btn:active {
  transform: scale(0.95);
}

.total {
  text-align: right;
  font-weight: 800;
  color: #e74c3c;
  font-size: 16px;
  border-top: 1px dashed #eee;
  padding-top: 6px;
  margin-top: auto;
}

/* BOTTOM ACTIONS - THANH ĐIỀU HƯỚNG DƯỚI */
.bottom-actions {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  display: flex;
  gap: 12px; /* Khoảng cách giữa 2 nút */
  z-index: 90;
  padding-bottom: env(safe-area-inset-bottom);
}

/* Style chung cho cả 2 nút */
.action-btn {
  border-radius: 16px;
  border: none;
  color: white;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  transition: transform 0.1s;
}
.action-btn:active {
  transform: scale(0.96);
}

/* 1. Nút Hỗ trợ: Chiếm phần lớn diện tích (flex: 1) */
.support-btn {
  flex: 1; /* Tự động giãn hết mức có thể */
  background: linear-gradient(135deg, #ff6b01, #ff9f43);
  padding: 14px;
  gap: 10px;
  font-size: 14px;
}

/* --- HIỆU ỨNG RUNG CHUÔNG CHO NÚT THÔNG BÁO --- */

/* 1. Định nghĩa chuyển động rung (Copy từ code của bạn) */
@keyframes bell-ring {
  0% {
    transform: rotate(0);
  }
  10% {
    transform: rotate(30deg);
  }
  30% {
    transform: rotate(-30deg);
  }
  50% {
    transform: rotate(15deg);
  }
  70% {
    transform: rotate(-15deg);
  }
  100% {
    transform: rotate(0);
  }
}

/* 2. Style cho nút thông báo (Giao diện mới) */
.noti-btn {
  width: 54px;
  flex-shrink: 0;
  background: white;
  color: #ff6b01;
  /* Giữ các thuộc tính của action-btn */
  border-radius: 16px;
  border: none;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  transition: transform 0.1s;
}

.noti-btn i {
  font-size: 22px;
  /* Thêm dòng này để chuẩn bị cho hiệu ứng rung */
  transform-origin: top center;
}

/* 3. KÍCH HOẠT RUNG: Khi di chuột vào */
.noti-btn:hover i {
  animation: bell-ring 1s infinite;
}

/* [MỞ RỘNG] KÍCH HOẠT RUNG TỰ ĐỘNG: Khi có tin nhắn (Class này sẽ được JS thêm vào) */
.noti-btn.has-news i {
  animation: bell-ring 2s infinite; /* Rung chậm hơn xíu cho đỡ nhức mắt */
}

/* 4. Style số đỏ (Copy và chỉnh lại từ code của bạn cho khớp vị trí mới) */
.bell-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bell-badge {
  position: absolute;
  top: -8px; /* Căn chỉnh lại cho khớp nút mới */
  right: -8px;
  background: red;
  color: white;
  font-size: 10px;
  font-weight: bold;
  height: 18px;
  min-width: 18px;
  padding: 0 4px;
  border-radius: 10px; /* Bo tròn kiểu viên thuốc */
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
  z-index: 2;
}
.btn-icon {
  font-size: 18px;
}

/* MODALS */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-content {
  background: var(--white);
  width: 88%;
  max-width: 340px;
  border-radius: 24px;
  padding: 25px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.bounce-in {
  animation: bounce 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes bounce {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.modal-header h3 {
  margin: 0;
  color: var(--primary);
  font-size: 18px;
}
.close-btn {
  font-size: 26px;
  color: #bbb;
  cursor: pointer;
  padding: 5px;
}
.modal-input {
  width: 100%;
  padding: 14px;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  margin-bottom: 12px;
  background: #fafafa;
  font-size: 15px;
}
.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: bold;
  cursor: pointer;
}

/* PAYMENT TABS */
.currency-tabs {
  display: flex;
  background: #f0f0f0;
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 15px;
}
.cur-tab {
  flex: 1;
  text-align: center;
  padding: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #666;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.2s;
}
.cur-tab.active {
  background: white;
  color: #27ae60;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.qr-box {
  text-align: center;
  margin-bottom: 15px;
}
.qr-img {
  width: 180px;
  height: 180px;
  border-radius: 12px;
  border: 1px solid #eee;
}
.bank-info p {
  margin: 8px 0;
  border-bottom: 1px solid #f5f5f5;
  padding-bottom: 8px;
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}
.money-highlight {
  font-size: 24px;
  font-weight: 800;
  color: #27ae60;
  margin: 10px 0;
}
.note {
  font-size: 12px;
  color: #e74c3c;
  background: #fff0e6;
  padding: 10px;
  border-radius: 8px;
  text-align: center;
  margin-top: 15px;
  font-weight: 500;
}

/* SUPPORT LINKS */
.support-link {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background: #f5f5f5;
  border-radius: 14px;
  color: #333;
  text-decoration: none;
  font-weight: 600;
  margin-bottom: 12px;
  transition: 0.2s;
}
.support-link:active {
  background: #eee;
}
.support-link i {
  font-size: 20px;
  width: 25px;
  text-align: center;
}
.support-link.call i {
  color: #2196f3;
}
.support-link.wechat i {
  color: #07c160;
}
.support-link.mess i {
  color: #0084ff;
}

/* [CẬP NHẬT] SLIDER IMAGE VIEWER (XỊN HƠN) */
.image-viewer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000; /* Nền đen hoàn toàn */
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.viewer-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#viewer-img {
  max-width: 100%;
  max-height: 80vh;
  transition: opacity 0.2s ease; /* Hiệu ứng mờ khi chuyển ảnh */
}

/* Nút đóng góc trên */
.close-viewer-icon {
  position: absolute;
  top: 40px;
  right: 20px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 20px;
  z-index: 102;
  cursor: pointer;
}

/* Thanh điều hướng dưới đáy */
.viewer-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 80px;
  background: rgba(20, 20, 20, 0.9);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  z-index: 101;
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 24px;
  padding: 10px;
  cursor: pointer;
}
.nav-btn:active {
  color: var(--primary);
}

.img-counter {
  color: white;
  font-weight: bold;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.1);
  padding: 5px 15px;
  border-radius: 20px;
}

/* Loading Spinner trong Viewer */
.viewer-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
}
.loading-spinner.white {
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid #fff;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
/* THANH CẢNH BÁO - UPDATE */
.warning-bar {
  display: flex;
  align-items: center;
  background: #fff3cd;
  color: #856404;
  padding: 8px 12px;
  margin-top: 10px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid #ffeeba;
  overflow: hidden; /* Quan trọng để cắt chữ thừa */
}

.warning-bar i {
  margin-right: 10px;
  color: #ff9800;
  flex-shrink: 0;
  animation: shake 1s infinite;
}

/* CSS Animation chạy chữ thay cho marquee */
.marquee-content {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
}

.marquee-content span {
  display: inline-block;
  padding-left: 100%;
  animation: marquee 15s linear infinite;
}

@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-10deg);
  }
  75% {
    transform: rotate(10deg);
  }
}
/* Badge cảnh báo ngày lưu kho */
.fee-badge,
.risk-badge {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  margin-bottom: 6px;
  display: inline-block;
  font-weight: 600;
  width: fit-content;
  animation: fadeIn 0.5s;
}

/* Quá 5 ngày: Màu vàng cam */
.fee-badge {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
}

/* Quá 15 ngày: Màu đỏ gắt */
.risk-badge {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Icon trong badge */
.fee-badge i,
.risk-badge i {
  margin-right: 4px;
}
/* --- SỬA LẠI PHẦN TOTAL ĐỂ NẰM NGANG --- */
.total {
  border-top: 1px dashed #eee;
  padding-top: 8px;
  margin-top: auto;
  /* Dùng Flexbox để xếp ngang */
  display: flex;
  justify-content: space-between; /* Đẩy 2 phần về 2 đầu */
  align-items: center; /* Căn giữa theo chiều dọc */
  min-height: 30px; /* Giữ chiều cao ổn định */
}

/* Sửa lại Badge cảnh báo cho nhỏ gọn để nằm vừa 1 dòng */
.badge-warning {
  font-size: 10px; /* Chữ nhỏ lại xíu cho đỡ chật */
  padding: 4px 6px;
  border-radius: 4px;
  font-weight: 600;
  /* Bỏ margin-bottom đi vì giờ nằm ngang rồi */
  margin-bottom: 0;
  display: inline-block;
  white-space: nowrap; /* Cấm xuống dòng */
}

/* Các cấp độ màu sắc giữ nguyên */
.lv-1 {
  background: #fff3cd;
  color: #856404;
  border: 1px dashed #ffeeba;
}
.lv-2 {
  background: #ffe082;
  color: #5d4037;
  border: 1px solid #ffca28;
}
.lv-3 {
  background: #ffccbc;
  color: #bf360c;
  border: 1px dashed #ffab91;
}
.lv-4 {
  background: #ffcdd2;
  color: #c62828;
  border: 1px solid #ef9a9a;
}

/* Style cho phần Tiền (để bên phải) */
.money-text {
  font-weight: 800;
  color: #e74c3c;
  font-size: 16px;
  margin-left: auto; /* Đẩy sát sang phải nếu không có badge */
}
/* 1. Thiết lập khung cha để làm mốc tọa độ */
.user-info {
  flex: 1;
  min-width: 0;
  position: relative; /* QUAN TRỌNG: Để con nó định vị theo nó */
}

/* 2. Định vị hộp điểm bay lơ lửng */
.point-box {
  position: absolute; /* Bay lơ lửng, không chiếm chỗ */
  right: 20px; /* Căn sát lề phải của khoảng trắng */
  top: 8px; /* Đẩy xuống 8px -> Nằm giữa Tên và SĐT */

  /* Style làm đẹp */
  background: linear-gradient(135deg, #fff8e1, #ffecb3);
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid #ffe0b2;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);

  /* Xếp chữ nằm ngang: "Điểm: 100" */
  display: flex;
  align-items: center;
  gap: 5px;
  z-index: 10;
}

/* Chỉnh chữ bé lại cho gọn */
.point-label {
  font-size: 11px;
  color: #f39c12;
  font-weight: 700;
  text-transform: uppercase;
}

.point-number {
  font-size: 15px;
  font-weight: 800;
  color: #d35400;
}
/* Nút nổi góc màn hình */
.notification-fab {
  position: fixed;
  bottom: 20px;
  left: 20px; /* Muốn nằm phải thì đổi thành right: 20px */
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #ff6b01, #ff9f43);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(255, 107, 1, 0.4);
  cursor: pointer;
  z-index: 999; /* Luôn nổi trên cùng */
  transition: transform 0.2s;
}

.notification-fab:active {
  transform: scale(0.9);
}

.bell-container {
  position: relative;
  color: white;
  font-size: 24px;
}

/* Hiệu ứng rung chuông */
.notification-fab:hover i {
  animation: bell-ring 1s infinite;
}

/* Số đỏ đếm thông báo */
.bell-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: red;
  color: white;
  font-size: 10px;
  font-weight: bold;
  height: 18px;
  min-width: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid white;
}

@keyframes bell-ring {
  0% {
    transform: rotate(0);
  }
  10% {
    transform: rotate(30deg);
  }
  30% {
    transform: rotate(-30deg);
  }
  50% {
    transform: rotate(15deg);
  }
  70% {
    transform: rotate(-15deg);
  }
  100% {
    transform: rotate(0);
  }
}

/* --- SKELETON LOADING --- */
.skeleton-wrapper {
  padding: 15px; /* Giống list-container */
}

.skeleton-card {
  background: white;
  border-radius: 18px;
  padding: 15px;
  margin-bottom: 15px;
  display: flex;
  gap: 12px;
  border: 1px solid #f0f0f0;
}

/* Hiệu ứng nhấp nháy */
.skeleton-anim {
  background: #eee;
  background: linear-gradient(110deg, #ececec 8%, #f5f5f5 18%, #ececec 33%);
  background-size: 200% 100%;
  animation: shimmer 1.5s linear infinite;
  border-radius: 6px;
}

@keyframes shimmer {
  to {
    background-position-x: -200%;
  }
}

/* Các khối giả lập */
.sk-img {
  width: 75px;
  height: 75px;
  border-radius: 12px;
  flex-shrink: 0;
}
.sk-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.sk-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}
.sk-line-short {
  width: 30%;
  height: 14px;
}
.sk-line-medium {
  width: 60%;
  height: 14px;
}
.sk-line-long {
  width: 100%;
  height: 14px;
}
/* --- BUTTONS BOTTOM --- */
.bottom-actions {
  /* Cập nhật lại gap để vừa 3 nút */
  gap: 8px;
}
.point-btn {
  flex: 1; /* Chia đều diện tích với nút Hỗ trợ */
  background: linear-gradient(
    135deg,
    #8e44ad,
    #9b59b6
  ); /* Màu tím sang trọng */
  padding: 10px;
  flex-direction: column; /* Icon trên chữ dưới cho gọn */
  gap: 2px;
  font-size: 11px;
}
.support-btn {
  /* Sửa lại support btn để giống style point btn */
  flex: 1;
  flex-direction: column;
  padding: 10px;
  gap: 2px;
  font-size: 11px;
}
.noti-btn {
  /* Giữ nguyên nút chuông tròn hoặc vuông */
  width: 50px;
}

/* --- POINT MODAL STYLES --- */
/* --- SỬA HEADER MODAL ĐỂ CÓ NÚT (?) --- */
.point-tabs-header {
  display: flex;
  align-items: center;
  background: #f8f9fa;
  border-bottom: 1px solid #eee;
  position: relative;
  padding-right: 40px; /* Chừa chỗ cho nút đóng */
  padding-left: 40px; /* Chừa chỗ cho nút Help */
}

/* Nút (?) Luật chơi */
.icon-help {
  position: absolute;
  left: 15px;
  top: 12px;
  font-size: 22px;
  color: #3498db;
  cursor: pointer;
  z-index: 5;
}

/* --- BANNER KHO QUÀ (Trong tab Xếp hạng) --- */
.exchange-banner {
  background: linear-gradient(135deg, #ff9ff3, #feca57);
  border-radius: 16px;
  padding: 15px;
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(254, 202, 87, 0.4);
  border: 2px solid white;
  transition: transform 0.1s;
}
.exchange-banner:active {
  transform: scale(0.98);
}
.ex-content h3 {
  margin: 0;
  color: #d35400;
  font-size: 18px;
  font-weight: 900;
}
.ex-content p {
  margin: 4px 0 0;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.ex-img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.2));
}

/* --- BẢNG NỘI QUY (RULES TABLE) --- */
.rules-table {
  padding: 10px;
}
.r-section-title {
  font-size: 12px;
  font-weight: 800;
  padding: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 6px;
  margin-top: 10px;
  margin-bottom: 5px;
}
.r-section-title.green {
  background: #e8f5e9;
  color: #27ae60;
}
.r-section-title.red {
  background: #ffebee;
  color: #c0392b;
}

.r-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px dashed #eee;
  font-size: 13px;
}
.r-row:last-child {
  border-bottom: none;
}
.r-row span {
  color: #555;
}
.r-row b {
  color: #2c3e50;
}
.text-red {
  color: #e74c3c !important;
}

/* --- GRID KHO QUÀ (Trong Modal đổi quà) --- */
.my-point-mini {
  text-align: center;
  margin-bottom: 15px;
  font-size: 14px;
}
.gift-grid {
  display: grid;
  grid-template-columns: 1fr 1fr; /* 2 cột */
  gap: 12px;
}
.gift-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 15px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.gift-img {
  font-size: 30px;
  margin-bottom: 5px;
}
.gift-card h4 {
  margin: 5px 0;
  font-size: 13px;
  color: #333;
}
.g-price {
  font-weight: bold;
  color: #e67e22;
  font-size: 12px;
  margin-bottom: 10px;
}
.btn-claim {
  background: #27ae60;
  color: white;
  border: none;
  width: 100%;
  padding: 6px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
}
.pt-tab {
  flex: 1;
  text-align: center;
  padding: 15px;
  font-weight: 600;
  color: #888;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.pt-tab.active {
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
  background: #fff;
}
.close-btn-absolute {
  position: absolute;
  right: 15px;
  top: 10px;
  font-size: 28px;
  cursor: pointer;
  color: #999;
  line-height: 1;
}
.modal-body-scroll {
  padding: 20px;
  max-height: 70vh;
  overflow-y: auto;
}

/* My Rank Card */
.my-rank-card {
  background: linear-gradient(135deg, #34495e, #2c3e50);
  color: white;
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 5px 15px rgba(44, 62, 80, 0.3);
  margin-bottom: 20px;
}
.rank-icon-large {
  font-size: 30px;
  color: #f1c40f; /* Vàng kim loại */
  margin-bottom: 5px;
}
.rank-info-text h2 {
  margin: 0;
  font-size: 36px;
  font-weight: 800;
}
.rank-name {
  font-size: 14px;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: bold;
}
.rank-progress-bar {
  background: rgba(255, 255, 255, 0.2);
  height: 6px;
  border-radius: 3px;
  margin: 10px 0 5px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: #2ecc71;
}
.next-rank-text {
  font-size: 10px;
  color: #ccc;
  margin: 0;
}

/* Lịch sử điểm */
.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed #eee;
}
.his-left {
  display: flex;
  flex-direction: column;
}
.his-reason {
  font-size: 13px;
  font-weight: 600;
  color: #333;
}
.his-date {
  font-size: 10px;
  color: #999;
}
.his-amount {
  font-weight: 800;
  font-size: 14px;
}
.his-amount.plus {
  color: #27ae60;
} /* Cộng màu xanh */
.his-amount.minus {
  color: #e74c3c;
} /* Trừ màu đỏ */

/* Bảng xếp hạng */
.leaderboard-list {
  margin-bottom: 20px;
}
.rank-row {
  display: flex;
  align-items: center;
  background: #fff;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 8px;
  border: 1px solid #f0f0f0;
}
.r-num {
  width: 30px;
  font-weight: 800;
  font-size: 16px;
  color: #7f8c8d;
  text-align: center;
}
.r-top-1 {
  color: #f1c40f;
  font-size: 20px;
} /* Vàng */
.r-top-2 {
  color: #bdc3c7;
  font-size: 18px;
} /* Bạc */
.r-top-3 {
  color: #d35400;
  font-size: 18px;
} /* Đồng */

.r-info {
  flex: 1;
  padding-left: 10px;
}
.r-name {
  font-weight: 700;
  font-size: 13px;
  display: block;
}
.r-reward {
  font-size: 10px;
  color: #e67e22;
}
.r-point {
  font-weight: 800;
  color: #2c3e50;
}

/* Khu vực đổi quà */
.exchange-section {
  border-top: 4px solid #f0f0f0;
  padding-top: 15px;
}
.gift-item {
  display: flex;
  align-items: center;
  background: #fff8e1;
  padding: 10px;
  border-radius: 10px;
  margin-bottom: 10px;
  border: 1px solid #ffe0b2;
}
.gift-icon {
  font-size: 24px;
  margin-right: 12px;
}
.gift-info {
  flex: 1;
}
.gift-info b {
  font-size: 13px;
  display: block;
  color: #d35400;
}
.gift-info span {
  font-size: 10px;
  color: #666;
}
.btn-exchange {
  background: #ff6b01;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
}
/* --- STYLE CHO MODAL THÔNG BÁO --- */

/* Item thông báo chung */
.noti-item {
  background: white;
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
  border-left: 4px solid #ddd; /* Viền trái mặc định */
  animation: fadeIn 0.3s ease;
}

/* 1. Loại Quan trọng (Màu đỏ/cam) */
.noti-item.danger {
  border-left-color: #e74c3c;
  background: #fff5f5;
}
.noti-item.warning {
  border-left-color: #f39c12;
  background: #fffcf5;
}

/* 2. Loại Thường (Màu xanh) */
.noti-item.normal {
  border-left-color: #2ecc71;
}

.noti-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}
.noti-title {
  font-weight: 700;
  font-size: 14px;
  color: #333;
}
.noti-time {
  font-size: 10px;
  color: #999;
}
.noti-desc {
  font-size: 13px;
  color: #555;
  line-height: 1.4;
}

/* Nút Góp ý ở dưới cùng */
.btn-feedback {
  width: 100%;
  padding: 12px;
  background: #f1f2f6;
  color: #2c3e50;
  border: 1px dashed #bdc3c7;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-feedback:active {
  background: #e0e0e0;
  transform: scale(0.98);
}
.btn-feedback:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #fff;
}
/* Đường kẻ phân cách trong modal hỗ trợ */
.separator-line {
  height: 1px;
  background: #eee;
  margin: 15px 0;
}

/* Style riêng cho nút Góp ý */
.support-link.feedback {
  background: #fff;
  border: 1px dashed #95a5a6;
  color: #555;
  justify-content: center; /* Căn giữa chữ */
  cursor: pointer;
  width: 100%; /* Đảm bảo full width vì nó là thẻ button */
  font-size: 14px;
}
.support-link.feedback:active {
  background: #f1f2f6;
  border-color: #7f8c8d;
}
.support-link.feedback i {
  color: #e67e22; /* Icon màu cam cho nổi */
}
:root {
  --primary: #ff6b01;
  --bg: #f2f4f8;
  --text: #2d3436;
  --white: #fff;
  --shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* KHÓA CHẶT BODY */
html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-x pan-y;
  -webkit-text-size-adjust: 100%;
}
.hidden {
  display: none !important;
}

/* LOGIN */
#login-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--white);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 25px;
}
.login-content {
  width: 100%;
  max-width: 400px;
  text-align: center;
}
.brand-logo {
  font-size: 65px;
  color: var(--primary);
  margin-bottom: 15px;
  filter: drop-shadow(0 5px 10px rgba(255, 107, 1, 0.2));
}
.input-group {
  position: relative;
  margin-bottom: 15px;
  background: #f9f9f9;
  border-radius: 14px;
  border: 1px solid #eee;
}
.input-group i {
  position: absolute;
  top: 16px;
  left: 16px;
  color: #999;
}
.input-group input {
  width: 100%;
  padding: 16px 16px 16px 48px;
  border: none;
  background: transparent;
  outline: none;
  font-size: 16px;
}
.btn-login {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #ff6b01, #ff9f43);
  color: var(--white);
  border: none;
  border-radius: 14px;
  font-weight: 700;
  font-size: 16px;
  margin-top: 15px;
  cursor: pointer;
}

/* LAYOUT */
#home-screen {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  width: 100%;
  position: relative;
}

/* HEADER */
.fixed-header {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  z-index: 100;
  padding: 15px 15px 8px;
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
  box-shadow: var(--shadow);
  padding-top: max(15px, env(safe-area-inset-top));
}
.user-card {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  gap: 10px;
}
.avatar-container {
  position: relative;
}
#user-avatar-img {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary);
  padding: 2px;
  background: #fff;
}
.user-info {
  flex: 1;
  min-width: 0;
}
.user-info h3 {
  margin: 0 0 4px;
  color: var(--primary);
  font-size: 18px;
  font-weight: 800;
}
.info-row {
  font-size: 13px;
  color: #666;
  margin: 2px 0;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.highlight {
  color: #2c3e50;
  font-weight: 600;
}
.time {
  color: #e67e22;
  font-style: italic;
  font-weight: 500;
}

.header-actions {
  display: grid;
  grid-template-columns: 1fr 1fr; /* 2 cột */
  gap: 6px;
  margin-left: 8px;
  flex-shrink: 0;
}
.icon-btn {
  width: 37px;
  height: 37px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  margin: 0;
}
/* Thêm vào chỗ các nút icon-btn */
.refresh-btn {
  background: #e8f5e9;
  color: #2e7d32;
}

/* Hiệu ứng xoay khi đang load */
.spin-anim {
  animation: spin 1s linear infinite;
}
.edit-btn {
  background: #e3f2fd;
  color: #2196f3;
}
.logout-btn {
  background: #ffebee;
  color: #ef5350;

  /* QUAN TRỌNG: Để nút này nằm giữa hàng dưới */
  grid-column: span 2;
  justify-self: center;
  width: 37px;
}

/* TABS */
.tabs-container {
  display: flex;
  background: #f1f2f6;
  padding: 5px;
  border-radius: 14px;
}
.tab {
  flex: 1;
  text-align: center;
  padding: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #888;
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  transition: 0.3s;
}
.tab.active {
  background: var(--white);
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.badge-count {
  position: absolute;
  top: 8px;
  right: 12px;
  background: #ff4757;
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
}

/* LIST */
#list-container {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  padding-bottom: 90px;
  -webkit-overflow-scrolling: touch;
}
#list-container::-webkit-scrollbar {
  width: 0;
}

/* CARD */
.group-card {
  background: var(--white);
  border-radius: 18px;
  padding: 15px;
  margin-bottom: 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  display: flex;
  gap: 12px;
  animation: slideUp 0.4s ease;
  border: 1px solid #f0f0f0;
}
@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
.group-img {
  width: 75px;
  height: 75px;
  border-radius: 12px;
  object-fit: cover;
  background: #eee;
  flex-shrink: 0;
  cursor: pointer;
}
.group-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.codes {
  font-weight: 800;
  color: #333;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60%;
}
.status {
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.st-pending {
  background: #fff8e1;
  color: #f39c12;
}
.st-shipping {
  background: #e3f2fd;
  color: #2980b9;
}
.st-done {
  background: #e8f5e9;
  color: #27ae60;
}

/* LAYOUT HÀNG GIỮA (TRACKING + NÚT) */
.middle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
  gap: 8px;
}
.tracking-list {
  flex: 1;
}
.tracking-item {
  font-family: monospace;
  font-size: 13px;
  color: #555;
  background: #f8f9fa;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 4px;
  display: inline-block;
}

.mini-pay-btn {
  background: #27ae60;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(39, 174, 96, 0.3);
  margin: 0;
}
.mini-pay-btn:active {
  transform: scale(0.95);
}

.total {
  text-align: right;
  font-weight: 800;
  color: #e74c3c;
  font-size: 16px;
  border-top: 1px dashed #eee;
  padding-top: 6px;
  margin-top: auto;
}

/* BOTTOM ACTIONS - THANH ĐIỀU HƯỚNG DƯỚI */
.bottom-actions {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  display: flex;
  gap: 12px; /* Khoảng cách giữa 2 nút */
  z-index: 90;
  padding-bottom: env(safe-area-inset-bottom);
}

/* Style chung cho cả 2 nút */
.action-btn {
  border-radius: 16px;
  border: none;
  color: white;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  transition: transform 0.1s;
}
.action-btn:active {
  transform: scale(0.96);
}

/* 1. Nút Hỗ trợ: Chiếm phần lớn diện tích (flex: 1) */
.support-btn {
  flex: 1; /* Tự động giãn hết mức có thể */
  background: linear-gradient(135deg, #ff6b01, #ff9f43);
  padding: 14px;
  gap: 10px;
  font-size: 14px;
}

/* --- HIỆU ỨNG RUNG CHUÔNG CHO NÚT THÔNG BÁO --- */

/* 1. Định nghĩa chuyển động rung (Copy từ code của bạn) */
@keyframes bell-ring {
  0% {
    transform: rotate(0);
  }
  10% {
    transform: rotate(30deg);
  }
  30% {
    transform: rotate(-30deg);
  }
  50% {
    transform: rotate(15deg);
  }
  70% {
    transform: rotate(-15deg);
  }
  100% {
    transform: rotate(0);
  }
}

/* 2. Style cho nút thông báo (Giao diện mới) */
.noti-btn {
  width: 54px;
  flex-shrink: 0;
  background: white;
  color: #ff6b01;
  /* Giữ các thuộc tính của action-btn */
  border-radius: 16px;
  border: none;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  transition: transform 0.1s;
}

.noti-btn i {
  font-size: 22px;
  /* Thêm dòng này để chuẩn bị cho hiệu ứng rung */
  transform-origin: top center;
}

/* 3. KÍCH HOẠT RUNG: Khi di chuột vào */
.noti-btn:hover i {
  animation: bell-ring 1s infinite;
}

/* [MỞ RỘNG] KÍCH HOẠT RUNG TỰ ĐỘNG: Khi có tin nhắn (Class này sẽ được JS thêm vào) */
.noti-btn.has-news i {
  animation: bell-ring 2s infinite; /* Rung chậm hơn xíu cho đỡ nhức mắt */
}

/* 4. Style số đỏ (Copy và chỉnh lại từ code của bạn cho khớp vị trí mới) */
.bell-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bell-badge {
  position: absolute;
  top: -8px; /* Căn chỉnh lại cho khớp nút mới */
  right: -8px;
  background: red;
  color: white;
  font-size: 10px;
  font-weight: bold;
  height: 18px;
  min-width: 18px;
  padding: 0 4px;
  border-radius: 10px; /* Bo tròn kiểu viên thuốc */
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
  z-index: 2;
}
.btn-icon {
  font-size: 18px;
}

/* MODALS */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-content {
  background: var(--white);
  width: 88%;
  max-width: 340px;
  border-radius: 24px;
  padding: 25px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.bounce-in {
  animation: bounce 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes bounce {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.modal-header h3 {
  margin: 0;
  color: var(--primary);
  font-size: 18px;
}
.close-btn {
  font-size: 26px;
  color: #bbb;
  cursor: pointer;
  padding: 5px;
}
.modal-input {
  width: 100%;
  padding: 14px;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  margin-bottom: 12px;
  background: #fafafa;
  font-size: 15px;
}
.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: bold;
  cursor: pointer;
}

/* PAYMENT TABS */
.currency-tabs {
  display: flex;
  background: #f0f0f0;
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 15px;
}
.cur-tab {
  flex: 1;
  text-align: center;
  padding: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #666;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.2s;
}
.cur-tab.active {
  background: white;
  color: #27ae60;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.qr-box {
  text-align: center;
  margin-bottom: 15px;
}
.qr-img {
  width: 180px;
  height: 180px;
  border-radius: 12px;
  border: 1px solid #eee;
}
.bank-info p {
  margin: 8px 0;
  border-bottom: 1px solid #f5f5f5;
  padding-bottom: 8px;
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}
.money-highlight {
  font-size: 24px;
  font-weight: 800;
  color: #27ae60;
  margin: 10px 0;
}
.note {
  font-size: 12px;
  color: #e74c3c;
  background: #fff0e6;
  padding: 10px;
  border-radius: 8px;
  text-align: center;
  margin-top: 15px;
  font-weight: 500;
}

/* SUPPORT LINKS */
.support-link {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background: #f5f5f5;
  border-radius: 14px;
  color: #333;
  text-decoration: none;
  font-weight: 600;
  margin-bottom: 12px;
  transition: 0.2s;
}
.support-link:active {
  background: #eee;
}
.support-link i {
  font-size: 20px;
  width: 25px;
  text-align: center;
}
.support-link.call i {
  color: #2196f3;
}
.support-link.wechat i {
  color: #07c160;
}
.support-link.mess i {
  color: #0084ff;
}

/* [CẬP NHẬT] SLIDER IMAGE VIEWER (XỊN HƠN) */
.image-viewer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000; /* Nền đen hoàn toàn */
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.viewer-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#viewer-img {
  max-width: 100%;
  max-height: 80vh;
  transition: opacity 0.2s ease; /* Hiệu ứng mờ khi chuyển ảnh */
}

/* Nút đóng góc trên */
.close-viewer-icon {
  position: absolute;
  top: 40px;
  right: 20px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 20px;
  z-index: 102;
  cursor: pointer;
}

/* Thanh điều hướng dưới đáy */
.viewer-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 80px;
  background: rgba(20, 20, 20, 0.9);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  z-index: 101;
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 24px;
  padding: 10px;
  cursor: pointer;
}
.nav-btn:active {
  color: var(--primary);
}

.img-counter {
  color: white;
  font-weight: bold;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.1);
  padding: 5px 15px;
  border-radius: 20px;
}

/* Loading Spinner trong Viewer */
.viewer-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
}
.loading-spinner.white {
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid #fff;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
/* THANH CẢNH BÁO - UPDATE */
.warning-bar {
  display: flex;
  align-items: center;
  background: #fff3cd;
  color: #856404;
  padding: 8px 12px;
  margin-top: 10px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid #ffeeba;
  overflow: hidden; /* Quan trọng để cắt chữ thừa */
}

.warning-bar i {
  margin-right: 10px;
  color: #ff9800;
  flex-shrink: 0;
  animation: shake 1s infinite;
}

/* CSS Animation chạy chữ thay cho marquee */
.marquee-content {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
}

.marquee-content span {
  display: inline-block;
  padding-left: 100%;
  animation: marquee 15s linear infinite;
}

@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-10deg);
  }
  75% {
    transform: rotate(10deg);
  }
}
/* Badge cảnh báo ngày lưu kho */
.fee-badge,
.risk-badge {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  margin-bottom: 6px;
  display: inline-block;
  font-weight: 600;
  width: fit-content;
  animation: fadeIn 0.5s;
}

/* Quá 5 ngày: Màu vàng cam */
.fee-badge {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
}

/* Quá 15 ngày: Màu đỏ gắt */
.risk-badge {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Icon trong badge */
.fee-badge i,
.risk-badge i {
  margin-right: 4px;
}
/* --- SỬA LẠI PHẦN TOTAL ĐỂ NẰM NGANG --- */
.total {
  border-top: 1px dashed #eee;
  padding-top: 8px;
  margin-top: auto;
  /* Dùng Flexbox để xếp ngang */
  display: flex;
  justify-content: space-between; /* Đẩy 2 phần về 2 đầu */
  align-items: center; /* Căn giữa theo chiều dọc */
  min-height: 30px; /* Giữ chiều cao ổn định */
}

/* Sửa lại Badge cảnh báo cho nhỏ gọn để nằm vừa 1 dòng */
.badge-warning {
  font-size: 10px; /* Chữ nhỏ lại xíu cho đỡ chật */
  padding: 4px 6px;
  border-radius: 4px;
  font-weight: 600;
  /* Bỏ margin-bottom đi vì giờ nằm ngang rồi */
  margin-bottom: 0;
  display: inline-block;
  white-space: nowrap; /* Cấm xuống dòng */
}

/* Các cấp độ màu sắc giữ nguyên */
.lv-1 {
  background: #fff3cd;
  color: #856404;
  border: 1px dashed #ffeeba;
}
.lv-2 {
  background: #ffe082;
  color: #5d4037;
  border: 1px solid #ffca28;
}
.lv-3 {
  background: #ffccbc;
  color: #bf360c;
  border: 1px dashed #ffab91;
}
.lv-4 {
  background: #ffcdd2;
  color: #c62828;
  border: 1px solid #ef9a9a;
}

/* Style cho phần Tiền (để bên phải) */
.money-text {
  font-weight: 800;
  color: #e74c3c;
  font-size: 16px;
  margin-left: auto; /* Đẩy sát sang phải nếu không có badge */
}
/* 1. Thiết lập khung cha để làm mốc tọa độ */
.user-info {
  flex: 1;
  min-width: 0;
  position: relative; /* QUAN TRỌNG: Để con nó định vị theo nó */
}

/* 2. Định vị hộp điểm bay lơ lửng */
.point-box {
  position: absolute; /* Bay lơ lửng, không chiếm chỗ */
  right: 20px; /* Căn sát lề phải của khoảng trắng */
  top: 8px; /* Đẩy xuống 8px -> Nằm giữa Tên và SĐT */

  /* Style làm đẹp */
  background: linear-gradient(135deg, #fff8e1, #ffecb3);
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid #ffe0b2;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);

  /* Xếp chữ nằm ngang: "Điểm: 100" */
  display: flex;
  align-items: center;
  gap: 5px;
  z-index: 10;
}

/* Chỉnh chữ bé lại cho gọn */
.point-label {
  font-size: 11px;
  color: #f39c12;
  font-weight: 700;
  text-transform: uppercase;
}

.point-number {
  font-size: 15px;
  font-weight: 800;
  color: #d35400;
}
/* Nút nổi góc màn hình */
.notification-fab {
  position: fixed;
  bottom: 20px;
  left: 20px; /* Muốn nằm phải thì đổi thành right: 20px */
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #ff6b01, #ff9f43);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(255, 107, 1, 0.4);
  cursor: pointer;
  z-index: 999; /* Luôn nổi trên cùng */
  transition: transform 0.2s;
}

.notification-fab:active {
  transform: scale(0.9);
}

.bell-container {
  position: relative;
  color: white;
  font-size: 24px;
}

/* Hiệu ứng rung chuông */
.notification-fab:hover i {
  animation: bell-ring 1s infinite;
}

/* Số đỏ đếm thông báo */
.bell-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: red;
  color: white;
  font-size: 10px;
  font-weight: bold;
  height: 18px;
  min-width: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid white;
}

@keyframes bell-ring {
  0% {
    transform: rotate(0);
  }
  10% {
    transform: rotate(30deg);
  }
  30% {
    transform: rotate(-30deg);
  }
  50% {
    transform: rotate(15deg);
  }
  70% {
    transform: rotate(-15deg);
  }
  100% {
    transform: rotate(0);
  }
}

/* --- SKELETON LOADING --- */
.skeleton-wrapper {
  padding: 15px; /* Giống list-container */
}

.skeleton-card {
  background: white;
  border-radius: 18px;
  padding: 15px;
  margin-bottom: 15px;
  display: flex;
  gap: 12px;
  border: 1px solid #f0f0f0;
}

/* Hiệu ứng nhấp nháy */
.skeleton-anim {
  background: #eee;
  background: linear-gradient(110deg, #ececec 8%, #f5f5f5 18%, #ececec 33%);
  background-size: 200% 100%;
  animation: shimmer 1.5s linear infinite;
  border-radius: 6px;
}

@keyframes shimmer {
  to {
    background-position-x: -200%;
  }
}

/* Các khối giả lập */
.sk-img {
  width: 75px;
  height: 75px;
  border-radius: 12px;
  flex-shrink: 0;
}
.sk-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.sk-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}
.sk-line-short {
  width: 30%;
  height: 14px;
}
.sk-line-medium {
  width: 60%;
  height: 14px;
}
.sk-line-long {
  width: 100%;
  height: 14px;
}
/* --- BUTTONS BOTTOM --- */
.bottom-actions {
  /* Cập nhật lại gap để vừa 3 nút */
  gap: 8px;
}
.point-btn {
  flex: 1; /* Chia đều diện tích với nút Hỗ trợ */
  background: linear-gradient(
    135deg,
    #8e44ad,
    #9b59b6
  ); /* Màu tím sang trọng */
  padding: 10px;
  flex-direction: column; /* Icon trên chữ dưới cho gọn */
  gap: 2px;
  font-size: 11px;
}
.support-btn {
  /* Sửa lại support btn để giống style point btn */
  flex: 1;
  flex-direction: column;
  padding: 10px;
  gap: 2px;
  font-size: 11px;
}
.noti-btn {
  /* Giữ nguyên nút chuông tròn hoặc vuông */
  width: 50px;
}

/* --- POINT MODAL STYLES --- */
/* --- SỬA HEADER MODAL ĐỂ CÓ NÚT (?) --- */
.point-tabs-header {
  display: flex;
  align-items: center;
  background: #f8f9fa;
  border-bottom: 1px solid #eee;
  position: relative;
  padding-right: 40px; /* Chừa chỗ cho nút đóng */
  padding-left: 40px; /* Chừa chỗ cho nút Help */
}

/* Nút (?) Luật chơi */
.icon-help {
  position: absolute;
  left: 15px;
  top: 12px;
  font-size: 22px;
  color: #3498db;
  cursor: pointer;
  z-index: 5;
}

/* --- BANNER KHO QUÀ (Trong tab Xếp hạng) --- */
.exchange-banner {
  background: linear-gradient(135deg, #ff9ff3, #feca57);
  border-radius: 16px;
  padding: 15px;
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(254, 202, 87, 0.4);
  border: 2px solid white;
  transition: transform 0.1s;
}
.exchange-banner:active {
  transform: scale(0.98);
}
.ex-content h3 {
  margin: 0;
  color: #d35400;
  font-size: 18px;
  font-weight: 900;
}
.ex-content p {
  margin: 4px 0 0;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.ex-img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.2));
}

/* --- BẢNG NỘI QUY (RULES TABLE) --- */
.rules-table {
  padding: 10px;
}
.r-section-title {
  font-size: 12px;
  font-weight: 800;
  padding: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 6px;
  margin-top: 10px;
  margin-bottom: 5px;
}
.r-section-title.green {
  background: #e8f5e9;
  color: #27ae60;
}
.r-section-title.red {
  background: #ffebee;
  color: #c0392b;
}

.r-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px dashed #eee;
  font-size: 13px;
}
.r-row:last-child {
  border-bottom: none;
}
.r-row span {
  color: #555;
}
.r-row b {
  color: #2c3e50;
}
.text-red {
  color: #e74c3c !important;
}

/* --- GRID KHO QUÀ (Trong Modal đổi quà) --- */
.my-point-mini {
  text-align: center;
  margin-bottom: 15px;
  font-size: 14px;
}
.gift-grid {
  display: grid;
  grid-template-columns: 1fr 1fr; /* 2 cột */
  gap: 12px;
}
.gift-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 15px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.gift-img {
  font-size: 30px;
  margin-bottom: 5px;
}
.gift-card h4 {
  margin: 5px 0;
  font-size: 13px;
  color: #333;
}
.g-price {
  font-weight: bold;
  color: #e67e22;
  font-size: 12px;
  margin-bottom: 10px;
}
.btn-claim {
  background: #27ae60;
  color: white;
  border: none;
  width: 100%;
  padding: 6px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
}
.pt-tab {
  flex: 1;
  text-align: center;
  padding: 15px;
  font-weight: 600;
  color: #888;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.pt-tab.active {
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
  background: #fff;
}
.close-btn-absolute {
  position: absolute;
  right: 15px;
  top: 10px;
  font-size: 28px;
  cursor: pointer;
  color: #999;
  line-height: 1;
}
.modal-body-scroll {
  padding: 20px;
  max-height: 70vh;
  overflow-y: auto;
}

/* My Rank Card */
.my-rank-card {
  background: linear-gradient(135deg, #34495e, #2c3e50);
  color: white;
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 5px 15px rgba(44, 62, 80, 0.3);
  margin-bottom: 20px;
}
.rank-icon-large {
  font-size: 30px;
  color: #f1c40f; /* Vàng kim loại */
  margin-bottom: 5px;
}
.rank-info-text h2 {
  margin: 0;
  font-size: 36px;
  font-weight: 800;
}
.rank-name {
  font-size: 14px;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: bold;
}
.rank-progress-bar {
  background: rgba(255, 255, 255, 0.2);
  height: 6px;
  border-radius: 3px;
  margin: 10px 0 5px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: #2ecc71;
}
.next-rank-text {
  font-size: 10px;
  color: #ccc;
  margin: 0;
}

/* Lịch sử điểm */
.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed #eee;
}
.his-left {
  display: flex;
  flex-direction: column;
}
.his-reason {
  font-size: 13px;
  font-weight: 600;
  color: #333;
}
.his-date {
  font-size: 10px;
  color: #999;
}
.his-amount {
  font-weight: 800;
  font-size: 14px;
}
.his-amount.plus {
  color: #27ae60;
} /* Cộng màu xanh */
.his-amount.minus {
  color: #e74c3c;
} /* Trừ màu đỏ */

/* Bảng xếp hạng */
.leaderboard-list {
  margin-bottom: 20px;
}
.rank-row {
  display: flex;
  align-items: center;
  background: #fff;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 8px;
  border: 1px solid #f0f0f0;
}
.r-num {
  width: 30px;
  font-weight: 800;
  font-size: 16px;
  color: #7f8c8d;
  text-align: center;
}
.r-top-1 {
  color: #f1c40f;
  font-size: 20px;
} /* Vàng */
.r-top-2 {
  color: #bdc3c7;
  font-size: 18px;
} /* Bạc */
.r-top-3 {
  color: #d35400;
  font-size: 18px;
} /* Đồng */

.r-info {
  flex: 1;
  padding-left: 10px;
}
.r-name {
  font-weight: 700;
  font-size: 13px;
  display: block;
}
.r-reward {
  font-size: 10px;
  color: #e67e22;
}
.r-point {
  font-weight: 800;
  color: #2c3e50;
}

/* Khu vực đổi quà */
.exchange-section {
  border-top: 4px solid #f0f0f0;
  padding-top: 15px;
}
.gift-item {
  display: flex;
  align-items: center;
  background: #fff8e1;
  padding: 10px;
  border-radius: 10px;
  margin-bottom: 10px;
  border: 1px solid #ffe0b2;
}
.gift-icon {
  font-size: 24px;
  margin-right: 12px;
}
.gift-info {
  flex: 1;
}
.gift-info b {
  font-size: 13px;
  display: block;
  color: #d35400;
}
.gift-info span {
  font-size: 10px;
  color: #666;
}
.btn-exchange {
  background: #ff6b01;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
}
/* --- STYLE CHO MODAL THÔNG BÁO --- */

/* Item thông báo chung */
.noti-item {
  background: white;
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
  border-left: 4px solid #ddd; /* Viền trái mặc định */
  animation: fadeIn 0.3s ease;
}

/* 1. Loại Quan trọng (Màu đỏ/cam) */
.noti-item.danger {
  border-left-color: #e74c3c;
  background: #fff5f5;
}
.noti-item.warning {
  border-left-color: #f39c12;
  background: #fffcf5;
}

/* 2. Loại Thường (Màu xanh) */
.noti-item.normal {
  border-left-color: #2ecc71;
}

.noti-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}
.noti-title {
  font-weight: 700;
  font-size: 14px;
  color: #333;
}
.noti-time {
  font-size: 10px;
  color: #999;
}
.noti-desc {
  font-size: 13px;
  color: #555;
  line-height: 1.4;
}

/* Nút Góp ý ở dưới cùng */
.btn-feedback {
  width: 100%;
  padding: 12px;
  background: #f1f2f6;
  color: #2c3e50;
  border: 1px dashed #bdc3c7;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-feedback:active {
  background: #e0e0e0;
  transform: scale(0.98);
}
.btn-feedback:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #fff;
}
/* Đường kẻ phân cách trong modal hỗ trợ */
.separator-line {
  height: 1px;
  background: #eee;
  margin: 15px 0;
}

/* Style riêng cho nút Góp ý */
.support-link.feedback {
  background: #fff;
  border: 1px dashed #95a5a6;
  color: #555;
  justify-content: center; /* Căn giữa chữ */
  cursor: pointer;
  width: 100%; /* Đảm bảo full width vì nó là thẻ button */
  font-size: 14px;
}
.support-link.feedback:active {
  background: #f1f2f6;
  border-color: #7f8c8d;
}
.support-link.feedback i {
  color: #e67e22; /* Icon màu cam cho nổi */
}
