/* =====================================================================
 * AIDV.vn - 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:     #0b1120;
  --bg-secondary:   #131c33;
  --bg-card:        #16203c;
  --bg-band-top:    #0E1626;   /* top hero band (Courses + Instructors) — dark */
  --accent-cyan:    #38bdf8;
  --accent-purple:  #1e3a8a;
  --accent-gold:        #fbbf24;
  --accent-gold-strong: #f59e0b;
  --accent-gradient: linear-gradient(135deg, #1e3a8a, #0891b2);
  --teal:           #0B8DAA;
  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --border:         rgba(255,255,255,0.07);
  --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);
  /* Badge "Phổ biến nhất" (featured) — tone xanh, nhường màu vàng kim (--accent-gold) cho giá */
  --featured-badge-bg:     #1e3a5f;
  --featured-badge-border: rgba(147,197,253,0.45);
  --featured-badge-text:   #93c5fd;
}

/* Light mode (toggle bằng JS: data-theme="light" ở thẻ html) */
html[data-theme="light"] {
  /* ── BACKGROUNDS ── */
  --bg-primary:    #F8FBFE;   /* hero, main canvas */
  --bg-secondary:  #F1F5F9;   /* neutral sections: partners, trust, feedback */
  --bg-card:       #FFFFFF;   /* cards */
  --bg-brand:      #EDF4F8;   /* courses section */
  --bg-band-top:   #E9F1FB;   /* top hero band (Courses + Instructors) — light */

  /* ── TEXT ── */
  --text-primary:   #0F172A;
  --text-secondary: #475569;
  --text-muted:     #64748B;
  --text-faint:     #94A3B8;

  /* ── BRAND COLORS ── */
  --blue:           #2457C5;
  --blue-hover:     #1E4FB4;
  --blue-light:     #2D67DD;
  --teal:           #0B8DAA;
  --teal-dark:      #08758D;

  /* ── ACCENT / SEMANTIC ── */
  --accent-cyan:        #2457C5;   /* repoint cyan → blue for light readability */
  --accent-gradient:    linear-gradient(135deg, #2457C5 0%, #0B8DAA 100%);
  --accent-gradient-hover: linear-gradient(135deg, #2D67DD 0%, #10A6C5 100%);
  --accent-gold:        #B7791F;
  --accent-gold-strong: #92620F;
  --gold-star:          #E4B84C;
  --gold-bg:            #FFF7E6;

  /* ── BORDER / SHADOW ── */
  --border:         #DCE5EF;
  --border-dark:    #C8D5E3;
  --shadow-sm:      0 8px 22px rgba(15,23,42,.045);
  --shadow-card:    0 16px 42px rgba(15,23,42,.075);

  /* ── FEATURED BADGE ── */
  --featured-badge-bg:     #E8F1FC;
  --featured-badge-border: rgba(36,87,197,0.25);
  --featured-badge-text:   #1E4FB4;

  /* ── DARK SECTION (navy block mid-page) ── */
  --bg-dark:        #0F1B2D;
  --bg-dark-card:   #13233A;
  --text-dark-1:    #F8FAFC;
  --text-dark-2:    #B8C5D8;
}

* { 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); }

/* ══════════════════════════════════════════════
   LIGHT MODE — component overrides
   ══════════════════════════════════════════════ */

/* Header */
html[data-theme="light"] .glass {
  background: rgba(255,255,255,.9);
  border-bottom-color: #DCE5EF;
}
html[data-theme="light"] header .glass {
  backdrop-filter: blur(18px);
}

/* Nav links */
html[data-theme="light"] .nav-link {
  color: #475569;
}
html[data-theme="light"] .nav-link:hover,
html[data-theme="light"] .nav-link.active {
  color: #2457C5;
}

/* Eyebrow badge */
html[data-theme="light"] .eyebrow-badge {
  background: rgba(36,87,197,.07);
  border: 1px solid rgba(36,87,197,.16);
  color: #2457C5;
}

/* Section backgrounds */
html[data-theme="light"] .s-neutral,
html[data-theme="light"] .s-trust,
html[data-theme="light"] .s-feedback,
html[data-theme="light"] .s-partners {
  background: #F1F5F9;
}
html[data-theme="light"] .s-courses,
html[data-theme="light"] .s-brand {
  background: #EDF4F8;
}
html[data-theme="light"] .s-white,
html[data-theme="light"] .s-why,
html[data-theme="light"] .s-instructor,
html[data-theme="light"] .s-faq {
  background: #FFFFFF;
}

/* Course card */
html[data-theme="light"] .course-card,
html[data-theme="light"] .card {
  background: #FFFFFF;
  border-color: #DCE5EF;
  box-shadow: 0 8px 22px rgba(15,23,42,.045);
}
html[data-theme="light"] .course-card:hover,
html[data-theme="light"] .card:hover {
  box-shadow: 0 16px 42px rgba(15,23,42,.075);
  border-color: #C8D5E3;
}

/* Price */
html[data-theme="light"] .price-current,
html[data-theme="light"] .price-new {
  color: #B7791F;
}
html[data-theme="light"] .price-old {
  color: #94A3B8;
}

/* Skill pill / tag */
html[data-theme="light"] .skill-pill,
html[data-theme="light"] .tag-pill {
  background: rgba(36,87,197,.06);
  border-color: rgba(36,87,197,.18);
  color: #2457C5;
}

/* FAQ accordion */
html[data-theme="light"] .faq-item {
  border-bottom-color: #DCE5EF;
}
html[data-theme="light"] .faq-item.open {
  background: #F8FBFE;
}

/* Footer */
html[data-theme="light"] footer,
html[data-theme="light"] .footer {
  background: #080F1C;  /* footer stays dark always */
}

/* Buttons — ghost variant */
html[data-theme="light"] .btn-ghost,
html[data-theme="light"] .btn-secondary {
  background: #FFFFFF;
  border-color: #DCE5EF;
  color: #0F172A;
}
html[data-theme="light"] .btn-ghost:hover,
html[data-theme="light"] .btn-secondary:hover {
  border-color: #2457C5;
  background: rgba(36,87,197,.04);
}

/* Partner logos: in dark they need brightness boost, in light normal */
html[data-theme="light"] .partner-logo {
  filter: grayscale(100%);
  opacity: 0.55;
}
html[data-theme="light"] .partner-logo:hover {
  opacity: 1;
  filter: grayscale(0%);
}

/* Instructor title */
html[data-theme="light"] .instructor-title {
  color: #0B8DAA;
}

/* Quote block border */
html[data-theme="light"] .quote-block,
html[data-theme="light"] blockquote {
  border-left-color: #0B8DAA;
}

/* FAB phone button — keep gradient */
html[data-theme="light"] .fab-phone {
  background: linear-gradient(135deg, #2457C5 0%, #0B8DAA 100%);
}

/* Input / form fields */
html[data-theme="light"] input,
html[data-theme="light"] textarea,
html[data-theme="light"] select {
  background: #FFFFFF;
  border-color: #DCE5EF;
  color: #0F172A;
}
html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder {
  color: #94A3B8;
}
html[data-theme="light"] input:focus,
html[data-theme="light"] textarea:focus,
html[data-theme="light"] select:focus {
  border-color: #2457C5;
  outline: none;
  box-shadow: 0 0 0 3px rgba(36,87,197,.12);
}

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

/* === Homepage hero textured background ============================= */
.hero-section {
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
}
/* Dark (default): two soft glow blobs in blue palette */
.hero-section::before {
  content: "";
  position: absolute;
  width: 720px; height: 720px;
  top: -200px; right: -160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(30,58,138,.40) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.hero-section::after {
  content: "";
  position: absolute;
  width: 560px; height: 560px;
  bottom: -160px; left: -140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56,189,248,.22) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
/* Light theme: lighter blobs + faint dot grid for texture (no blank white) */
html[data-theme="light"] .hero-section {
  background: #F8FBFE;
}
html[data-theme="light"] .hero-section::before {
  background:
    radial-gradient(ellipse 55% 65% at 15% 60%, rgba(36,87,197,.09) 0%, transparent 70%),
    radial-gradient(ellipse 50% 60% at 85% 40%, rgba(11,141,170,.08) 0%, transparent 70%);
  background-image: none;
  background-size: auto;
  width: 100%; height: 100%;
  top: 0; right: 0; left: 0; bottom: 0;
  border-radius: 0;
}
html[data-theme="light"] .hero-section::after { display: none; }

/* === 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(30, 58, 138, .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(56, 189, 248, .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;
}

/* Badge "Phổ biến nhất" (featured) trên thumbnail card — tone xanh để nhường màu vàng kim cho giá.
   Vị trí left/right set inline trong _course-card.php vì phụ thuộc trạng thái coming_soon. */
.card-featured-badge {
  position: absolute;
  top: 8px;
  z-index: 3;
  background: var(--featured-badge-bg);
  border: 1px solid var(--featured-badge-border);
  color: var(--featured-badge-text);
  font-size: 0.7rem;
  font-weight: 650;
  padding: 2px 8px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

/* === 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(56, 189, 248, .14); color: #7dd3fc; border-color: rgba(56, 189, 248, .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);
}
/* Sắp ra mắt — accent navy (brand) để đọc như "upcoming", phân biệt với grey */
.badge-status-coming_soon {
  background: rgba(30, 58, 138, .22); color: #93c5fd; border-color: rgba(30, 58, 138, .5);
}

/* ===== Coming soon — premium card + teaser (presentation only, CSS-only) ===== */
/* Card thumbnail "frosted / mystery": blur + scale (overflow:hidden on the <a> clips edges) */
.cs-thumb-img { filter: blur(6px) brightness(.75); transform: scale(1.1); }
.cs-thumb-tint { position: absolute; inset: 0; background: rgba(30, 58, 138, .30); pointer-events: none; }
.cs-thumb-lock {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; opacity: .80; pointer-events: none;
}
/* "Sắp ra mắt" gradient pill — shared by card (absolute) + teaser hero (.cs-badge--lg, static) */
.cs-badge {
  position: absolute; top: 10px; left: 10px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  background: linear-gradient(135deg, #1e3a8a, #38bdf8);
  color: #0a0e1a; font-size: .8rem; font-weight: 800; letter-spacing: .02em;
  box-shadow: 0 2px 10px rgba(30, 58, 138, .45);
  animation: cs-badge-glow 3.2s ease-in-out infinite alternate;
}
.cs-badge svg { flex-shrink: 0; }
.cs-badge--lg { position: static; padding: 7px 16px; font-size: .9rem; margin-bottom: 6px; }
@keyframes cs-badge-glow {
  from { box-shadow: 0 2px 8px rgba(30, 58, 138, .35); }
  to   { box-shadow: 0 2px 16px rgba(56, 189, 248, .55); }
}
@media (prefers-reduced-motion: reduce) { .cs-badge { animation: none; } }
/* Card meta pill (replaces price/rating slot) */
.cs-meta-pill {
  display: inline-flex; align-items: center; gap: 7px; align-self: flex-start;
  padding: 6px 12px; border-radius: 999px;
  font-size: .78rem; font-weight: 600;
  color: #38bdf8; background: rgba(56, 189, 248, .08); border: 1px solid rgba(56, 189, 248, .2);
}
.cs-meta-pill svg { flex-shrink: 0; }
/* Card bottom CTA — ghost gradient, pinned to bottom so card height matches normal cards */
.cs-cta {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: auto; min-height: 46px; padding: .6rem 1rem;
  border-radius: 10px; font-size: .9rem; font-weight: 700; text-decoration: none;
  color: #93c5fd; border: 1px solid #1e3a8a;
  background: linear-gradient(135deg, rgba(30, 58, 138, .14), rgba(56, 189, 248, .10));
  transition: background .18s ease, box-shadow .18s ease;
}
.cs-cta:hover {
  background: linear-gradient(135deg, rgba(30, 58, 138, .24), rgba(56, 189, 248, .18));
  box-shadow: 0 6px 20px -6px rgba(30, 58, 138, .5);
}
/* Teaser hero (trailer-style) */
.cs-hero {
  position: relative; width: 100%; min-height: 420px;
  border-radius: 18px; overflow: hidden; margin-top: 8px;
  display: flex; align-items: flex-end; justify-content: center;
  background: linear-gradient(135deg, #1e3a8a, #38bdf8);
  background-size: cover; background-position: center;
}
.cs-hero-overlay {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(60% 60% at 50% 28%, rgba(30, 58, 138, .40), transparent 70%),
    linear-gradient(180deg, rgba(10, 14, 26, .45) 0%, rgba(10, 14, 26, .68) 55%, #0a0e1a 100%);
}
.cs-hero-content { position: relative; z-index: 1; text-align: center; padding: 0 24px 42px; max-width: 560px; }
.cs-hero-topic { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #7dd3fc; margin-bottom: 4px; }
.cs-hero-title { margin: .35rem 0 .75rem; font-size: clamp(1.6rem, 4vw, 2.6rem); font-weight: 800; line-height: 1.2; color: #fff; }
.cs-hero-desc { margin: 0 auto; max-width: 440px; color: #cbd5e1; font-size: 1rem; line-height: 1.65; }
/* Teaser primary Zalo CTA */
.cs-zalo-cta {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 32px; border-radius: 12px;
  font-size: 1.05rem; font-weight: 700; color: #fff; text-decoration: none;
  background: linear-gradient(135deg, #1e3a8a, #38bdf8);
  box-shadow: 0 10px 30px -8px rgba(30, 58, 138, .6);
  transition: transform .15s ease, box-shadow .15s ease;
}
.cs-zalo-cta:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -10px rgba(56, 189, 248, .6); }
.cs-zalo-cta svg { flex-shrink: 0; }
@media (max-width: 640px) {
  .cs-hero { min-height: 340px; }
  .cs-hero-content { padding-bottom: 30px; }
}

/* === 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(56,189,248,.10);  border-color: rgba(56,189,248,.4);  color: #7dd3fc; }
.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); }

/* --- Tên dài: cắt bằng "…" thay vì xuống dòng (25/08/2026) ---
   Tên bài học có thể dài 70+ ký tự; đường dẫn 4 bậc không cắt sẽ xuống 3 dòng.
   Rê chuột vào đọc được đủ (thuộc tính title do _breadcrumb.php gắn).
   Bậc cuối (đang đứng ở đây) được rộng hơn các bậc giữa. */
.breadcrumb a,
.breadcrumb .current {
  max-width: 24ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.breadcrumb .current { max-width: 40ch; }

/* --- Điện thoại: chỉ giữ 2 bậc cuối --- */
.breadcrumb .bc-ellipsis { display: none; }
@media (max-width: 600px) {
  .breadcrumb .bc-mid { display: none; }
  .breadcrumb .bc-ellipsis { display: inline; }
  .breadcrumb a, .breadcrumb .current { max-width: 18ch; }
  .breadcrumb .current { max-width: 24ch; }
}

/* === 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(56, 189, 248, .10);
  color: var(--accent-cyan) !important;
  border: 1px solid rgba(56, 189, 248, .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; }
}

/* Content area cho courses.php (không cần max-width/scale theo breakpoint
   như .member-content — chỉ padding cố định, xem mobile override bên dưới) */
.member-content-courses {
  padding: 28px 32px;
}

/* 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; }
  /* Giảm ~45% padding-top trang member trên mobile — bớt khoảng trắng dư
     giữa topbar sticky và tiêu đề trang (UI fix 16/06/2026) */
  .member-content,
  .member-content-form { padding-top: 13px; }
  .member-content-courses { padding-top: 15px; }
  .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(56, 189, 248, .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); }

/* Member navigation: the same groups and spacing on all three surfaces. */
.member-menu-heading {
  margin: 0;
  padding: 8px 16px;
  color: var(--text-secondary);
  font-size: .75rem;
  font-weight: 600;
  line-height: 1.5;
}
.member-menu-section + .member-menu-section {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.member-menu-section .sidebar-link {
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 8px;
}
.member-menu-section .ic {
  width: 24px;
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 24px;
}
.user-menu--member {
  top: calc(100% + 8px);
  max-height: calc(100vh - var(--topbar-height) - 24px);
  max-height: calc(100dvh - var(--topbar-height) - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.user-menu--member .user-menu-head { padding: 16px; gap: 12px; }
.user-menu--member .user-menu-item { min-height: 44px; padding: 12px 16px; gap: 12px; }
.user-menu--member .umi-ic { width: 24px; line-height: 24px; }
.user-menu--member .user-menu-item.active { color: var(--accent-cyan); background: var(--bg-secondary); }
.user-menu--member .user-menu-item:focus-visible,
.member-menu-section .sidebar-link:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: -4px;
}
html[data-theme="light"] .user-menu--member .user-menu-logout { color: #b91c1c; }

/* === 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(56, 189, 248, .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-icon {
  display: block;
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}

/* 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, #2457C5 0%, #08758D 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(56, 189, 248, 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.08), transparent);
  animation: shineSweep 2.8s ease-in-out infinite;
}

.btn-enter-learn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(36, 87, 197, 0.35),
              0 4px 12px rgba(11, 141, 170, 0.25);
}

.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(56, 189, 248, 0.65),
              0 0 16px rgba(56, 189, 248, 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(56, 189, 248, 0.55),
              0 0 16px rgba(56, 189, 248, 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: linear-gradient(135deg, #38bdf8, #67e8f9);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
html[data-theme="light"] .static-page-hero h1 { background-image: var(--accent-gradient); }
.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(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 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; }

/* Khối thông tin công ty (chính sách thanh toán, bảo mật, điều khoản, liên hệ) */
.static-company-card,
.contact-company {
  --space-4: 4px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-24: 24px;
  --space-32: 32px;
}
.static-company-card {
  max-width: 760px;
  margin: 0 auto var(--space-32);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-cyan);
  border-radius: var(--radius);
  padding: var(--space-24);
}
.static-company-card .scc-intro {
  margin: 0 0 var(--space-8);
  color: var(--text-secondary);
  font-size: .9rem;
}
.static-company-card .scc-name {
  margin: 0 0 var(--space-16);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: .2px;
}
.static-company-card .scc-list { margin: 0; }
.static-company-card .scc-list > div {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4) var(--space-16);
  padding: var(--space-8) 0;
  border-top: 1px solid var(--border);
}
.static-company-card .scc-list > div:first-child { border-top: 0; }
.static-company-card .scc-list dt {
  flex: 0 0 168px;
  color: var(--text-secondary);
  font-size: .9rem;
}
.static-company-card .scc-list dd {
  flex: 1 1 200px;
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text-primary);
  font-size: .92rem;
}
.static-company-card .scc-list a { color: var(--accent-cyan); }

/* Khối quyền lợi "sau khi mua nhận được gì" — hướng dẫn mua hàng */
.static-benefits {
  max-width: 760px;
  margin: 0 auto 36px;
  background: rgba(56, 189, 248, 0.06);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: var(--radius);
  padding: 20px 24px;
}
.static-benefits h2 {
  margin: 0 0 12px;
  color: var(--text-primary);
  font-size: 1.15rem;
  font-weight: 600;
}
.static-benefits ul {
  margin: 0;
  padding-left: 20px;
  color: var(--text-secondary);
  line-height: 1.8;
}
.static-benefits li { margin-bottom: 4px; }
.static-benefits .sb-note {
  margin: 12px 0 0;
  font-size: .85rem;
  font-style: italic;
  color: var(--text-secondary);
}

/* Trang Liên hệ — 2 cột desktop, 1 cột mobile */
.contact-grid {
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}
.contact-col {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 26px 28px;
}
.contact-col h2 {
  color: var(--text-primary);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 16px;
}
.contact-col h3 {
  color: var(--text-primary);
  font-size: .95rem;
  font-weight: 600;
  margin: 22px 0 8px;
}
.contact-channels {
  list-style: none;
  padding: 0;
  margin: 0 0 6px;
  color: var(--text-secondary);
  line-height: 1.9;
  font-size: .95rem;
}
.contact-channels strong { color: var(--text-primary); }
.contact-channels a { color: var(--accent-cyan); }
.contact-oa-card {
  margin: 22px 0 28px; padding: 20px; border: 1px solid var(--border);
  border-radius: 16px; background: var(--bg-primary); text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.contact-oa-qr { background: #fff; padding: 10px; border-radius: 12px; }
.contact-oa-qr img { display: block; width: 236px; height: 236px; object-fit: contain; }
.contact-oa-hint { margin: 0; color: var(--text-secondary); font-size: .88rem; line-height: 1.6; }
.contact-oa-button { width: 100%; min-height: 44px; display: flex; justify-content: center; align-items: center; text-align: center; padding: .8rem 1rem; box-sizing: border-box; }
@media (max-width: 380px) { .contact-oa-card { padding: 14px 10px; } }
.contact-copy-mobile { display: none; }
@media (max-width: 620px) {
  .contact-oa-qr, .contact-copy-desktop { display: none; }
  .contact-copy-mobile { display: inline; }
}
.contact-note {
  color: var(--text-secondary);
  font-size: .85rem;
  font-style: italic;
  margin: 0 0 4px;
}
.contact-support-list {
  margin: 0;
  padding-left: 20px;
  color: var(--text-secondary);
  line-height: 1.75;
  font-size: .92rem;
}
.contact-support-list li { margin-bottom: 4px; }
.contact-company {
  max-width: 980px;
  margin: var(--space-32) auto 0;
  scroll-margin-top: calc(var(--topbar-height) + var(--space-24));
}
.contact-company h2 {
  margin: 0 0 var(--space-16);
  color: var(--text-primary);
  font-size: 1.25rem;
  font-weight: 600;
}
.contact-company .static-company-card {
  max-width: none;
  margin-bottom: 0;
}
.contact-field { margin-bottom: 16px; }
.contact-field .field-error {
  display: block;
  margin-top: 6px;
  color: #f87171;
  font-size: .82rem;
}
.contact-field .input.has-error,
.contact-field textarea.input.has-error {
  border-color: rgba(248, 113, 113, .6);
}
textarea.input { resize: vertical; min-height: 120px; font-family: inherit; }

@media (max-width: 860px) {
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .static-steps { flex-direction: column; }
  .static-company-card .scc-list dt { flex-basis: 100%; }
}

/* Course card — placeholder light mode */
html[data-theme="light"] .course-thumb-placeholder {
  background: linear-gradient(135deg, #D6E4F7 0%, #C8EAF0 100%) !important;
}
html[data-theme="light"] .course-thumb-placeholder span {
  color: rgba(36,87,197,.25) !important;
}

/* ============ UNIFIED SEARCH BAR (courses page) ============ */
.searchbar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid rgba(14,23,38,.10);
  border-radius: 14px;
  padding: 7px;
  box-shadow: 0 2px 8px rgba(14,23,38,.08), 0 8px 24px -10px rgba(14,23,38,.12);
}

.searchbar .search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  padding: 0 10px;
  min-width: 0;
}
.searchbar .search-field svg {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
  flex: none;
}
.searchbar .search-field input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: none;
  font-family: inherit;
  font-size: 15px;
  font-weight: 420;
  color: var(--text-primary);
}
.searchbar .search-field input::placeholder {
  color: var(--text-secondary);
  opacity: .7;
}
.searchbar .sb-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  flex: none;
}
.searchbar .topic-select {
  position: relative;
  flex: none;
}
.searchbar .topic-select select {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  outline: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 10px 34px 10px 14px;
  border-radius: 10px;
  transition: background .2s, color .2s;
}
.searchbar .topic-select select:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}
.searchbar .topic-select svg {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-secondary);
  pointer-events: none;
}
.searchbar .btn-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding: 11px 22px;
  border-radius: 10px;
  background: var(--accent-gradient);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 18px -8px rgba(36,87,197,.6);
  transition: transform .15s, box-shadow .2s, filter .2s;
}
.searchbar .btn-search:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 12px 24px -8px rgba(36,87,197,.7);
}
.searchbar .btn-search svg {
  width: 15px;
  height: 15px;
}

/* Clear filter link (below search bar) */
.search-clear-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .85rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color .2s;
}
.search-clear-link:hover {
  color: var(--text-primary);
}
.search-clear-link svg {
  width: 13px;
  height: 13px;
}

@media (max-width: 720px) {
  .searchbar { flex-wrap: wrap; gap: 8px; }
  .searchbar .search-field { flex: 1 1 100%; padding: 8px 10px; }
  .searchbar .sb-divider { display: none; }
  .searchbar .topic-select,
  .searchbar .topic-select select,
  .searchbar .btn-search { flex: 1; }
  .searchbar .btn-search { justify-content: center; }
}
/* ============ END UNIFIED SEARCH BAR ============ */

/* ===== Top hero band — Courses + Instructors pages only (opt in via $bodyClass='has-top-band') ===== */
body.has-top-band{
  --band-height: 360px;            /* TUNE: raise/lower the band height */
  background-image:
    radial-gradient(640px 300px at 86% -40px, rgba(11,141,170,.12), transparent 60%),
    radial-gradient(560px 280px at 8% -30px, rgba(36,87,197,.12), transparent 60%),
    linear-gradient(180deg, var(--bg-band-top) 0, transparent var(--band-height));
  background-repeat: no-repeat;
}
/* AIDV.vn: lựa chọn chủ động trước đăng ký/chốt đơn, dùng được ở hai nền. */
.legal-consent{margin:18px 0;font-size:.85rem;line-height:1.65;color:var(--text-secondary)}
.legal-consent-choice{display:flex;align-items:flex-start;gap:10px}
.legal-consent-choice input{flex:0 0 20px;width:20px;height:20px;margin:4px 0 0;accent-color:var(--accent-cyan);cursor:pointer}
.legal-consent-choice input:focus-visible{outline:2px solid var(--accent-cyan);outline-offset:3px}
.legal-consent-choice label{display:block;min-width:0;cursor:pointer;font-size:inherit;font-weight:400;color:inherit;margin:0}
.legal-consent a{color:var(--accent-cyan);text-decoration:underline;text-underline-offset:3px}
.legal-consent .error-text{margin:8px 0 0}
html[data-theme="light"] .legal-consent .error-text{color:#b91c1c}
