/* ============================================
   THEME ÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂEN - VÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂNG  v2
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400;1,700&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg: #0a0a0a;
  --bg-soft: #141414;
  --bg-card: #1a1a1a;
  --bg-hover: #222222;
  --border: #2a2a2a;
  --border-soft: #1f1f1f;
  --text: #ffffff;
  --text-soft: #b8b8b8;
  --text-mute: #6b6b6b;
  --accent: #d4af6e;
  --accent-dark: #b8923f;
  --accent-soft: rgba(212, 175, 110, 0.12);
  --success: #4ade80;
  --danger: #ef4444;
  --info: #3b82f6;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-yellow: 0 4px 16px rgba(212, 175, 110, 0.2);
  --transition: 0.2s ease;
  --font-serif: "Playfair Display", "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-dark); }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

input, select, textarea {
  font-family: inherit;
  font-size: 14px;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  width: 100%;
  transition: var(--transition);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}
textarea { resize: vertical; min-height: 80px; }

/* ============================================
   HEADER
   ============================================ */
.site-header {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 20px;
  color: var(--text);
}

.logo-mark {
  background: var(--accent);
  color: #000;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-weight: 900;
  font-size: 18px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-header {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-soft);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-header:hover { border-color: var(--accent); color: var(--accent); }

.btn-header.danger:hover { border-color: var(--danger); color: var(--danger); }

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 5px 12px 5px 5px;
  border-radius: 999px;
  font-size: 13px;
}

.user-chip img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
}

.user-chip .badge {
  background: var(--accent);
  color: #000;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

/* ============================================
   AUTH (LOGIN PAGE)
   ============================================ */
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 214, 10, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(255, 214, 10, 0.06) 0%, transparent 50%),
    var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 32px;
  text-align: center;
  box-shadow: var(--shadow);
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: var(--accent);
  color: #000;
  border-radius: 16px;
  font-size: 32px;
  font-weight: 900;
  margin-bottom: 24px;
}

.auth-card h1 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 24px;
  margin-bottom: 8px;
  color: var(--text);
}

.auth-card h1 span { color: var(--accent); 
  font-style: italic;
  font-weight: 700;
}

.auth-subtitle {
  color: var(--text-soft);
  margin-bottom: 32px;
}

.btn-google {
  width: 100%;
  background: #fff;
  color: #000;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: var(--transition);
}

.btn-google:hover {
  background: #f5f5f5;
  transform: translateY(-1px);
}

.btn-google svg { width: 20px; height: 20px; }

.auth-note {
  margin-top: 24px;
  font-size: 12px;
  color: var(--text-mute);
}

/* ============================================
   MAIN CONTAINER
   ============================================ */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 24px;
}

.page-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 8px;
}
.page-title .accent { color: var(--accent); 
  font-style: italic;
}

.page-subtitle {
  color: var(--text-soft);
  font-size: 16px;
  margin-bottom: 32px;
}

/* ============================================
   COURSE CARDS (HOMEPAGE)
   ============================================ */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.course-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.course-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-yellow);
}

.course-thumb {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a00 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  color: var(--accent);
  position: relative;
  overflow: hidden;
}

.course-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 70% 30%, rgba(255, 214, 10, 0.15) 0%, transparent 60%);
}

.course-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.course-level {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  align-self: flex-start;
}

.course-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.course-desc {
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.5;
  flex: 1;
}

.course-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-mute);
}

.course-progress-bar {
  height: 6px;
  background: var(--border-soft);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
}

.course-progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.4s ease;
}

/* ============================================
   COURSE PAGE LAYOUT
   ============================================ */
.course-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
  min-height: calc(100vh - 80px);
}

.sidebar {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  height: fit-content;
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.sidebar-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-mute);
  margin-bottom: 8px;
}

.sidebar-course-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}

.progress-block {
  background: var(--bg-card);
  padding: 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 8px;
}

.progress-percent { color: var(--accent); font-weight: 700; }

.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent));
  transition: width 0.4s ease;
}

.lesson-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lesson-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

.lesson-item:hover:not(.locked) { background: var(--bg-hover); }

.lesson-item.active {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.lesson-item.locked { opacity: 0.5; cursor: not-allowed; }

.lesson-status {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  background: var(--border);
  color: var(--text-mute);
}

.lesson-item.completed .lesson-status,
.lesson-item.active .lesson-status {
  background: var(--accent);
  color: #000;
}

.lesson-item.locked .lesson-status { background: var(--bg-card); }

.lesson-info { flex: 1; min-width: 0; }

.lesson-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lesson-item.locked .lesson-name { color: var(--text-mute); }

.lesson-duration { font-size: 12px; color: var(--text-mute); }

/* ============================================
   MAIN CONTENT (VIDEO + INFO)
   ============================================ */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.video-wrap {
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  position: relative;
  aspect-ratio: 16 / 9;
}

.video-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-mute);
  text-align: center;
  padding: 24px;
}

.video-placeholder .icon { font-size: 64px; color: var(--accent); opacity: 0.5; }

/* ===== VIP locked video (no popup) ===== */
.video-locked {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  background:
    radial-gradient(circle at 50% 35%, rgba(212,175,110,0.18) 0%, transparent 60%),
    linear-gradient(135deg, #161616 0%, #2a1f0a 100%);
}
.video-locked-inner { max-width: 460px; }
.video-locked-icon { font-size: 64px; line-height: 1; margin-bottom: 10px; }
.video-locked-title { font-size: 20px; font-weight: 800; color: #f3e3c4; }
.video-locked-sub { font-size: 14px; color: var(--text-soft, #bbb); margin: 6px 0 18px; }
.video-locked-note { margin-top: 14px; font-size: 13px; color: #facc15; }
.video-locked-note.warn { color: #f87171; }

.btn-buy-pulse {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  cursor: pointer;
  font-size: 17px;
  font-weight: 800;
  color: #1a1400;
  padding: 14px 30px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffd60a, #d4af6e);
  box-shadow: 0 8px 24px rgba(255,214,10,0.35);
  animation: buyPulse 1.25s ease-in-out infinite;
}
.btn-buy-pulse:hover { filter: brightness(1.05); }
@keyframes buyPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 8px 24px rgba(255,214,10,0.30); }
  50%      { transform: scale(1.08); box-shadow: 0 12px 34px rgba(255,214,10,0.55); }
}
@media (prefers-reduced-motion: reduce) {
  .btn-buy-pulse { animation: none; }
}

/* ===== VIP SALES PAGE (2 cột + thẻ mua sticky) ===== */
.course-layout.vip-sales-mode {
  display: block;
  max-width: 1180px;
}
.vip-sales {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 32px;
  align-items: start;
}
.vip-sales-main { min-width: 0; }
.vip-sales-title {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.25;
  color: #f3e3c4;
  margin: 0 0 10px;
}
.vip-sales-tagline {
  font-size: 16px;
  color: var(--text-soft, #c7c7c7);
  line-height: 1.6;
  margin: 0 0 24px;
}
.vip-sec { margin-bottom: 26px; }
.vip-sec-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--accent, #ffd60a);
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(212,175,110,0.25);
}
.vip-sec-body p { margin: 0 0 8px; line-height: 1.6; color: var(--text, #e5e5e5); }
.vip-sec-list { list-style: none; margin: 0; padding: 0; }
.vip-sec-list li {
  position: relative;
  padding: 6px 0 6px 28px;
  line-height: 1.55;
  color: var(--text, #e5e5e5);
}
.vip-sec-list li::before {
  content: "✓";
  position: absolute;
  left: 0; top: 6px;
  color: #4ade80;
  font-weight: 800;
}

/* Sticky buy card */
.vip-sales-aside { position: relative; }
.vip-buy-card {
  position: sticky;
  top: 88px;
  background: var(--bg-card, #161616);
  border: 1px solid rgba(212,175,110,0.4);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}
.vip-buy-cover {
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  margin-bottom: 16px;
}
.vip-buy-cover-fallback {
  display: flex; align-items: center; justify-content: center;
  font-size: 56px;
  background: linear-gradient(135deg, #1a1a1a, #2a1f0a);
}
.vip-buy-price { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.vip-buy-price strong { font-size: 26px; font-weight: 800; color: var(--accent, #ffd60a); }
.vip-buy-orig { font-size: 15px; text-decoration: line-through; color: var(--muted, #888); }
.vip-buy-meta { border-top: 1px solid var(--border, #2a2a2a); padding-top: 12px; margin-bottom: 16px; }
.vip-buy-meta-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 0; font-size: 14px;
}
.vip-buy-meta-row span { color: var(--text-soft, #aaa); }
.vip-buy-meta-row strong { color: var(--text, #fff); }
.vip-buy-btn { width: 100%; justify-content: center; font-size: 16px; padding: 14px 18px; }
.vip-buy-note { margin-top: 12px; font-size: 13px; color: #facc15; text-align: center; }
.vip-buy-note.warn { color: #f87171; }
.vip-buy-back {
  display: block; text-align: center; margin-top: 14px;
  font-size: 13px; color: var(--text-soft, #999); text-decoration: none;
}
.vip-buy-back:hover { color: var(--accent, #ffd60a); }

/* Nút mua mobile (ẩn trên desktop) */
.vip-sales-buy-mobile { display: none; margin-top: 24px; }
.vip-sales-buy-mobile .btn-buy-pulse { width: 100%; justify-content: center; }

@media (max-width: 900px) {
  .vip-sales { grid-template-columns: 1fr; }
  .vip-sales-aside { display: none; }
  .vip-sales-buy-mobile { display: block; }
  .vip-sales-title { font-size: 24px; }
}

/* ===== Admin: nhóm 5 ô nội dung bán VIP ===== */
.vip-sales-fields {
  margin-top: 8px;
  padding: 16px;
  border: 1px dashed rgba(212,175,110,0.4);
  border-radius: 12px;
  background: rgba(212,175,110,0.05);
}
.vip-sales-fields-head { font-weight: 700; color: var(--accent, #ffd60a); margin-bottom: 4px; }
.vip-sales-fields-head span { font-weight: 400; font-size: 12px; color: var(--text-soft, #999); }

.lesson-content {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.lesson-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.lesson-title-big {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
}

.lesson-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.lesson-badge.done {
  background: rgba(74, 222, 128, 0.15);
  color: var(--success);
}

.lesson-description {
  color: var(--text-soft);
  line-height: 1.7;
  margin-bottom: 20px;
}

.timer-info {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-soft);
}

.timer-info.ready {
  border-color: var(--success);
  color: var(--success);
}

.timer-icon { font-size: 20px; }

.action-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.nav-buttons {
  display: flex;
  gap: 8px;
}

.btn {
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: var(--accent);
  color: #000;
}

.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); }
.btn-primary:disabled {
  background: var(--border); color: var(--text-mute);
  cursor: not-allowed; transform: none;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn-secondary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover { background: rgba(239, 68, 68, 0.25); border-color: var(--danger); }

.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ============================================
   MOBILE MENU TOGGLE
   ============================================ */
.mobile-toggle {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--accent);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 16px;
  width: 100%;
  text-align: left;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-mute);
  grid-column: 1 / -1;
}

.empty-state .icon {
  font-size: 64px;
  color: var(--accent);
  margin-bottom: 16px;
}

.empty-state p { margin-bottom: 16px; }

/* ============================================
   ADMIN PAGE
   ============================================ */
.admin-layout {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 24px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-soft);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 24px;
  width: fit-content;
  flex-wrap: wrap;
}

.admin-tab {
  padding: 10px 18px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-soft);
  transition: var(--transition);
}

.admin-tab:hover { color: var(--text); }

.admin-tab.active {
  background: var(--accent);
  color: #000;
}

.admin-section { display: none; }
.admin-section.active { display: block; }

.admin-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}

.admin-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-card-title {
  font-size: 18px;
  font-weight: 700;
}

.admin-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Lesson row in admin */
.admin-lesson-row {
  display: grid;
  grid-template-columns: 24px 40px 1fr auto;
  gap: 12px;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  align-items: center;
}

/* Backward compat: row chưa có drag handle (cũ) — chỉ 3 cột */
.admin-lesson-row:not(:has(.drag-handle)) {
  grid-template-columns: 40px 1fr auto;
}

/* ===== Course accordion (collapse/expand bài học) — siêu compact ===== */
.course-card.collapsed .course-collapsible { display: none !important; }
.course-card.collapsed {
  padding: 8px 16px !important;
  margin-bottom: 8px !important;
  min-height: auto !important;
}
.course-card.collapsed .admin-card-header {
  margin-bottom: 0 !important;
  align-items: center !important;
  min-height: auto !important;
  gap: 8px !important;
}
.course-card.collapsed .admin-card-title {
  font-size: 15px !important;
  line-height: 1.3 !important;
}
.course-card.collapsed .course-toggle-btn {
  width: 26px !important;
  height: 26px !important;
  font-size: 11px !important;
}
/* Trong card đã mở: giữ chevron bình thường */
.course-card .course-toggle-btn {
  transition: transform .15s;
}
.course-card .course-toggle-btn:hover {
  background: rgba(212,175,110,0.3) !important;
}

/* ===== Drag-drop visual feedback (SortableJS) ===== */
.admin-lesson-row .drag-handle:active,
.lc-drag-handle:active { cursor: grabbing !important; }

.sortable-ghost {
  opacity: 0.4;
  background: rgba(212, 175, 110, 0.12) !important;
}
.sortable-chosen {
  background: rgba(212, 175, 110, 0.06) !important;
  box-shadow: 0 4px 18px rgba(0,0,0,0.3);
}

.admin-lesson-row .num {
  background: var(--accent);
  color: #000;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.admin-lesson-info { min-width: 0; }
.admin-lesson-info .name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-lesson-info .meta {
  font-size: 12px;
  color: var(--text-mute);
}

/* Form */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.form-row.single { grid-template-columns: 1fr; }

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 6px;
}

.form-help {
  font-size: 12px;
  color: var(--text-mute);
  margin-top: 4px;
}

.form-help code {
  background: var(--bg-card);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 11px;
  color: var(--accent);
}

/* Users table */
.users-table {
  width: 100%;
  border-collapse: collapse;
}
.users-table th, .users-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.users-table th {
  background: var(--bg-card);
  font-weight: 700;
  color: var(--text-soft);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.users-table tr:hover td { background: var(--bg-hover); }

.role-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}
.role-badge.admin { background: var(--accent); color: #000; }
.role-badge.user { background: var(--border); color: var(--text-soft); }

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-overlay.active { display: flex; }

.modal {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 { font-size: 18px; }

.modal-close {
  background: transparent;
  font-size: 24px;
  color: var(--text-mute);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover { background: var(--bg-card); color: var(--text); }

.modal-body { padding: 24px; }

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ============================================
   LOADING / SPINNER
   ============================================ */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  gap: 16px;
  color: var(--text-mute);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 960px) {
  .course-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    max-height: none;
    order: 2;
  }

  .main-content { order: 1; }

  .mobile-toggle { display: block; order: 1; }

  .sidebar.collapsed { display: none; }

  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .container, .admin-layout { padding: 20px 16px; }

  .course-layout { padding: 16px; }

  .page-title { font-size: 24px; }

  .lesson-title-big { font-size: 20px; }

  .header-inner { padding: 0 4px; }

  .logo { font-size: 16px; }

  .course-grid { grid-template-columns: 1fr; gap: 16px; }

  .action-row { flex-direction: column; align-items: stretch; }

  .nav-buttons { width: 100%; }

  .nav-buttons .btn { flex: 1; justify-content: center; }

  .btn { width: 100%; justify-content: center; }

  .user-chip .name { display: none; }

  .users-table th:nth-child(3),
  .users-table td:nth-child(3) { display: none; }
}

/* Scrollbar */
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px;
  text-align: center;
  color: var(--text-mute);
  font-size: 13px;
  margin-top: 64px;
}

/* ============================================
   LANDING PAGE ÃÂÃÂÃÂÃÂ¢ÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ public, before login
   ============================================ */
.landing-body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at top, rgba(255, 214, 10, 0.08), transparent 60%),
    var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.landing-loading {
  text-align: center;
  color: var(--text-mute);
}

.landing-wrap {
  width: 100%;
  max-width: 560px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.landing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px 36px 36px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow);
}

.landing-logo {
  width: 64px;
  height: 64px;
  background: var(--accent);
  color: #000;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 900;
  font-family: "Arial Black", sans-serif;
  margin: 0 auto 20px;
  box-shadow: var(--shadow-yellow);
}

.landing-card h1 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 8px;
}
.landing-card h1 .accent { color: var(--accent); 
  font-style: italic;
}

.landing-subtitle {
  color: var(--text-soft);
  font-size: 15px;
  margin-bottom: 32px;
}

.landing-buttons {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}

.landing-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  text-align: left;
  text-decoration: none;
  transition: var(--transition);
  background: var(--bg-soft);
}

.landing-btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--bg-hover);
}

.landing-btn.register-btn {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}
.landing-btn.register-btn:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #000;
  box-shadow: var(--shadow-yellow);
}

.landing-btn.login-btn {
  color: var(--text);
}
.landing-btn.login-btn:hover {
  color: var(--text);
}

.landing-btn-icon {
  font-size: 28px;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 10px;
}
.landing-btn.login-btn .landing-btn-icon {
  background: var(--accent-soft);
}

.landing-btn-content {
  flex: 1;
}

.landing-btn-title {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 2px;
}

.landing-btn-desc {
  font-size: 13px;
  opacity: 0.75;
}

.landing-note {
  font-size: 13px;
  color: var(--text-mute);
  line-height: 1.5;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

@media (max-width: 480px) {
  .landing-card {
    padding: 32px 22px 24px;
  }
  .landing-card h1 {
    font-size: 22px;
  }
  .landing-btn {
    padding: 14px 16px;
    gap: 12px;
  }
  .landing-btn-icon {
    width: 40px;
    height: 40px;
    font-size: 24px;
  }
  .landing-btn-title { font-size: 15px; }
}

/* ============================================
   24H LESSON LOCK FEATURE
   ============================================ */
.lesson-item.expired {
  opacity: 0.65;
  cursor: not-allowed;
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.06);
}
.lesson-item.expired .lesson-status {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}
.lesson-item.expired .lesson-name {
  color: var(--text-mute);
  text-decoration: line-through;
}

.lesson-countdown {
  display: inline-block;
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 6px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.lesson-countdown.urgent {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.15);
}
.lesson-expired-tag {
  display: inline-block;
  font-size: 11px;
  color: var(--danger);
  background: rgba(239, 68, 68, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 6px;
  font-weight: 600;
}

.expired-notice {
  text-align: center;
  padding: 48px 24px;
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius);
}
.expired-notice .icon { font-size: 56px; color: var(--danger); margin-bottom: 16px; }
.expired-notice h3 {
  font-family: var(--font-serif);
  font-size: 24px;
  color: var(--danger);
  margin-bottom: 12px;
}
.expired-notice p { color: var(--text-soft); margin-bottom: 8px; }

.admin-locked-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 13px;
}
.admin-locked-row .info { flex: 1; min-width: 0; }
.admin-locked-row .info .name { font-weight: 600; }
.admin-locked-row .info .meta { font-size: 11px; color: var(--text-mute); }
.admin-locked-row .btn { white-space: nowrap; }


/* ============================================
   VIP LESSONS + PAYMENT MODAL
   ============================================ */
.lesson-vip-tag {
  display: inline-block;
  font-size: 11px;
  color: #000;
  background: linear-gradient(135deg, #e8c887, var(--accent));
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 6px;
  font-weight: 700;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 8px rgba(212, 175, 110, 0.3);
}

.lesson-item.vip-locked {
  border-color: var(--accent);
  background: rgba(212, 175, 110, 0.08);
}
.lesson-item.vip-locked .lesson-status {
  background: linear-gradient(135deg, #e8c887, var(--accent));
  color: #000;
  font-size: 18px;
}

.vip-notice {
  text-align: center;
  padding: 32px 24px;
  background: linear-gradient(135deg, rgba(212, 175, 110, 0.08), rgba(212, 175, 110, 0.03));
  border: 1px solid var(--accent);
  border-radius: var(--radius);
}
.vip-notice h3 {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--accent);
  margin-bottom: 16px;
}
.vip-notice .vip-price {
  font-family: var(--font-serif);
  font-size: 36px;
  font-style: italic;
  font-weight: 700;
  color: var(--accent);
  margin: 16px 0;
}
.vip-notice .vip-instructions {
  color: var(--text-soft);
  margin-bottom: 20px;
  line-height: 1.7;
}
.vip-notice .vip-info-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: 14px;
}
.vip-notice.pending {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(59, 130, 246, 0.03));
  border-color: var(--info);
}
.vip-notice.pending h3 { color: var(--info); }
.vip-warn {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 13px;
}

.modal.payment-modal { max-width: 480px; }
.payment-qr-wrap {
  text-align: center;
  background: #fff;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
}
.payment-qr { width: 100%; max-width: 300px; height: auto; }
.payment-info {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 14px;
}
.payment-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 14px;
  border-bottom: 1px dashed var(--border);
}
.payment-row:last-child { border-bottom: none; }
.payment-row.highlight strong { color: var(--accent); font-size: 16px; }
.payment-note {
  font-size: 13px;
  color: var(--text-soft);
  background: rgba(212, 175, 110, 0.06);
  padding: 12px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
}

.payment-row-admin {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(212, 175, 110, 0.06);
  border: 1px solid rgba(212, 175, 110, 0.3);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}
.payment-row-admin .info { flex: 1; min-width: 0; }
.payment-row-admin .info .name {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.payment-row-admin .info .meta {
  font-size: 12px;
  color: var(--text-mute);
  margin-top: 4px;
}
.payment-row-admin .payment-content code {
  background: var(--bg-card);
  padding: 2px 8px;
  border-radius: 3px;
  font-family: monospace;
  color: var(--accent);
}
.payment-row-admin .payment-amount {
  color: var(--accent);
  font-weight: 700;
  background: rgba(212, 175, 110, 0.15);
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 13px;
}
.payment-row-admin .payment-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.payment-count {
  display: inline-block;
  background: var(--danger);
  color: #fff;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  margin-left: 8px;
  font-weight: 700;
}


/* === Payment type badge & Course VIP === */
.payment-type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-right: 8px;
  vertical-align: middle;
}
.payment-type-badge.course {
  background: linear-gradient(135deg, #d4af6e, #8b6b3a);
  color: #000;
}
.payment-type-badge.lesson {
  background: rgba(212, 175, 110, 0.15);
  color: #d4af6e;
  border: 1px solid rgba(212, 175, 110, 0.3);
}
.vip-notice.course-vip {
  border: 2px solid rgba(212, 175, 110, 0.4);
  background: linear-gradient(135deg, rgba(42, 31, 10, 0.6), rgba(20, 20, 20, 0.6));
}


/* === Revenue stats cards === */
.revenue-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
}
.stat-label {
  color: var(--text-mute);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stat-value {
  font-size: 24px;
  font-weight: 700;
  margin: 6px 0;
  color: #fff;
}
.stat-value.accent { color: #d4af6e; }
.stat-value.warn { color: #fbbf24; }
.stat-value.mute { color: var(--text-mute); }
.stat-sub {
  font-size: 11px;
  color: var(--text-mute);
}

/* === Filter buttons === */
.payments-filter {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.filter-btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: 0.2s ease;
}
.filter-btn:hover {
  border-color: #d4af6e;
  color: #d4af6e;
}
.filter-btn.active {
  background: #d4af6e;
  color: #000;
  border-color: #d4af6e;
  font-weight: 700;
}

/* === Status badges === */
.status-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.status-badge.success { background: rgba(74, 222, 128, 0.15); color: #4ade80; }
.status-badge.warn { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.status-badge.danger { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

/* === User row hover === */
.user-row:hover {
  background: rgba(212, 175, 110, 0.05) !important;
}

/* === Modal large === */
.modal.modal-large {
  max-width: 720px;
  width: 90%;
}
.user-detail-header {
  background: rgba(212, 175, 110, 0.05);
  border: 1px solid rgba(212, 175, 110, 0.2);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 20px;
  display: grid;
  gap: 6px;
}
.user-detail-header > div { font-size: 14px; }
.detail-section {
  margin-bottom: 22px;
}
.detail-section h3 {
  font-size: 14px;
  color: #d4af6e;
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.detail-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}
.detail-list li {
  padding: 8px 12px;
  background: rgba(255,255,255,0.02);
  border-radius: 6px;
  font-size: 13px;
}


/* === Course card VIP overlay (landing home.html) === */
.course-card { position: relative; }
.course-vip-overlay {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.course-vip-overlay.course-vip-full {
  background: linear-gradient(135deg, #d4af6e, #8b6b3a);
  color: #000;
}
.course-vip-overlay.course-vip-full strong {
  font-size: 14px;
  margin-top: 2px;
}
.course-vip-overlay.course-vip-partial {
  background: rgba(212, 175, 110, 0.15);
  color: #d4af6e;
  border: 1px solid rgba(212, 175, 110, 0.4);
  backdrop-filter: blur(6px);
}
.course-card.vip-course {
  border: 2px solid rgba(212, 175, 110, 0.4);
}
.course-card.vip-course:hover {
  border-color: #d4af6e;
  box-shadow: 0 8px 24px rgba(212, 175, 110, 0.2);
}

/* === Timer paused hint === */
.timer-paused-hint {
  display: none;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: #fbbf24;
  padding: 10px 14px;
  border-radius: 8px;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
}

/* === Auto-approved payment row === */
.payment-row-admin.auto-approved {
  border-left: 4px solid #fbbf24;
  background: rgba(251, 191, 36, 0.04);
}


/* === Leaderboard (v3 — clean redesign) === */
.leaderboard-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 100px;
}
.leaderboard-header {
  text-align: center;
  margin-bottom: 28px;
}
.leaderboard-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 50px;
}
.lb-tab {
  padding: 10px 22px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: 0.2s ease;
}
.lb-tab:hover { color: #d4af6e; border-color: #d4af6e; }
.lb-tab.active {
  background: linear-gradient(135deg, #d4af6e, #8b6b3a);
  color: #000;
  border-color: #d4af6e;
}

/* Podium: 3 cards 2-1-3, all clean inside, NO floating icons */
.leaderboard-podium {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  gap: 18px;
  align-items: stretch;
  margin: 0 auto 36px;
  max-width: 760px;
}
.podium-slot {
  position: relative;
  border-radius: 16px;
  padding: 28px 18px 24px;
  text-align: center;
  background: linear-gradient(180deg, rgba(30,30,30,0.7), rgba(15,15,15,0.95));
  border: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  transition: 0.25s ease;
}
.podium-slot.first {
  background: linear-gradient(180deg, rgba(212,175,110,0.18), rgba(40,28,8,0.95));
  border: 2px solid rgba(212,175,110,0.55);
  box-shadow: 0 12px 30px rgba(212,175,110,0.18);
}
.podium-slot.second {
  background: linear-gradient(180deg, rgba(192,197,208,0.15), rgba(30,32,38,0.95));
  border: 1.5px solid rgba(192,197,208,0.4);
}
.podium-slot.third {
  background: linear-gradient(180deg, rgba(205,127,50,0.15), rgba(38,28,18,0.95));
  border: 1.5px solid rgba(205,127,50,0.4);
}

/* Inline rank badge at top of card */
.podium-rank-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.podium-slot.first .podium-rank-pill {
  background: linear-gradient(135deg, #d4af6e, #8b6b3a);
  color: #000;
}
.podium-slot.second .podium-rank-pill {
  background: linear-gradient(135deg, #c0c5d0, #6e7282);
  color: #1a1a1a;
}
.podium-slot.third .podium-rank-pill {
  background: linear-gradient(135deg, #cd7f32, #7a4a1a);
  color: #fff;
}

/* Number circle */
.podium-num-circle {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 12px;
  background: rgba(255,255,255,0.04);
  border: 2px solid currentColor;
}
.podium-slot.first .podium-num-circle { color: #d4af6e; }
.podium-slot.second .podium-num-circle { color: #c0c5d0; }
.podium-slot.third .podium-num-circle { color: #cd7f32; }

.podium-name {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #fff;
  margin: 6px 0 14px;
  min-height: 36px;
  line-height: 1.25;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  word-break: break-word;
}
.podium-slot.first .podium-name { font-size: 15px; }

.podium-score-main {
  font-size: 30px;
  font-weight: 800;
  color: #d4af6e;
  letter-spacing: -0.5px;
  line-height: 1;
}
.podium-slot.first .podium-score-main { font-size: 36px; }
.podium-stat-label {
  font-size: 10px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 6px;
}
.podium-mini-stats {
  font-size: 11px;
  color: var(--text-soft);
  margin-top: 10px;
}

/* Hide old leftover classes from v1/v2 */
.podium-medal, .podium-avatar, .podium-rank, .podium-score { display: none; }
.podium-slot::before { display: none !important; }

.lb-table {
  width: 100%; border-collapse: collapse;
  background: rgba(255,255,255,0.02);
  border-radius: 10px; overflow: hidden;
}
.lb-table th, .lb-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.lb-table th { color: var(--text-mute); font-size: 12px; text-transform: uppercase; }
.lb-table tr.me-row { background: rgba(212,175,110,0.08); }
.lb-table tr.me-row td { color: #d4af6e; font-weight: 600; }

.my-rank-card {
  position: fixed;
  bottom: 20px;
  right: 24px;
  width: 320px;
  max-width: calc(100vw - 32px);
  z-index: 80;
}
.my-rank-inner {
  background: linear-gradient(135deg, #2a1f0a 0%, #1a1305 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(212,175,110,0.5);
  border-radius: 14px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.7);
}
.my-rank-label { font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: .5px; }
.my-rank-value { font-size: 26px; font-weight: 800; color: #d4af6e; line-height: 1; margin-top: 2px; }
.my-rank-score { font-size: 18px; font-weight: 700; color: #f4eddf; white-space: nowrap; }
.my-rank-breakdown { font-size: 11px; color: #999; flex: 1; }

@media (max-width: 768px) {
  .my-rank-card {
    left: 14px;
    right: 14px;
    width: auto;
    bottom: 14px;
  }
  .my-rank-inner { padding: 12px 14px; gap: 10px; }
  .my-rank-value { font-size: 22px; }
  .my-rank-score { font-size: 16px; }
}

/* === Score formula card === */
.formula-card {
  background: rgba(212,175,110,0.04);
  border: 1px solid rgba(212,175,110,0.2);
  border-radius: 12px;
  padding: 18px 22px;
  margin: 20px 0;
  font-size: 13px;
  line-height: 1.7;
}
.formula-card h3 {
  font-size: 14px;
  color: #d4af6e;
  margin: 0 0 12px;
  font-weight: 700;
}
.formula-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 18px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.formula-list li {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(255,255,255,0.06);
}
.formula-list strong { color: #d4af6e; font-weight: 700; }
.formula-list .neg { color: #ef4444; }

@media (max-width: 700px) {
  .leaderboard-podium { grid-template-columns: 1fr; gap: 16px; }
  .my-rank-inner { grid-template-columns: 1fr; text-align: center; gap: 8px; }
  .my-rank-breakdown { text-align: center; }
}

/* === LOCKSCREEN OVERLAY (full-page) === */
.lock-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(8, 8, 8, 0.92);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: lockFadeIn 0.3s ease;
}
@keyframes lockFadeIn { from { opacity: 0; } to { opacity: 1; } }
.lock-overlay-inner {
  max-width: 480px;
  text-align: center;
  background: linear-gradient(180deg, rgba(212,175,110,0.08), rgba(20,20,20,0.6));
  border: 1px solid rgba(212,175,110,0.3);
  border-radius: 18px;
  padding: 40px 32px 36px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.lock-icon-big {
  width: 110px;
  height: 130px;
  margin: 0 auto 22px;
  color: #d4af6e;
  filter: drop-shadow(0 4px 16px rgba(212,175,110,0.4));
}
.lock-icon-big svg { width: 100%; height: 100%; }
.lock-title {
  font-family: 'Playfair Display', serif;
  font-size: 30px;
  font-weight: 700;
  margin: 0 0 14px;
  color: #fff;
}
.lock-subtitle {
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-soft);
  margin: 0 0 10px;
}
.lock-hint {
  font-size: 13px;
  color: var(--text-mute);
  margin: 8px 0 0;
}
.lock-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 24px;
}
.lock-actions .btn {
  padding: 10px 22px;
  font-weight: 600;
}

/* === LEADERBOARD PODIUM v2 (kiểu ảnh tham chiếu) === */
.leaderboard-podium {
  display: grid;
  grid-template-columns: 1fr 1.3fr 1fr;
  gap: 14px;
  align-items: end;
  margin: 30px auto 40px;
  max-width: 700px;
  padding: 0 12px;
}
.podium-slot {
  position: relative;
  background: linear-gradient(180deg, rgba(40,40,40,0.5), rgba(15,15,15,0.85));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 50px 16px 24px;
  text-align: center;
  transition: 0.25s ease;
}

/* Medal/cup floating above card */
.podium-slot::before {
  content: "";
  position: absolute;
  top: -34px;
  left: 50%;
  transform: translateX(-50%);
  width: 64px;
  height: 64px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}
.podium-slot.first {
  border: 2px solid rgba(212,175,110,0.5);
  background: linear-gradient(180deg, rgba(212,175,110,0.12), rgba(20,20,20,0.9));
  padding-top: 64px;
  transform: translateY(-30px);
  box-shadow: 0 10px 40px rgba(212,175,110,0.2);
}
.podium-slot.first::before {
  width: 80px; height: 80px; top: -54px;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 80"><path d="M16 8v22a16 16 0 0032 0V8H16z" fill="%23d4af6e"/><path d="M14 14H4v8a10 10 0 0010 10V14zM50 14h10v8a10 10 0 01-10 10V14z" stroke="%23d4af6e" stroke-width="3" fill="none"/><path d="M26 52h12v8h6v6H20v-6h6v-8z" fill="%23d4af6e"/></svg>');
}
.podium-slot.second::before {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 80"><path d="M32 8L20 22h-8l-4 16h12v6h24v-6h12L52 22h-8L32 8z" fill="%23c0c5d0"/><circle cx="32" cy="50" r="18" fill="%23dde0e8" stroke="%23a0a8b8" stroke-width="2"/><text x="32" y="56" text-anchor="middle" font-size="20" font-weight="bold" fill="%23495162">2</text></svg>');
}
.podium-slot.third::before {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 80"><path d="M32 8L20 22h-8l-4 16h12v6h24v-6h12L52 22h-8L32 8z" fill="%23cd7f32"/><circle cx="32" cy="50" r="18" fill="%23d97732" stroke="%23a05a1f" stroke-width="2"/><text x="32" y="56" text-anchor="middle" font-size="20" font-weight="bold" fill="%23fff">3</text></svg>');
}

/* Big number circle inside card */
.podium-num-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  border: 2px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  margin: 0 auto 14px;
  color: #fff;
}
.podium-slot.first .podium-num-circle {
  background: rgba(212,175,110,0.15);
  border-color: #d4af6e;
  color: #d4af6e;
}

.podium-name {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #fff;
  margin: 8px 0 12px;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}
.podium-score-main {
  font-size: 24px;
  font-weight: 800;
  color: #d4af6e;
  letter-spacing: -0.5px;
}
.podium-slot.first .podium-score-main { font-size: 28px; }
.podium-stat-label {
  font-size: 10px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}
.podium-medal { display: none; } /* hide old emoji */
.podium-avatar { display: none; }
.podium-rank { display: none; }
.podium-score { display: none; }

/* === Score formula explainer === */
.formula-card {
  background: rgba(212,175,110,0.05);
  border: 1px solid rgba(212,175,110,0.2);
  border-radius: 12px;
  padding: 18px 22px;
  margin: 30px 0;
  font-size: 13px;
  line-height: 1.7;
}
.formula-card h3 {
  font-size: 14px;
  color: #d4af6e;
  margin: 0 0 10px;
  font-weight: 700;
}
.formula-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 6px 16px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.formula-list li {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(255,255,255,0.05);
}
.formula-list strong { color: #d4af6e; font-weight: 700; }
.formula-list .neg { color: #ef4444; }

@media (max-width: 600px) {
  .leaderboard-podium { grid-template-columns: 1fr; gap: 30px; }
  .podium-slot.first { transform: none; }
}


/* Lock overlay close button */
.lock-overlay-inner { position: relative; }
.lock-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text-soft);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s ease;
}
.lock-close:hover {
  background: rgba(239,68,68,0.2);
  color: #ef4444;
  border-color: rgba(239,68,68,0.4);
}


/* === Course thumb: locked state with big lock SVG === */
.course-thumb.thumb-locked {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 0;
  transition: 0.25s ease;
}
.thumb-lock-svg {
  width: 80px;
  height: 100px;
  filter: drop-shadow(0 4px 14px rgba(0,0,0,0.45));
}
.thumb-locked-full {
  background: linear-gradient(135deg, #4a3915 0%, #2a1f0a 50%, #1a1208 100%);
  color: #d4af6e;
}
.thumb-locked-full .thumb-lock-svg {
  filter: drop-shadow(0 6px 20px rgba(212,175,110,0.5));
}
.thumb-locked-partial {
  background: linear-gradient(135deg, #2a2010 0%, #1a1a1a 100%);
  color: rgba(212,175,110,0.65);
}
.thumb-lock-label {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: inherit;
  padding: 6px 14px;
  background: rgba(0,0,0,0.4);
  border-radius: 20px;
  border: 1px solid currentColor;
}

/* Hide old overlay since we now use thumb */
.course-vip-overlay { display: none !important; }

.course-card.vip-course {
  border: 2px solid rgba(212,175,110,0.45);
  background: linear-gradient(180deg, rgba(212,175,110,0.04), rgba(15,15,15,0.6));
}
.course-card.vip-course:hover {
  border-color: #d4af6e;
  box-shadow: 0 12px 32px rgba(212,175,110,0.25);
  transform: translateY(-4px);
}
.course-card.has-vip-lessons {
  border: 1.5px solid rgba(212,175,110,0.25);
}

/* === Price line in course body === */
.course-price-line {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 10px;
  background: linear-gradient(135deg, rgba(212,175,110,0.18), rgba(139,107,58,0.08));
  border: 1px solid rgba(212,175,110,0.45);
  border-radius: 10px;
  padding: 10px 14px;
  margin: 14px 0 12px;
}
.course-price-line .price-label {
  font-size: 12px;
  color: var(--text-soft);
  font-weight: 500;
}
.course-price-line .price-value {
  font-size: 19px;
  color: #d4af6e;
  font-weight: 800;
  letter-spacing: -0.3px;
}
.course-price-line.price-partial {
  background: rgba(255,255,255,0.02);
  border-style: dashed;
  border-color: rgba(212,175,110,0.3);
}
.course-price-line.price-partial .price-value {
  font-size: 16px;
}


/* === QUIZ BUILDER (admin) === */
.quiz-builder {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
}
.quiz-builder-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.quiz-builder-header h3 {
  margin: 0 0 4px;
  font-size: 16px;
  color: #d4af6e;
}
.quiz-count {
  color: var(--text-mute);
  font-weight: 400;
  font-size: 13px;
  margin-left: 6px;
}
.quiz-q-row {
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.quiz-q-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.quiz-q-num {
  font-weight: 700;
  color: #d4af6e;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.btn-icon-x {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: #ef4444;
  width: 28px; height: 28px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}
.btn-icon-x:hover { background: rgba(239,68,68,0.3); }

.quiz-q-text {
  width: 100%;
  padding: 9px 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  margin-bottom: 8px;
}
.quiz-opt-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.quiz-opt-row input[type="radio"] {
  width: auto;
  flex-shrink: 0;
  cursor: pointer;
}
.quiz-opt-text {
  flex: 1;
  padding: 7px 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: #fff;
  font-size: 13px;
}
.quiz-q-hint {
  font-size: 11px;
  color: var(--text-mute);
  font-style: italic;
  margin-top: 4px;
}

/* === QUIZ USER-SIDE === */
.quiz-section {
  margin-top: 24px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px 26px;
}
.quiz-header {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--border);
}
.quiz-header h3 {
  margin: 0 0 6px;
  color: #d4af6e;
  font-size: 18px;
}
.quiz-subtitle {
  color: var(--text-soft);
  font-size: 13px;
}
.quiz-passed-badge {
  display: inline-block;
  background: rgba(74,222,128,0.15);
  color: #4ade80;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  margin-left: 8px;
}
.quiz-form { display: flex; flex-direction: column; gap: 16px; }
.quiz-q-user {
  background: rgba(255,255,255,0.025);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  transition: 0.2s ease;
}
.quiz-q-user.quiz-q-correct {
  border-color: rgba(74,222,128,0.5);
  background: rgba(74,222,128,0.05);
}
.quiz-q-user.quiz-q-wrong {
  border-color: rgba(239,68,68,0.5);
  background: rgba(239,68,68,0.05);
}
.quiz-q-text {
  font-weight: 600;
  margin-bottom: 12px;
  color: #fff;
  font-size: 14px;
}
.quiz-opt-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.18s ease;
  border: 1px solid transparent;
}
.quiz-opt-user:hover {
  background: rgba(212,175,110,0.08);
  border-color: rgba(212,175,110,0.25);
}
.quiz-opt-user input[type="radio"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #ef4444;            /* chấm tròn ĐỎ khi tick */
  flex-shrink: 0;
}
/* Khi user chọn option này → cả dòng đổi nền gold + viền đỏ rõ ràng */
.quiz-opt-user:has(input[type="radio"]:checked) {
  background: rgba(239,68,68,0.10);
  border-color: #ef4444;
  box-shadow: 0 0 0 2px rgba(239,68,68,0.15);
}
.quiz-opt-user:has(input[type="radio"]:checked) .quiz-opt-text {
  color: #fff;
  font-weight: 600;
}
.quiz-submit {
  align-self: flex-start;
  padding: 11px 26px;
  font-weight: 700;
  margin-top: 6px;
}
.quiz-result-card {
  margin-top: 14px;
  padding: 18px 20px;
  border-radius: 12px;
  text-align: center;
}
.quiz-result-card.passed {
  background: rgba(74,222,128,0.08);
  border: 1px solid rgba(74,222,128,0.4);
}
.quiz-result-card.failed {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.4);
}
.quiz-result-icon { font-size: 42px; margin-bottom: 8px; }
.quiz-result-score {
  font-size: 28px;
  font-weight: 800;
  color: #d4af6e;
  margin-bottom: 6px;
}
.quiz-result-msg {
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 12px;
}


/* === COUPON UI === */
.coupon-block {
  background: rgba(212,175,110,0.05);
  border: 1px dashed rgba(212,175,110,0.35);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 18px 0 12px;
}
.coupon-block > label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #d4af6e;
  margin-bottom: 8px;
}
.coupon-input-row {
  display: flex;
  gap: 8px;
}
.coupon-input-row input {
  flex: 1;
  padding: 9px 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.coupon-input-row input:focus {
  outline: none;
  border-color: #d4af6e;
  background: rgba(255,255,255,0.08);
}
.coupon-result {
  margin-top: 10px;
  font-size: 13px;
  min-height: 20px;
}
.coupon-ok {
  color: #4ade80;
  display: inline-block;
  background: rgba(74,222,128,0.08);
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgba(74,222,128,0.25);
  width: 100%;
  box-sizing: border-box;
}
.coupon-err {
  color: #ef4444;
}


/* Fix: select dropdown options invisible (white on white) */
select option {
  background: #1a1a1a;
  color: #fff;
}
select option:checked {
  background: #d4af6e;
  color: #000;
}

/* Quiz option letter prefix */
.quiz-opt-letter {
  display: inline-block;
  min-width: 22px;
  font-weight: 700;
  color: #d4af6e;
  font-size: 13px;
  text-align: center;
}



/* ============================================
   PHASE A — SETTINGS + DASHBOARD STYLES
   ============================================ */

/* ===== SETTINGS LAYOUT ===== */
.settings-layout {
  max-width: 1000px;
  margin: 32px auto;
  padding: 0 20px;
}
.settings-header { margin-bottom: 24px; }
.settings-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid rgba(212,175,110,0.2);
  margin-bottom: 24px;
  overflow-x: auto;
}
.settings-tab {
  background: transparent;
  border: none;
  color: #999;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all .15s;
  white-space: nowrap;
}
.settings-tab:hover { color: #d4af6e; }
.settings-tab.active {
  color: #d4af6e;
  border-bottom-color: #d4af6e;
}
.settings-section { display: none; }
.settings-section.active { display: block; }

.settings-card {
  background: #1a1a1a;
  border: 1px solid rgba(212,175,110,0.15);
  border-radius: 12px;
  padding: 28px;
}
.settings-card-title {
  font-size: 20px;
  font-weight: 700;
  color: #f4eddf;
  margin: 0 0 4px 0;
}
.settings-card-title.danger { color: #ef4444; }
.settings-card-desc {
  color: #999;
  font-size: 14px;
  margin: 0 0 22px 0;
}
.settings-actions {
  margin-top: 22px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ===== PROFILE TAB ===== */
.profile-avatar-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px;
  background: rgba(212,175,110,0.05);
  border-radius: 10px;
  margin-bottom: 22px;
}
.profile-avatar {
  width: 84px; height: 84px;
  border-radius: 50%;
  background: #d4af6e;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 800;
  flex-shrink: 0;
  border: 3px solid #2a2a2a;
}

/* ===== NOTIFICATION ROWS ===== */
.notif-list { display: flex; flex-direction: column; gap: 4px; }
.notif-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s;
}
.notif-row:hover { background: rgba(212,175,110,0.05); }
.notif-row-title {
  font-weight: 600;
  color: #f4eddf;
  font-size: 15px;
}
.notif-row-desc {
  color: #888;
  font-size: 13px;
  margin-top: 2px;
}

/* Toggle switch */
.switch {
  position: relative;
  width: 46px; height: 26px;
  flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute;
  inset: 0;
  background: #444;
  border-radius: 26px;
  transition: .2s;
  cursor: pointer;
}
.switch .slider::before {
  content: '';
  position: absolute;
  height: 20px; width: 20px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: .2s;
}
.switch input:checked + .slider { background: #d4af6e; }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* ===== SECURITY TAB ===== */
.security-google-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: rgba(212,175,110,0.05);
  border-radius: 10px;
  gap: 16px;
}
.danger-zone {
  border: 1px solid rgba(239,68,68,0.3) !important;
}
.danger-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: rgba(239,68,68,0.05);
  border-radius: 10px;
  gap: 16px;
}
.btn-danger {
  background: #ef4444;
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  font-size: 14px;
}
.btn-danger:hover { background: #dc2626; }

/* ===== PAYMENTS TAB ===== */
.payments-summary {
  color: #d4af6e;
  font-weight: 700;
  font-size: 14px;
}
.payments-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 14px;
}
.payments-table th {
  text-align: left;
  padding: 12px;
  background: rgba(212,175,110,0.08);
  color: #d4af6e;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1px solid rgba(212,175,110,0.2);
}
.payments-table td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  color: #ddd;
  vertical-align: top;
}
.payments-table tbody tr:hover { background: rgba(212,175,110,0.04); }
.pay-status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.pay-status.approved { background: rgba(74,222,128,0.15); color: #4ade80; }
.pay-status.pending  { background: rgba(212,175,110,0.15); color: #d4af6e; }
.pay-status.rejected { background: rgba(239,68,68,0.15); color: #ef4444; }
.pay-status.fraud    { background: rgba(239,68,68,0.3); color: #fff; }

/* ===== DASHBOARD LAYOUT ===== */
.dashboard-layout {
  max-width: 1100px;
  margin: 24px auto 48px;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* Welcome card */
.dash-welcome {
  background: linear-gradient(135deg, rgba(212,175,110,0.18), rgba(212,175,110,0.04));
  border: 1px solid rgba(212,175,110,0.3);
  border-radius: 16px;
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.dash-greet {
  font-size: 28px;
  font-weight: 800;
  color: #f4eddf;
  margin: 0;
}
.dash-greet-sub {
  color: #bbb;
  margin: 6px 0 18px 0;
  font-size: 15px;
}
.dash-stat-row {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}
.dash-stat-num {
  font-size: 28px;
  font-weight: 800;
  color: #d4af6e;
}
.dash-stat-label {
  color: #999;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-top: 2px;
}

/* Level card */
.dash-level-card {
  background: #1a1a1a;
  border: 1px solid rgba(212,175,110,0.2);
  border-radius: 14px;
  padding: 22px 26px;
}
.dash-level-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 12px;
}
.dash-level-label {
  color: #999;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.dash-level-num {
  font-size: 24px;
  font-weight: 800;
  color: #d4af6e;
}
.dash-level-xp { color: #ddd; font-weight: 700; font-size: 14px; }
.dash-level-bar {
  height: 12px;
  background: #2a2a2a;
  border-radius: 6px;
  overflow: hidden;
}
.dash-level-fill {
  height: 100%;
  background: linear-gradient(90deg, #d4af6e, #f4eddf);
  transition: width .6s ease-out;
}
.dash-level-foot {
  color: #999;
  font-size: 13px;
  margin-top: 10px;
  text-align: center;
}

/* Dashboard grid */
.dash-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 22px;
}
@media (max-width: 800px) { .dash-grid { grid-template-columns: 1fr; } }

.dash-card {
  background: #1a1a1a;
  border: 1px solid rgba(212,175,110,0.15);
  border-radius: 14px;
  padding: 22px;
}
.dash-card-title {
  font-size: 16px;
  font-weight: 700;
  color: #f4eddf;
  margin: 0 0 16px 0;
}

/* Continue card */
.dash-card-continue { display: flex; flex-direction: column; }
.continue-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.continue-course-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.continue-course-title {
  font-size: 18px;
  font-weight: 700;
  color: #d4af6e;
  margin: 0;
}
.continue-next-label {
  color: #999;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-top: 6px;
}
.continue-next-title {
  font-size: 15px;
  font-weight: 600;
  color: #f4eddf;
}
.continue-progress { margin-top: 8px; }
.continue-progress-bar {
  height: 6px;
  background: #2a2a2a;
  border-radius: 3px;
  overflow: hidden;
}
.continue-progress-fill {
  height: 100%;
  background: #d4af6e;
}
.continue-progress-text {
  color: #999;
  font-size: 12px;
  margin-top: 4px;
}
.continue-cta { margin-top: 12px; text-align: center; }
.continue-empty {
  text-align: center;
  color: #999;
  padding: 24px 0;
}
.vip-tag {
  background: linear-gradient(135deg, #d4af6e, #f4eddf);
  color: #000;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 10px;
  display: inline-block;
}

/* Quick grid */
.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.quick-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(212,175,110,0.05);
  border: 1px solid rgba(212,175,110,0.15);
  border-radius: 10px;
  color: #f4eddf;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  transition: all .15s;
}
.quick-tile:hover {
  background: rgba(212,175,110,0.12);
  border-color: #d4af6e;
  transform: translateY(-2px);
}
.quick-icon { font-size: 24px; margin-bottom: 6px; }

/* Recent courses */
.dash-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.btn-link {
  color: #d4af6e;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.btn-link:hover { text-decoration: underline; }
.recent-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 760px) { .recent-grid { grid-template-columns: 1fr; } }
.recent-tile {
  background: #1a1a1a;
  border: 1px solid rgba(212,175,110,0.15);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: transform .15s, border-color .15s;
  display: flex;
  flex-direction: column;
}
.recent-tile:hover {
  transform: translateY(-3px);
  border-color: rgba(212,175,110,0.4);
}
.recent-thumb {
  background: linear-gradient(135deg, rgba(212,175,110,0.2), rgba(212,175,110,0.05));
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: #d4af6e;
}
.recent-body { padding: 14px; }
.recent-body h4 {
  margin: 6px 0;
  font-size: 15px;
  color: #f4eddf;
  font-weight: 700;
}
.recent-meta {
  display: flex;
  justify-content: space-between;
  color: #888;
  font-size: 12px;
  margin-top: 6px;
}

/* Support card */
.dash-support {
  background: linear-gradient(135deg, rgba(74,222,128,0.08), rgba(74,222,128,0.02));
  border: 1px solid rgba(74,222,128,0.25);
  border-radius: 14px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.dash-support-icon { font-size: 36px; }
.dash-support-body { flex: 1; min-width: 200px; }
.dash-support-body h3 { margin: 0; color: #f4eddf; font-size: 16px; }
.dash-support-body p { margin: 4px 0 0 0; color: #aaa; font-size: 13px; }

/* Form row utility used by settings */
.form-row.single { grid-template-columns: 1fr; }

/* ===== HEADER NAV (Phase A) ===== */
.header-nav {
  display: flex;
  gap: 4px;
  align-items: center;
}
.btn-header.active {
  background: rgba(212,175,110,0.15);
  color: #d4af6e !important;
  border-color: rgba(212,175,110,0.4);
}
@media (max-width: 760px) {
  .header-nav { display: none; }
  /* Mobile: chỉ giữ Avatar + logout, nav ẩn (user vào dashboard.html sẽ thấy quick-tile) */
}



/* ============================================
   PHASE B — SOCIAL PROOF + FREEZE + MY COURSES
   ============================================ */

/* Social proof bar (top dashboard) */
.social-proof-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(90deg, rgba(74,222,128,0.12), rgba(212,175,110,0.12));
  border: 1px solid rgba(74,222,128,0.25);
  border-radius: 50px;
  padding: 10px 20px;
  margin-bottom: 6px;
  font-size: 13px;
  color: #f4eddf;
  font-weight: 500;
  min-height: 40px;
  overflow: hidden;
}
.social-proof-text {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: center;
}
.sp-icon { font-size: 16px; }
.sp-time { color: #888; font-weight: 400; font-size: 12px; }

/* Freeze badge */
.freeze-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(99,179,237,0.15);
  color: #63b3ed;
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  margin-top: 4px;
  cursor: help;
}

/* My Courses page */
.my-courses-header { margin: 24px 0 18px 0; }
.my-courses-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid rgba(212,175,110,0.2);
  margin-bottom: 24px;
  overflow-x: auto;
}
.mc-tab {
  background: transparent;
  border: none;
  color: #999;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.mc-tab:hover { color: #d4af6e; }
.mc-tab.active {
  color: #d4af6e;
  border-bottom-color: #d4af6e;
}
.mc-count {
  background: rgba(212,175,110,0.2);
  color: #d4af6e;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 700;
}
.mc-tab.active .mc-count {
  background: #d4af6e;
  color: #000;
}

.my-courses-cta-block {
  margin-top: 32px;
  text-align: center;
  padding: 28px;
  background: rgba(212,175,110,0.05);
  border: 1px dashed rgba(212,175,110,0.3);
  border-radius: 12px;
}
.my-courses-cta-block h3 { color: #d4af6e; margin: 0 0 8px; }
.my-courses-cta-block p { color: #aaa; margin: 0 0 16px; }

/* CTA chữ trong course card (Phase B) */
.course-cta {
  text-align: center;
  background: #d4af6e;
  color: #000;
  padding: 8px 0;
  border-radius: 6px;
  font-weight: 700;
  font-size: 13px;
  margin-top: 10px;
}



/* ============================================
   PHASE C — TELEGRAM CARD
   ============================================ */
.telegram-card {
  background: linear-gradient(135deg, #1a1a1a 0%, rgba(99,179,237,0.05) 100%);
  border-color: rgba(99,179,237,0.2) !important;
}
.telegram-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.telegram-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.telegram-badge.linked {
  background: rgba(74,222,128,0.18);
  color: #4ade80;
}
.telegram-badge.unlinked {
  background: rgba(255,255,255,0.08);
  color: #999;
}



/* ============================================
   MOBILE RESPONSIVE PASS (Phase R)
   Breakpoints: 768px (tablet) · 480px (phone)
   ============================================ */

/* ----- HAMBURGER + MOBILE DRAWER ----- */
.hamburger-btn {
  display: none;
  background: transparent;
  border: 1px solid rgba(212,175,110,0.3);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  padding: 0;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}
.hamburger-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: #d4af6e;
  border-radius: 1px;
}

.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: none;
}
.mobile-drawer.open { display: block; }
.mobile-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  animation: fadeIn .2s ease;
}
.mobile-drawer-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 280px;
  max-width: 80vw;
  background: #1a1a1a;
  border-left: 1px solid rgba(212,175,110,0.2);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  animation: slideInRight .25s ease;
}
.mobile-drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(212,175,110,0.15);
}
.mobile-drawer-close {
  background: transparent;
  border: none;
  color: #f4eddf;
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
  padding: 0 6px;
}
.mobile-drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.mobile-drawer-nav .btn-header {
  display: block;
  text-align: left;
  padding: 12px 14px;
  border-radius: 8px;
  width: 100%;
  font-size: 15px;
}
.mobile-drawer-nav .btn-header.active {
  background: rgba(212,175,110,0.15);
  color: #d4af6e !important;
}

@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes slideInRight {
  from { transform: translateX(100%) } to { transform: translateX(0) }
}

/* ----- TABLET (≤768px) ----- */
@media (max-width: 768px) {
  /* Header */
  .header-inner { padding: 12px 14px; }
  .header-nav { display: none !important; }
  .user-chip .name { display: none; }
  .user-chip .badge { display: none; }
  .desktop-only { display: none !important; }
  .hamburger-btn { display: inline-flex; }

  /* Containers */
  .container, .dashboard-layout, .settings-layout, .admin-layout {
    padding: 0 14px;
  }
  .page-title { font-size: 22px; }
  .page-subtitle { font-size: 14px; }

  /* Welcome card */
  .dash-welcome {
    flex-direction: column;
    align-items: stretch;
    padding: 20px;
    gap: 14px;
  }
  .dash-welcome-right { width: 100%; }
  .dash-welcome-right .btn { width: 100%; text-align: center; }
  .dash-greet { font-size: 22px; }
  .dash-stat-row { gap: 16px; flex-wrap: wrap; }
  .dash-stat-num { font-size: 22px; }

  /* Level card */
  .dash-level-card { padding: 16px 18px; }
  .dash-level-num { font-size: 20px; }

  /* Grid */
  .dash-grid { grid-template-columns: 1fr; gap: 14px; }
  .dash-card { padding: 16px; }
  .recent-grid { grid-template-columns: 1fr 1fr; gap: 10px; }

  /* Course grid */
  .course-grid { grid-template-columns: 1fr; gap: 12px; }
  .course-card { width: 100%; }

  /* Settings */
  .settings-card { padding: 18px; }
  .settings-tabs { gap: 4px; }
  .settings-tab { padding: 12px 14px; font-size: 13px; }
  .form-row { grid-template-columns: 1fr !important; gap: 12px; }
  .settings-actions { flex-direction: column; }
  .settings-actions .btn { width: 100%; }
  .profile-avatar-row { flex-direction: column; align-items: flex-start; }
  .telegram-card-head { flex-direction: column; align-items: flex-start; }
  .security-google-row, .danger-row { flex-direction: column; align-items: stretch; gap: 12px; }
  .security-google-row .btn, .danger-row .btn { width: 100%; text-align: center; }

  /* My courses tabs */
  .my-courses-tabs { gap: 4px; }
  .mc-tab { padding: 10px 12px; font-size: 12px; }
  .mc-count { font-size: 10px; }

  /* Social proof bar */
  .social-proof-bar { font-size: 12px; padding: 8px 14px; }
}

@media (max-width: 768px) {
  /* Course player (course.html) */
  .course-layout { flex-direction: column !important; }
  .course-sidebar, .course-main {
    width: 100% !important;
    max-width: 100% !important;
  }
  .course-video, .course-video iframe, .course-video video {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16/9;
  }
  .lesson-list { max-height: 280px; overflow-y: auto; }

  /* Admin layout — scroll ngang thay vì wrap nhiều hàng (10+ tabs) */
  .admin-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    width: 100%;
    max-width: 100%;
    padding: 4px;
    gap: 4px;
    -ms-overflow-style: none;
  }
  .admin-tabs::-webkit-scrollbar { height: 4px; }
  .admin-tabs::-webkit-scrollbar-thumb { background: rgba(212,175,110,0.3); border-radius: 2px; }
  .admin-tab {
    padding: 10px 14px;
    font-size: 13px;
    flex: 0 0 auto;          /* không co lại */
    white-space: nowrap;
    min-width: 0;
  }
  .admin-card { padding: 14px; border-radius: 10px; margin-bottom: 12px; }
  .admin-card-header { flex-direction: column; align-items: stretch; gap: 10px; }
  .admin-card-header .btn { width: 100%; }
  .admin-card-title { font-size: 16px; }

  /* Admin tables: horizontal scroll on parent container */
  #users-container, #pendings-container, #payments-container,
  #courses-container, #coupons-container,
  .table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .users-table, .payments-table { min-width: 560px; }
  table th, table td { padding: 10px 8px !important; font-size: 13px; }

  /* Modal */
  .modal-overlay { padding: 10px; }
  .modal {
    max-width: 95vw !important;
    max-height: 90vh;
    overflow-y: auto;
    margin: auto;
  }
  .modal-body { padding: 14px; }
  .modal-footer { flex-direction: column; gap: 8px; }
  .modal-footer .btn { width: 100%; }

  /* Leaderboard */
  .leaderboard-table { font-size: 13px; }
  .leaderboard-table th, .leaderboard-table td { padding: 10px 6px; }

  /* Login / Landing */
  .login-card, .landing-hero {
    padding: 24px 18px;
    margin: 16px;
  }
  .login-card { width: auto; max-width: 100%; }
  .landing-hero h1 { font-size: 28px; }
  .landing-features { grid-template-columns: 1fr; }

  /* Payments table (settings tab Thanh toán) */
  .payments-table { font-size: 12px; }
  .payments-table th, .payments-table td { padding: 10px 6px; }

  /* Touch target: ensure buttons are tappable */
  .btn, .btn-header, .btn-sm { min-height: 40px; }
  input, textarea, select { font-size: 16px !important; } /* Avoid iOS zoom */
}

/* ----- PHONE (≤480px) ----- */
@media (max-width: 480px) {
  .header-inner { padding: 10px 12px; }
  .logo span:last-child { font-size: 18px; }
  .dash-stat { flex: 1 1 30%; min-width: 0; }
  .dash-stat-num { font-size: 20px; }
  .dash-stat-label { font-size: 11px; }
  .quick-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .quick-tile { padding: 14px 10px; font-size: 12px; }
  .recent-grid { grid-template-columns: 1fr; }
  .dash-card-title { font-size: 14px; }
  .settings-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .settings-tab { white-space: nowrap; }
  .telegram-badge { align-self: flex-start; }
}

/* ----- IPHONE NOTCH SAFE AREA ----- */
@supports (padding: env(safe-area-inset-bottom)) {
  .site-header { padding-top: env(safe-area-inset-top); }
  .site-footer { padding-bottom: env(safe-area-inset-bottom); }
}



/* ============================================
   VIDEO PROTECTION (chặn tải Drive + fullscreen custom)
   ============================================ */
.video-protect-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  background: #000;
  border: 1px solid rgba(212,175,110,0.15);
}
.video-protect-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Blocker che góc trên phải iframe (nút "↗" mở Drive page) */
.video-corner-blocker {
  position: absolute;
  top: 0;
  right: 0;
  width: 90px;
  height: 56px;
  background: transparent;
  z-index: 5;
  cursor: not-allowed;
  -webkit-touch-callout: none; /* iOS: chặn long-press menu */
  -webkit-user-select: none;
  user-select: none;
}

/* Custom fullscreen button (góc dưới phải) */
.video-fullscreen-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  border: 1px solid rgba(212,175,110,0.4);
  cursor: pointer;
  font-size: 18px;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  opacity: 0.7;
}
.video-fullscreen-btn:hover {
  opacity: 1;
  background: rgba(212,175,110,0.9);
  color: #000;
  transform: scale(1.08);
}

/* Fullscreen mode: làm full viewport */
.video-protect-wrap:fullscreen {
  width: 100vw;
  height: 100vh;
  aspect-ratio: unset;
  border-radius: 0;
}
.video-protect-wrap:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  aspect-ratio: unset;
  border-radius: 0;
}

@media (max-width: 768px) {
  .video-corner-blocker { width: 60px; height: 44px; }
  .video-fullscreen-btn { width: 44px; height: 44px; font-size: 20px; }
}



/* ===== PSEUDO-FULLSCREEN (CSS-based, work iOS Safari) ===== */
.video-protect-wrap.pseudo-fs {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  aspect-ratio: unset !important;
  border-radius: 0 !important;
  z-index: 99999 !important;
  background: #000 !important;
}
.video-protect-wrap.pseudo-fs .video-fullscreen-btn {
  width: 48px;
  height: 48px;
  font-size: 22px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border-color: rgba(255,255,255,0.4);
  opacity: 1;
}

/* ===== MOBILE — chặn TOÀN bộ thanh top của Drive iframe ===== */
@media (max-width: 768px) {
  .video-corner-blocker {
    width: 100%;    /* full width chặn cả title + menu + open-external */
    height: 60px;
  }
  /* Khi fullscreen mobile, blocker vẫn che top */
  .video-protect-wrap.pseudo-fs .video-corner-blocker {
    height: 72px;
  }
}

/* iOS Safari: chặn long-press menu trên iframe vùng video */
.video-protect-wrap {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}



/* ============================================
   APP SHELL — Sidebar trái (Kohada-style)
   ============================================ */
:root {
  --sidebar-w: 260px;
  --topbar-h: 64px;
}

/* Khi shell active, body padding-left để content shift sang phải */
body.has-app-shell {
  padding-left: var(--sidebar-w);
  padding-top: var(--topbar-h);
  transition: padding .25s ease;
}

/* Hide legacy header */
body.has-app-shell .site-header { display: none !important; }

/* ===== SIDEBAR ===== */
.app-sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: #0f0f0f;
  border-right: 1px solid rgba(212,175,110,0.1);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Brand top */
.sidebar-brand {
  display: flex;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(212,175,110,0.08);
  gap: 10px;
  position: relative;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex: 1;
  min-width: 0;
}
.sidebar-logo .logo-mark {
  width: 36px;
  height: 36px;
  background: #d4af6e;
  color: #000;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  flex-shrink: 0;
}
.sidebar-brand-text { min-width: 0; }
.brand-name {
  font-weight: 700;
  font-size: 15px;
  color: #f4eddf;
  line-height: 1.2;
}
.brand-sub {
  font-size: 11px;
  color: #888;
  margin-top: 2px;
}
.sidebar-close {
  display: none;
  background: transparent;
  border: none;
  color: #f4eddf;
  font-size: 26px;
  cursor: pointer;
  padding: 0 6px;
  line-height: 1;
}

/* Nav vertical */
.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 12px;
  overflow-y: auto;
}
.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  color: #bbb;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all .15s;
}
.sidebar-nav-item:hover {
  background: rgba(212,175,110,0.08);
  color: #f4eddf;
}
.sidebar-nav-item.active {
  background: rgba(212,175,110,0.15);
  color: #d4af6e;
  font-weight: 600;
}
.sidebar-nav-icon { font-size: 18px; flex-shrink: 0; width: 22px; text-align: center; }
.sidebar-nav-label { flex: 1; }

/* Support card */
.sidebar-support {
  margin: 0 12px 12px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(212,175,110,0.12), rgba(74,222,128,0.06));
  border: 1px solid rgba(212,175,110,0.2);
  border-radius: 12px;
  text-align: center;
}
.sidebar-support .support-icon { font-size: 24px; margin-bottom: 6px; }
.sidebar-support .support-title {
  color: #d4af6e;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
}
.sidebar-support .support-desc {
  color: #999;
  font-size: 11px;
  margin-bottom: 10px;
  line-height: 1.4;
}
.sidebar-support .btn { display: block; width: 100%; font-size: 12px; padding: 8px 10px; }

/* User chip bottom */
.sidebar-user {
  padding: 14px;
  border-top: 1px solid rgba(212,175,110,0.08);
}
.sidebar-user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  margin-bottom: 8px;
}
.sidebar-user-chip img,
.sidebar-user-chip .avatar-fallback {
  width: 36px; height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
}
.avatar-fallback {
  background: #d4af6e;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}
.sidebar-user-text { flex: 1; min-width: 0; }
.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: #f4eddf;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-email {
  font-size: 11px;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 9px;
  background: transparent;
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 8px;
  color: #ef4444;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.sidebar-logout:hover {
  background: rgba(239,68,68,0.1);
}

/* ===== TOP BAR ===== */
.app-topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--topbar-h);
  background: rgba(15,15,15,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(212,175,110,0.1);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  z-index: 90;
  transition: left .25s ease;
}
.topbar-title {
  font-size: 17px;
  font-weight: 700;
  color: #f4eddf;
  margin: 0;
}
.topbar-spacer { flex: 1; }
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(212,175,110,0.15);
  border-radius: 24px;
  cursor: pointer;
  max-width: 340px;
  flex-shrink: 0;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.topbar-user-chip:hover {
  background: rgba(212,175,110,0.10);
  border-color: rgba(212,175,110,0.45);
}
.topbar-user-chip:active { transform: scale(0.98); }
.topbar-user-chip img,
.topbar-user-chip .avatar-fallback {
  width: 30px; height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
}
.topbar-user-chip .name {
  font-size: 13px;
  font-weight: 600;
  color: #f4eddf;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}
.topbar-user-chip .badge {
  background: #d4af6e;
  color: #000;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 8px;
  flex-shrink: 0;
}

/* Sidebar backdrop (mobile) */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 95;
  animation: fadeIn .2s ease;
}
.sidebar-backdrop.open { display: block; }

/* Hamburger ẩn ở desktop */
.app-topbar .hamburger-btn {
  display: none;
  background: transparent;
  border: 1px solid rgba(212,175,110,0.3);
  border-radius: 8px;
  width: 40px; height: 40px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0;
}
.app-topbar .hamburger-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: #d4af6e;
}

/* ===== MOBILE: sidebar off-canvas ===== */
@media (max-width: 768px) {
  body.has-app-shell {
    padding-left: 0;
  }
  .app-sidebar {
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
  }
  .app-sidebar.open {
    transform: translateX(0);
  }
  .sidebar-close { display: inline-flex; align-items: center; }
  .app-topbar {
    left: 0;
    padding: 0 14px;
  }
  .app-topbar .hamburger-btn { display: inline-flex; }
  .topbar-title { font-size: 15px; }
  .topbar-user-chip .name { display: none; }
  .topbar-user-chip { padding: 4px; }
}

/* ===== Cleanup styles cũ liên quan tới horizontal header ===== */
body.has-app-shell .mobile-drawer { display: none !important; }
body.has-app-shell .header-nav,
body.has-app-shell .user-chip,
body.has-app-shell .btn-header { display: none; }


/* ===== Custom scrollbar (sidebar + global) ===== */
.app-sidebar::-webkit-scrollbar,
.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}
.app-sidebar::-webkit-scrollbar-thumb,
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(212,175,110,0.25);
  border-radius: 4px;
}
.app-sidebar::-webkit-scrollbar-thumb:hover,
.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(212,175,110,0.55);
}
.app-sidebar::-webkit-scrollbar-track,
.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}
/* Firefox */
.app-sidebar, .sidebar-nav {
  scrollbar-width: thin;
  scrollbar-color: rgba(212,175,110,0.3) transparent;
}

/* Global page scrollbar đẹp hơn */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb {
  background: rgba(212,175,110,0.25);
  border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(212,175,110,0.5);
}
::-webkit-scrollbar-track { background: transparent; }



/* ============================================
   CHAT AI WIDGET — floating button + panel
   ============================================ */
#chat-widget-host { position: fixed; bottom: 0; right: 0; z-index: 9990; }

#chat-fab {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 60px; height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d4af6e, #b8954c);
  border: none;
  color: #000;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(212,175,110,0.4);
  transition: all .2s;
  font-size: 26px;
}
#chat-fab:hover { transform: scale(1.08); box-shadow: 0 12px 32px rgba(212,175,110,0.6); }
.fab-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid #d4af6e;
  animation: fabPulse 2s ease-out infinite;
  pointer-events: none;
}
@keyframes fabPulse {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}

#chat-panel {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100vh - 48px);
  background: #1a1a1a;
  border: 1px solid rgba(212,175,110,0.25);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(135deg, #2a1f0a, #1a1305);
  border-bottom: 1px solid rgba(212,175,110,0.2);
}
.chat-head-info { display: flex; align-items: center; gap: 12px; }
.chat-head-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d4af6e, #b8954c);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.chat-head-name { font-weight: 700; color: #f4eddf; font-size: 15px; }
.chat-head-sub { color: #d4af6e; font-size: 12px; }
.chat-close {
  background: transparent;
  border: none;
  color: #aaa;
  font-size: 26px;
  cursor: pointer;
  padding: 0 6px;
  line-height: 1;
}
.chat-close:hover { color: #f4eddf; }

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-msg { display: flex; }
.chat-msg.user { justify-content: flex-end; }
.chat-msg.bot { justify-content: flex-start; }
.chat-bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
}
.chat-msg.user .chat-bubble {
  background: #d4af6e;
  color: #000;
  border-bottom-right-radius: 4px;
}
.chat-msg.bot .chat-bubble {
  background: #2a2a2a;
  color: #f4eddf;
  border-bottom-left-radius: 4px;
}

.chat-suggested {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.chat-sugg-btn {
  background: rgba(212,175,110,0.08);
  border: 1px solid rgba(212,175,110,0.2);
  border-radius: 18px;
  padding: 8px 14px;
  text-align: left;
  font-size: 12px;
  color: #ddd;
  cursor: pointer;
  transition: all .15s;
}
.chat-sugg-btn:hover {
  background: rgba(212,175,110,0.15);
  border-color: #d4af6e;
  color: #f4eddf;
}

.chat-input-wrap {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid rgba(212,175,110,0.15);
}
#chat-input {
  flex: 1;
  background: #0f0f0f;
  border: 1px solid rgba(212,175,110,0.2);
  border-radius: 20px;
  padding: 10px 14px;
  color: #f4eddf;
  font-size: 13px;
  outline: none;
}
#chat-input:focus { border-color: #d4af6e; }
#chat-send {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #d4af6e;
  color: #000;
  border: none;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
#chat-send:hover { background: #b8954c; }

.chat-footer {
  text-align: center;
  font-size: 10px;
  color: #666;
  padding: 6px 0 10px;
}

/* Loading dots */
.chat-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  height: 16px;
}
.chat-dots span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #888;
  animation: dotPulse 1.4s ease-in-out infinite;
}
.chat-dots span:nth-child(2) { animation-delay: .2s; }
.chat-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes dotPulse {
  0%, 60%, 100% { transform: scale(1); opacity: .5; }
  30% { transform: scale(1.2); opacity: 1; }
}

@media (max-width: 480px) {
  #chat-panel {
    right: 12px; left: 12px;
    width: auto;
    bottom: 12px;
    height: calc(100vh - 80px);
  }
  #chat-fab { bottom: 16px; right: 16px; width: 54px; height: 54px; }
}



/* ============================================
   BLOG STYLES
   ============================================ */
.blog-header { margin: 28px 0 20px; }
.blog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.filter-pill {
  background: transparent;
  border: 1px solid rgba(212,175,110,0.25);
  color: #aaa;
  border-radius: 18px;
  padding: 7px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}
.filter-pill:hover { background: rgba(212,175,110,0.08); color: #d4af6e; }
.filter-pill.active { background: #d4af6e; color: #000; border-color: #d4af6e; font-weight: 600; }

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 20px;
}
.blog-card {
  background: #1a1a1a;
  border: 1px solid rgba(212,175,110,0.15);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: all .2s;
  display: flex;
  flex-direction: column;
}
.blog-card:hover { transform: translateY(-3px); border-color: rgba(212,175,110,0.4); }
.blog-card.featured { border-color: rgba(212,175,110,0.5); box-shadow: 0 8px 24px rgba(212,175,110,0.12); }
.blog-card-cover {
  height: 180px;
  background-size: cover;
  background-position: center;
  background-color: #2a2a2a;
  position: relative;
}
.blog-featured-badge {
  position: absolute; top: 10px; left: 10px;
  background: linear-gradient(135deg, #d4af6e, #f4eddf);
  color: #000;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 10px;
}
.blog-card-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.blog-card-cat {
  display: inline-block;
  background: rgba(212,175,110,0.12);
  color: #d4af6e;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 10px;
  align-self: flex-start;
}
.blog-card-title {
  font-size: 16px;
  font-weight: 700;
  color: #f4eddf;
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-card-excerpt {
  font-size: 13px;
  color: #aaa;
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.blog-card-meta {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: #888;
  margin-top: auto;
}
.blog-card-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.blog-tag {
  background: rgba(212,175,110,0.06);
  border: 1px solid rgba(212,175,110,0.15);
  color: #d4af6e;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 6px;
}

/* Blog post detail */
.blog-post-container { max-width: 760px; margin: 28px auto; padding: 0 20px; }
.blog-back-link {
  display: inline-block;
  color: #d4af6e;
  text-decoration: none;
  font-size: 13px;
  margin-bottom: 20px;
}
.blog-back-link:hover { text-decoration: underline; }
.blog-post-cover {
  height: 340px;
  background-size: cover;
  background-position: center;
  background-color: #2a2a2a;
  border-radius: 14px;
  margin-bottom: 22px;
}
.blog-post-meta-top { display: flex; gap: 10px; margin-bottom: 14px; }
.blog-post-title {
  font-size: 34px;
  line-height: 1.25;
  color: #f4eddf;
  margin: 8px 0 14px;
}
.blog-post-excerpt {
  font-size: 17px;
  color: #bbb;
  line-height: 1.6;
  margin: 0 0 22px;
}
.blog-post-author {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-top: 1px solid rgba(212,175,110,0.15);
  border-bottom: 1px solid rgba(212,175,110,0.15);
  margin-bottom: 30px;
}
.blog-author-info strong {
  display: block;
  color: #d4af6e;
  font-size: 14px;
}
.blog-author-info span {
  color: #888;
  font-size: 12px;
}
.blog-post-content { font-size: 16px; line-height: 1.75; color: #ddd; }
.blog-post-tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 30px 0; }
.blog-post-footer { text-align: center; padding: 30px 0; border-top: 1px solid rgba(212,175,110,0.15); }

/* Markdown rendering */
.markdown-body h1, .markdown-body h2, .markdown-body h3 { color: #f4eddf; margin: 24px 0 12px; }
.markdown-body h1 { font-size: 28px; }
.markdown-body h2 { font-size: 22px; }
.markdown-body h3 { font-size: 18px; }
.markdown-body p { margin: 12px 0; }
.markdown-body ul, .markdown-body ol { padding-left: 24px; margin: 12px 0; }
.markdown-body li { margin: 6px 0; }
.markdown-body a { color: #d4af6e; }
.markdown-body code {
  background: rgba(212,175,110,0.1);
  color: #d4af6e;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}
.markdown-body pre {
  background: #0f0f0f;
  border: 1px solid rgba(212,175,110,0.15);
  border-radius: 8px;
  padding: 14px;
  overflow-x: auto;
}
.markdown-body pre code { background: transparent; color: #ddd; padding: 0; }
.markdown-body blockquote {
  border-left: 3px solid #d4af6e;
  padding-left: 14px;
  margin: 16px 0;
  color: #aaa;
  font-style: italic;
}
.markdown-body img { max-width: 100%; border-radius: 8px; margin: 16px 0; }
.markdown-body hr { border: none; border-top: 1px solid rgba(212,175,110,0.15); margin: 24px 0; }

/* Editor */
.blog-editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}
@media (max-width: 900px) { .blog-editor-grid { grid-template-columns: 1fr; } }
.blog-editor-form, .blog-editor-preview {
  background: #1a1a1a;
  border: 1px solid rgba(212,175,110,0.15);
  border-radius: 12px;
  padding: 20px;
}
.editor-preview-label {
  font-size: 12px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(212,175,110,0.1);
}



/* ============================================
   COMMUNITY FEED STYLES
   ============================================ */
.cm-composer {
  background: #1a1a1a;
  border: 1px solid rgba(212,175,110,0.18);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 22px;
}
.cm-composer-head {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}
.cm-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: #d4af6e;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}
#cm-content {
  flex: 1;
  background: #0f0f0f;
  border: 1px solid rgba(212,175,110,0.15);
  border-radius: 10px;
  padding: 12px 14px;
  color: #f4eddf;
  resize: vertical;
  font-size: 14px;
}
#cm-content:focus { outline: none; border-color: #d4af6e; }
.cm-composer-tools {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
#cm-image-url, #cm-link-url {
  flex: 1;
  min-width: 200px;
  background: #0f0f0f;
  border: 1px solid rgba(212,175,110,0.15);
  border-radius: 8px;
  padding: 8px 12px;
  color: #f4eddf;
  font-size: 12px;
}

.cm-feed { display: flex; flex-direction: column; gap: 16px; }
.cm-post {
  background: #1a1a1a;
  border: 1px solid rgba(212,175,110,0.15);
  border-radius: 14px;
  padding: 18px;
}
.cm-post-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.cm-post-meta { flex: 1; }
.cm-post-meta strong { color: #f4eddf; font-size: 14px; display: block; }
.cm-post-meta span { color: #888; font-size: 12px; }
.cm-del-btn {
  background: transparent;
  border: 1px solid rgba(239,68,68,0.3);
  color: #ef4444;
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.cm-del-btn:hover { background: rgba(239,68,68,0.1); }

.cm-post-content {
  color: #ddd;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 12px;
  white-space: pre-wrap;
}
.cm-post-img {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 12px;
}
.cm-post-link {
  display: block;
  background: rgba(212,175,110,0.06);
  border: 1px solid rgba(212,175,110,0.15);
  color: #d4af6e;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  text-decoration: none;
  margin-bottom: 12px;
  word-break: break-all;
}
.cm-post-actions {
  display: flex;
  gap: 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(212,175,110,0.1);
}
.cm-like, .cm-comment-toggle {
  background: transparent;
  border: none;
  color: #aaa;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 6px;
}
.cm-like:hover, .cm-comment-toggle:hover { background: rgba(212,175,110,0.06); color: #d4af6e; }
.cm-like.liked { color: #ef4444; }

.cm-comments {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(212,175,110,0.1);
}
.cm-comment {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  align-items: flex-start;
}
.cm-comment-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(212,175,110,0.15);
  color: #d4af6e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}
.cm-comment-body { flex: 1; font-size: 13px; color: #ddd; line-height: 1.5; }
.cm-comment-composer {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(212,175,110,0.08);
}
.cm-cinput {
  flex: 1;
  background: #0f0f0f;
  border: 1px solid rgba(212,175,110,0.15);
  border-radius: 18px;
  padding: 8px 14px;
  color: #f4eddf;
  font-size: 13px;
}



/* ============================================
   AFFILIATE PAGE STYLES
   ============================================ */
.aff-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.aff-stat-card {
  background: linear-gradient(135deg, #1a1a1a, rgba(212,175,110,0.04));
  border: 1px solid rgba(212,175,110,0.18);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
}
.aff-stat-icon { font-size: 28px; margin-bottom: 6px; }
.aff-stat-num {
  font-size: 28px;
  font-weight: 800;
  color: #d4af6e;
  line-height: 1.2;
  margin: 4px 0;
}
.aff-stat-label { color: #888; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }

.aff-link-card {
  background: #1a1a1a;
  border: 1px solid rgba(212,175,110,0.18);
  border-radius: 14px;
  padding: 20px;
}
.aff-link-row {
  display: flex;
  gap: 10px;
  margin: 14px 0;
}
#aff-link-input {
  flex: 1;
  background: rgba(212,175,110,0.06);
  border: 1px solid rgba(212,175,110,0.3);
  border-radius: 10px;
  padding: 12px 14px;
  color: #d4af6e;
  font-family: 'Courier New', monospace;
  font-size: 13px;
}
.aff-share-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.aff-share-btn {
  background: rgba(212,175,110,0.08);
  border: 1px solid rgba(212,175,110,0.2);
  color: #d4af6e;
  padding: 8px 16px;
  border-radius: 20px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}
.aff-share-btn:hover { background: rgba(212,175,110,0.15); }

/* ============================================
   EVENTS PAGE — Calendar + Upcoming list
   ============================================ */
.ev-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 20px;
  margin-top: 16px;
}
@media (max-width: 900px) {
  .ev-layout { grid-template-columns: 1fr; }
}

.ev-cal-card {
  background: var(--card-bg, #1a1a1a);
  border: 1px solid var(--border, #2a2a2a);
  border-radius: 14px;
  padding: 18px;
}
.ev-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
}
.cal-nav-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border, #2a2a2a);
  color: var(--text);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cal-nav-btn:hover { background: rgba(255,214,10,0.1); border-color: #ffd60a; }

.ev-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-dow {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted, #888);
  padding: 6px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.cal-day {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--text);
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
}
.cal-day.empty { background: transparent; }
.cal-day.has-event {
  background: rgba(255,214,10,0.08);
  color: #ffd60a;
  font-weight: 600;
}
.cal-day.today {
  background: #ffd60a;
  color: #000;
  font-weight: 800;
}
.cal-dot {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #ffd60a;
}
.cal-day.today .cal-dot { background: #000; }

/* New polish styles for redesigned calendar */
.ev-cal-head { padding: 4px 4px 12px; }
.ev-cal-head #cal-title {
  font-size: 18px;
  letter-spacing: 0.2px;
}
.cal-day {
  cursor: default;
  transition: background 0.15s, transform 0.1s;
}
.cal-day.has-event:hover {
  background: rgba(255,214,10,0.18);
}
.cal-day-link {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  text-decoration: none;
  border-radius: 8px;
}
.cal-dots {
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 3px;
  align-items: center;
}
.cal-dots .cal-dot {
  position: static;
  transform: none;
  bottom: auto;
  left: auto;
}
.cal-dots-more {
  font-size: 9px;
  color: #ffd60a;
  margin-left: 2px;
  font-weight: 700;
}
.cal-day.today .cal-dots .cal-dot { background: #000; }

/* Empty state for upcoming list */
.ev-empty {
  text-align: center;
  padding: 50px 16px;
  background: rgba(255,255,255,0.02);
  border: 1px dashed rgba(255,255,255,0.08);
  border-radius: 14px;
}
.ev-empty-icon {
  font-size: 56px;
  margin-bottom: 14px;
  opacity: 0.7;
  filter: drop-shadow(0 4px 12px rgba(255,214,10,0.2));
}
.ev-empty-text {
  color: var(--muted, #888);
  font-size: 14px;
}


/* Upcoming list */
.ev-list-card {
  background: var(--card-bg, #1a1a1a);
  border: 1px solid var(--border, #2a2a2a);
  border-radius: 14px;
  padding: 18px;
}
.ev-item {
  display: flex;
  gap: 14px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid transparent;
  text-decoration: none;
  color: inherit;
  margin-bottom: 10px;
  transition: all 0.15s;
}
.ev-item:hover {
  background: rgba(255,214,10,0.05);
  border-color: rgba(255,214,10,0.2);
  transform: translateX(2px);
}
.ev-item-date {
  flex-shrink: 0;
  width: 56px;
  text-align: center;
  background: rgba(255,214,10,0.1);
  border-radius: 10px;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.ev-item-day {
  font-size: 22px;
  font-weight: 800;
  color: #ffd60a;
  line-height: 1;
}
.ev-item-month {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted, #888);
  text-transform: uppercase;
  margin-top: 4px;
}
.ev-item-info { flex: 1; min-width: 0; }
.ev-item-cat {
  font-size: 11px;
  color: #ffd60a;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.ev-item-info h4 {
  margin: 0 0 6px 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.ev-item-meta {
  font-size: 12px;
  color: var(--muted, #888);
}

/* ============================================
   EVENT DETAIL PAGE
   ============================================ */
.ev-detail-cover {
  width: 100%;
  height: 280px;
  background-size: cover;
  background-position: center;
  border-radius: 14px;
  margin-bottom: 18px;
}
.ev-detail-head { margin-bottom: 20px; }
.ev-detail-cat {
  font-size: 12px;
  color: #ffd60a;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.ev-detail-title {
  font-size: 32px;
  font-weight: 800;
  margin: 0 0 12px 0;
  line-height: 1.2;
  color: var(--text);
}
@media (max-width: 700px) {
  .ev-detail-title { font-size: 24px; }
  .ev-detail-cover { height: 180px; }
}
.ev-detail-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted, #888);
}

.ev-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 24px;
  margin-top: 20px;
}
@media (max-width: 900px) {
  .ev-detail-grid { grid-template-columns: 1fr; }
}
.ev-detail-body {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
}
.ev-detail-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ev-detail-loc {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border, #2a2a2a);
  border-radius: 12px;
  padding: 16px;
}
.ev-detail-loc-label {
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}
.ev-detail-loc-hint {
  font-size: 12px;
  color: var(--muted, #888);
  margin-top: 8px;
}
.ev-detail-addr {
  font-size: 14px;
  color: var(--text);
}
.ev-detail-rsvp {
  background: rgba(255,214,10,0.08);
  border: 1px solid rgba(255,214,10,0.2);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}
.ev-rsvp-hint {
  font-size: 12px;
  color: var(--muted, #888);
  margin: 10px 0 0 0;
}
.btn-block {
  display: block;
  width: 100%;
  text-align: center;
}
.ev-detail-footer {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border, #2a2a2a);
}

/* ============================================
   EVENT EDITOR — Form rows
   ============================================ */
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}
@media (max-width: 700px) {
  .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
}
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
}
.check-row input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }
.btn-danger {
  background: #c62828;
  color: #fff;
  border: 1px solid #c62828;
}
.btn-danger:hover { background: #b71c1c; border-color: #b71c1c; }

/* ============================================
   V3: COURSES PAGE (merged) + Course Cards new
   ============================================ */
.courses-tabs {
  display: flex;
  gap: 6px;
  margin: 18px 0 22px;
  border-bottom: 1px solid var(--border, #2a2a2a);
}
.courses-tab {
  background: transparent;
  border: none;
  color: var(--muted, #888);
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s;
}
.courses-tab:hover { color: var(--text); }
.courses-tab.active {
  color: #ffd60a;
  border-bottom-color: #ffd60a;
}
.tab-badge {
  display: inline-block;
  background: rgba(255,214,10,0.15);
  color: #ffd60a;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 4px;
  font-weight: 700;
}
.courses-tab.active .tab-badge {
  background: #ffd60a;
  color: #000;
}

/* Category sections */
.cat-section { margin-bottom: 36px; }
.cat-section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 14px 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border, #2a2a2a);
}
.cat-count {
  font-size: 13px;
  color: var(--muted, #888);
  font-weight: 500;
  margin-left: 6px;
}

/* Cover image trên course card */
.course-thumb.has-cover {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}
.course-thumb.has-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,0.4));
}
.thumb-owned {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #4ade80;
  color: #000;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 12px;
  z-index: 2;
}

/* Giá gốc gạch ngang */
.price-original {
  text-decoration: line-through;
  color: var(--muted, #888);
  font-size: 14px;
}
.price-free strong {
  color: #4ade80;
}

/* Owned badge highlight */
.course-card.owned {
  border-color: rgba(74,222,128,0.3);
}

/* ============================================
   ADMIN COVER TABS
   ============================================ */
.cover-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border, #2a2a2a);
}
.cover-tab {
  background: transparent;
  border: none;
  color: var(--muted, #888);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.cover-tab.active {
  color: #ffd60a;
  border-bottom-color: #ffd60a;
}
.cover-tab-pane {
  padding: 8px 0;
}
.cover-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 10px;
  border: 1px dashed var(--border, #2a2a2a);
  border-radius: 8px;
}
.cover-preview img {
  max-width: 200px;
  max-height: 120px;
  border-radius: 6px;
  object-fit: cover;
}

/* ============================================
   V3: COMMUNITY FILTERS + SHARE BUTTONS + TAGS
   ============================================ */
.cm-filters {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.cm-search {
  flex: 1;
  min-width: 200px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border, #2a2a2a);
  color: var(--text);
  border-radius: 8px;
  font-size: 14px;
}
.cm-sort {
  padding: 8px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border, #2a2a2a);
  color: var(--text);
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}
.cm-tag-filter {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
}
.tag-filter-label {
  font-size: 12px;
  color: var(--muted, #888);
  margin-right: 4px;
}
.tag-chip {
  background: rgba(255,214,10,0.08);
  border: 1px solid rgba(255,214,10,0.2);
  color: #ffd60a;
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.tag-chip:hover { background: rgba(255,214,10,0.15); }
.tag-chip.active {
  background: #ffd60a;
  color: #000;
  border-color: #ffd60a;
}

/* Tags trong post */
.cm-post-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 8px 0;
}

/* Share buttons */
.cm-share-row {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.cm-share-row-inline {
  margin-top: 0;
  margin-left: auto;
}
.cm-share-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border, #2a2a2a);
  color: var(--text);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.cm-share-btn:hover {
  background: rgba(255,214,10,0.12);
  border-color: #ffd60a;
  color: #ffd60a;
}
.cm-share-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted, #888);
  font-size: 12px;
  margin: 0 4px;
}

/* ============================================
   V3: DASHBOARD COMPACT (1 màn hình)
   ============================================ */
.dash-compact {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.dash-top-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  align-items: stretch;
}
@media (max-width: 860px) {
  .dash-top-row { grid-template-columns: 1fr; }
}
.dash-welcome-compact {
  padding: 18px 22px;
  margin: 0;
}
.dash-welcome-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.dash-welcome-compact .dash-greet {
  font-size: 22px;
  margin: 0;
}
.dash-welcome-compact .dash-greet-sub {
  font-size: 13px;
  margin: 6px 0 14px;
  color: var(--muted, #888);
}
.dash-welcome-compact .dash-stat-row {
  display: flex;
  gap: 22px;
  margin: 0;
}
.dash-welcome-compact .dash-stat-num {
  font-size: 26px;
}
.dash-welcome-compact .dash-stat-label {
  font-size: 11px;
}
/* Level card khít với top row */
.dash-top-row .dash-level-card {
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
/* Bottom grid 2 cột */
.dash-compact .dash-grid {
  grid-template-columns: 1.4fr 1fr;
  margin: 0;
}
@media (max-width: 860px) {
  .dash-compact .dash-grid { grid-template-columns: 1fr; }
}
.dash-compact .dash-card { padding: 16px 18px; }
.dash-compact .quick-grid { gap: 10px; }
.dash-compact .quick-tile { padding: 12px 8px; font-size: 13px; }

/* ============================================
   V3: DASHBOARD POLISH — chữ to hơn + lấp trống
   ============================================ */
.dash-welcome-compact .dash-greet { font-size: 26px; }
.dash-welcome-compact .dash-greet-sub { font-size: 15px; margin: 8px 0 18px; }
.dash-welcome-compact .dash-stat-row { gap: 32px; }
.dash-welcome-compact .dash-stat-num { font-size: 34px; }
.dash-welcome-compact .dash-stat-label { font-size: 13px; }

/* Level card: chữ to + căn đều lấp trống */
.dash-top-row .dash-level-card { padding: 24px 26px; gap: 14px; }
.dash-top-row .dash-level-label { font-size: 14px; letter-spacing: 0.5px; }
.dash-top-row .dash-level-num { font-size: 38px; margin-top: 4px; }
.dash-top-row .dash-level-xp { font-size: 16px; }
.dash-top-row .dash-level-bar { height: 14px; }
.dash-top-row .dash-level-foot { font-size: 14px; margin-top: 6px; }

/* Card titles to hơn */
.dash-compact .dash-card-title { font-size: 18px; }

/* Continue learning text to hơn */
.dash-compact .dash-card-continue h3,
.dash-compact #continue-container { font-size: 15px; }

/* Quick tiles to + thoáng hơn */
.dash-compact .quick-tile { padding: 20px 10px; font-size: 15px; font-weight: 600; }
.dash-compact .quick-icon { font-size: 32px; margin-bottom: 6px; }
.dash-compact .quick-grid { gap: 14px; }

/* ============================================
   V3: DASHBOARD FILL — lấp vùng trống
   ============================================ */
/* Welcome card: nội dung trải đều full chiều cao + stats giãn ngang */
.dash-welcome-compact {
  display: flex;
  flex-direction: column;
}
.dash-welcome-compact .dash-stat-row {
  justify-content: space-between;
  margin-top: auto;       /* đẩy stats xuống đáy, lấp khoảng trống giữa */
  width: 100%;
  padding-top: 10px;
}
.dash-welcome-compact .dash-stat { flex: 1; text-align: center; }
.dash-welcome-compact .dash-stat:first-child { text-align: left; }
.dash-welcome-compact .dash-stat:last-child { text-align: right; }

/* Level card: trải header→bar→foot đều khắp chiều cao (hết trống trên/dưới) */
.dash-top-row .dash-level-card {
  justify-content: space-between !important;
}
.dash-top-row .dash-level-header { margin-bottom: auto; }
.dash-top-row .dash-level-num { font-size: 44px; }
.dash-top-row .dash-level-foot { margin-top: auto; }

/* ===== Sidebar collapse (thu gọn thanh trái) ===== */
.app-sidebar { transition: width .25s ease; }
.sidebar-collapse-side {
  position: absolute;
  top: 12px; right: 10px;
  background: transparent;
  border: 1px solid rgba(212,175,110,0.25);
  color: #d4af6e;
  width: 26px; height: 26px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
  transition: background .15s, transform .25s ease;
}
.sidebar-collapse-side:hover { background: rgba(212,175,110,0.15); }

body.sidebar-collapsed { --sidebar-w: 72px; }
body.sidebar-collapsed .app-sidebar { width: 72px; }
body.sidebar-collapsed .sidebar-brand { padding: 18px 0; justify-content: center; }
body.sidebar-collapsed .sidebar-logo { display: none; }
body.sidebar-collapsed .sidebar-brand-text,
body.sidebar-collapsed .sidebar-nav-label,
body.sidebar-collapsed .sidebar-support,
body.sidebar-collapsed .sidebar-user-text { display: none !important; }
body.sidebar-collapsed .sidebar-collapse-side { position: static; transform: rotate(180deg); margin: 0 auto; width: 32px; height: 32px; font-size: 14px; }
body.sidebar-collapsed .sidebar-nav { padding: 14px 8px; }
body.sidebar-collapsed .sidebar-nav-item { justify-content: center; padding: 11px 0; gap: 0; position: relative; }
body.sidebar-collapsed .sidebar-user { padding: 12px 8px; }
body.sidebar-collapsed .sidebar-user-chip { justify-content: center; }
body.sidebar-collapsed .sidebar-logout { justify-content: center; font-size: 0; padding: 10px 0; }
body.sidebar-collapsed .sidebar-logout span { font-size: 18px; }
body.sidebar-collapsed .sidebar-nav-item:hover::after {
  content: attr(title);
  position: absolute; left: 100%; margin-left: 10px; top: 50%; transform: translateY(-50%);
  background: #1a1a1a; color: #f4eddf;
  padding: 6px 10px; border-radius: 6px; font-size: 13px;
  white-space: nowrap; z-index: 300; border: 1px solid rgba(212,175,110,0.3);
  pointer-events: none;
}

/* ============================================
   COURSE CARD V2 — Cần mua badge + colored CTAs
   ============================================ */
.course-card { position: relative; }

/* "Cần mua" badge — top-left orange pill */
.cc-need-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 6px;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 10px rgba(245,158,11,0.45);
}

/* Meta row (replaces course-meta visual for v2 — chương · bài · % done) */
.cc-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  font-size: 13px;
  color: var(--text-mute);
  padding: 4px 0 6px;
}
.cc-meta-row .cc-percent {
  color: var(--text-mute);
}
.cc-meta-row .cc-percent.done {
  color: #22c55e;
  font-weight: 700;
}

/* Footer row: price (left) + CTA (right) */
.cc-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* Price column */
.cc-price-col {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.cc-price-col .cc-price-sale {
  font-size: 17px;
  font-weight: 800;
  color: #d4af6e;
  letter-spacing: -0.2px;
}
.cc-price-col .cc-price-orig {
  font-size: 13px;
  color: var(--text-mute);
  text-decoration: line-through;
}
.cc-price-col.cc-price-free {
  color: #22c55e;
  font-weight: 800;
  font-size: 16px;
}
.cc-price-col.cc-price-owned {
  color: #d4af6e;
  font-weight: 700;
  font-size: 14px;
}

/* CTA button */
.cc-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 22px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 14px;
  white-space: nowrap;
  transition: transform .15s, box-shadow .15s, filter .15s;
  flex: none;
}
.cc-cta-enter {
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #fff;
  box-shadow: 0 4px 12px rgba(22,163,74,0.35);
}
.cc-cta-buy {
  background: linear-gradient(135deg, #ffd60a, #d4af6e);
  color: #1a1400;
  box-shadow: 0 4px 12px rgba(255,214,10,0.4);
}
.course-card:hover .cc-cta {
  transform: translateY(-1px);
  filter: brightness(1.06);
}




/* ============================================
   LOGO IMG OVERRIDES — when logo is <img> not letter
   ============================================ */
.lv2-logo-img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 10px;
  background: transparent;
  padding: 0;
  display: block;
  border: 1px solid rgba(255, 214, 10, 0.25);
}
.logo-mark-img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 8px;
  background: transparent;
  padding: 0;
  display: inline-block;
  vertical-align: middle;
  border: 1px solid rgba(255, 214, 10, 0.2);
}
.auth-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
  display: block;
}
.auth-logo {
  padding: 0 !important;
  background: transparent !important;
  overflow: hidden;
  border: 1px solid rgba(255, 214, 10, 0.2);
}

/* ============================================
   LANDING PAGE — long scroll (makeviral.pro style)
   ============================================ */
.lp-body {
  margin: 0;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(255, 214, 10, 0.12) 0%, transparent 60%),
    #0a0a0a;
  color: #f4eddf;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
}
.lp-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 28px;
  box-sizing: border-box;
}
.lp-center { text-align: center; }
.lp-accent {
  background: linear-gradient(135deg, #ffd60a 30%, #d4af6e 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-style: italic;
}

/* === TOP NAV === */
.lp-nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(212, 175, 110, 0.15);
}
.lp-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #f4eddf; }
.lp-brand-logo {
  width: 42px; height: 42px; object-fit: cover;
  border-radius: 10px; border: 1px solid rgba(255, 214, 10, 0.25);
}
.lp-brand-text { font-size: 17px; font-weight: 700; }
.lp-login {
  color: #d4af6e; text-decoration: none; font-weight: 700; font-size: 14px;
  padding: 10px 20px;
  border: 1px solid rgba(212, 175, 110, 0.45);
  border-radius: 999px;
  transition: all .2s;
  animation: lp-login-pulse 1.6s ease-in-out infinite;
}
.lp-login:hover { background: rgba(212, 175, 110, 0.18); border-color: #ffd60a; color: #ffd60a; animation-play-state: paused; }
@keyframes lp-login-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212, 175, 110, 0.65); border-color: rgba(212, 175, 110, 0.45); }
  50%      { box-shadow: 0 0 0 12px rgba(212, 175, 110, 0); border-color: #ffd60a; }
}

/* === HERO === */
.lp-hero { padding: 64px 0 48px; text-align: center; }
.lp-tag {
  display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: 1.5px;
  color: #d4af6e; background: rgba(212, 175, 110, 0.12);
  border: 1px solid rgba(212, 175, 110, 0.35);
  padding: 7px 16px; border-radius: 999px;
  margin-bottom: 22px;
}
.lp-hero-title {
  font-family: 'Cormorant Garamond', 'Times New Roman', serif;
  font-size: clamp(38px, 5.4vw, 68px);
  line-height: 1.22; margin: 0 0 22px;
  font-weight: 700; color: #fff; letter-spacing: -0.5px;
}
.lp-hero-title .lp-hero-accent,
.lp-hero-title em,
.lp-hero-title i { display: inline-block; margin-top: 6px; }
.lp-hero-sub {
  color: #c9c0a8; font-size: clamp(15px, 1.2vw, 18px);
  line-height: 1.7; margin: 0 auto 32px;
  max-width: 720px;
}
.lp-cta {
  display: inline-flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, #ffd60a, #d4af6e);
  color: #1a1400; font-weight: 800; font-size: 16px;
  padding: 17px 34px; border-radius: 14px;
  text-decoration: none;
  box-shadow: 0 12px 30px rgba(255, 214, 10, 0.35);
  transition: transform .15s, filter .15s, box-shadow .15s;
  animation: lp-cta-pulse 1.6s ease-in-out infinite;
}
.lp-cta:hover { transform: translateY(-2px); filter: brightness(1.08); animation-play-state: paused; }
@keyframes lp-cta-pulse {
  0%, 100% { box-shadow: 0 12px 30px rgba(255, 214, 10, 0.35), 0 0 0 0 rgba(255, 214, 10, 0.55); transform: scale(1); }
  50%      { box-shadow: 0 16px 40px rgba(255, 214, 10, 0.55), 0 0 0 16px rgba(255, 214, 10, 0); transform: scale(1.03); }
}
.lp-meta { color: #8a8268; font-size: 13px; font-weight: 500; margin-top: 16px; }
@media (prefers-reduced-motion: reduce) { .lp-cta, .lp-login { animation: none; } }

/* === VIDEO === */
.lp-video-frame {
  max-width: 900px;
  margin: 28px auto 8px;
  aspect-ratio: 16 / 9;
  background: #111;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(212, 175, 110, 0.35);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}
.lp-video-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* === STATS === */
.lp-stats-section { padding: 24px 0 56px; }
.lp-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
  border-top: 1px solid rgba(212, 175, 110, 0.15);
  border-bottom: 1px solid rgba(212, 175, 110, 0.15);
  padding: 36px 0;
}
.lp-stat { text-align: center; }
.lp-stat-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(30px, 3.5vw, 46px);
  font-weight: 700;
  background: linear-gradient(135deg, #ffd60a, #d4af6e);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  line-height: 1;
}
.lp-stat-label { color: #c9c0a8; font-size: 13px; margin-top: 8px; }

/* === SECTIONS === */
.lp-section { padding: 80px 0; }
.lp-section-alt { background: rgba(212, 175, 110, 0.03); }
.lp-section-eyebrow {
  text-align: center; color: #d4af6e; font-size: 12px;
  font-weight: 800; letter-spacing: 2px; margin-bottom: 14px;
}
.lp-section-title {
  font-family: 'Cormorant Garamond', serif;
  text-align: center; font-size: clamp(28px, 3.6vw, 44px);
  font-weight: 700; color: #fff; margin: 0 0 48px; line-height: 1.15;
}

/* === GRIDS === */
.lp-grid { display: grid; gap: 24px; }
.lp-grid-3 { grid-template-columns: repeat(3, 1fr); }
.lp-grid-bullets .lp-card { padding: 32px 28px; }

/* === CARDS === */
.lp-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(212, 175, 110, 0.2);
  border-radius: 14px;
  padding: 28px 24px;
  transition: transform .2s, border-color .2s;
}
.lp-card:hover { transform: translateY(-4px); border-color: rgba(212, 175, 110, 0.45); }
.lp-card h3 {
  margin: 0 0 14px; font-size: 19px; font-weight: 700; color: #ffd60a;
  font-family: 'Cormorant Garamond', serif;
}
.lp-card p { margin: 0; color: #c9c0a8; font-size: 14.5px; line-height: 1.65; }
.lp-card-icon { font-size: 36px; margin-bottom: 12px; }
.lp-card-gold {
  background: linear-gradient(135deg, rgba(255, 214, 10, 0.08), rgba(212, 175, 110, 0.04));
  border-color: rgba(255, 214, 10, 0.4);
}
.lp-card-soft { background: transparent; border-color: rgba(255, 255, 255, 0.08); }

/* === LIST WITH CHECK ICONS === */
.lp-list { list-style: none; padding: 0; margin: 0; }
.lp-list li {
  position: relative;
  padding: 9px 0 9px 30px;
  color: #c9c0a8;
  font-size: 14.5px;
  line-height: 1.55;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
}
.lp-list li:last-child { border-bottom: 0; }
.lp-list li::before {
  content: "✓";
  position: absolute;
  left: 0; top: 9px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(255, 214, 10, 0.18);
  color: #ffd60a;
  font-weight: 800;
  font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}

/* === TESTIMONIALS === */
.lp-tm {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(212, 175, 110, 0.2);
  border-radius: 14px;
  padding: 28px;
  display: flex; flex-direction: column; gap: 20px;
}
.lp-tm-quote {
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px; line-height: 1.55; font-style: italic;
  color: #f4eddf;
}
.lp-tm-author { display: flex; align-items: center; gap: 12px; }
.lp-tm-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, #ffd60a, #d4af6e);
  color: #1a1400; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px;
}
.lp-tm-name { font-weight: 700; color: #fff; font-size: 14px; }
.lp-tm-meta { color: #8a8268; font-size: 12px; margin-top: 2px; }

/* === CTA SECTION === */
.lp-cta-section {
  padding: 72px 0;
  background:
    radial-gradient(ellipse 80% 100% at 50% 50%, rgba(255, 214, 10, 0.10) 0%, transparent 60%),
    rgba(255, 214, 10, 0.02);
  border-top: 1px solid rgba(212, 175, 110, 0.15);
  border-bottom: 1px solid rgba(212, 175, 110, 0.15);
}
.lp-cta-sub { color: #c9c0a8; font-size: 16px; margin: 0 0 30px; }

/* === FOOTER === */
.lp-footer { padding: 56px 0 30px; border-top: 1px solid rgba(212, 175, 110, 0.12); }
.lp-footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 36px; margin-bottom: 36px; }
.lp-footer-logo { width: 48px; height: 48px; border-radius: 10px; border: 1px solid rgba(255,214,10,0.2); margin-bottom: 12px; }
.lp-footer-brand { font-weight: 700; font-size: 16px; color: #fff; margin-bottom: 10px; }
.lp-footer-desc { color: #8a8268; font-size: 13px; line-height: 1.6; }
.lp-footer-title { font-weight: 700; color: #d4af6e; font-size: 13px; text-transform: uppercase; letter-spacing: 1.2px; margin-bottom: 14px; }
.lp-footer-link { display: block; color: #c9c0a8; text-decoration: none; font-size: 14px; padding: 5px 0; transition: color .2s; }
.lp-footer-link:hover { color: #ffd60a; }
.lp-footer-bottom {
  text-align: center; color: #8a8268; font-size: 12px;
  padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* === MOBILE === */
@media (max-width: 800px) {
  .lp-nav { padding: 12px 18px; }
  .lp-brand-text { display: none; }
  .lp-login { font-size: 13px; padding: 8px 14px; }
  .lp-container { padding: 0 18px; }
  .lp-hero { padding: 36px 0 28px; }
  .lp-section { padding: 48px 0; }
  .lp-stats { grid-template-columns: repeat(2, 1fr); gap: 16px; padding: 24px 0; }
  .lp-grid-3 { grid-template-columns: 1fr; }
  .lp-footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .lp-cta { padding: 14px 24px; font-size: 15px; }
}


/* === LANDING EXTRAS: featured, stories, 5 points === */
.lp-section-sub {
  text-align: center; max-width: 720px; margin: -28px auto 36px;
  color: #c9c0a8; font-size: 15.5px; line-height: 1.65;
}
.lp-grid-2 { grid-template-columns: repeat(2, 1fr); }

/* Featured story */
.lp-featured {
  display: grid; grid-template-columns: 240px 1fr; gap: 36px;
  align-items: center;
  background: linear-gradient(135deg, rgba(255,214,10,0.06), rgba(212,175,110,0.02));
  border: 1px solid rgba(255,214,10,0.3);
  border-radius: 16px;
  padding: 36px;
  max-width: 980px; margin: 0 auto;
}
.lp-featured-stat { text-align: center; }
.lp-featured-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 110px; line-height: 1; font-weight: 700;
  background: linear-gradient(135deg,#ffd60a,#d4af6e);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lp-featured-label { color: #c9c0a8; font-size: 14px; margin-top: 4px; font-weight: 600; }
.lp-featured-body h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px; color: #fff; margin: 0 0 12px; line-height: 1.25;
}
.lp-featured-body p { color: #c9c0a8; font-size: 15px; line-height: 1.7; margin: 0 0 20px; }

/* Story card (Before / After) */
.lp-story {
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(212,175,110,0.2);
  border-radius: 14px;
  padding: 26px;
  display: flex; flex-direction: column; gap: 16px;
  transition: transform .2s, border-color .2s;
}
.lp-story:hover { transform: translateY(-3px); border-color: rgba(212,175,110,0.45); }
.lp-story-ba p {
  color: #c9c0a8; font-size: 14.5px; line-height: 1.65;
  margin: 0 0 12px;
}
.lp-story-ba p:last-child { margin-bottom: 0; }
.lp-story-ba strong { color: #f4eddf; }
.lp-story-ba p strong:first-child { color: #ffd60a; }
.lp-story-quote {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  color: #ffd60a;
  font-size: 17px; line-height: 1.45;
  padding: 14px 16px;
  background: rgba(255,214,10,0.06);
  border-left: 3px solid #d4af6e;
  border-radius: 6px;
  margin-top: auto;
}

/* 5 điểm chung */
.lp-points {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 20px; max-width: 980px; margin: 0 auto;
}
.lp-points .lp-point:nth-child(5) { grid-column: 1 / -1; max-width: 480px; margin: 0 auto; }
.lp-point {
  display: flex; gap: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(212,175,110,0.18);
  border-radius: 12px; padding: 22px;
}
.lp-point-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 38px; line-height: 1; font-weight: 700;
  background: linear-gradient(135deg,#ffd60a,#d4af6e);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  flex: none;
}
.lp-point-body h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px; color: #fff; margin: 0 0 6px; line-height: 1.3;
}
.lp-point-body p { color: #c9c0a8; font-size: 14px; line-height: 1.5; margin: 0; }

/* Mobile tweaks */
@media (max-width: 800px) {
  .lp-grid-2 { grid-template-columns: 1fr; }
  .lp-featured { grid-template-columns: 1fr; padding: 24px; gap: 16px; }
  .lp-featured-num { font-size: 80px; }
  .lp-points { grid-template-columns: 1fr; }
  .lp-points .lp-point:nth-child(5) { max-width: none; }
}


/* === HERO 2-COLUMN === */
.lp-hero-2col { padding: 48px 0 36px; }
.lp-hero-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 48px;
  align-items: center;
}
.lp-hero-text { text-align: left; }
.lp-hero-2col .lp-hero-title { text-align: left; }
.lp-hero-2col .lp-hero-sub { text-align: left; margin-left: 0; }
.lp-hero-2col .lp-cta { margin-top: 8px; }
.lp-hero-2col .lp-meta { text-align: left; margin-top: 14px; }
.lp-hero-video .lp-video-frame {
  margin: 0;
  max-width: none;
  width: 100%;
}

/* === ALTERNATING ROWS === */
.lp-rows { padding: 64px 0; }
.lp-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  margin-bottom: 56px;
}
.lp-row:last-child { margin-bottom: 0; }
.lp-row-reverse .lp-row-img { order: 2; }
.lp-row-reverse .lp-row-text { order: 1; }
.lp-row-img {
  aspect-ratio: 4 / 3;
  background:
    radial-gradient(ellipse 80% 80% at 30% 30%, rgba(255,214,10,0.15) 0%, transparent 60%),
    linear-gradient(135deg, #1a1400 0%, #0f0a00 60%, #050300 100%);
  border: 1px solid rgba(212,175,110,0.3);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}
.lp-row-img::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 50% at 70% 70%, rgba(212,175,110,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.lp-row-icon {
  font-size: 90px; line-height: 1;
  filter: drop-shadow(0 8px 20px rgba(255,214,10,0.35));
}
.lp-row-img-label {
  font-size: 14px; font-weight: 700; color: #d4af6e;
  letter-spacing: 0.5px;
}
.lp-row-text { padding: 0 8px; }
.lp-row-eyebrow {
  color: #d4af6e; font-size: 15px; font-weight: 800;
  letter-spacing: 3px; margin-bottom: 14px;
  text-transform: uppercase;
}
.lp-row-text h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 30px; line-height: 1.2; color: #fff;
  margin: 0 0 16px; font-weight: 700;
}
.lp-row-text p {
  color: #c9c0a8; font-size: 15.5px; line-height: 1.7; margin: 0;
}

/* === MOBILE === */
@media (max-width: 800px) {
  .lp-hero-grid { grid-template-columns: 1fr; gap: 24px; }
  .lp-hero-2col .lp-hero-title, .lp-hero-2col .lp-hero-sub, .lp-hero-2col .lp-meta { text-align: center; }
  .lp-row { grid-template-columns: 1fr; gap: 20px; margin-bottom: 40px; }
  .lp-row-reverse .lp-row-img { order: 0; }
  .lp-row-reverse .lp-row-text { order: 0; }
  .lp-row-img { aspect-ratio: 16/10; }
  .lp-row-text h3 { font-size: 22px; }
  .lp-row-icon { font-size: 60px; }
}


/* === LANDING CMS — background image + row images === */
body.lp-body.has-lp-bg-image {
  background-image:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(255,214,10,0.12) 0%, transparent 60%),
    linear-gradient(180deg, rgba(10,10,10,0.55) 0%, rgba(10,10,10,0.82) 100%),
    var(--lp-bg-image);
  background-size: auto, auto, cover;
  background-position: center top, center, center;
  background-attachment: fixed, fixed, fixed;
  background-repeat: no-repeat;
  background-color: #0a0a0a;
}

/* Row image when real image is set */
.lp-row-img-has-image {
  padding: 0 !important;
  background: #0a0a0a !important;
}
.lp-row-img-real {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 17px;
  display: block;
}


/* === HERO COMPACT (1 column, big full-width video) === */
.lp-hero-compact { padding: 36px 0 32px; text-align: center; }
.lp-hero-compact .lp-hero-title { text-align: center; margin: 0 0 16px; font-size: clamp(34px, 4.8vw, 58px); }
.lp-hero-compact .lp-hero-sub { text-align: center; margin: 0 auto 22px; max-width: 720px; }
.lp-hero-compact .lp-cta { margin-top: 4px; }
.lp-hero-compact .lp-meta { text-align: center; margin-top: 14px; margin-bottom: 28px; }
.lp-video-big {
  max-width: 1100px !important;
  width: 100%;
  margin: 0 auto !important;
  aspect-ratio: 16 / 9;
}


/* === Larger section titles === */
.lp-section-title {
  font-size: clamp(32px, 4.4vw, 56px) !important;
  line-height: 1.1;
}
.lp-section-eyebrow {
  font-size: 15px !important;
  letter-spacing: 3px !important;
  font-weight: 800 !important;
  margin-bottom: 18px !important;
}

/* === Stories 2-col (image + text) === */
.lp-story-2col {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 22px;
  align-items: stretch;
}
.lp-story-img {
  background: linear-gradient(135deg, #1a1400 0%, #0f0a00 50%, #050300 100%);
  border: 1px solid rgba(212, 175, 110, 0.25);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  overflow: hidden;
  position: relative;
}
.lp-story-img.lp-row-img-has-image { padding: 0 !important; background: #0a0a0a !important; }
.lp-story-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 11px; display: block; }
/* ABOUT ME SECTION */
.lp-about-wrap {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 2fr;
  gap: 40px;
  align-items: stretch;
  max-width: 1100px;
  margin: 32px auto 0;
}
/* About me carousel */
.lp-about-carousel {
  position: relative;
  background: linear-gradient(135deg, #1a1400, #0a0a0a);
  border: 1px solid rgba(212, 175, 110, 0.3);
  border-radius: 16px;
  overflow: hidden;
  align-self: stretch;
  height: 100%;
}
.lp-about-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.5s cubic-bezier(.4,0,.2,1);
}
.lp-about-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 80px;
  color: rgba(255,255,255,.15);
}
.lp-about-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lp-about-placeholder { font-size: 60px; opacity: .3; }
.lp-about-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  border: 1px solid rgba(212,175,110,.4);
  color: #d4af6e;
  font-size: 26px;
  line-height: 36px;
  cursor: pointer;
  z-index: 3;
  display: none;
  transition: background .2s, transform .2s;
}
.lp-about-carousel.has-multi .lp-about-arrow { display: block; }
.lp-about-arrow:hover { background: rgba(212,175,110,.85); color: #1a1400; transform: translateY(-50%) scale(1.08); }
.lp-about-prev { left: 10px; }
.lp-about-next { right: 10px; }
.lp-about-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  gap: 6px;
  z-index: 3;
}
.lp-about-carousel.has-multi .lp-about-dots { display: flex; }
.lp-about-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.4);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background .2s, transform .2s;
}
.lp-about-dot.active { background: #d4af6e; transform: scale(1.3); }
.lp-about-body { padding-top: 8px; align-self: stretch; display: flex; flex-direction: column; }
.lp-about-name { font-size: 28px; margin: 0 0 6px; color: #fff; }
.lp-about-role { font-size: 15px; color: #d4af6e; margin-bottom: 18px; font-style: italic; }
.lp-about-para { font-size: 16px; line-height: 1.7; color: rgba(255,255,255,.85); margin: 0 0 12px; }
.lp-about-highlights {
  list-style: none; padding: 0; margin: 20px 0 0;
  display: grid; gap: 8px;
}
.lp-about-highlights li {
  padding: 10px 14px;
  background: rgba(212, 175, 110, .08);
  border-left: 3px solid #d4af6e;
  border-radius: 6px;
  font-size: 15px;
  color: rgba(255,255,255,.92);
}
@media (max-width: 760px) {
  .lp-about-wrap { grid-template-columns: 1fr; gap: 24px; align-items: stretch; }
  .lp-about-img { max-width: 320px; margin: 0 auto; }
  .lp-about-carousel { min-height: 0; aspect-ratio: 3 / 5; height: auto; }
}

.lp-story-avatar-big {
  width: 84px !important;
  height: 84px !important;
  font-size: 36px !important;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffd60a, #d4af6e);
  color: #1a1400;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}
.lp-story-text {
  display: flex; flex-direction: column;
  gap: 14px;
}
/* Hide small avatar in author row when story has image (avoid duplicate) */
.lp-story-2col .lp-tm-author .lp-tm-avatar { display: none; }

/* Featured image override */
.lp-featured-stat.lp-row-img-has-image { padding: 0 !important; background: #111 !important; border-radius: 14px; overflow: hidden; }
.lp-featured-stat img { width: 100%; height: 100%; object-fit: cover; display: block; min-height: 220px; }

@media (max-width: 800px) {
  .lp-story-2col { grid-template-columns: 1fr; }
  .lp-story-img { min-height: 160px; }
}


/* === Settings Profile — compact để fit 1 viewport === */
#section-profile .settings-card { padding: 18px 20px; }
#section-profile .settings-card-title { font-size: 17px; margin-bottom: 4px; }
#section-profile .settings-card-desc { font-size: 13px; margin-bottom: 14px; }
#section-profile .profile-avatar-row { gap: 14px; margin-bottom: 14px; padding: 12px; }
#section-profile .profile-avatar { width: 72px !important; height: 72px !important; font-size: 26px !important; }
#section-profile .form-row { margin-bottom: 10px; gap: 14px; }
#section-profile .form-group label { font-size: 13px; margin-bottom: 4px; }
#section-profile .form-group input,
#section-profile .form-group textarea { padding: 8px 12px; font-size: 13.5px; }
#section-profile .form-help { font-size: 11.5px; margin-top: 3px; }
#section-profile #profile-bio { min-height: 56px !important; }
#section-profile .settings-actions { margin-top: 12px; }
#section-profile .telegram-card { padding: 14px 20px; margin-bottom: 14px !important; }
#section-profile .telegram-card .settings-card-title { font-size: 16px; }
#section-profile .telegram-card .settings-card-desc { font-size: 12.5px; }


/* === CHAPTER ACCORDION trong sidebar khóa học === */
.chapter-group {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(212,175,110,0.18);
  border-radius: 10px;
  margin-bottom: 10px;
  overflow: hidden;
}
.chapter-summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  background: rgba(212,175,110,0.06);
  border-bottom: 1px solid transparent;
  transition: background .15s;
  user-select: none;
}
.chapter-summary::-webkit-details-marker { display: none; }
.chapter-summary:hover { background: rgba(212,175,110,0.12); }
.chapter-arrow {
  color: #d4af6e;
  font-size: 14px;
  transition: transform .2s;
  display: inline-block;
}
.chapter-group[open] .chapter-arrow { transform: rotate(90deg); }
.chapter-group[open] .chapter-summary { border-bottom-color: rgba(212,175,110,0.2); }
.chapter-title { flex: 1; font-weight: 700; color: #f4eddf; font-size: 14px; }
.chapter-progress {
  font-size: 12px;
  color: #d4af6e;
  background: rgba(212,175,110,0.12);
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 700;
}
.chapter-lessons {
  list-style: none;
  padding: 6px 0;
  margin: 0;
}
.chapter-lessons .lesson-item { border-radius: 0; margin: 0; }


/* === LOCKED BY DATE (course card + lesson sidebar) === */
.cc-cta-locked {
  background: rgba(212, 175, 110, 0.18) !important;
  color: #d4af6e !important;
  border: 1px dashed rgba(212, 175, 110, 0.45);
  box-shadow: none !important;
  cursor: not-allowed;
}
.cc-need-badge.cc-need-badge-soon {
  background: linear-gradient(135deg, #6b7280, #4b5563);
  box-shadow: 0 4px 10px rgba(75, 85, 99, 0.45);
}
.lesson-item.locked-by-date {
  opacity: 0.65;
  cursor: not-allowed;
}
.lesson-item.locked-by-date .lesson-status {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
}
.lesson-date-tag {
  display: inline-block;
  margin-left: 8px;
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
}


/* === MID-CTA bands — upsell xen giữa các section === */
.lp-mid-cta {
  padding: 56px 0;
  text-align: center;
  background:
    radial-gradient(ellipse 60% 80% at 50% 50%, rgba(255,214,10,0.08) 0%, transparent 70%);
  border-top: 1px solid rgba(212,175,110,0.12);
  border-bottom: 1px solid rgba(212,175,110,0.12);
}
.lp-mid-cta-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 700;
  color: #fff;
  margin: 0 0 22px;
  line-height: 1.2;
}
.lp-mid-cta .lp-cta { margin: 0; }

@media (max-width: 800px) {
  .lp-mid-cta { padding: 36px 0; }
  .lp-mid-cta-title { font-size: 22px; margin-bottom: 16px; }
}


/* ============================================
   ✨ UI POLISH v27 — micro-interactions & animations
   ============================================ */

/* === 1) Activity ticker contrast + pulse === */
.social-proof-bar {
  background: linear-gradient(90deg, rgba(74,222,128,0.20), rgba(212,175,110,0.22)) !important;
  border-color: rgba(74,222,128,0.45) !important;
  box-shadow: 0 4px 14px rgba(74,222,128,0.08);
  color: #fff !important;
  font-weight: 600 !important;
  position: relative;
  overflow: hidden;
}
.social-proof-bar::before {
  content: "";
  position: absolute;
  top: 0; left: -100%;
  width: 30%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  animation: sp-shimmer 4s ease-in-out infinite;
}
@keyframes sp-shimmer { to { left: 100%; } }
.sp-time { color: rgba(255,255,255,0.65) !important; font-weight: 500 !important; }
.sp-icon { animation: sp-bounce 2s ease-in-out infinite; display: inline-block; }
@keyframes sp-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

/* === 2) Course card lift + glow on hover === */
.course-card {
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s, border-color 0.2s;
  will-change: transform;
  min-height: 480px;             /* equalize heights */
  display: flex;
  flex-direction: column;
}
.course-card:hover {
  transform: translateY(-6px) scale(1.012);
  box-shadow: 0 14px 38px rgba(212, 175, 110, 0.22), 0 4px 14px rgba(0,0,0,0.3);
}
.course-card .course-desc {
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.course-card .course-meta {
  margin-top: auto;              /* push footer to bottom always */
}

/* === 3) Generic button ripple + lift === */
.btn {
  position: relative;
  overflow: hidden;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease !important;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0) scale(0.97);
}
.btn-primary:hover {
  box-shadow: 0 6px 18px rgba(212, 175, 110, 0.35);
}

/* === 4) Sidebar nav item hover smooth + tooltip === */
.sidebar-nav-item {
  position: relative;
  transition: background 0.18s, transform 0.12s;
}
.sidebar-nav-item:hover {
  transform: translateX(2px);
}
.sidebar-nav-item.active::before {
  content: "";
  position: absolute;
  left: 0; top: 25%;
  width: 3px; height: 50%;
  background: var(--accent, #d4af6e);
  border-radius: 0 4px 4px 0;
  animation: sidebar-pop 0.3s ease-out;
}
@keyframes sidebar-pop {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}

/* === 5) Stat number counter glow === */
.dash-stat-num,
.dash-greet .accent {
  background: linear-gradient(135deg, #fbbf24, #d4af6e);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: stat-fadein 0.6s ease-out;
}
@keyframes stat-fadein {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === 6) Streak fire icon pulse === */
.dash-stat-label,
.streak-fire-icon {
  display: inline-block;
}
.dash-stat-row .dash-stat:nth-child(2) .dash-stat-num {
  text-shadow: 0 0 18px rgba(251, 191, 36, 0.4);
  animation: streak-pulse 1.8s ease-in-out infinite;
}
@keyframes streak-pulse {
  0%, 100% { text-shadow: 0 0 12px rgba(251, 191, 36, 0.3); }
  50% { text-shadow: 0 0 24px rgba(251, 191, 36, 0.6); }
}

/* === 7) Card fade-in on page load === */
.dash-welcome,
.dash-level-card,
.continue-section,
.dash-recent,
.settings-card,
.course-card,
.ev-cal-card,
.ev-list-card {
  animation: card-fadein 0.5s ease-out backwards;
}
.dash-level-card { animation-delay: 0.05s; }
.continue-section { animation-delay: 0.1s; }
.dash-recent { animation-delay: 0.15s; }
.course-card:nth-child(1) { animation-delay: 0s; }
.course-card:nth-child(2) { animation-delay: 0.08s; }
.course-card:nth-child(3) { animation-delay: 0.16s; }
.course-card:nth-child(4) { animation-delay: 0.24s; }
.course-card:nth-child(5) { animation-delay: 0.32s; }
.course-card:nth-child(6) { animation-delay: 0.4s; }
@keyframes card-fadein {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === 8) Empty state animation === */
.ev-empty-icon,
.empty-state .icon {
  animation: empty-float 3s ease-in-out infinite;
  display: inline-block;
}
@keyframes empty-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* === 9) Calendar today highlight pulse === */
.cal-day.today {
  position: relative;
  box-shadow: 0 0 0 0 rgba(255, 214, 10, 0.6);
  animation: today-pulse 2.5s ease-out infinite;
}
@keyframes today-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 214, 10, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(255, 214, 10, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 214, 10, 0); }
}

/* === 10) Skeleton loading shimmer === */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: skel-shimmer 1.4s infinite;
  border-radius: 6px;
}
@keyframes skel-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* === 11) Tab transition smooth (settings) === */
.settings-section {
  animation: section-fade 0.35s ease-out;
}
@keyframes section-fade {
  from { opacity: 0; transform: translateX(8px); }
  to { opacity: 1; transform: translateX(0); }
}

/* === 12) Mobile responsive polish === */
@media (max-width: 768px) {
  .course-card { min-height: auto; }
  .dash-top-row { grid-template-columns: 1fr !important; }
  .ev-layout { grid-template-columns: 1fr !important; }
  .topbar-user-chip .name { max-width: 90px !important; }
  .topbar-user-chip { max-width: 220px !important; }
  .dash-greet { font-size: 22px !important; }
  .page-title { font-size: 24px !important; }
}
@media (max-width: 420px) {
  .topbar-user-chip .name { display: none; }
  .topbar-user-chip { padding: 4px 8px 4px 4px; max-width: 80px; }
  .ev-cal-grid { gap: 2px; }
  .cal-day { font-size: 12px; }
  .cal-dow { font-size: 10px; }
}

/* === 13) Reduce motion accessibility === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.05ms !important;
  }
}

/* ============================================
   COURSE SEARCH + FILTER BAR (home page)
   ============================================ */
.course-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 22px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
}
.course-search-wrap {
  position: relative;
  flex: 1;
  min-width: 240px;
  max-width: 420px;
}
.course-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  opacity: 0.55;
  pointer-events: none;
}
#course-search {
  width: 100%;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 10px 38px 10px 38px;
  color: var(--text, #f4eddf);
  font-size: 14px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}
#course-search:focus {
  border-color: rgba(212,175,110,0.6);
  box-shadow: 0 0 0 3px rgba(212,175,110,0.15);
}
#course-search::placeholder { opacity: 0.45; }
#course-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.08);
  border: none;
  color: #f4eddf;
  width: 24px; height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
#course-search-clear:hover { background: rgba(255,255,255,0.16); }
.course-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.course-chip {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  padding: 7px 14px;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.course-chip:hover {
  background: rgba(212,175,110,0.10);
  border-color: rgba(212,175,110,0.30);
  color: #f4eddf;
}
.course-chip.active {
  background: linear-gradient(135deg, #d4af6e, #8b6b3a);
  border-color: #d4af6e;
  color: #000;
  font-weight: 700;
}
@media (max-width: 768px) {
  .course-filter-bar { flex-direction: column; align-items: stretch; gap: 10px; }
  .course-search-wrap { max-width: 100%; }
  .course-filter-chips { justify-content: flex-start; overflow-x: auto; padding-bottom: 4px; flex-wrap: nowrap; }
  .course-chip { flex-shrink: 0; }
}

/* ============================================
   🌗 LIGHT MODE THEME
   ============================================ */
html[data-theme="light"] {
  --bg: #f8f7f4;
  --bg-soft: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #f0ede7;
  --border: #e5e1d8;
  --border-soft: #efece5;
  --text: #1a1815;
  --text-soft: #4b4944;
  --text-mute: #888581;
  --accent: #b8923f;
  --accent-dark: #8b6b2a;
  --accent-soft: rgba(184, 146, 63, 0.12);
  /* compat aliases used elsewhere */
  --line: #e5e1d8;
  --panel: #ffffff;
  --ink: #1a1815;
  --muted: #888581;
  --card-bg: #ffffff;
}
html[data-theme="light"] body {
  background:
    radial-gradient(1200px 800px at 20% -10%, rgba(184,146,63,0.10), transparent 60%),
    radial-gradient(900px 700px at 100% 0%, rgba(212,175,110,0.08), transparent 50%),
    var(--bg);
  color: var(--text);
}
html[data-theme="light"] .site-header,
html[data-theme="light"] .app-topbar,
html[data-theme="light"] .app-sidebar {
  background: rgba(255, 255, 255, 0.92);
  border-color: var(--border);
}
html[data-theme="light"] .topbar-user-chip {
  background: rgba(184, 146, 63, 0.06);
  border-color: rgba(184, 146, 63, 0.20);
}
html[data-theme="light"] .topbar-user-chip .name {
  color: var(--text);
}
html[data-theme="light"] input,
html[data-theme="light"] textarea,
html[data-theme="light"] select {
  background: #ffffff;
  border-color: var(--border);
  color: var(--text);
}
html[data-theme="light"] .btn-secondary {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text);
  border: 1px solid var(--border);
}
html[data-theme="light"] .btn-secondary:hover {
  background: rgba(184, 146, 63, 0.10);
}
html[data-theme="light"] .cal-day {
  background: rgba(0, 0, 0, 0.025);
  color: var(--text);
}
html[data-theme="light"] .cal-day.today {
  background: #fbbf24;
  color: #000;
}
html[data-theme="light"] .cal-day.has-event {
  background: rgba(184, 146, 63, 0.10);
  color: var(--accent);
}
html[data-theme="light"] .cal-dow {
  color: var(--text-mute);
}
html[data-theme="light"] .sidebar-nav-item {
  color: var(--text-soft);
}
html[data-theme="light"] .sidebar-nav-item:hover {
  background: rgba(184, 146, 63, 0.08);
  color: var(--text);
}
html[data-theme="light"] .sidebar-nav-item.active {
  background: rgba(184, 146, 63, 0.12);
  color: var(--accent);
}
html[data-theme="light"] .course-chip {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-soft);
  border-color: var(--border);
}
html[data-theme="light"] .course-chip.active {
  background: linear-gradient(135deg, #d4af6e, #b8923f);
  color: #fff;
}
html[data-theme="light"] .social-proof-bar {
  background: linear-gradient(90deg, rgba(74,222,128,0.15), rgba(184,146,63,0.15)) !important;
  color: var(--text) !important;
}
html[data-theme="light"] .sp-time { color: var(--text-mute) !important; }

/* Theme toggle pill (topbar) */
.theme-toggle-pill {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  color: var(--text);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
  margin-right: 6px;
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
}
.theme-toggle-pill:hover {
  background: rgba(212,175,110,0.12);
  border-color: rgba(212,175,110,0.35);
  transform: rotate(15deg);
}
.theme-toggle-pill:active {
  transform: scale(0.92);
}
html[data-theme="light"] .theme-toggle-pill {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.10);
}
html[data-theme="light"] .theme-toggle-pill:hover {
  background: rgba(184,146,63,0.12);
  border-color: rgba(184,146,63,0.35);
}
@media (max-width: 768px) {
  .theme-toggle-pill { width: 32px; height: 32px; font-size: 14px; }
}


/* ============================================
   🌗 LIGHT MODE — comprehensive overrides
   ============================================ */
html[data-theme="light"] .dash-welcome,
html[data-theme="light"] .dash-level-card,
html[data-theme="light"] .dash-recent,
html[data-theme="light"] .continue-section,
html[data-theme="light"] .settings-card,
html[data-theme="light"] .settings-layout,
html[data-theme="light"] .ev-cal-card,
html[data-theme="light"] .ev-list-card,
html[data-theme="light"] .ev-detail-card,
html[data-theme="light"] .blog-item,
html[data-theme="light"] .blog-card,
html[data-theme="light"] .blog-detail,
html[data-theme="light"] .lesson-item,
html[data-theme="light"] .sidebar,
html[data-theme="light"] .quick-tile,
html[data-theme="light"] .leaderboard-card,
html[data-theme="light"] .community-post,
html[data-theme="light"] .post-card,
html[data-theme="light"] .admin-card,
html[data-theme="light"] .course-card,
html[data-theme="light"] .stat-card,
html[data-theme="light"] .auth-card,
html[data-theme="light"] .from-bot-card,
html[data-theme="light"] .telegram-card {
  background: #ffffff !important;
  border-color: var(--border) !important;
  color: var(--text);
}
html[data-theme="light"] .dash-stat,
html[data-theme="light"] .ev-item {
  background: #f8f7f4 !important;
  border-color: var(--border) !important;
}
html[data-theme="light"] .course-thumb {
  background: linear-gradient(135deg, #fff8e7 0%, #f0e6c0 100%) !important;
}
html[data-theme="light"] .course-vip-overlay.course-vip-partial {
  background: rgba(184, 146, 63, 0.10);
}
html[data-theme="light"] .settings-tab {
  color: var(--text-soft);
}
html[data-theme="light"] .settings-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
html[data-theme="light"] .lesson-item.completed { color: var(--text-mute); }
html[data-theme="light"] .lesson-item:hover { background: rgba(184,146,63,0.06); }
html[data-theme="light"] .lesson-item.active { background: rgba(184,146,63,0.12); color: var(--accent); }
html[data-theme="light"] .course-title,
html[data-theme="light"] .page-title,
html[data-theme="light"] h1, html[data-theme="light"] h2, html[data-theme="light"] h3,
html[data-theme="light"] .course-desc,
html[data-theme="light"] .page-subtitle,
html[data-theme="light"] .dash-greet,
html[data-theme="light"] .settings-card-title,
html[data-theme="light"] .ev-item-title,
html[data-theme="light"] .ev-cat,
html[data-theme="light"] .form-help {
  color: var(--text);
}
html[data-theme="light"] .page-subtitle,
html[data-theme="light"] .course-desc,
html[data-theme="light"] .settings-card-desc,
html[data-theme="light"] .ev-item-meta,
html[data-theme="light"] .form-help,
html[data-theme="light"] small {
  color: var(--text-soft) !important;
}
html[data-theme="light"] .dash-stat-label,
html[data-theme="light"] .stat-label {
  color: var(--text-mute);
}
html[data-theme="light"] code,
html[data-theme="light"] pre {
  background: #f0ede7;
  color: #6b4d1a;
}
html[data-theme="light"] .modal-content,
html[data-theme="light"] .modal-overlay {
  background: rgba(255,255,255,0.95);
  color: var(--text);
}
html[data-theme="light"] .modal-overlay { background: rgba(40,30,15,0.55); }
html[data-theme="light"] .cal-day {
  color: var(--text);
}
html[data-theme="light"] .badge {
  background: rgba(184,146,63,0.15);
  color: var(--accent);
}
html[data-theme="light"] .footer,
html[data-theme="light"] .site-footer {
  color: var(--text-mute);
  border-color: var(--border);
}
html[data-theme="light"] .empty-state {
  background: rgba(0,0,0,0.02);
  border-color: var(--border);
  color: var(--text-soft);
}
html[data-theme="light"] .empty-state .icon { opacity: 0.6; }
html[data-theme="light"] .ev-empty {
  background: rgba(0,0,0,0.02);
  border-color: var(--border);
}
html[data-theme="light"] .course-progress-bar { background: rgba(0,0,0,0.06); }
html[data-theme="light"] .progress-bar { background: rgba(0,0,0,0.06); }
html[data-theme="light"] .form-group label,
html[data-theme="light"] label { color: var(--text); }


/* ============================================
   UPSELL FREE → VIP (banner + modal)
   ============================================ */

/* Sticky banner */
.upsell-banner {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 10px 16px;
  background: linear-gradient(90deg, #d4af6e, #ffd60a);
  color: #1a1400;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(0,0,0,.15);
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.upsell-banner-text { line-height: 1.4; }
.upsell-banner-cta {
  display: inline-block;
  padding: 6px 14px;
  background: #1a1400;
  color: #ffd60a;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  transition: transform .15s, background .15s;
}
.upsell-banner-cta:hover { transform: translateY(-1px); background: #000; }
.upsell-banner-dismiss {
  background: none;
  border: 1px solid rgba(26,20,0,.4);
  color: #1a1400;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 600;
  opacity: .8;
}
.upsell-banner-dismiss:hover { opacity: 1; background: rgba(0,0,0,.08); }
@media (max-width: 640px) {
  .upsell-banner { font-size: 12px; padding: 8px 10px; gap: 8px; }
  .upsell-banner-cta { padding: 5px 10px; font-size: 12px; }
}

/* Post-completion modal */
.upsell-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
  animation: upsellFadeIn .3s ease;
}
@keyframes upsellFadeIn { from { opacity: 0; } to { opacity: 1; } }
.upsell-modal {
  background: linear-gradient(180deg, #1a1400 0%, #0a0a0a 100%);
  border: 1px solid rgba(212,175,110,.4);
  border-radius: 16px;
  padding: 32px 28px;
  max-width: 480px;
  width: calc(100% - 32px);
  text-align: center;
  position: relative;
  box-shadow: 0 20px 60px rgba(212,175,110,.2);
  animation: upsellPop .35s cubic-bezier(.4,.2,.4,1.5);
}
@keyframes upsellPop {
  from { transform: scale(.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.upsell-modal-emoji { font-size: 56px; margin-bottom: 8px; line-height: 1; }
.upsell-modal-title {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 10px;
}
.upsell-modal-subtitle {
  font-size: 14px;
  color: rgba(255,255,255,.7);
  margin: 0 0 22px;
  line-height: 1.5;
}
.upsell-modal-course {
  background: rgba(212,175,110,.12);
  border: 1px solid rgba(212,175,110,.35);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 22px;
  text-align: left;
}
.upsell-modal-course-title {
  font-size: 16px;
  font-weight: 700;
  color: #d4af6e;
  margin: 0 0 6px;
}
.upsell-modal-course-desc {
  font-size: 13px;
  color: rgba(255,255,255,.85);
  line-height: 1.5;
  margin: 0 0 10px;
}
.upsell-modal-price {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
}
.upsell-modal-price-old { color: #888; text-decoration: line-through; font-weight: 500; }
.upsell-modal-price-new { color: #ffd60a; font-weight: 800; font-size: 18px; }
.upsell-modal-badge {
  background: #ef4444;
  color: #fff;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}
.upsell-modal-actions {
  display: flex;
  gap: 10px;
  flex-direction: column;
}
.upsell-modal-cta {
  background: linear-gradient(90deg, #d4af6e, #ffd60a);
  color: #1a1400;
  font-weight: 800;
  padding: 14px 24px;
  border-radius: 10px;
  border: none;
  font-size: 15px;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  text-decoration: none;
  display: inline-block;
}
.upsell-modal-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(212,175,110,.4); }
.upsell-modal-secondary {
  background: none;
  border: 1px solid rgba(255,255,255,.15);
  color: rgba(255,255,255,.6);
  padding: 10px 24px;
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
}
.upsell-modal-secondary:hover { color: #fff; border-color: rgba(255,255,255,.3); }
.upsell-modal-close {
  position: absolute;
  top: 12px; right: 14px;
  background: none; border: none;
  color: rgba(255,255,255,.4);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}
.upsell-modal-close:hover { color: #fff; }

/* ============================================================
   COURSE CARD — Membership-gated state (Phương án A)
   ============================================================ */
.cc-price-membership {
  color: #d4af6e;
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.cc-cta-membership {
  background: linear-gradient(135deg, #d4af6e, #f0c87a) !important;
  color: #1a1400 !important;
  border: none !important;
  font-weight: 800 !important;
  box-shadow: 0 4px 12px rgba(212,175,110,0.3);
}
.cc-cta-membership:hover {
  background: linear-gradient(135deg, #f0c87a, #fff5cc) !important;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(212,175,110,0.45);
}

.cc-need-badge-membership {
  background: linear-gradient(135deg, rgba(212,175,110,0.95), rgba(240,200,122,0.95)) !important;
  color: #1a1400 !important;
  font-weight: 800;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 12px rgba(212,175,110,0.4);
}

.course-card.need-membership {
  position: relative;
  border: 1px solid rgba(212,175,110,0.2);
}
.course-card.need-membership:hover {
  border-color: rgba(212,175,110,0.5);
  box-shadow: 0 12px 28px rgba(212,175,110,0.15);
}
.course-card.need-membership .course-thumb {
  position: relative;
}
.course-card.need-membership .course-thumb::after {
  content: "💎 MEMBERSHIP";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(212,175,110,0.85), rgba(168,85,247,0.6));
  color: #1a1400;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 2px;
  border-radius: inherit;
  pointer-events: none;
}

/* ============================================================
   SIDEBAR HIGHLIGHT cho Membership nav item
   ============================================================ */
.sidebar-nav-item.highlight {
  background: linear-gradient(135deg, rgba(212,175,110,0.12), rgba(212,175,110,0.04));
  border: 1px solid rgba(212,175,110,0.3);
  position: relative;
  overflow: hidden;
}
.sidebar-nav-item.highlight:hover {
  background: linear-gradient(135deg, rgba(212,175,110,0.22), rgba(212,175,110,0.08));
  border-color: rgba(212,175,110,0.5);
}
.sidebar-nav-item.highlight .sidebar-nav-label {
  background: linear-gradient(135deg, #f0c87a, #d4af6e);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
}
.sidebar-nav-item.highlight .nav-sparkle {
  position: absolute;
  right: 10px;
  font-size: 11px;
  animation: navSparkle 2s ease-in-out infinite;
}
@keyframes navSparkle {
  0%, 100% { opacity: 0.4; transform: scale(1) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.2) rotate(180deg); }
}

/* ============================================================
   MEMBERSHIP UPSELL BANNER trên courses page
   ============================================================ */
.mb-upsell-banner {
  background:
    radial-gradient(ellipse at top right, rgba(212,175,110,0.15), transparent 60%),
    linear-gradient(135deg, #1a1612, #0d0c0a);
  border: 1px solid rgba(212,175,110,0.35);
  border-radius: 16px;
  padding: 22px 28px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative;
  overflow: hidden;
}
.mb-upsell-banner::before {
  content: "💎";
  position: absolute;
  top: -20px;
  right: -10px;
  font-size: 140px;
  opacity: 0.08;
  pointer-events: none;
}
.mb-upsell-banner-content {
  flex: 1;
  min-width: 0;
}
.mb-upsell-banner-eyebrow {
  font-size: 11px;
  color: #d4af6e;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.mb-upsell-banner-title {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 6px;
  letter-spacing: -0.3px;
}
.mb-upsell-banner-title b {
  background: linear-gradient(135deg, #d4af6e, #f0c87a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.mb-upsell-banner-sub {
  font-size: 13.5px;
  color: #999;
  margin: 0;
  line-height: 1.5;
}
.mb-upsell-banner-cta {
  flex-shrink: 0;
  padding: 13px 24px;
  background: linear-gradient(135deg, #d4af6e, #f0c87a);
  color: #1a1400;
  border-radius: 10px;
  font-weight: 800;
  text-decoration: none;
  font-size: 14px;
  transition: 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(212,175,110,0.25);
  animation: ctaFinalGlow 2.5s ease-in-out infinite;
}
.mb-upsell-banner-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(212,175,110,0.4);
}
.mb-upsell-banner-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.3);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition: color 0.15s;
}
.mb-upsell-banner-close:hover { color: rgba(255,255,255,0.7); }

@media (max-width: 640px) {
  .mb-upsell-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 18px 20px;
  }
  .mb-upsell-banner-cta { width: 100%; text-align: center; padding: 14px; }
  .mb-upsell-banner-title { font-size: 17px; }
}

/* ============================================================
   ADMIN MEMBERSHIP TAB
   ============================================================ */
.am-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.am-stat {
  padding: 16px 18px;
  border-radius: 10px;
  border: 1px solid;
  background: rgba(255,255,255,0.02);
}
.am-stat-label {
  font-size: 11px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}
.am-stat-value {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
}

.am-info-banner {
  background: rgba(212,175,110,0.06);
  border-left: 3px solid #d4af6e;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 22px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-soft);
}

.am-section-title {
  color: #d4af6e;
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid #222;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ----- Tier editor card ----- */
.am-tier {
  background: #0e0e0e;
  border: 1px solid #222;
  border-left: 4px solid var(--tier-color, #d4af6e);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 16px;
}
.am-tier-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid #222;
}
.am-tier-name-wrap {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.am-tier-name {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--tier-color, #d4af6e);
}
.am-tier-slug {
  font-size: 12px;
  color: #666;
  font-family: monospace;
  background: rgba(255,255,255,0.04);
  padding: 2px 8px;
  border-radius: 4px;
}
.am-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  color: #ccc;
  white-space: nowrap;
}
.am-toggle input { cursor: pointer; }

.am-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
.am-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.am-field-label {
  font-size: 11px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}
.am-input,
.am-textarea {
  width: 100%;
  padding: 9px 11px;
  background: rgba(255,255,255,0.04);
  border: 1px solid #2a2a2a;
  border-radius: 7px;
  color: #eee;
  font-size: 14px;
  box-sizing: border-box;
  transition: 0.15s ease;
  font-family: inherit;
}
.am-input:focus,
.am-textarea:focus {
  outline: none;
  border-color: #d4af6e;
  background: rgba(255,255,255,0.06);
}
.am-textarea {
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 12px;
  resize: vertical;
  min-height: 120px;
  line-height: 1.5;
}

.am-courses-picker {
  max-height: 220px;
  overflow-y: auto;
  background: rgba(0,0,0,0.3);
  border: 1px solid #222;
  border-radius: 7px;
  padding: 6px 0;
}
.am-courses-picker::-webkit-scrollbar { width: 6px; }
.am-courses-picker::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
.am-course-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  font-size: 13px;
  color: #ccc;
  cursor: pointer;
  transition: 0.12s ease;
  border-radius: 5px;
}
.am-course-row:hover {
  background: rgba(212,175,110,0.06);
  color: #fff;
}
.am-course-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #d4af6e;
  cursor: pointer;
  flex-shrink: 0;
}

.am-tier-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #222;
  flex-wrap: wrap;
}
.am-save-btn {
  padding: 10px 22px;
  background: linear-gradient(135deg, #d4af6e, #f0c87a);
  color: #1a1400;
  border: none;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
  font-size: 13px;
  transition: 0.18s;
  letter-spacing: 0.3px;
}
.am-save-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(212,175,110,0.3); }
.am-save-btn:disabled { opacity: 0.6; cursor: wait; }

/* ----- Members table ----- */
.am-members-wrap {
  background: #0e0e0e;
  border: 1px solid #222;
  border-radius: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.am-members-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 720px;
}
.am-members-table thead {
  background: rgba(212,175,110,0.06);
  border-bottom: 1px solid #222;
}
.am-members-table th {
  padding: 12px 14px;
  text-align: left;
  color: #d4af6e;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.am-members-table th.right { text-align: right; }
.am-members-table th.center { text-align: center; }
.am-members-table td {
  padding: 12px 14px;
  border-top: 1px solid #1a1a1a;
  color: #ddd;
}
.am-members-table td.right { text-align: right; font-variant-numeric: tabular-nums; }
.am-members-table td.center { text-align: center; }
.am-members-table tr:hover td { background: rgba(255,255,255,0.02); }
.am-status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
}
.am-status-active { background: rgba(34,197,94,0.15); color: #22c55e; }
.am-status-expired { background: rgba(239,68,68,0.15); color: #ef4444; }
.am-status-refunded { background: rgba(251,146,60,0.15); color: #fb923c; }

.am-refund-btn {
  padding: 5px 12px;
  font-size: 11px;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: #ef4444;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.15s;
}
.am-refund-btn:hover { background: rgba(239,68,68,0.2); }

.am-empty-msg {
  text-align: center;
  color: #888;
  padding: 40px 20px;
  font-style: italic;
  background: rgba(0,0,0,0.2);
  border-radius: 10px;
}

/* ----- Responsive ----- */
@media (max-width: 768px) {
  .am-stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .am-stat { padding: 12px; }
  .am-stat-value { font-size: 22px; }
  .am-form-grid { grid-template-columns: 1fr; gap: 10px; }
  .am-tier { padding: 14px; }
  .am-tier-head { gap: 8px; }
  .am-tier-name { font-size: 16px; }
  .am-tier-actions { flex-direction: column; align-items: stretch; }
  .am-save-btn { width: 100%; padding: 12px; }
}
@media (max-width: 420px) {
  .am-stats { grid-template-columns: 1fr; }
}

/* ============================================================
   ADMIN MOBILE POLISH v122 — Funnel / Remarketing / Forms
   ============================================================ */
@media (max-width: 768px) {
  /* Container chính */
  .admin-section,
  #section-shares, #section-funnel, #section-remarketing,
  #section-landing, #section-courses, #section-users,
  #section-payments, #section-coaching, #section-quiz-reset,
  #section-grant {
    padding: 0;
  }

  /* Funnel + Remarketing stats grid: 2 cột thay vì auto-fit */
  #funnel-container > div[style*="grid-template-columns"],
  #remarketing-container > div[style*="grid-template-columns"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  #funnel-container > div[style*="grid-template-columns"] > div,
  #remarketing-container > div[style*="grid-template-columns"] > div {
    padding: 12px !important;
  }
  #funnel-container > div[style*="grid-template-columns"] > div > div:last-child,
  #remarketing-container > div[style*="grid-template-columns"] > div > div:last-child {
    font-size: 22px !important;
  }

  /* Remarketing: form sửa template không tràn */
  #remarketing-container input[type="text"],
  #remarketing-container textarea {
    width: 100% !important;
    box-sizing: border-box !important;
    font-size: 14px !important;
  }
  #remarketing-container textarea {
    height: 220px !important;
    font-size: 11px !important;
  }

  /* Remarketing: nút Lưu + Preview full width side-by-side */
  #remarketing-container [data-tpl-save],
  #remarketing-container [data-tpl-preview] {
    flex: 1;
    min-width: 0;
  }

  /* Funnel step rows: gọn, không vỡ */
  #funnel-container [class*="step"] {
    flex-wrap: wrap !important;
  }

  /* Modal email list (Xem email rớt) */
  .modal-overlay #emails-textarea,
  textarea#emails-textarea {
    height: 200px !important;
    font-size: 11px !important;
  }

  /* Hint scroll cho bảng */
  #users-container::before,
  #payments-container::before {
    content: "← Vuốt ngang để xem thêm →";
    display: block;
    text-align: center;
    color: #888;
    font-size: 11px;
    padding: 6px 0;
    font-style: italic;
  }

  /* Card header: tiêu đề + nút action cùng dòng nếu chỗ */
  .admin-card-header {
    align-items: flex-start !important;
  }
  .admin-card-header > div[style*="display:flex"],
  .admin-card-header > div[style*="display: flex"] {
    width: 100%;
    justify-content: flex-end;
  }
}

/* ----- VERY SMALL (≤420px) — siêu nhỏ ----- */
@media (max-width: 420px) {
  .admin-tab { padding: 9px 12px; font-size: 12px; }
  .admin-card { padding: 12px; }
  .admin-card-title { font-size: 15px; }

  /* Stats: 1 cột to thay vì 2 cột chật */
  #funnel-container > div[style*="grid-template-columns"],
  #remarketing-container > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
  #funnel-container > div[style*="grid-template-columns"] > div,
  #remarketing-container > div[style*="grid-template-columns"] > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px !important;
  }
  #funnel-container > div[style*="grid-template-columns"] > div > div:last-child,
  #remarketing-container > div[style*="grid-template-columns"] > div > div:last-child {
    font-size: 20px !important;
  }
}
