/* Ads4u Dashboard Skin — Styles */
:root{
  --a-bd:rgba(15,23,42,.12);
  --a-text:#0f172a;
  --a-muted:#64748b;
}

/* แถบสรุปสถานะด้านบน */
.a-status{
  position:sticky; top:0; z-index:9;        /* คงอยู่ แต่ต่ำกว่าเมนู */
  margin:0 0 14px;
  border-radius:16px; padding:14px 16px;
  background:#fff;
  border:1px solid var(--a-bd);
  box-shadow:0 8px 20px rgba(2,6,23,.06);
  color:var(--a-text);
  overflow:hidden; /* สำหรับ ripple */
}
.a-row{display:flex;flex-wrap:wrap;gap:12px;align-items:center}
.a-badge{
  font-weight:800; font-size:13px;
  padding:6px 10px; border-radius:999px;
  background:var(--a-accent,#6366f1); color:#0b1020;
}
.a-label{font-size:13px; color:var(--a-muted)}
.a-value{font-weight:800; color:var(--a-text)}

/* Progress สู่เลเวลถัดไป */
.a-prog{display:grid; grid-template-columns:1fr auto; gap:10px; align-items:center; margin-top:8px}
.a-bar{width:100%; height:10px; border-radius:999px; background:rgba(2,6,23,.09); overflow:hidden}
.a-bar>span{display:block; height:100%; width:0; border-radius:999px;
  background:linear-gradient(90deg, var(--a-accent,#6366f1), #9ca3af)}

/* การ์ดระดับสมาชิก */
.a-card{position:relative; border-radius:18px; outline:1px solid var(--a-bd)}
.a-card.a-current{outline:2px solid var(--a-accent); box-shadow:0 10px 28px rgba(2,6,23,.12)}
.a-ribbon{
  position:absolute; top:12px; left:-8px;
  background:var(--a-accent); color:#0b1020;
  font-weight:900; padding:6px 12px; border-radius:10px
}

/* โน้ตเล็ก */
.a-note{font-size:12px; color:#475569}

/* --- ทำให้แถบสถานะดูคลิกได้ --- */
.a-status.clickable{
  cursor: pointer;
  transition: box-shadow .2s ease, transform .15s ease, border-color .2s ease;
}
.a-status.clickable:hover{
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(2,6,23,.12);
  border-color: color-mix(in oklab, var(--a-accent, #6366f1) 25%, var(--a-bd));
}

/* CTA pill ด้านขวา */
.a-cta{
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 800; font-size: 12px;
  padding: 6px 10px; border-radius: 999px;
  background: var(--a-accent,#6366f1); color: #0b1020;
  box-shadow: 0 4px 12px color-mix(in oklab, var(--a-accent,#6366f1), black 75%);
}
.a-cta .chev{ display:inline-block; transition: transform .2s ease; }
.a-status.clickable:hover .a-cta .chev{ transform: translateX(2px); }

/* จุด pulse เล็ก ๆ */
.a-cta .pulse{
  width:8px; height:8px; border-radius:999px; background:#0b1020;
  box-shadow: 0 0 0 0 rgba(11,16,32,.4);
  animation: a-pulse 2s infinite;
}
@keyframes a-pulse{
  0%{ box-shadow:0 0 0 0 rgba(11,16,32,.4) }
  70%{ box-shadow:0 0 0 12px rgba(11,16,32,0) }
  100%{ box-shadow:0 0 0 0 rgba(11,16,32,0) }
}

/* Ripple effect */
.a-status .ripple{
  position:absolute; border-radius:50%; transform:scale(0);
  background:rgba(0,0,0,.08); pointer-events:none; animation: a-rip .6s linear;
}
@keyframes a-rip{ to { transform:scale(4); opacity:0; } }

/* --- Mobile fix: อย่าให้แถบสถานะทับเมนู --- */
@media (max-width: 768px) {
  .a-status{
    position: static;     /* เลิก sticky บนมือถือ */
    top: auto;
    z-index: 1;           /* ต่ำกว่าชั้นเมนู */
    margin: 8px 0 12px;
    border-radius: 12px;
  }
  .a-row{ gap: 8px }
  .a-badge{ font-size:12px; padding:5px 8px }
  .a-label{ font-size:12px }
  .a-prog{ grid-template-columns: 1fr } /* แถวเดียว */
  .a-bar{ height: 8px }
}

/* --- ให้ dropdown อยู่บนสุดเสมอ --- */
.header .dropdown-menu,
.dropdown-menu,
.select2-container--open,
.choices__list--dropdown.is-active,
.flatpickr-calendar.open {
  z-index: 3000 !important;  /* สูงกว่า .a-status */
}

/* เมื่อมีเมนูเปิด: ถอยแถบสถานะไปพื้นหลัง (ยังมองเห็นอยู่) และไม่ขวางการคลิก */
.a-status.a-behind{
  z-index: 0 !important;
  pointer-events: none; /* ให้คลิกผ่านได้ */
}
