/* ===== User profile slide-in drawer ===== */
.user-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 9999;
}
.user-drawer-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.user-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 86%;
  max-width: 360px;
  background: #0e0f12;
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.user-drawer.is-open { transform: translateX(0); }

.user-drawer__header {
  background: linear-gradient(135deg, #282c38 0%, #1c1f27 100%);
  padding: 56px 18px 22px;
  border-bottom: 1px solid #1f2128;
}
.user-drawer__back {
  position: absolute;
  top: 14px;
  left: 14px;
  font-size: 22px;
  color: #fff;
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
}
.user-drawer__user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: #fff;
}
.user-drawer__user .icon {
  font-family: "uniicons";
  font-size: 24px;
  color: #ceb359;
}
.user-drawer__uid {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-top: 12px;
}
.user-drawer__copy {
  cursor: pointer;
  color: #9fa6b5;
  background: none;
  border: none;
  font-size: 16px;
  padding: 0 4px;
}
.user-drawer__copy:hover { color: #ceb359; }

.user-drawer__kyc {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 14px -18px 0;
  padding: 12px 18px;
  background: #1c1f27;
  font-size: 14px;
  color: #ceb359;
}
.user-drawer__kyc-icon {
  font-family: "uniicons";
  margin-right: 6px;
}
.user-drawer__kyc-action {
  font-size: 12px;
  background: #ceb359;
  color: #0e0f12;
  border: none;
  border-radius: 999px;
  padding: 4px 12px;
  font-weight: 600;
  cursor: pointer;
}
.user-drawer__kyc-action.is-verified {
  background: #1f7647;
  color: #fff;
  cursor: default;
}

.user-drawer__menu {
  flex: 1;
  padding: 8px 0 18px;
}
.user-drawer__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  font-size: 15px;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  background: transparent;
  border-left: none; border-right: none; border-top: none;
  text-align: left;
  width: 100%;
}
.user-drawer__item:hover { background: #14171f; }
.user-drawer__item .label {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-drawer__item .label-icon {
  font-family: "uniicons";
  color: #ceb359;
  font-size: 18px;
  width: 22px;
  text-align: center;
}
.user-drawer__item .arrow {
  color: #6e7686;
  font-size: 18px;
}

.user-drawer__logout {
  margin: 16px 18px 24px;
  padding: 12px;
  background: #1c1f27;
  color: #ce5b67;
  border: 1px solid #2d3140;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  width: calc(100% - 36px);
}
.user-drawer__logout:hover { background: #ce5b67; color: #fff; }

.user-drawer__login-cta {
  margin: 16px 18px;
  padding: 14px;
  background: #ce5b67;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: block;
}

/* ===== Generic in-drawer panel (history lists, etc.) ===== */
.drawer-panel {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 86%;
  max-width: 360px;
  background: #0e0f12;
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10001;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.drawer-panel.is-open { transform: translateX(0); }
.drawer-panel__header {
  padding: 14px 14px 12px;
  background: #1c1f27;
  display: flex;
  align-items: center;
  gap: 12px;
}
.drawer-panel__back {
  background: none;
  border: none;
  font-size: 22px;
  color: #fff;
  cursor: pointer;
  padding: 0;
}
.drawer-panel__title {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}
.drawer-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
}
.drawer-panel__row {
  background: #14171f;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  font-size: 13px;
  color: #d1d4dc;
}
.drawer-panel__row .top {
  display: flex; justify-content: space-between;
  margin-bottom: 6px;
}
.drawer-panel__row .top span:first-child { color: #fff; font-weight: 600; }
.drawer-panel__row .meta {
  color: #9fa6b5;
  font-size: 12px;
}
.drawer-panel__row .status {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
}
.drawer-panel__row .status--pending { background: rgba(206, 179, 89, 0.18); color: #ceb359; }
.drawer-panel__row .status--approved,
.drawer-panel__row .status--completed { background: rgba(31,118,71,0.18); color: #1fc480; }
.drawer-panel__row .status--rejected { background: rgba(206, 91, 103, 0.18); color: #ff6c7d; }

.drawer-panel__empty {
  text-align: center;
  color: #6e7686;
  padding: 40px 0;
  font-size: 13px;
}

/* ----- Tab bar inside a sub-panel ----- */
.drawer-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin: 0 -14px 12px;
  padding: 0 14px;
}
.drawer-tab {
  flex: 1;
  background: none;
  border: none;
  color: #9fa6b5;
  font-size: 14px;
  padding: 12px 0;
  cursor: pointer;
  position: relative;
}
.drawer-tab.is-active { color: #ceb359; }
.drawer-tab.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  width: 24px;
  height: 2px;
  background: #ceb359;
  border-radius: 1px;
}

/* ----- Pill toggle (公告 / 消息) ----- */
.drawer-pills {
  display: inline-flex;
  background: #2d3140;
  border-radius: 999px;
  padding: 3px;
  margin: 8px auto 14px;
}
.drawer-pills__wrap { text-align: center; }
.drawer-pill {
  background: none;
  border: none;
  color: #9fa6b5;
  padding: 6px 22px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
}
.drawer-pill.is-active {
  background: #ceb359;
  color: #131722;
  font-weight: 600;
}

/* ----- Form rows inside a panel ----- */
.drawer-form {
  background: #0e0f12;
}
.drawer-form__row {
  padding: 12px 14px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.drawer-form__label {
  font-size: 13px;
  color: #fff;
  margin-bottom: 4px;
}
.drawer-form__input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #d1d4dc;
  font-size: 14px;
  padding: 4px 0;
}
.drawer-form__input::placeholder { color: #6e7686; }
.drawer-form__hint {
  padding: 14px;
  color: #9fa6b5;
  font-size: 13px;
}

.drawer-panel__action {
  position: sticky;
  bottom: 0;
  width: 100%;
  padding: 12px 14px;
  background: #0e0f12;
  border-top: 1px solid rgba(255,255,255,0.04);
}
.drawer-panel__action button {
  width: 100%;
  padding: 12px;
  background: #ce5b67;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.drawer-panel__action button:disabled { opacity: 0.5; cursor: not-allowed; }

/* ----- Loan panel ----- */
.loan-card {
  background: #1c1f27;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
}
.loan-card__label { font-size: 12px; color: #9fa6b5; margin-bottom: 8px; }
.loan-card__value { font-size: 24px; color: #fff; font-weight: 700; }
.loan-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.loan-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.loan-btn {
  padding: 12px 0;
  background: transparent;
  color: #1fc480;
  border: 1px solid #1fc480;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}
.loan-btn.is-primary { background: #1fc480; color: #131722; font-weight: 600; }
.loan-apply {
  width: 100%;
  padding: 12px;
  background: transparent;
  color: #1fc480;
  border: 1px solid #1fc480;
  border-radius: 6px;
  margin-bottom: 10px;
  cursor: pointer;
  font-size: 14px;
}

/* ----- Settings rows ----- */
.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 14px;
  font-size: 14px;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  cursor: pointer;
  background: transparent;
  border-left: none; border-right: none; border-top: none;
  width: 100%;
  text-align: left;
}
.settings-row .value {
  color: #9fa6b5;
  display: flex;
  align-items: center;
  gap: 6px;
}
.settings-row .avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #ceb359;
  color: #131722;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

/* ----- Announcement / message rows ----- */
.notice-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px;
  background: #14171f;
  border-radius: 8px;
  margin-bottom: 10px;
  cursor: pointer;
}
.notice-row__title { font-size: 14px; color: #fff; }
.notice-row__time { font-size: 12px; color: #6e7686; margin-top: 4px; }
.notice-row__arrow { color: #6e7686; }

/* ----- KYC list rows ----- */
.kyc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  background: #14171f;
  border-radius: 10px;
  margin-bottom: 10px;
  font-size: 14px;
  color: #fff;
  border: none;
  width: 100%;
  cursor: pointer;
  text-align: left;
}
.kyc-row__status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: #9fa6b5;
}
.kyc-row__status::before {
  content: "ⓘ";
  font-size: 14px;
}
.kyc-row__status--pending  { color: #ceb359; }
.kyc-row__status--pending::before { color: #ceb359; }
.kyc-row__status--verified { color: #1fc480; }
.kyc-row__status--verified::before { color: #1fc480; }
.kyc-row__status--rejected { color: #ff6c7d; }
.kyc-row__status--rejected::before { color: #ff6c7d; }

/* ----- KYC photo uploaders ----- */
.kyc-upload-section { padding: 14px; }
.kyc-upload-section__title {
  color: #fff;
  font-size: 14px;
  margin-bottom: 10px;
}
.kyc-upload {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.kyc-upload__preview {
  flex: 0 0 110px;
  height: 80px;
  background: #1c1f27;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #4a5060;
  font-size: 40px;
}
.kyc-upload__preview img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.kyc-upload__btn {
  flex: 0 0 110px;
  height: 80px;
  background: #14171f;
  border: 1px solid #2d3140;
  border-radius: 8px;
  color: #6e7686;
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.kyc-upload__file { display: none; }
