/* ----------------------- 01. Bố cục: tóm tắt tài khoản + các tab ----------------------- */
.pf-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 20px;
  margin-top: 30px;
  align-items: start;
}

.pf-card {
  background-color: #fff;
  border-radius: 8px;
  padding: 20px 24px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  box-sizing: border-box;
}

/* ----------------------- 02. Tóm tắt tài khoản ----------------------- */
.pf-summary {
  text-align: center;
}

.pf-avatar {
  position: relative;
  display: inline-block;
  width: 96px;
  height: 96px;
  margin: 4px auto 12px;
  border-radius: 50%;
  cursor: pointer;
}

.pf-avatar img,
.pf-avatar-letter {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
}

.pf-avatar-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #e8eaf6;
  color: #3f51b5;
  font-size: 38px;
  font-weight: 600;
}

.pf-avatar img:not([hidden]) + .pf-avatar-letter {
  display: none;
}

.pf-avatar-edit {
  position: absolute;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  font-size: 14px;
}

.pf-avatar:hover .pf-avatar-edit {
  background-color: #eef0fe;
}

.pf-summary-name {
  margin: 0 0 4px;
  font-size: 18px;
  color: #222;
  overflow-wrap: anywhere;
}

.pf-coins {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 600;
  color: #e6a700;
}

.pf-plan {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 12px;
  background-color: #eef0fe;
  color: #3f51b5;
  font-size: 13px;
}

.pf-referral {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #f0f0f0;
  text-align: left;
}

.pf-referral label {
  display: block;
  margin: 10px 0 6px;
  font-size: 13px;
  color: #444;
}

.pf-inline {
  display: flex;
  gap: 6px;
}

.pf-inline input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
}

#pf-my-code {
  background-color: #f8f9ff;
  font-family: Consolas, monospace;
  letter-spacing: 1px;
}

.pf-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: #888;
}

/* ----------------------- 03. Tabs ----------------------- */
.pf-tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid #e5e5e5;
  margin-bottom: 20px;
  overflow-x: auto;
}

.pf-tab {
  padding: 8px 0;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  font-size: 14px;
  font-family: inherit;
  color: #555;
  white-space: nowrap;
  cursor: pointer;
}

.pf-tab.active {
  color: #3f51b5;
  border-bottom-color: #3f51b5;
}

.pf-tab-panel {
  display: none;
}

.pf-tab-panel.active {
  display: block;
}

.pf-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.pf-panel-head h3 {
  margin: 0;
  font-size: 16px;
  color: #222;
}

/* ----------------------- 04. Form ----------------------- */
.pf-form {
  max-width: 560px;
}

.pf-form fieldset {
  margin: 0;
  padding: 0;
  border: none;
}

.pf-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.pf-label {
  font-size: 14px;
  color: #555;
}

.pf-row input,
.pf-phone select,
.pf-phone input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background-color: #fff;
  box-sizing: border-box;
}

.pf-row input:focus,
.pf-phone select:focus,
.pf-phone input:focus {
  outline: none;
  border-color: #3f51b5;
}

.pf-form input:disabled,
.pf-form select:disabled {
  background-color: #f6f7f9;
  color: #555;
}

/* Khung chứa các ô (fieldset) không tô nền khi khoá, chỉ các ô nhập */
.pf-form fieldset:disabled {
  background: none;
}

.pf-radios {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 38px; /* Cao bằng các ô nhập bên dưới */
  font-size: 14px;
}

.pf-radios label {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  color: #333;
  cursor: pointer;
}

/* Nút chọn tròn: kích thước tự nhiên (không giãn 100% như ô nhập) */
.pf-row .pf-radios input[type="radio"] {
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  accent-color: #3f51b5;
  cursor: pointer;
}

.pf-form fieldset:disabled .pf-radios label,
.pf-form fieldset:disabled .pf-radios input[type="radio"] {
  cursor: default;
}

.pf-phone {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 8px;
}

.pf-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.pf-form-actions[hidden] {
  display: none;
}

.pf-danger {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid #f0f0f0;
}

.pf-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #444;
}

/* ----------------------- 05. ELS Coin và giao dịch ----------------------- */
.pf-balance {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding: 16px 20px;
  border-radius: 10px;
  background: linear-gradient(135deg, #fff8e1, #fff3cd);
}

.pf-balance strong {
  display: block;
  margin-top: 4px;
  font-size: 26px;
  color: #b28900;
}

.pf-table-wrap {
  overflow-x: auto;
}

.pf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.pf-table th,
.pf-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #f0f0f0;
  text-align: left;
  white-space: nowrap;
}

.pf-table th {
  color: #888;
  font-weight: 500;
  text-transform: uppercase;
  font-size: 12px;
}

.pf-amount-plus { color: #2e7d32; }
.pf-amount-minus { color: #d32f2f; }

.pf-empty {
  margin: 20px 0;
  font-size: 14px;
  color: #999;
  text-align: center;
}

/* ----------------------- 06. Nút ----------------------- */
.pf-primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  border: none;
  border-radius: 6px;
  background-color: #4a5cf0;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s;
}

.pf-primary-btn:hover {
  background-color: #3846d4;
}

.pf-primary-btn:disabled {
  background-color: #a9b1f5;
  cursor: wait;
}

.pf-secondary-btn {
  padding: 9px 18px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #fff;
  color: #333;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}

.pf-outline-btn {
  padding: 8px 14px;
  border: 1px solid #4a5cf0;
  border-radius: 6px;
  background-color: #fff;
  color: #4a5cf0;
  font-size: 13px;
  font-family: inherit;
  white-space: nowrap;
  cursor: pointer;
}

.pf-outline-btn:hover {
  background-color: #eef0fe;
}

.pf-danger-btn {
  padding: 8px 14px;
  border: 1px solid #e57373;
  border-radius: 6px;
  background-color: #fff;
  color: #d32f2f;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}

.pf-danger-btn:hover {
  background-color: #fdecea;
}

.pf-danger-btn.solid {
  background-color: #d32f2f;
  border-color: #d32f2f;
  color: #fff;
  font-size: 14px;
  padding: 9px 18px;
}

.pf-danger-btn.solid:disabled {
  background-color: #ef9a9a;
  border-color: #ef9a9a;
  cursor: not-allowed;
}

/* ----------------------- 07. Modal ----------------------- */
.pf-modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 16px 16px;
  background-color: rgba(0, 0, 0, 0.45);
  z-index: 20000; /* Trên header (z-index 10000) */
  overflow-y: auto;
}

.pf-modal-overlay.open {
  display: flex;
}

.pf-modal {
  position: relative;
  width: 100%;
  max-width: 480px;
  background-color: #fff;
  border-radius: 10px;
  padding: 22px 24px 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
}

.pf-modal h3 {
  margin: 0 0 14px;
  font-size: 19px;
}

.pf-modal p {
  margin: 0 0 16px;
  font-size: 14px;
  color: #555;
  line-height: 1.5;
}

.pf-modal .pf-row {
  grid-template-columns: 1fr;
  gap: 6px;
}

.pf-warning {
  color: #c62828 !important;
}

.pf-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  border: none;
  background: none;
  font-size: 22px;
  line-height: 1;
  color: #999;
  cursor: pointer;
}

/* ----------------------- 08. Thông báo nhanh (toast) ----------------------- */
.pf-toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 20001;
}

.pf-toast {
  min-width: 240px;
  max-width: 360px;
  padding: 12px 16px;
  border-radius: 6px;
  background-color: #323232;
  color: #fff;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.pf-toast.success { background-color: #2e7d32; }
.pf-toast.error   { background-color: #c62828; }

/* ----------------------- 09. Màn hình nhỏ ----------------------- */
@media (max-width: 1000px) {
  .pf-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .pf-card {
    padding: 16px;
  }

  .pf-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .pf-phone {
    grid-template-columns: 1fr;
  }

  .pf-balance {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ----------------------- Quên mật khẩu (mã gửi qua email) ----------------------- */
.pf-actions-split {
  justify-content: space-between;
  align-items: center;
}

.pf-link-btn {
  padding: 0;
  border: none;
  background: none;
  color: #3f51b5;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}

.pf-link-btn:hover {
  text-decoration: underline;
}

.pf-forgot {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #eee;
}

.pf-forgot[hidden] {
  display: none;
}

.pf-forgot h4 {
  margin: 0 0 6px;
  font-size: 15px;
  color: #222;
}

.pf-code {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.pf-code input:not(:placeholder-shown) {
  letter-spacing: 4px;
}

.pf-code .pf-outline-btn {
  white-space: nowrap;
}

/* Bot Telegram */
.pf-telegram {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #eee;
  text-align: left;
}

.pf-tg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}

.pf-tg-actions a,
.pf-tg-actions button {
  flex: 1 1 140px;
  text-align: center;
  text-decoration: none;
}
