/* ============================================================
   SkillUp Academy — Course Platform
   Original design inspired by common Vietnamese e-learning UX
   ============================================================ */

:root {
  --brand: #4f46e5;
  --brand-dark: #4338ca;
  --brand-light: #eef2ff;
  --accent: #f97316;
  --accent-light: #fff7ed;
  --success: #16a34a;
  --danger: #e11d48;
  --star: #f59e0b;

  --ink: #0f172a;
  --body: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --bg-alt: #f1f5f9;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow: 0 10px 30px rgba(15, 23, 42, .08);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, .12);
  --container: 1180px;
  --font: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--body);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; font-weight: 700; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.section { padding: 84px 0; }
.section-soft { background: var(--bg-soft); }
.section-alt { background: var(--bg-alt); }

.section-head { text-align: center; max-width: 680px; margin: 0 auto 52px; }
.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--brand-light);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.section-head h2 { font-size: clamp(28px, 4vw, 40px); margin-bottom: 14px; }
.section-head p { color: var(--muted); font-size: 17px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 600;
  font-size: 15px;
  padding: 12px 24px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 8px 20px rgba(79, 70, 229, .3); }
.btn-primary:hover { background: var(--brand-dark); box-shadow: 0 12px 26px rgba(79, 70, 229, .38); }
.btn-accent { background: var(--accent); color: #fff; box-shadow: 0 8px 20px rgba(249, 115, 22, .3); }
.btn-accent:hover { background: #ea580c; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-white { background: #fff; color: var(--brand); }
.btn-white:hover { background: var(--brand-light); }
.btn-outline-white { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.btn-outline-white:hover { background: rgba(255,255,255,.12); }
.btn-lg { padding: 15px 32px; font-size: 16px; }
.btn-block { width: 100%; }

/* ---------- Header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; color: var(--ink); }
.logo-mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, var(--brand), #7c3aed);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 20px;
  box-shadow: 0 6px 16px rgba(79,70,229,.35);
}
.logo span { color: var(--brand); }
.nav-menu { display: flex; align-items: center; gap: 4px; }
.nav-menu a {
  font-weight: 500; font-size: 15px; color: var(--body);
  padding: 8px 14px; border-radius: 8px; transition: .2s;
}
.nav-menu a:hover { color: var(--brand); background: var(--brand-light); }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-actions .link-login { font-weight: 600; font-size: 15px; padding: 8px 12px; }
.nav-actions .link-login:hover { color: var(--brand); }
.menu-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.menu-toggle span { display: block; width: 24px; height: 2px; background: var(--ink); margin: 5px 0; border-radius: 2px; transition: .3s; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 72px 0 88px;
  background:
    radial-gradient(1000px 500px at 85% -10%, #ede9fe 0%, transparent 55%),
    radial-gradient(800px 400px at 5% 10%, #fef3e7 0%, transparent 50%),
    var(--bg);
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 56px;
  align-items: center;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  padding: 6px 14px 6px 8px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--body);
  margin-bottom: 22px;
}
.hero-badge .dot { width: 22px; height: 22px; border-radius: 50%; background: var(--accent-light); color: var(--accent); display: grid; place-items: center; font-size: 13px; }
.hero h1 { font-size: clamp(34px, 5vw, 54px); font-weight: 800; letter-spacing: -.02em; margin-bottom: 20px; }
.hero h1 .grad {
  background: linear-gradient(120deg, var(--brand), #7c3aed 60%, var(--accent));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-sub { font-size: 18px; color: var(--muted); margin-bottom: 30px; max-width: 540px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 30px; }
.hero-perks { display: flex; flex-wrap: wrap; gap: 18px 26px; }
.hero-perks li { display: flex; align-items: center; gap: 9px; font-size: 14.5px; font-weight: 500; color: var(--body); }
.hero-perks .check {
  width: 22px; height: 22px; border-radius: 50%; background: #dcfce7; color: var(--success);
  display: grid; place-items: center; font-size: 12px; flex-shrink: 0;
}

/* Hero visual card */
.hero-visual { position: relative; }
.hero-card {
  background: #fff; border: 1px solid var(--line); border-radius: 22px;
  box-shadow: var(--shadow-lg); padding: 22px; position: relative; z-index: 2;
}
.hero-card-thumb {
  border-radius: 14px; height: 190px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6 55%, #ec4899);
  position: relative; overflow: hidden; display: grid; place-items: center; margin-bottom: 18px;
}
.hero-card-thumb .play {
  width: 62px; height: 62px; border-radius: 50%; background: rgba(255,255,255,.95);
  display: grid; place-items: center; color: var(--brand); font-size: 22px;
  box-shadow: 0 10px 30px rgba(0,0,0,.2); cursor: pointer; transition: transform .2s;
}
.hero-card-thumb .play:hover { transform: scale(1.08); }
.hero-card-thumb .tag { position: absolute; top: 14px; left: 14px; background: rgba(0,0,0,.35); color: #fff; font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 999px; backdrop-filter: blur(4px); }
.hero-card h4 { font-size: 17px; margin-bottom: 6px; }
.hero-card .meta { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.hero-card .price-row { display: flex; align-items: center; justify-content: space-between; }
.hero-card .price { font-size: 22px; font-weight: 800; color: var(--brand); }
.hero-card .price s { font-size: 14px; color: var(--muted); font-weight: 500; margin-left: 8px; }
.float-badge {
  position: absolute; background: #fff; border-radius: 14px; box-shadow: var(--shadow);
  padding: 12px 16px; display: flex; align-items: center; gap: 10px; z-index: 3; border: 1px solid var(--line);
}
.float-badge .ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; }
.float-badge strong { display: block; font-size: 16px; color: var(--ink); line-height: 1.1; }
.float-badge small { color: var(--muted); font-size: 12px; }
.float-1 { top: -18px; right: -14px; }
.float-1 .ico { background: #dcfce7; }
.float-2 { bottom: -20px; left: -18px; }
.float-2 .ico { background: var(--accent-light); }

/* ---------- Stats strip ---------- */
.stats { background: var(--brand); color: #fff; }
.stats .container { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; padding-top: 44px; padding-bottom: 44px; }
.stat { text-align: center; }
.stat .num { font-size: clamp(30px, 4vw, 44px); font-weight: 800; line-height: 1; }
.stat .lbl { font-size: 14.5px; opacity: .85; margin-top: 8px; }
.stat + .stat { border-left: 1px solid rgba(255,255,255,.18); }

/* ---------- Steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.step {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px 26px; position: relative; transition: .25s;
}
.step:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.step-num {
  position: absolute; top: 24px; right: 26px; font-size: 46px; font-weight: 800; color: var(--brand-light); line-height: 1;
}
.step-ico { width: 56px; height: 56px; border-radius: 14px; background: var(--brand-light); color: var(--brand); display: grid; place-items: center; font-size: 26px; margin-bottom: 20px; }
.step h3 { font-size: 20px; margin-bottom: 10px; }
.step p { color: var(--muted); font-size: 15px; }

/* ---------- Webinars ---------- */
.webinar-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.webinar {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: .25s; display: flex; flex-direction: column;
}
.webinar:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.webinar-top { padding: 20px 22px; background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; position: relative; }
.webinar-top.free { background: linear-gradient(135deg, #16a34a, #22c55e); }
.webinar-date { display: flex; align-items: baseline; gap: 6px; font-weight: 700; }
.webinar-date .day { font-size: 34px; line-height: 1; }
.webinar-date .mon { font-size: 14px; opacity: .9; }
.webinar-pill { position: absolute; top: 18px; right: 18px; background: rgba(255,255,255,.22); font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 999px; backdrop-filter: blur(4px); }
.webinar-body { padding: 20px 22px; flex: 1; display: flex; flex-direction: column; }
.webinar-body h3 { font-size: 18px; margin-bottom: 8px; }
.webinar-body p { font-size: 14px; color: var(--muted); margin-bottom: 16px; flex: 1; }
.webinar-meta { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.webinar-meta span { display: flex; align-items: center; gap: 5px; }
.webinar-foot { display: flex; align-items: center; justify-content: space-between; }
.webinar-price { font-size: 20px; font-weight: 800; color: var(--ink); }
.webinar-price.free-txt { color: var(--success); }

/* ---------- Course filter + grid ---------- */
.filter-tabs { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 40px; }
.filter-tab {
  font-family: inherit; font-weight: 600; font-size: 14px; color: var(--body);
  background: #fff; border: 1.5px solid var(--line); padding: 9px 20px; border-radius: 999px; cursor: pointer; transition: .2s;
}
.filter-tab:hover { border-color: var(--brand); color: var(--brand); }
.filter-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }

.course-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.course {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: .25s;
}
.course:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: transparent; }
.course-thumb { height: 168px; position: relative; display: grid; place-items: center; color: #fff; }
.course-thumb .ico { font-size: 44px; opacity: .95; }
.course-thumb .cat-tag {
  position: absolute; top: 14px; left: 14px; background: rgba(255,255,255,.92); color: var(--ink);
  font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 999px;
}
.course-thumb .discount {
  position: absolute; top: 14px; right: 14px; background: var(--danger); color: #fff;
  font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 8px;
}
.g1 { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.g2 { background: linear-gradient(135deg, #f97316, #fb923c); }
.g3 { background: linear-gradient(135deg, #0ea5e9, #38bdf8); }
.g4 { background: linear-gradient(135deg, #ec4899, #f472b6); }
.g5 { background: linear-gradient(135deg, #16a34a, #4ade80); }
.g6 { background: linear-gradient(135deg, #8b5cf6, #c084fc); }
.g7 { background: linear-gradient(135deg, #0891b2, #22d3ee); }
.g8 { background: linear-gradient(135deg, #dc2626, #f87171); }
.g9 { background: linear-gradient(135deg, #ca8a04, #facc15); }

.course-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.course-body h3 { font-size: 17px; margin-bottom: 10px; min-height: 44px; }
.course-rate { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); margin-bottom: 8px; }
.course-rate .stars { color: var(--star); letter-spacing: 1px; }
.course-rate b { color: var(--ink); }
.course-meta { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--muted); margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.course-meta span { display: flex; align-items: center; gap: 5px; }
.course-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.course-price .now { font-size: 20px; font-weight: 800; color: var(--brand); }
.course-price .old { font-size: 13px; color: var(--muted); text-decoration: line-through; }
.course-price .free { font-size: 18px; font-weight: 800; color: var(--success); }

.courses-more { text-align: center; margin-top: 46px; }

/* ---------- Features / why ---------- */
.why-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.feature { display: flex; gap: 18px; padding: 26px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); transition: .2s; }
.feature:hover { box-shadow: var(--shadow); }
.feature .ico { width: 52px; height: 52px; flex-shrink: 0; border-radius: 13px; display: grid; place-items: center; font-size: 24px; }
.feature h3 { font-size: 18px; margin-bottom: 6px; }
.feature p { font-size: 14.5px; color: var(--muted); }

/* ---------- Testimonials ---------- */
.tst-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.tst { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.tst .stars { color: var(--star); letter-spacing: 2px; margin-bottom: 14px; }
.tst p { font-size: 15px; color: var(--body); margin-bottom: 20px; }
.tst-who { display: flex; align-items: center; gap: 12px; }
.tst-av { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 17px; }
.tst-who strong { display: block; color: var(--ink); font-size: 15px; }
.tst-who small { color: var(--muted); font-size: 13px; }

/* ---------- FAQ ---------- */
.faq { max-width: 760px; margin: 0 auto; }
.faq-item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 14px; overflow: hidden; }
.faq-q { width: 100%; text-align: left; font-family: inherit; font-weight: 600; font-size: 16px; color: var(--ink); background: none; border: none; padding: 20px 24px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.faq-q .plus { flex-shrink: 0; font-size: 22px; color: var(--brand); transition: transform .25s; }
.faq-item.open .faq-q .plus { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.faq-a p { padding: 0 24px 22px; color: var(--muted); font-size: 15px; }

/* ---------- CTA band ---------- */
.cta {
  background: linear-gradient(120deg, var(--brand), #7c3aed 70%, #a855f7);
  color: #fff; text-align: center; border-radius: 28px; padding: 62px 30px; position: relative; overflow: hidden;
}
.cta::before, .cta::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.09); }
.cta::before { width: 260px; height: 260px; top: -80px; left: -60px; }
.cta::after { width: 200px; height: 200px; bottom: -70px; right: -40px; }
.cta h2 { color: #fff; font-size: clamp(28px, 4vw, 40px); margin-bottom: 14px; position: relative; }
.cta p { font-size: 18px; opacity: .92; max-width: 560px; margin: 0 auto 30px; position: relative; }
.cta-btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; position: relative; }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: #cbd5e1; padding: 64px 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 46px; }
.footer .logo { color: #fff; margin-bottom: 16px; }
.footer-about p { font-size: 14.5px; color: #94a3b8; margin-bottom: 20px; max-width: 320px; }
.footer-social { display: flex; gap: 10px; }
.footer-social a { width: 40px; height: 40px; border-radius: 10px; background: rgba(255,255,255,.08); display: grid; place-items: center; color: #cbd5e1; font-size: 17px; transition: .2s; }
.footer-social a:hover { background: var(--brand); color: #fff; }
.footer-col h4 { color: #fff; font-size: 16px; margin-bottom: 18px; }
.footer-col ul li { margin-bottom: 11px; }
.footer-col a { font-size: 14.5px; color: #94a3b8; transition: .2s; }
.footer-col a:hover { color: #fff; }
.footer-contact li { display: flex; gap: 10px; font-size: 14.5px; color: #94a3b8; margin-bottom: 12px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 22px 0; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 13.5px; color: #94a3b8; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { max-width: 460px; margin: 0 auto; }
  .steps, .webinar-grid, .course-grid, .tst-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .stats .container { grid-template-columns: repeat(2, 1fr); gap: 30px; }
  .stat + .stat { border-left: none; }
}

@media (max-width: 720px) {
  .section { padding: 60px 0; }
  .nav-menu, .nav-actions .link-login { display: none; }
  .menu-toggle { display: block; }
  .nav-menu.open {
    display: flex; flex-direction: column; align-items: stretch;
    position: absolute; top: 72px; left: 0; right: 0; background: #fff;
    border-bottom: 1px solid var(--line); padding: 12px 20px; gap: 4px; box-shadow: var(--shadow);
  }
  .nav-menu.open a { padding: 12px; border-radius: 8px; }
  .why-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .steps, .webinar-grid, .course-grid, .tst-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 32px; }
  .hero-cta .btn { flex: 1; }
  .footer-grid { grid-template-columns: 1fr; }
  .cta { padding: 46px 22px; }
}

/* ============================================================
   ADDED COMPONENTS — multi-page (cart, detail, auth, checkout)
   ============================================================ */

.btn-sm { padding: 9px 16px; font-size: 14px; }

/* Header extras */
.cart-btn { position: relative; font-size: 20px; width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: var(--bg-alt); transition: .2s; }
.cart-btn:hover { background: var(--brand-light); }
.cart-count { position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.user-chip { display: flex; align-items: center; gap: 8px; }
.user-av { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px; }
.user-name { font-weight: 600; font-size: 14px; color: var(--ink); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Page hero */
.page-hero { background: linear-gradient(135deg, var(--brand-light), #faf5ff); border-bottom: 1px solid var(--line); padding: 48px 0 40px; }
.page-hero.small { padding: 34px 0 28px; }
.page-hero h1 { font-size: clamp(28px, 4vw, 40px); margin: 8px 0 10px; }
.page-hero p { color: var(--muted); font-size: 16px; max-width: 620px; }
.crumbs { font-size: 13.5px; color: var(--muted); }
.crumbs a:hover { color: var(--brand); }
.crumbs.light, .crumbs.light a { color: rgba(255,255,255,.85); }

/* Courses toolbar */
.courses-toolbar { display: flex; gap: 14px; justify-content: space-between; align-items: center; margin-bottom: 22px; flex-wrap: wrap; }
.search-box { display: flex; align-items: center; gap: 8px; background: #fff; border: 1.5px solid var(--line); border-radius: 999px; padding: 10px 18px; flex: 1; max-width: 420px; }
.search-box input { border: none; outline: none; font-family: inherit; font-size: 15px; width: 100%; background: none; color: var(--ink); }
.select { font-family: inherit; font-size: 14.5px; font-weight: 500; color: var(--ink); border: 1.5px solid var(--line); border-radius: 999px; padding: 10px 18px; background: #fff; cursor: pointer; }
.result-count { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.empty-state { text-align: center; padding: 60px 20px; }
.empty-ico { font-size: 52px; margin-bottom: 12px; }
.empty-state h3 { font-size: 20px; margin-bottom: 8px; }
.empty-state p { color: var(--muted); }

/* ---------- Course detail ---------- */
.course-hero { background: linear-gradient(135deg, #312e81, #4f46e5 60%, #7c3aed); color: #fff; padding: 44px 0 52px; }
.course-hero-grid { display: grid; grid-template-columns: 1fr 380px; gap: 40px; align-items: start; }
.ch-cat { display: inline-block; background: rgba(255,255,255,.18); font-size: 13px; font-weight: 700; padding: 5px 14px; border-radius: 999px; margin: 14px 0 12px; }
.course-hero h1 { color: #fff; font-size: clamp(26px, 3.6vw, 38px); margin-bottom: 14px; }
.ch-sub { font-size: 17px; opacity: .92; margin-bottom: 18px; max-width: 620px; }
.ch-stats { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14.5px; margin-bottom: 14px; }
.ch-rate b { color: #fde047; }
.ch-rate .stars { color: #fde047; }
.ch-teacher { font-size: 14.5px; opacity: .9; }

.ch-card { background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; position: sticky; top: 90px; }
.ch-card-thumb { height: 190px; position: relative; display: grid; place-items: center; color: #fff; }
.ch-card-thumb .ico { font-size: 52px; }
.ch-card-thumb .play { position: absolute; width: 58px; height: 58px; border-radius: 50%; background: rgba(255,255,255,.92); color: var(--brand); display: grid; place-items: center; font-size: 20px; cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.ch-card-body { padding: 22px; }
.cp-price { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.cp-price .now { font-size: 30px; font-weight: 800; color: var(--ink); }
.cp-price .old { font-size: 16px; color: var(--muted); text-decoration: line-through; }
.cp-price .free { font-size: 28px; font-weight: 800; color: var(--success); }
.cp-off { background: var(--danger); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 7px; }
.cp-timer { font-size: 13px; color: var(--danger); background: #fef2f2; padding: 8px 12px; border-radius: 9px; margin: 12px 0 16px; text-align: center; }
.ch-card-body .btn { margin-bottom: 10px; }
.ch-incl { margin: 18px 0 14px; }
.ch-incl li { font-size: 14px; color: var(--body); padding: 7px 0; border-bottom: 1px dashed var(--line); }
.ch-incl li:last-child { border-bottom: none; }
.ch-guarantee { font-size: 13px; color: var(--success); background: #f0fdf4; padding: 10px; border-radius: 9px; text-align: center; }

.course-body-grid { display: grid; grid-template-columns: 1fr 300px; gap: 40px; align-items: start; }
.tabs { display: flex; gap: 6px; border-bottom: 2px solid var(--line); margin-bottom: 26px; }
.tab { font-family: inherit; font-weight: 600; font-size: 15.5px; color: var(--muted); background: none; border: none; padding: 12px 18px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: .2s; }
.tab:hover { color: var(--brand); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.learn-box { background: var(--brand-light); border-radius: var(--radius); padding: 26px; margin-bottom: 30px; }
.learn-box h3 { font-size: 20px; margin-bottom: 16px; }
.learn-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; }
.learn-list li { display: flex; gap: 10px; font-size: 15px; }
.lk { color: var(--success); font-weight: 800; flex-shrink: 0; }
.cb-h { font-size: 20px; margin: 26px 0 12px; }
.cb-p { color: var(--body); font-size: 15.5px; margin-bottom: 14px; }
.req-list li { color: var(--body); font-size: 15px; padding: 4px 0; }

.curriculum { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.curr-head { background: var(--bg-alt); padding: 14px 20px; font-size: 14px; font-weight: 600; color: var(--body); }
.curr-sec { border-top: 1px solid var(--line); }
.curr-sec-head { width: 100%; display: flex; justify-content: space-between; align-items: center; background: #fff; border: none; font-family: inherit; font-weight: 700; font-size: 15.5px; color: var(--ink); padding: 16px 20px; cursor: pointer; }
.curr-meta { display: flex; align-items: center; gap: 12px; font-weight: 500; font-size: 13.5px; color: var(--muted); }
.curr-meta .plus { font-style: normal; font-size: 20px; color: var(--brand); transition: transform .25s; }
.curr-sec.open .curr-meta .plus { transform: rotate(45deg); }
.curr-list { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.curr-sec.open .curr-list { max-height: 600px; }
.curr-lesson { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; border-top: 1px solid var(--line); font-size: 14.5px; }
.cl-name { color: var(--body); }
.cl-dur { color: var(--muted); font-size: 13px; }
.cl-dur .prev { color: var(--brand); }

.ins-card { display: flex; gap: 22px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.ins-av { width: 84px; height: 84px; border-radius: 50%; color: #fff; font-weight: 800; font-size: 34px; display: grid; place-items: center; flex-shrink: 0; }
.ins-role { color: var(--brand); font-weight: 600; margin-bottom: 10px; }
.ins-stats { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; color: var(--muted); margin-bottom: 14px; }

.side-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; position: sticky; top: 90px; }
.side-box h4 { font-size: 16px; margin-bottom: 14px; }
.info-list li { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 14.5px; color: var(--muted); }
.info-list li:last-child { border-bottom: none; }
.info-list b { color: var(--ink); }

/* ---------- Auth pages ---------- */
.auth-body { background: var(--bg-soft); }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; max-width: 1080px; margin: 0 auto; }
.auth-brand { background: linear-gradient(150deg, var(--brand), #7c3aed 70%, #a855f7); color: #fff; padding: 56px 48px; display: flex; flex-direction: column; justify-content: center; }
.auth-brand h2 { color: #fff; font-size: 30px; margin: 34px 0 14px; }
.auth-brand p { opacity: .92; font-size: 16px; margin-bottom: 26px; }
.auth-perks li { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; font-size: 15px; }
.auth-perks span { width: 24px; height: 24px; border-radius: 50%; background: rgba(255,255,255,.2); display: grid; place-items: center; font-size: 13px; flex-shrink: 0; }
.auth-panel { background: #fff; padding: 48px 44px; display: flex; flex-direction: column; justify-content: center; }
.auth-back { font-size: 14px; color: var(--muted); margin-bottom: 20px; }
.auth-back:hover { color: var(--brand); }
.auth-panel h1 { font-size: 30px; margin-bottom: 8px; }
.auth-lead { color: var(--muted); margin-bottom: 26px; }
.auth-form .field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: 14px; color: var(--ink); margin-bottom: 7px; }
.field input, .co-fields input, .card-form input, .field textarea, .field .ta { width: 100%; font-family: inherit; font-size: 15px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); outline: none; transition: .2s; color: var(--ink); background: #fff; }
.field textarea, .field .ta { resize: vertical; line-height: 1.5; }
.field textarea:focus, .field .ta:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light); }
.field input:focus, .co-fields input:focus, .card-form input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light); }
.field.invalid input { border-color: var(--danger); }
.field .err { display: block; color: var(--danger); font-size: 12.5px; margin-top: 5px; min-height: 4px; }
.pw-wrap { position: relative; }
.pw-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; font-size: 16px; opacity: .6; }
.pw-meter { height: 5px; background: var(--line); border-radius: 999px; margin-top: 8px; overflow: hidden; }
.pw-meter span { display: block; height: 100%; width: 0; background: var(--danger); border-radius: 999px; transition: width .25s, background .25s; }
.field-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.checkbox { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--body); cursor: pointer; }
.checkbox.agree { margin-bottom: 20px; }
.checkbox.invalid { color: var(--danger); }
.link-sm { font-size: 14px; color: var(--brand); font-weight: 600; }
.auth-or { text-align: center; position: relative; margin: 24px 0; }
.auth-or::before { content: ""; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--line); }
.auth-or span { position: relative; background: #fff; padding: 0 14px; color: var(--muted); font-size: 13px; }
.social-auth { display: grid; gap: 10px; }
.auth-switch { text-align: center; margin-top: 22px; font-size: 15px; color: var(--body); }
.auth-switch a { color: var(--brand); font-weight: 600; }
.auth-demo { margin-top: 18px; font-size: 12.5px; color: var(--muted); background: var(--bg-alt); padding: 10px 12px; border-radius: 9px; text-align: center; }

/* ---------- Checkout ---------- */
.checkout-grid { display: grid; grid-template-columns: 1fr 380px; gap: 30px; align-items: start; }
.co-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 22px; }
.co-box h3 { font-size: 18px; margin-bottom: 18px; }
.co-fields { display: grid; gap: 16px; }
.co-fields.two { grid-template-columns: 1fr 1fr; }
.pay-methods { display: grid; gap: 12px; }
.pay-method { display: flex; align-items: center; gap: 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; cursor: pointer; transition: .2s; position: relative; }
.pay-method:hover { border-color: var(--brand); }
.pay-method.active { border-color: var(--brand); background: var(--brand-light); }
.pay-method input { accent-color: var(--brand); width: 18px; height: 18px; }
.pm-ico { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; font-size: 22px; }
.pm-txt b { display: block; font-size: 15px; color: var(--ink); }
.pm-txt small { color: var(--muted); font-size: 13px; }
.pm-badge { position: absolute; top: 12px; right: 14px; background: var(--success); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }

.co-summary { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; position: sticky; top: 90px; }
.co-summary h3 { font-size: 18px; margin-bottom: 18px; }
.co-items { display: grid; gap: 14px; margin-bottom: 18px; }
.co-item { display: flex; align-items: center; gap: 12px; }
.co-item-ico { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; font-size: 20px; color: #fff; flex-shrink: 0; }
.co-item-info { flex: 1; min-width: 0; }
.co-item-info b { display: block; font-size: 14px; color: var(--ink); line-height: 1.3; }
.co-item-info small { color: var(--muted); font-size: 12.5px; }
.co-item-price { font-weight: 700; font-size: 14px; color: var(--ink); white-space: nowrap; }
.coupon { display: flex; gap: 8px; margin: 16px 0 6px; }
.coupon input { flex: 1; font-family: inherit; font-size: 14px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); outline: none; }
.coupon input:focus { border-color: var(--brand); }
.coupon-msg { font-size: 13px; min-height: 6px; margin-bottom: 6px; }
.coupon-msg.ok { color: var(--success); }
.coupon-msg.bad { color: var(--danger); }
.co-totals { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 10px; }
.ct-row { display: flex; justify-content: space-between; font-size: 14.5px; color: var(--body); margin-bottom: 10px; }
.ct-row.save b { color: var(--success); }
.ct-row.total { font-size: 18px; padding-top: 12px; border-top: 1px dashed var(--line); }
.ct-row.total b { color: var(--brand); font-size: 22px; }
.co-summary .btn { margin-top: 6px; }
.co-secure { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: 12px; }

/* Payment screen */
.pay-screen, .success-screen { max-width: 560px; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 32px; }
.pay-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.pay-order { font-size: 14px; color: var(--muted); }
.pay-amt { font-size: 22px; font-weight: 800; color: var(--brand); }
.qr-wrap { display: flex; gap: 22px; align-items: center; background: var(--bg-soft); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.qr { width: 150px; height: 150px; border-radius: 10px; box-shadow: var(--shadow-sm); background: #fff; padding: 6px; }
.qr-info { flex: 1; min-width: 200px; }
.qr-bank { margin-bottom: 8px; }
.qr-line { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; color: var(--muted); padding: 4px 0; }
.qr-line b { color: var(--ink); }
.qr-amt { color: var(--brand) !important; font-size: 16px; }
.pay-status { display: flex; align-items: center; gap: 14px; background: #fffbeb; border: 1px solid #fde68a; border-radius: var(--radius-sm); padding: 16px; margin-bottom: 18px; }
.pay-status b { color: var(--ink); font-size: 15px; }
.pay-status small { display: block; color: var(--muted); font-size: 13px; }
.pay-countdown { margin-left: auto; font-weight: 800; font-size: 18px; color: var(--accent); font-variant-numeric: tabular-nums; }
.spinner { width: 26px; height: 26px; border: 3px solid var(--brand-light); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.pay-actions { display: flex; gap: 12px; }
.pay-actions .btn { flex: 1; }
.pay-hint { font-size: 12.5px; color: var(--muted); text-align: center; margin-top: 16px; }
.card-form { margin-bottom: 20px; }
.card-form .field { margin-bottom: 14px; }
.card-note { font-size: 12.5px; color: var(--muted); }

/* Success */
.success-screen { text-align: center; }
.success-ring { width: 92px; height: 92px; margin: 0 auto 20px; border-radius: 50%; background: #dcfce7; display: grid; place-items: center; animation: pop .5s ease; }
.success-check { width: 62px; height: 62px; border-radius: 50%; background: var(--success); color: #fff; font-size: 32px; display: grid; place-items: center; }
@keyframes pop { 0% { transform: scale(0); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
.success-screen h2 { font-size: 26px; margin-bottom: 8px; }
.success-screen > p { color: var(--muted); margin-bottom: 24px; }
.success-card { background: var(--bg-soft); border-radius: var(--radius); padding: 20px; text-align: left; margin-bottom: 22px; }
.sc-row { display: flex; justify-content: space-between; font-size: 14.5px; color: var(--muted); padding: 7px 0; }
.sc-row b { color: var(--ink); }
.sc-row.total { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 12px; font-size: 16px; }
.sc-row.total b { color: var(--brand); font-size: 20px; }
.success-items { text-align: left; margin-bottom: 24px; }
.success-items h4 { font-size: 15px; margin-bottom: 12px; }
.si-row { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 10px; transition: .2s; }
.si-row:hover { border-color: var(--brand); background: var(--brand-light); }
.si-row b { flex: 1; font-size: 14.5px; color: var(--ink); }
.si-go { color: var(--brand); font-weight: 600; font-size: 14px; }
.success-actions { display: flex; gap: 12px; justify-content: center; }

/* Responsive for added components */
@media (max-width: 900px) {
  .course-hero-grid, .course-body-grid, .checkout-grid { grid-template-columns: 1fr; }
  .ch-card, .side-box, .co-summary { position: static; }
  .learn-list { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-panel { padding: 40px 24px; min-height: 100vh; }
}
@media (max-width: 560px) {
  .co-fields.two { grid-template-columns: 1fr; }
  .success-actions, .pay-actions { flex-direction: column; }
  .qr-wrap { justify-content: center; text-align: center; }
}

/* ============================================================
   ADMIN
   ============================================================ */
.admin-login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.admin-login-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 36px 34px; width: 100%; max-width: 400px; }
.admin-login-tag { text-align: center; font-size: 13px; font-weight: 600; color: var(--brand); background: var(--brand-light); padding: 6px 14px; border-radius: 999px; width: fit-content; margin: 0 auto 16px; }
.admin-login-card h1 { text-align: center; font-size: 24px; margin-bottom: 24px; }
.admin-login-card .field { margin-bottom: 16px; }
.err-msg { font-size: 13.5px; color: var(--danger); min-height: 6px; margin-bottom: 8px; }
.err-msg.ok { color: var(--success); }

.admin-topbar { background: #fff; border-bottom: 1px solid var(--line); height: 66px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; position: sticky; top: 0; z-index: 50; }
.admin-topbar-right { display: flex; align-items: center; gap: 14px; }
.admin-who { font-size: 14px; font-weight: 600; color: var(--ink); }
.admin-shell { max-width: 1180px; margin: 0 auto; padding: 30px 24px 60px; }
.admin-h { font-size: 22px; margin-bottom: 20px; }

.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 28px; }
.admin-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: flex; align-items: center; gap: 16px; }
.ac-ico { width: 52px; height: 52px; border-radius: 13px; display: grid; place-items: center; font-size: 24px; flex-shrink: 0; }
.ac-val { font-size: 26px; font-weight: 800; color: var(--ink); line-height: 1.1; }
.ac-lbl { font-size: 13.5px; color: var(--muted); margin-top: 2px; }

.admin-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 22px; margin-bottom: 22px; }
.admin-section { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 22px; }
.admin-grid .admin-section { margin-bottom: 0; }
.admin-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.admin-section-head h3 { font-size: 17px; }
.activate-form .field { margin-bottom: 14px; }

.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { text-align: left; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 12px; border-bottom: 2px solid var(--line); white-space: nowrap; }
.data-table td { padding: 12px; border-bottom: 1px solid var(--line); color: var(--body); vertical-align: top; }
.data-table td small { color: var(--muted); font-size: 12px; }
.data-table td.num { font-weight: 700; color: var(--ink); white-space: nowrap; }
.data-table tbody tr:hover, .data-table tr:hover { background: var(--bg-soft); }
.empty-cell { text-align: center; color: var(--muted); padding: 30px !important; }
.badge { display: inline-block; background: var(--brand-light); color: var(--brand); font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.badge-soft { background: var(--bg-alt); color: var(--body); margin-bottom: 4px; }

@media (max-width: 860px) {
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .admin-grid { grid-template-columns: 1fr !important; }
}

/* Admin tabs */
.admin-tabs-bar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 66px; z-index: 40; }
.admin-tabs { display: flex; gap: 4px; }
.admin-tab { font-family: inherit; font-weight: 600; font-size: 14.5px; color: var(--muted); background: none; border: none; border-bottom: 3px solid transparent; padding: 15px 18px; cursor: pointer; transition: .2s; }
.admin-tab:hover { color: var(--brand); }
.admin-tab.active { color: var(--brand); border-bottom-color: var(--brand); }

/* CRM */
.crm-toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.status-badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 11px; border-radius: 999px; white-space: nowrap; }
.tag-chip { display: inline-block; background: var(--bg-alt); color: var(--body); font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 6px; margin: 3px 3px 0 0; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.5); backdrop-filter: blur(2px); z-index: 200; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; }
.modal { background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); padding: 26px; width: 100%; max-width: 560px; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.modal-head h3 { font-size: 20px; }
.modal-close { background: var(--bg-alt); border: none; width: 34px; height: 34px; border-radius: 9px; font-size: 15px; cursor: pointer; color: var(--muted); flex-shrink: 0; }
.modal-close:hover { background: var(--line); }
.modal .field { margin-bottom: 14px; }
.crm-detail-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; background: var(--bg-soft); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 18px; }
.crm-detail-stats > div { text-align: center; }
.crm-detail-stats b { display: block; font-size: 19px; color: var(--ink); }
.crm-detail-stats span { font-size: 12.5px; color: var(--muted); }
.crm-row { margin-bottom: 12px; }
.crm-row label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
.sess-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.crm-row .select, .crm-row input { width: 100%; }
.crm-h { font-size: 14px; margin: 18px 0 8px; color: var(--ink); }
.hist-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.hist-row b { white-space: nowrap; }
.note-add { display: flex; gap: 8px; margin-bottom: 12px; }
.note-add input { flex: 1; }
.note-item { background: var(--bg-soft); border-left: 3px solid var(--brand); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; font-size: 14px; }
.note-at { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }

/* Finance */
.fin-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 26px; }
.admin-card.fin-profit { border-width: 2px; border-color: currentColor; }
.etype { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.etype-ads { background: #fee2e2; color: #dc2626; }
.etype-salary { background: #ffedd5; color: #ea580c; }
.etype-other { background: #e2e8f0; color: #475569; }
.icon-del { background: none; border: none; cursor: pointer; font-size: 15px; opacity: .6; }
.icon-del:hover { opacity: 1; }

.fin-cards-3 { grid-template-columns: repeat(3, 1fr); }
.chan-badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 11px; border-radius: 999px; white-space: nowrap; }
.bar { display: inline-block; width: 70px; height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; vertical-align: middle; margin-right: 7px; }
.bar span { display: block; height: 100%; border-radius: 999px; }
.data-table tr.row-total td { border-top: 2px solid var(--line); background: var(--bg-soft); }
.fin-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line); }
.fin-form .select, .fin-form input { font-family: inherit; font-size: 13.5px; padding: 9px 11px; border: 1.5px solid var(--line); border-radius: 8px; outline: none; }
.fin-form .select:focus, .fin-form input:focus { border-color: var(--brand); }
.fin-form input[name=name], .fin-form input[name=note] { flex: 1; min-width: 110px; }
.fin-form input[name=amount] { width: 120px; }
.fin-form input[name=date] { width: 150px; }
.fin-form .err-msg { width: 100%; margin: 0; }

/* Video player */
.video-box { background: #0f172a; border-radius: 16px; width: 100%; max-width: 900px; overflow: hidden; box-shadow: var(--shadow-lg); }
.video-bar { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; color: #fff; font-weight: 600; font-size: 15px; }
.video-bar .modal-close { background: rgba(255,255,255,.15); color: #fff; }
.video-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.curr-lesson.playable { cursor: pointer; }
.curr-lesson.playable:hover { background: var(--brand-light); }
.curr-lesson.playable .cl-name { color: var(--brand); }
.cl-right { display: flex; align-items: center; gap: 10px; }
.cl-check { background: none; border: none; cursor: pointer; font-size: 15px; line-height: 1; color: var(--muted); padding: 2px; border-radius: 50%; }
.cl-check.done { color: var(--success); }
.cl-check:hover { transform: scale(1.15); }
.prog-wrap { padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--bg-soft); }
.prog-bar { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; margin-bottom: 8px; }
.prog-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #22c55e); border-radius: 999px; transition: width .4s ease; }
.prog-txt { font-size: 13px; color: var(--body); font-weight: 600; }
#markBtn { white-space: nowrap; }

/* Course builder (admin) */
.builder-sec { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 12px; background: var(--bg-soft); }
.builder-sec-top { display: flex; gap: 8px; margin-bottom: 10px; }
.builder-sec-top input { flex: 1; font-family: inherit; font-size: 14px; font-weight: 600; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 8px; }
.builder-lesson { display: grid; grid-template-columns: 1.4fr 70px 1.8fr auto auto; gap: 6px; align-items: center; margin-bottom: 6px; }
.builder-lesson input[type=text] { font-family: inherit; font-size: 13px; padding: 7px 9px; border: 1.5px solid var(--line); border-radius: 7px; width: 100%; }
.builder-lesson label { font-size: 12px; display: flex; align-items: center; gap: 4px; white-space: nowrap; color: var(--muted); }
.builder-lesson .icon-del { font-size: 14px; }
.mini-btn { font-family: inherit; font-size: 12.5px; font-weight: 600; padding: 6px 12px; border: 1.5px dashed var(--line); background: #fff; border-radius: 8px; cursor: pointer; color: var(--brand); }
.mini-btn:hover { border-color: var(--brand); }
@media (max-width: 640px) { .builder-lesson { grid-template-columns: 1fr; } }

/* Messaging channels */
.chan-status { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 8px; }
.chan-card { background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: flex; align-items: center; gap: 14px; }
.chan-card.on { border-color: #16a34a; background: #f0fdf4; }
.chan-ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; flex-shrink: 0; }
.chan-info b { display: block; font-size: 15px; color: var(--ink); }
.chan-state { font-size: 13px; color: var(--muted); font-weight: 600; }
.chan-state.ok { color: var(--success); }
.chan-hint { grid-column: 1 / -1; font-size: 13px; color: var(--muted); background: var(--bg-alt); padding: 12px 14px; border-radius: 10px; margin-top: 6px; }
.chan-hint code { background: #fff; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line); font-size: 12.5px; }

@media (max-width: 860px) {
  .fin-cards, #crmCards { grid-template-columns: repeat(2, 1fr) !important; }
  .fin-cards-3 { grid-template-columns: 1fr !important; }
  .chan-status { grid-template-columns: 1fr; }
}
