.ap-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

.ap-hero {
  padding: 36px 0 26px;
  background: #0b1b3a;
  color: #fff;
}

.ap-hero h1 {
  margin: 0;
  font-size: 34px;
  font-weight: 800;
}

.ap-hero p {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.82);
  max-width: 820px;
}

.ap-bc {
  margin-top: 10px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
}

.ap-bc a {
  color: #fff;
  text-decoration: none;
}

.ap-bc .sep {
  margin: 0 6px;
  opacity: 0.7;
}

.ap-body {
  padding: 22px 0 40px;
}

.ap-layout {
  display: flex;
  gap: 16px;
}

.ap-sidebar {
  width: 320px;
  flex: 0 0 320px;
}

.ap-main {
  flex: 1;
}

.ap-card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 14px;
}

.ap-card + .ap-card {
  margin-top: 12px;
}

.ap-card-title {
  font-weight: 800;
  margin-bottom: 10px;
  font-size: 14px;
}

.ap-cat-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ap-cat-list li a {
  display: block;
  padding: 9px 10px;
  border-radius: 10px;
  color: #111827;
  text-decoration: none;
  font-weight: 600;
}

.ap-cat-list li a:hover {
  background: #f3f4f6;
}

.ap-cat-list li.active a {
  background: #eef2ff;
  color: #1d4ed8;
}

.ap-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.ap-offer {
  display: block;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: #111827;
}

.ap-thumb {
  height: 140px;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ap-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.ap-name {
  padding: 10px 10px 12px;
  font-weight: 800;
  line-height: 1.25;
}

/* detail helpers (index/category vẫn dùng được) */
.ap-detail {
  display: flex;
  gap: 16px;
}

.ap-left {
  width: 340px;
  flex: 0 0 340px;
}

.ap-right {
  flex: 1;
}

.ap-offerimg {
  height: 180px;
  background: #f3f4f6;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ap-offerimg img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.ap-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.ap-fact {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
}

.ap-fact .k {
  font-size: 12px;
  color: #6b7280;
}

.ap-fact .v {
  font-size: 14px;
  font-weight: 800;
  margin-top: 2px;
}

.ap-section {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 14px;
  margin-top: 12px;
}

@media (max-width: 992px) {
  .ap-layout,
  .ap-detail {
    flex-direction: column;
  }

  .ap-sidebar,
  .ap-left {
    width: 100%;
    flex: auto;
  }

  .ap-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .ap-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Auth / Dashboard (Affiliate Programs Post) ===== */
.ap_auth_wrap {
  /* background: #E3ECF0; */
  padding-top: 100px !important;
  padding-bottom: 80px;
}

.ap_auth_container {
  /* width: min(1080px, 92%); */
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 26px;
  align-items: start;
}

.ap_auth_left {
  padding: 6px 2px;
}

.ap_auth_card {
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
}

.ap_auth_title {
  font-size: 34px;
  line-height: 1.15;
  margin: 0 0 10px;
  color: #0c4464;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.ap_auth_desc {
  color: #475569;
  font-size: 15px;
  line-height: 1.7;
  margin: 0 0 16px;
  font-weight: 600;
}

.ap_auth_signup {
  color: #0c4464;
  font-size: 16px;
  font-weight: 600;
  margin-top: 14px !important;
  margin-bottom: 0 !important;
}

.ap_auth_kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.ap_auth_kpi {
  border-radius: 16px;
  padding: 14px 14px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #ffffff;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
}

.ap_auth_kpi b {
  color: #0f172a;
  font-size: 16px;
}
.ap_auth_kpi span {
  display: block;
  margin-top: 6px;
  color: #64748b;
  font-weight: 700;
  font-size: 13px;
}

.ap_auth_tabs {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.ap_btn {
  appearance: none;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  color: #0f172a;
  padding: 10px 14px;
  border-radius: 14px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}
.ap_btn:hover {
  transform: translateY(-1px);
  border-color: rgba(26, 115, 232, 0.35);
  box-shadow: 0 10px 24px rgba(26, 115, 232, 0.12);
}
.ap_btn_primary {
  background: #1a73e8;
  color: #fff;
  border-color: rgba(26, 115, 232, 0.6);
}
.ap_btn_primary:hover {
  border-color: rgba(26, 115, 232, 0.8);
  box-shadow: 0 16px 34px rgba(26, 115, 232, 0.18);
}

.ap_form {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.ap_row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.ap_field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #0c4464;
  margin-bottom: 6px;
}

.ap_input {
  width: 100%;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  padding: 0 12px;
  font-size: 14px;
  outline: none;
}
.ap_input:focus {
  border-color: rgba(26, 115, 232, 0.55);
  box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.12);
}

.ap_input::placeholder {
  color: #8a8a8a !important;
}

.ap_help {
  margin-top: 6px;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
}

.ap_alert {
  border-radius: 14px;
  padding: 10px 12px;
  font-weight: 600;
  font-size: 13px;
  border: 1px solid rgba(15, 23, 42, 0.1);
}
.ap_alert_ok {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.35);
  color: #065f46;
}
.ap_alert_err {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.35);
  color: #7f1d1d;
}

.ap_muted_link {
  color: #1a73e8;
  font-weight: 800;
  text-decoration: none;
}
.ap_muted_link:hover {
  text-decoration: underline;
}

.ap_dash_kv {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.ap_kv {
  display: flex;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
}
.ap_kv b {
  color: #0f172a;
}
.ap_code {
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  background: #0b1220;
  color: #e5e7eb;
  padding: 10px 12px;
  border-radius: 12px;
  overflow: auto;
  border: 1px solid rgba(15, 23, 42, 0.2);
}

/* responsive */
@media (max-width: 920px) {
  .ap_auth_container {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 520px) {
  .ap_row2 {
    grid-template-columns: 1fr;
  }
  .ap_auth_kpis {
    grid-template-columns: 1fr;
  }
}

/* ===== Auth KPIs (match .ap_stats/.ap_stat style) ===== */
.ap_auth_kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 14px 0 16px;
}

.ap_auth_kpi {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;

  border-radius: 16px;
  padding: 14px;

  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #ffffff;

  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

/* subtle glow ribbon like stats */
.ap_auth_kpi:before {
  content: "";
  position: absolute;
  inset: -40px -60px auto auto;
  width: 160px;
  height: 160px;
  border-radius: 999px;
  filter: blur(2px);
  opacity: 0.55;
  transform: rotate(18deg);
}

/* per-card glow */
.ap_auth_kpi_key:before {
  background: radial-gradient(
    circle at 30% 30%,
    rgba(26, 115, 232, 0.55),
    rgba(26, 115, 232, 0) 60%
  );
}
.ap_auth_kpi_view:before {
  background: radial-gradient(
    circle at 30% 30%,
    rgba(16, 185, 129, 0.5),
    rgba(16, 185, 129, 0) 60%
  );
}

/* icon pill (same vibe as stat icon) */
.ap_auth_icon {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 12px;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(248, 250, 252, 0.95);
  color: #0f172a;
}

.ap_auth_icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

/* text */
.ap_auth_body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.ap_auth_body b {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}

.ap_auth_body span {
  font-size: 12.5px;
  color: #64748b;
  line-height: 1.3;
}

/* small hover */
.ap_auth_kpi {
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease;
}
.ap_auth_kpi:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 23, 42, 0.16);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.1);
}

/* responsive: stack on small screens */
@media (max-width: 520px) {
  .ap_auth_kpis {
    grid-template-columns: 1fr;
  }
}

.ap_img_wrap_signup img {
  width: 100%;
  height: 500px; /* key: limit height */
  object-fit: cover; /* cover nicely */
  display: block;
  border-radius: 30px;
}

.ap_field_error {
  margin-top: 6px;
  font-size: 12px;
  /* font-weight:700; */
  color: #dc2626;
}

/* ===== AP profile in header ===== */
.ap-profile {
  position: relative;
}
.ap-profileBtn {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  border-radius: 999px;
  padding: 6px 10px 6px 6px;
  cursor: pointer;
}
.ap-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(
    180deg,
    rgba(26, 115, 232, 0.14),
    rgba(26, 115, 232, 0.06)
  );
  border: 1px solid rgba(26, 115, 232, 0.25);
  color: #0c4464;
  font-weight: 900;
  font-size: 12px;
}
.ap-caret {
  color: #64748b;
  font-weight: 900;
}

.ap-profileMenu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 180px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.12);
  padding: 8px;
  display: none;
  z-index: 9999;
}
.ap-profileMenu a {
  display: block;
  padding: 10px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: #0f172a;
}
.ap-profileMenu a:hover {
  background: rgba(26, 115, 232, 0.08);
  color: #0c4464;
}
.ap-profile.is-open .ap-profileMenu {
  display: block;
}

/* mobile side profile */
.side-profile {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
  margin-bottom: 10px;
}
.side-avatar {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #e3ecf0;
  border: 1px solid rgba(15, 23, 42, 0.12);
  font-weight: 900;
  color: #0c4464;
  margin-bottom: 10px;
}
.side-actions a {
  display: block;
  padding: 8px 0;
  font-weight: 800;
}

.ap-pagi {
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.ap-pagi__meta {
  margin-right: auto;
  font-size: 13px;
  color: #6b7280;
}

.ap-pagi__btn,
.ap-pagi__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  min-width: 34px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fff;
  color: #0c4464;
  text-decoration: none;
  font-weight: 600;
  user-select: none;
}

.ap-pagi__btn:hover,
.ap-pagi__num:hover {
  background: #f3f4f6;
}

.ap-pagi__num.is-active {
  background: #0c4464;
  color: #fff;
}

.ap-pagi__btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: #fff;
}

.ap-pagi__dots {
  color: #9ca3af;
  padding: 0 4px;
  font-weight: 600;
}
