/* =====================================================================
 * AIDV Academy - Global stylesheet
 * (Dùng kèm Tailwind CDN — file này chỉ định nghĩa biến + class tùy biến)
 * ===================================================================== */

:root {
  --bg-primary:     #0a0e1a;
  --bg-secondary:   #0f1628;
  --bg-card:        #131b2e;
  --accent-cyan:    #00d4ff;
  --accent-purple:  #7c3aed;
  --accent-gradient: linear-gradient(135deg, #7c3aed, #00d4ff);
  --text-primary:   #f0f4ff;
  --text-secondary: #8892b0;
  --border:         rgba(255,255,255,0.08);
  --radius:         12px;
  --header-height:  64px;
  --sidebar-width:  240px;
  /* Chiều cao topbar sticky (banner + header). Mặc định = header (case không
     banner). JS trong _header.php đo chiều cao thật rồi ghi đè (xử lý banner
     1-2 dòng). Dùng cho .sidebar top để không bị topbar che. */
  --topbar-height:  var(--header-height);
}

/* Light mode (toggle bằng JS: data-theme="light" ở thẻ html) */
html[data-theme="light"] {
  --bg-primary:     #f8fafc;
  --bg-secondary:   #f1f5f9;
  --bg-card:        #ffffff;
  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --border:         rgba(0,0,0,0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Sticky footer: main lấp đầy không gian giữa header và footer */
body { display: flex; flex-direction: column; }
main { flex: 1; }

a { color: var(--accent-cyan); text-decoration: none; }
a:hover { opacity: .88; }

code {
  background: rgba(0,0,0,.25);
  padding: 2px 8px;
  border-radius: 6px;
  color: var(--accent-cyan);
  font-size: .9em;
}
html[data-theme="light"] code { background: rgba(0,0,0,.05); }

/* === Layout container ============================================== */
.container-aidv {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* === Buttons ======================================================== */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .7rem 1.4rem;
  border-radius: 999px;
  background: var(--accent-gradient);
  color: #fff !important;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px -10px rgba(124, 58, 237, .55);
  opacity: 1;
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .65rem 1.3rem;
  border-radius: 999px;
  background: transparent;
  color: var(--text-primary) !important;
  border: 1px solid var(--border);
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.btn-secondary:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan) !important;
  box-shadow: 0 0 18px -2px rgba(0, 212, 255, .35);
  opacity: 1;
}

.btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .6rem 1.2rem;
  border-radius: 999px;
  background: rgba(239,68,68,.15);
  color: #fca5a5 !important;
  border: 1px solid rgba(239,68,68,.4);
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}
.btn-danger:hover { background: rgba(239,68,68,.25); opacity: 1; }

/* === Cards ========================================================== */
.card-dark {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

/* === Glass effect (header) ========================================= */
.glass {
  background: rgba(15, 22, 40, .65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
html[data-theme="light"] .glass { background: rgba(248, 250, 252, .8); }

/* === Gradient text ================================================ */
.text-gradient {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* === Header bar =================================================== */
.aidv-header {
  position: sticky;
  top: 0;
  z-index: 50;
}
.aidv-header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-height);
}

/* === Admin maintenance reminder bar (03/06/2026) ==================
   Thanh đỏ nhắc admin khi maintenance_mode='1' (admin hay quên tắt). Render
   TRONG .aidv-topbar-sticky (ghim chung header) — xem _header.php. Read-only:
   link "Tắt ngay" chỉ điều hướng GET. Responsive: text wrap, link không vỡ. */
.admin-maint-bar {
  background: #b91c1c;            /* đỏ danger, tương phản cao với chữ trắng */
  color: #fff;
  font-size: .85rem;
  line-height: 1.45;
  border-bottom: 1px solid rgba(0, 0, 0, .25);
}
.admin-maint-bar-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;               /* màn hẹp: text + link tự xuống dòng */
  gap: 4px 12px;
  padding-top: 8px;
  padding-bottom: 8px;
  text-align: center;
}
.admin-maint-bar .amb-ic   { flex-shrink: 0; font-weight: 700; }
.admin-maint-bar .amb-text { overflow-wrap: anywhere; }
.admin-maint-bar .amb-action {
  color: #fff;
  font-weight: 600;             /* action rõ ràng, không phải nút nặng */
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;          /* "Tắt ngay" luôn nguyên cụm, dễ chạm */
}
.admin-maint-bar .amb-action:hover { color: #fde68a; }

/* === Badges trạng thái =========================================== */
.badge-status {
  display: inline-block;
  padding: .25rem .7rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
  border: 1px solid;
}
.badge-status-pending,
.badge-status-pending_payment {
  background: rgba(245, 158, 11, .15); color: #fbbf24; border-color: rgba(245, 158, 11, .4);
}
.badge-status-waiting_admin_confirm,
.badge-status-waiting {
  background: rgba(0, 212, 255, .12); color: #67e8f9; border-color: rgba(0, 212, 255, .4);
}
.badge-status-active,
.badge-status-approved,
.badge-status-paid {
  background: rgba(52, 211, 153, .15); color: #34d399; border-color: rgba(52, 211, 153, .4);
}
.badge-status-rejected,
.badge-status-cancelled,
.badge-status-revoked,
.badge-status-failed,
.badge-status-blocked {
  background: rgba(239, 68, 68, .15); color: #fca5a5; border-color: rgba(239, 68, 68, .4);
}
.badge-status-inactive,
.badge-status-draft,
.badge-status-hidden,
.badge-status-archived,
.badge-status-unpaid,
.badge-status-expired {
  background: rgba(136, 146, 176, .15); color: #cbd5e1; border-color: rgba(136, 146, 176, .35);
}

/* === Flash messages ============================================== */
/* P5-POLISH-FLASH: max-width 800px + canh giữa container + text canh giữa,
   nút X dismiss vẫn ở góc phải (absolute) để user tắt thủ công nếu muốn.
   Mobile < 800px tự shrink full-width — không cần media query. */
.flash {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  max-width: 800px;
  margin: 0 auto 12px;
  border: 1px solid;
  font-size: .95rem;
  position: relative;
  text-align: center;
}
/* Cho phần message (span đầu tiên) co giãn + canh giữa nội dung */
.flash > span:first-child { flex: 1 1 auto; justify-content: center; }
.flash-success { background: rgba(52,211,153,.12); border-color: rgba(52,211,153,.4); color: #6ee7b7; }
.flash-error   { background: rgba(239,68,68,.12);  border-color: rgba(239,68,68,.4);  color: #fca5a5; }
.flash-warning { background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.4); color: #fcd34d; }
.flash-info    { background: rgba(0,212,255,.10);  border-color: rgba(0,212,255,.4);  color: #67e8f9; }
.flash button.close {
  background: none; border: none; color: inherit;
  cursor: pointer; font-size: 1.3rem; line-height: 1;
  padding: 4px 8px; opacity: .7;
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
}
.flash button.close:hover { opacity: 1; }

/* === Breadcrumb =================================================== */
.breadcrumb {
  display: flex; flex-wrap: wrap; gap: 6px;
  font-size: .85rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--accent-cyan); }
.breadcrumb .sep { opacity: .5; }
.breadcrumb .current { color: var(--text-primary); }

/* === Sidebar (admin + member) ==================================== */
.sidebar {
  position: fixed;
  /* Bắt đầu DƯỚI sticky topbar (banner + header) để .sidebar-head (avatar +
     tên + email) không bị topbar che. Giữ bottom:0 → chiều cao tự co theo
     viewport, không tràn. JS trong _header.php đo --topbar-height thật. */
  top: var(--topbar-height); left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 45;
  transition: transform .25s ease;
}
.sidebar-head {
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border);
}
.sidebar-nav {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
}
.sidebar-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--text-secondary) !important;
  font-weight: 500;
  margin-bottom: 4px;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
.sidebar-link:hover {
  background: var(--bg-card);
  color: var(--text-primary) !important;
  opacity: 1;
}
.sidebar-link.active {
  background: rgba(0, 212, 255, .10);
  color: var(--accent-cyan) !important;
  border: 1px solid rgba(0, 212, 255, .25);
}
.sidebar-link .ic { width: 22px; text-align: center; font-size: 1.05rem; }
.sidebar-foot {
  padding: 14px;
  border-top: 1px solid var(--border);
}

/* === Sidebar accordion (P5 G4 Phase B1 — 24/05/2026) =============== */
.sidebar-group {
  margin-bottom: 4px;
}
/* B3 Step 3 (25/05/2026) — Cách 4 UI polish: divider giữa các group
   (border-top trên group thứ 2 trở đi → ngăn cách "Bán Hàng" / "Nội Dung" / ...
   nhưng không vẽ line trên group đầu tiên). */
.sidebar-group + .sidebar-group {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.sidebar-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-weight: 700;          /* B3 Step 3: 600 → 700, đậm hơn */
  font-size: .72rem;         /* B3 Step 3: .82rem → .72rem, nhỏ hơn */
  letter-spacing: .6px;      /* B3 Step 3: .2px → .6px, dãn ra để dễ đọc khi UPPERCASE */
  text-transform: uppercase;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s ease, color .15s ease;
}
.sidebar-group-header:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}
.sidebar-group-header .sg-icon {
  font-size: 1rem;
  width: 22px;
  text-align: center;
  text-transform: none;
}
.sidebar-group-header .sg-label {
  flex: 1;
  text-align: left;
}
.sidebar-group-header .sg-chevron {
  transition: transform .25s ease;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.sidebar-group.collapsed .sg-chevron {
  transform: rotate(-90deg);
}

.sidebar-group-body {
  overflow: hidden;
  max-height: 800px;
  transition: max-height .25s ease;
  padding-left: 8px;
  margin-top: 2px;
}
.sidebar-group.collapsed .sidebar-group-body {
  max-height: 0;
}

/* Badge đỏ nằm cuối sidebar-link (đã có style inline trước đây) */
.sidebar-badge {
  margin-left: auto;
  background: #ef4444;
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* Wrapper cho trang có sidebar */
.has-sidebar {
  padding-left: var(--sidebar-width);
  min-height: 100vh;
}

/* Content area bên trong .has-sidebar */
.admin-content {
  width: 100%;
  max-width: 1600px;
  padding: 28px 40px;
}
.admin-content-form {
  width: 100%;
  max-width: 1100px;
  padding: 28px 40px;
}
@media (max-width: 1024px) {
  .admin-content,
  .admin-content-form { padding: 24px 24px; }
}
@media (max-width: 768px) {
  .admin-content,
  .admin-content-form { padding: 20px 14px; }
}

/* ── Shared admin table ── */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .86rem;
}
.admin-table th {
  padding: 12px 14px;
  text-align: left;
  color: var(--text-secondary);
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 1px solid var(--border-color, rgba(255,255,255,0.08));
}
.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color, rgba(255,255,255,0.05));
  vertical-align: middle;
}
/* Hover highlight */
.admin-table tbody tr:hover td {
  background: rgba(255,255,255,0.06);
  transition: background 0.12s ease;
}
/* Secondary text — muted columns (date, email, id) */
.admin-table td.col-muted {
  color: var(--text-secondary);
  font-size: .82rem;
}

/* Content area cho member area */
.member-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 16px;
}
@media (min-width: 768px) {
  .member-content { padding: 32px 24px; }
}
@media (min-width: 1024px) {
  .member-content { padding: 40px; }
}

.member-content-form {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px;
}
@media (min-width: 768px) {
  .member-content-form { padding: 32px 24px; }
}

/* Mobile topbar (chỉ hiện ở mobile, đi kèm sidebar) */
.mobile-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: none;
  align-items: center;
  padding: 0 14px;
  z-index: 30;
}
.mobile-topbar button {
  background: none; border: none; color: inherit;
  padding: 8px; cursor: pointer;
}

@media (max-width: 768px) {
  .sidebar {
    /* Mobile: sidebar là drawer trượt (không phải cột fixed) → KHÔNG áp dụng
       offset topbar. Giữ top:0 như cũ để không đổi hành vi drawer hiện tại. */
    top: 0;
    transform: translateX(-100%);
    box-shadow: 0 20px 40px -10px rgba(0,0,0,.5);
  }
  .sidebar.open { transform: translateX(0); }
  .has-sidebar { padding-left: 0; padding-top: 56px; }
  .mobile-topbar { display: flex; }
}

/* === Mobile drawer (public header) ============================= */
.mobile-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 300px; max-width: 90vw;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform .25s ease;
  z-index: 60;
  display: flex; flex-direction: column;
  padding: 20px;
  /* B3 fix-final 25/05/2026 — cho phép cuộn khi nội dung accordion vượt viewport
     (admin drawer: header + user info + 3 group ≈ 600px → overflow mobile <600px viewport).
     iOS momentum scroll: -webkit-overflow-scrolling:touch giúp lướt mượt trên Safari. */
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.mobile-drawer.open { transform: translateX(0); }
.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  z-index: 55;
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }

/* === Avatar ==================================================== */
.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-gradient);
  color: #fff;
  font-weight: 600;
  flex-shrink: 0;
  text-transform: uppercase;
}
.avatar-sm { width: 32px; height: 32px; font-size: .8rem; }
.avatar-header { width: 36px; height: 36px; font-size: .9rem; }

/* === Form input ================================================ */
.input, .textarea, .select {
  width: 100%;
  padding: .7rem .9rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: inherit;
  font-size: .95rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, .15);
}
.textarea { min-height: 100px; resize: vertical; }
.label {
  display: block;
  margin-bottom: .35rem;
  font-size: .9rem;
  font-weight: 500;
  color: var(--text-primary);
}
.help { font-size: .8rem; color: var(--text-secondary); margin-top: .25rem; }
.error-text { font-size: .8rem; color: #fca5a5; margin-top: .25rem; }

/* === Nav link (header desktop) ================================ */
.nav-link {
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.nav-link:hover { color: var(--accent-cyan); }
.nav-link.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
}

/* === User dropdown menu (header) ============================== */
.user-menu-wrap { position: relative; }
.user-menu {
  position: absolute;
  right: 0; top: calc(100% + 6px);
  width: 260px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 20px 40px -12px rgba(0,0,0,.6);
  z-index: 60;
}
.user-menu.hidden { display: none; }

.user-menu-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px;
}
.user-menu-id { min-width: 0; }
.user-menu-name {
  font-weight: 600; font-size: .9rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-menu-email {
  font-size: .75rem; color: var(--text-secondary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-menu-divider { height: 1px; background: var(--border); }
.user-menu-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 10px 14px;
  font: inherit; font-size: .875rem;
  color: var(--text-primary); text-decoration: none;
  background: none; border: none; cursor: pointer;
  transition: background .15s;
}
.user-menu-item:hover { background: var(--bg-secondary); }
.umi-ic { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }
.user-menu-logout { color: #fca5a5; }
.user-menu-logout:hover { background: rgba(239,68,68,.1); }

/* === Details / Summary (accordion) ============================ */
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }

.profile-accordion { padding: 0; }
.profile-accordion-summary {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 28px; cursor: pointer;
}
.accordion-chevron { transition: transform .2s ease; flex-shrink: 0; }
details[open] .accordion-chevron { transform: rotate(180deg); }
.profile-accordion-body { padding: 0 28px 24px; }

/* === Notifications (chuông thông báo) ========================= */
.notif-wrap { position: relative; }
.notif-bell {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  padding: 7px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease;
}
.notif-bell:hover { background: var(--bg-card); }
.notif-badge {
  position: absolute;
  top: 0; right: 0;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  background: #ef4444;
  color: #fff;
  font-size: .66rem;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  border-radius: 999px;
  border: 2px solid var(--bg-secondary);
}
.notif-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-height: 460px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 48px -16px rgba(0,0,0,.7);
  z-index: 60;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.notif-panel.hidden { display: none; }
.notif-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.notif-panel-title { font-weight: 700; font-size: .98rem; }
.notif-panel-actions { display: flex; align-items: center; gap: 4px; }
.notif-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 7px;
  border-radius: 8px;
  color: var(--text-secondary);
  line-height: 1;
}
.notif-icon-btn:hover { background: var(--bg-secondary); }
.notif-close-x { display: none; }            /* chỉ hiện ở mobile */
.notif-list {
  flex: 1;
  overflow-y: auto;
  min-height: 80px;
}
.notif-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-secondary);
  font-size: .88rem;
}
.notif-item {
  display: flex;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: background .12s ease;
}
.notif-item:hover { background: var(--bg-secondary); }
.notif-item.unread {
  background: rgba(0, 212, 255, .06);
  border-left-color: var(--accent-cyan);
}
.notif-item-icon { font-size: 1.15rem; flex-shrink: 0; line-height: 1.4; }
.notif-item-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notif-item-title { font-weight: 600; font-size: .88rem; }
.notif-item-msg {
  font-size: .8rem;
  color: var(--text-secondary);
  line-height: 1.45;
}
.notif-item-time { font-size: .72rem; color: var(--text-secondary); opacity: .8; }
.notif-panel-foot {
  border-top: 1px solid var(--border);
  padding: 8px;
  flex-shrink: 0;
}
.notif-markall {
  width: 100%;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--accent-cyan);
  font-weight: 600;
  font-size: .84rem;
  border-radius: 8px;
  font-family: inherit;
}
.notif-markall:hover { background: var(--bg-secondary); }

@media (max-width: 640px) {
  .notif-panel {
    position: fixed;
    top: 0; right: 0; left: 0; bottom: 0;
    width: 100%;
    max-height: none;
    border-radius: 0;
  }
  .notif-close-x { display: inline-block; }
}

/* === Utility ================================================== */
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.muted { color: var(--text-secondary); }
.text-sm  { font-size: .875rem; }
.text-xs  { font-size: .75rem; }

/* === FAB liên hệ — Premium always-visible stack ================ */
.fab-contact-v2 {
  position: fixed;
  bottom: 28px;
  right: 24px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.fab-btn {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
}
.fab-btn:hover { transform: scale(1.08); }

/* Tooltip — hiện bên trái nút (desktop) */
.fab-btn::before {
  content: attr(data-tooltip);
  position: absolute;
  right: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(10,14,26,.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #f0f4ff;
  font-size: 12.5px;
  font-weight: 500;
  padding: 6px 13px;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  border: 1px solid rgba(255,255,255,.1);
}
.fab-btn:hover::before { opacity: 1; }

/* Zalo — xanh dương */
.fab-zalo {
  background: linear-gradient(135deg, #0068FF 0%, #0099FF 100%);
  box-shadow: 0 6px 20px rgba(0,104,255,.45), inset 0 0 0 2px rgba(255,255,255,.15);
}
.fab-zalo:hover {
  box-shadow: 0 8px 28px rgba(0,104,255,.6), inset 0 0 0 2px rgba(255,255,255,.2);
}
.fab-zalo-text {
  color: #fff;
  font-weight: 900;
  font-size: 1.35rem;
  line-height: 1;
  letter-spacing: -0.5px;
}

/* Hotline — xanh lá + pulse ring */
.fab-call {
  background: linear-gradient(135deg, #00C853 0%, #00E676 100%);
  box-shadow: 0 6px 20px rgba(0,200,83,.45), inset 0 0 0 2px rgba(255,255,255,.15);
}
.fab-call:hover {
  box-shadow: 0 8px 28px rgba(0,200,83,.6), inset 0 0 0 2px rgba(255,255,255,.2);
}
.fab-call::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(0,230,118,.7);
  animation: fab-pulse 2s ease-out infinite;
  pointer-events: none;
}

@keyframes fab-pulse {
  0%   { transform: scale(1);    opacity: .7; }
  70%  { transform: scale(1.65); opacity: 0; }
  100% { transform: scale(1.65); opacity: 0; }
}

@media (max-width: 640px) {
  .fab-contact-v2 { bottom: 18px; right: 16px; gap: 12px; }
  .fab-btn { width: 52px; height: 52px; }
  .fab-btn::before { display: none; }
}

/* Print: ẩn FAB và chrome */
@media print {
  .aidv-header, .sidebar, .mobile-topbar, .mobile-drawer, footer { display: none !important; }
  .has-sidebar { padding-left: 0; padding-top: 0; }
  .fab-contact-v2 { display: none !important; }
}

/* =====================================================================
 * Nút "Vào học ngay" — premium (P3-5C)
 * Dùng chung: order-detail, courses, index, course-detail, member/courses
 * ===================================================================== */
.btn-enter-learn {
  width: 100%;
  min-height: 52px;
  background: linear-gradient(135deg, #34d399 0%, #00d4ff 100%);
  color: #ffffff;
  border: 0;
  border-radius: 9999px;
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0.2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(52, 211, 153, 0.35),
              0 2px 8px rgba(0, 212, 255, 0.2);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
}

.btn-enter-learn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  animation: shineSweep 2.8s ease-in-out infinite;
}

.btn-enter-learn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(52, 211, 153, 0.45),
              0 4px 12px rgba(0, 212, 255, 0.3);
}

.btn-enter-learn:active {
  transform: translateY(0);
}

.btn-enter-learn > * {
  position: relative;
  z-index: 2;
}

/* Biến thể nhỏ — dùng trong card khóa học (courses.php, index.php, member) */
.btn-enter-learn--sm {
  min-height: 44px;
  font-size: 14px;
}

@keyframes shineSweep {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

/* === P4-2C-fix1: Nút submit chờ CAPTCHA verify ====================== */
/* Nút disabled khi CAPTCHA chưa verify Success */
.btn-captcha-pending {
  opacity: 0.65;
  cursor: not-allowed;
  pointer-events: none; /* chặn click luôn */
}
/* Container text + spinner trong nút */
.btn-captcha-pending-content {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
/* Spinner xoay */
.btn-captcha-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: btnCaptchaSpinner 0.6s linear infinite;
  display: inline-block;
}
@keyframes btnCaptchaSpinner {
  to { transform: rotate(360deg); }
}

/* =====================================================================
 * Preview ảnh upload (P5-POLISH) — avatar + thumbnail
 * ===================================================================== */
.img-preview-frame {
  position: relative;
  display: inline-block;
  animation: imgPreviewFade 0.2s ease;
}
@keyframes imgPreviewFade {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}
.img-preview-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Khung avatar: vuông bo tròn, glow cyan nhẹ */
.img-preview-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.65),
              0 0 16px rgba(0, 212, 255, 0.35);
}
.img-preview-avatar .img-preview-img {
  border-radius: 50%;
}

/* Khung thumbnail: tỉ lệ 16:9, bo góc nhẹ */
.img-preview-wide {
  width: 280px;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(0, 212, 255, 0.55),
              0 0 16px rgba(0, 212, 255, 0.28);
}
.img-preview-wide .img-preview-img {
  border-radius: 10px;
}

/* Nút Hủy: tròn, icon X, nền đỏ semi-transparent */
.img-preview-cancel {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid var(--bg-primary);
  background: rgba(220, 38, 38, 0.85);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.img-preview-cancel:hover {
  background: rgba(220, 38, 38, 1);
  transform: scale(1.08);
}

/* Dòng thông tin file: tên · dung lượng · kích thước */
.img-preview-meta {
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  word-break: break-all;
}

/* Toast lỗi validate phía client */
.aidv-img-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: #dc2626;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 9999;
  max-width: 90vw;
  text-align: center;
}
.aidv-img-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* =====================================================================
 * Static content pages (gioi-thieu, dieu-khoan, chinh-sach-*, huong-dan)
 * Cột nội dung hẹp, dễ đọc — dùng chung cho 5 trang tĩnh public.
 * ===================================================================== */
.static-page-hero {
  max-width: 760px;
  margin: 0 auto 36px;
  text-align: center;
}
.static-page-hero h1 {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 700;
  margin: 0 0 14px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.static-page-hero p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.7;
  margin: 0;
}

.static-page-content {
  max-width: 760px;
  margin: 0 auto;
  color: var(--text-secondary);
  line-height: 1.75;
  font-size: 1rem;
}
.static-page-content > section + section {
  border-top: 1px solid var(--border);
  margin-top: 30px;
  padding-top: 6px;
}
.static-page-content h2 {
  color: var(--text-primary);
  font-size: 1.3rem;
  font-weight: 600;
  border-left: 3px solid var(--accent-cyan);
  padding-left: 12px;
  margin: 34px 0 16px;
}
.static-page-content > section:first-child h2 { margin-top: 0; }
.static-page-content p { margin: 0 0 16px; }
.static-page-content a { color: var(--accent-cyan); }
.static-page-content ul,
.static-page-content ol { margin: 0 0 16px; padding-left: 22px; }
.static-page-content li { margin-bottom: 8px; }
.static-page-content strong { color: var(--text-primary); }

/* Thanh "Cập nhật lần cuối" */
.static-meta-bar {
  max-width: 760px;
  margin: 0 auto 18px;
  font-size: .82rem;
  color: var(--text-secondary);
}

/* Banner cảnh báo (amber) — chính sách hoàn tiền */
.static-notice {
  max-width: 760px;
  margin: 0 auto 30px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.38);
  border-radius: var(--radius);
  padding: 14px 18px;
  color: var(--text-secondary);
  line-height: 1.65;
  font-size: .92rem;
}
.static-notice .static-notice-icon {
  font-size: 1.15rem;
  line-height: 1.4;
  flex-shrink: 0;
}

/* Step pills — hướng dẫn mua hàng (4 bước) */
.static-steps {
  max-width: 760px;
  margin: 0 auto 40px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.static-step {
  flex: 1 1 150px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.static-step-num {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.3);
}
.static-step-label {
  color: var(--text-primary);
  font-weight: 500;
  font-size: .95rem;
}

/* FAQ accordion (details/summary) — dark theme */
.static-faq {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  margin-bottom: 12px;
  overflow: hidden;
}
.static-faq summary {
  cursor: pointer;
  padding: 14px 18px;
  color: var(--text-primary);
  font-weight: 500;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.static-faq summary::-webkit-details-marker { display: none; }
.static-faq summary::after {
  content: "+";
  color: var(--accent-cyan);
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
}
.static-faq[open] summary::after { content: "\2212"; }
.static-faq .static-faq-body {
  padding: 0 18px 16px;
  color: var(--text-secondary);
  line-height: 1.7;
}
.static-faq .static-faq-body p { margin: 0; }

@media (max-width: 640px) {
  .static-steps { flex-direction: column; }
}
