:root {
  --green: #16a34a;
  --green-l: #4ade80;
  --blue: #1d4ed8;
  --blue-l: #60a5fa;
  --bg: #f0fdf4;
  --surface: #ffffff;
  --border: #d1fae5;
  --text: #14532d;
  --text2: #166534;
  --text3: #6b7280;
  --sidebar-w: 240px;
  --radius: 14px;
  --shadow: 0 2px 16px rgba(22,163,74,0.1);
  --shadow-lg: 0 8px 32px rgba(22,163,74,0.18);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Sarabun', sans-serif; background: var(--bg); color: #1a1a1a; min-height: 100vh; }

/* ── AUTH ── */
#authPage, #pendingPage, #dashboardPage { min-height: 100vh; }
#authPage {
  min-height: 100vh; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0a0a1a 0%, #0f172a 50%, #0a1628 100%);
  position: relative; overflow: hidden;
}
.login-bg { position: absolute; inset: 0; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); animation: blobF 9s ease-in-out infinite alternate; }
.b1 { width: 520px; height: 520px; background: #22c55e; top: -160px; left: -120px; opacity: 0.12; }
.b2 { width: 400px; height: 400px; background: #818cf8; bottom: -80px; right: -60px; animation-delay: 4s; opacity: 0.1; }
.dna { position: absolute; width: 3px; opacity: 0.12; background: repeating-linear-gradient(to bottom, #4ade80 0, #4ade80 10px, transparent 10px, transparent 20px); animation: dnaFall 6s linear infinite; }
.dna1 { height: 100%; left: 15%; }
.dna2 { height: 100%; right: 20%; animation-delay: 3s; }
@keyframes blobF { from{transform:translate(0,0) scale(1)} to{transform:translate(30px,25px) scale(1.1)} }
@keyframes dnaFall { from{transform:translateY(-100%)} to{transform:translateY(100%)} }

.login-card {
  background: rgba(255,255,255,0.04); backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.08); border-radius: 24px;
  padding: 44px 40px; width: 100%; max-width: 420px;
  position: relative; z-index: 1;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
  animation: cardIn 0.55s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes cardIn { from{opacity:0;transform:translateY(40px) scale(0.93)} to{opacity:1;transform:none} }

.login-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.logo-circle { width: 60px; height: 60px; border-radius: 16px; background: linear-gradient(135deg, #16a34a, #4ade80); display: flex; align-items: center; justify-content: center; font-size: 28px; animation: pulse 2.5s ease-in-out infinite; overflow: hidden; }
.logo-circle img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }
@keyframes pulse { 0%,100%{box-shadow:0 0 0 0 rgba(74,222,128,0.4)} 50%{box-shadow:0 0 0 12px rgba(74,222,128,0)} }
.logo-main { font-family:'Prompt',sans-serif; font-size:26px; font-weight:800; color:#fff; display:block; line-height:1; }
.logo-sub { font-size:13px; color:rgba(255,255,255,0.55); }
.login-title { font-family:'Prompt',sans-serif; font-size:18px; font-weight:600; color:rgba(255,255,255,0.85); margin-bottom:22px; }

.auth-tabs { display:flex; gap:0; margin-bottom:22px; border-radius:10px; overflow:hidden; border:1.5px solid rgba(255,255,255,0.15); }
.atab { flex:1; padding:10px; background:transparent; border:none; color:rgba(255,255,255,0.55); font-family:'Sarabun',sans-serif; font-size:14px; font-weight:600; cursor:pointer; transition:all 0.2s; }
.atab.active { background:rgba(74,222,128,0.25); color:#4ade80; }

.form-group { margin-bottom:18px; }
.form-group label { display:block; color:rgba(255,255,255,0.65); font-size:13px; margin-bottom:7px; }
.form-group input { width:100%; padding:13px 16px; background:rgba(255,255,255,0.09); border:1px solid rgba(255,255,255,0.18); border-radius:10px; color:#fff; font-family:'Sarabun',sans-serif; font-size:15px; outline:none; transition:all 0.2s; }
.form-group input::placeholder { color:rgba(255,255,255,0.3); }
.form-group input:focus { background:rgba(255,255,255,0.14); border-color:#4ade80; box-shadow:0 0 0 3px rgba(74,222,128,0.2); }
.pw-wrap { position:relative; }
.pw-wrap input { padding-right:46px; }
.eye { position:absolute; right:12px; top:50%; transform:translateY(-50%); background:none; border:none; cursor:pointer; font-size:17px; opacity:0.55; transition:opacity 0.2s; }
.eye:hover { opacity:1; }
.err-msg { color:#fca5a5; font-size:13px; min-height:18px; text-align:center; margin-bottom:10px; }
.btn-login { width:100%; padding:14px; border:none; border-radius:11px; background:linear-gradient(135deg, #16a34a, #22c55e); color:#fff; font-family:'Prompt',sans-serif; font-size:16px; font-weight:600; cursor:pointer; transition:all 0.2s; box-shadow:0 4px 20px rgba(22,163,74,0.45); }
.btn-login:hover { transform:translateY(-2px); box-shadow:0 8px 28px rgba(22,163,74,0.55); }
.btn-forgot { background:none; border:none; color:rgba(255,255,255,0.45); font-size:13px; cursor:pointer; text-decoration:underline; font-family:'Sarabun',sans-serif; transition:color 0.2s; }
.btn-forgot:hover { color:rgba(255,255,255,0.8); }
.reg-note { margin-top:14px; font-size:12px; color:rgba(255,255,255,0.45); text-align:center; line-height:1.5; }

/* ── PENDING ── */
.pending-card { background:rgba(255,255,255,0.08); backdrop-filter:blur(20px); border:1px solid rgba(255,255,255,0.15); border-radius:20px; padding:40px; text-align:center; max-width:380px; color:#fff; }
.pending-card h2 { font-family:'Prompt',sans-serif; font-size:22px; margin-bottom:12px; }
.pending-card p { opacity:0.75; font-size:15px; line-height:1.6; }

/* ── DASHBOARD ── */
#dashboardPage { min-height:100vh; flex-direction:row; }
.sidebar { width:var(--sidebar-w); min-height:100vh; background:linear-gradient(180deg, #052e16 0%, #14532d 100%); display:flex; flex-direction:column; position:fixed; left:0; top:0; bottom:0; z-index:100; transition:transform 0.3s; }
.sb-logo { display:flex; align-items:center; gap:10px; padding:22px 18px; border-bottom:1px solid rgba(255,255,255,0.08); }
.sb-dna { font-size:28px; }
.sb-dna img { width:36px; height:36px; object-fit:cover; border-radius:50%; border:2px solid rgba(255,255,255,0.2); }
.sb-brand { font-family:'Prompt',sans-serif; font-size:18px; font-weight:800; color:#fff; line-height:1; }
.sb-tagline { font-size:11px; color:rgba(255,255,255,0.45); }
.sb-section-label { padding:16px 18px 6px; font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:1px; color:rgba(255,255,255,0.3); }
.sb-nav { padding:0 10px; }
.nav-item { display:flex; align-items:center; gap:10px; padding:11px 14px; border-radius:10px; color:rgba(255,255,255,0.6); text-decoration:none; font-size:14px; margin-bottom:2px; transition:all 0.2s; }
.nav-item:hover { background:rgba(255,255,255,0.08); color:#fff; }
.nav-item.active { background:rgba(74,222,128,0.2); color:#4ade80; font-weight:600; }
.nav-item.locked { color:rgba(255,255,255,0.3); cursor:pointer; }
.nav-item.locked:hover { background:rgba(255,255,255,0.05); color:rgba(255,255,255,0.5); }
.sb-footer { margin-top:auto; padding:14px; border-top:1px solid rgba(255,255,255,0.08); display:flex; align-items:center; gap:8px; }
.sb-user { flex:1; display:flex; align-items:center; gap:8px; overflow:hidden; }
.sb-avatar { width:34px; height:34px; border-radius:50%; background:linear-gradient(135deg,#16a34a,#4ade80); display:flex; align-items:center; justify-content:center; color:#fff; font-weight:700; font-size:15px; flex-shrink:0; }
.sb-uinfo { overflow:hidden; }
.sb-uinfo > div:first-child { color:#fff; font-size:13px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sb-uinfo > div:last-child { color:rgba(255,255,255,0.4); font-size:11px; }
.btn-logout { background:rgba(239,68,68,0.15); border:1px solid rgba(239,68,68,0.3); border-radius:8px; cursor:pointer; font-size:13px; opacity:1; transition:all 0.2s; flex-shrink:0; color:#fca5a5; padding:7px 12px; font-family:'Sarabun',sans-serif; font-weight:600; }
.btn-logout:hover { background:rgba(239,68,68,0.35); border-color:rgba(239,68,68,0.6); color:#fff; }

.main { margin-left:var(--sidebar-w); flex:1; display:flex; flex-direction:column; min-height:100vh; transition:margin-left 0.3s; }
.topbar { height:60px; background:#fff; border-bottom:1px solid #d1fae5; display:flex; align-items:center; padding:0 24px; gap:14px; position:sticky; top:0; z-index:50; box-shadow:0 1px 8px rgba(22,163,74,0.07); }
.hamburger { background:none; border:none; font-size:22px; cursor:pointer; color:#6b7280; display:none; }
.tb-title { font-family:'Prompt',sans-serif; font-size:17px; font-weight:700; flex:1; color:#14532d; }
.tb-right { color:#6b7280; font-size:13px; }

/* ── SECTIONS ── */
.sec { display:none; padding:28px; animation:fadeUp 0.3s ease; }
.sec.active { display:block; }
@keyframes fadeUp { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:none} }
.sec-title { font-family:'Prompt',sans-serif; font-size:18px; font-weight:700; color:#14532d; margin-bottom:16px; }

/* ── HOME ── */
.hero-banner { border-radius:20px; background:linear-gradient(135deg, #14532d 0%, #166534 50%, #1e40af 100%); padding:36px; color:#fff; display:flex; justify-content:space-between; align-items:center; margin-bottom:32px; box-shadow:var(--shadow-lg); }
.hero-tag { font-size:12px; background:rgba(255,255,255,0.15); padding:4px 14px; border-radius:20px; display:inline-block; margin-bottom:12px; }
.hero-banner h1 { font-family:'Prompt',sans-serif; font-size:28px; font-weight:800; margin-bottom:6px; }
.hero-banner p { opacity:0.75; font-size:15px; }
.hero-emoji { font-size:72px; line-height:1; animation:float 3s ease-in-out infinite; }
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-10px)} }

.course-cards { display:grid; grid-template-columns:repeat(auto-fill, minmax(280px,1fr)); gap:20px; }
.course-card { border-radius:var(--radius); padding:28px; color:#fff; box-shadow:var(--shadow-lg); cursor:pointer; transition:transform 0.2s, box-shadow 0.2s; position:relative; overflow:hidden; }
.course-card:hover { transform:translateY(-5px); box-shadow:0 14px 40px rgba(0,0,0,0.2); }
.course-card.locked { filter:grayscale(0.4); opacity:0.7; cursor:default; }
.cc-emoji { font-size:40px; margin-bottom:14px; }
.cc-name { font-family:'Prompt',sans-serif; font-size:20px; font-weight:700; margin-bottom:6px; }
.cc-desc { font-size:13px; opacity:0.8; line-height:1.5; }
.cc-badge { display:inline-flex; align-items:center; gap:6px; margin-top:18px; padding:6px 14px; border-radius:20px; font-size:12px; font-weight:700; }
.cc-badge.unlocked { background:rgba(255,255,255,0.2); color:#fff; }
.cc-badge.locked-b { background:rgba(0,0,0,0.2); color:rgba(255,255,255,0.6); }

/* ── COURSE ── */
.course-hero { border-radius:16px; padding:28px; color:#fff; margin-bottom:24px; display:flex; align-items:center; gap:20px; box-shadow:var(--shadow-lg); }
.ch-emoji { font-size:52px; }
.ch-name { font-family:'Prompt',sans-serif; font-size:24px; font-weight:800; margin-bottom:4px; }
.ch-desc { font-size:14px; opacity:0.8; }
.course-tabs { display:flex; gap:8px; margin-bottom:22px; }
.ctab { padding:10px 22px; border-radius:24px; border:2px solid #d1fae5; background:#fff; color:#166534; font-family:'Sarabun',sans-serif; font-size:14px; font-weight:600; cursor:pointer; transition:all 0.2s; }
.ctab.active { background:linear-gradient(135deg,#16a34a,#22c55e); color:#fff; border-color:transparent; box-shadow:0 4px 14px rgba(22,163,74,0.35); }
.ctab-content { display:none; }
.ctab-content.active { display:block; }

/* ── VIDEO ── */
.video-grid { display:block; }
.video-card { background:#fff; border-radius:var(--radius); border:1px solid var(--border); box-shadow:var(--shadow); cursor:pointer; transition:transform 0.2s, box-shadow 0.2s; overflow:hidden; }
.video-card:hover { transform:translateY(-4px); box-shadow:var(--shadow-lg); }
.vthumb { aspect-ratio:16/9; background:linear-gradient(135deg,#052e16,#14532d); display:flex; align-items:center; justify-content:center; font-size:44px; position:relative; }
.vthumb::after { content:'▶'; position:absolute; width:52px; height:52px; border-radius:50%; background:rgba(255,255,255,0.15); border:2px solid rgba(255,255,255,0.5); display:flex; align-items:center; justify-content:center; font-size:18px; color:#fff; opacity:0; transition:opacity 0.2s; }
.video-card:hover .vthumb::after { opacity:1; }
.vinfo { padding:14px 16px; }
.vtitle { font-family:'Prompt',sans-serif; font-size:14px; font-weight:700; margin-bottom:5px; line-height:1.4; }
.vmeta { color:var(--text3); font-size:12px; }

/* ── FILES ── */
.file-list { display:flex; flex-direction:column; gap:12px; }
.file-item { background:#fff; border:1px solid var(--border); border-radius:var(--radius); padding:16px 20px; display:flex; align-items:center; gap:14px; box-shadow:var(--shadow); transition:transform 0.2s, box-shadow 0.2s; }
.file-item:hover { transform:translateX(4px); box-shadow:var(--shadow-lg); }
.ficon { font-size:34px; flex-shrink:0; }
.finfo { flex:1; }
.fname { font-family:'Prompt',sans-serif; font-size:14px; font-weight:700; margin-bottom:3px; }
.fmeta { color:var(--text3); font-size:12px; }
.btn-dl { padding:9px 18px; border:none; border-radius:9px; background:linear-gradient(135deg,#16a34a,#22c55e); color:#fff; font-family:'Sarabun',sans-serif; font-size:13px; font-weight:600; cursor:pointer; transition:all 0.2s; white-space:nowrap; box-shadow:0 2px 10px rgba(22,163,74,0.3); }
.btn-dl:hover { transform:scale(1.05); }

/* ── MODALS ── */
.modal-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.65); z-index:200; align-items:center; justify-content:center; backdrop-filter:blur(4px); }
.modal-overlay.open { display:flex; }
.modal-box { background:#fff; border-radius:20px; width:90%; max-width:780px; overflow:hidden; animation:mIn 0.3s cubic-bezier(0.34,1.56,0.64,1); }
@keyframes mIn { from{opacity:0;transform:scale(0.88)} to{opacity:1;transform:none} }
.modal-hd { display:flex; justify-content:space-between; align-items:center; padding:16px 20px; border-bottom:1px solid #e5e7eb; }
.modal-hd h3 { font-family:'Prompt',sans-serif; font-size:16px; font-weight:700; }
.modal-hd button { background:none; border:none; font-size:20px; cursor:pointer; color:#6b7280; padding:2px 8px; border-radius:6px; transition:background 0.2s; }
.modal-hd button:hover { background:#f3f4f6; }
.yt-wrap { position:relative; width:100%; aspect-ratio:16/9; background:#000; }
.yt-wrap iframe { position:absolute; inset:0; width:100%; height:100%; }
.modal-desc { padding:14px 20px; color:#6b7280; font-size:14px; }
.lock-box { background:#fff; border-radius:20px; padding:40px 36px; text-align:center; max-width:360px; animation:mIn 0.3s cubic-bezier(0.34,1.56,0.64,1); }
.lock-icon { font-size:56px; margin-bottom:16px; }
.lock-box h3 { font-family:'Prompt',sans-serif; font-size:20px; font-weight:700; margin-bottom:8px; }
.lock-box p { color:#6b7280; font-size:14px; }
.lock-hint { margin-top:8px; color:#16a34a !important; font-weight:600; }
.btn-close-lock { margin-top:24px; padding:11px 32px; border:none; border-radius:10px; background:#16a34a; color:#fff; font-family:'Prompt',sans-serif; font-size:15px; cursor:pointer; transition:all 0.2s; }
.btn-close-lock:hover { background:#15803d; }

/* ── ADMIN ── */
.admin-header { margin-bottom:24px; }
.admin-header h2 { font-family:'Prompt',sans-serif; font-size:22px; font-weight:700; }
.admin-header p { color:var(--text3); font-size:14px; margin-top:4px; }
.admin-tabs { display:flex; gap:8px; margin-bottom:20px; flex-wrap:wrap; }
.adtab { padding:9px 20px; border-radius:20px; border:1.5px solid var(--border); background:#fff; color:#166534; font-family:'Sarabun',sans-serif; font-size:14px; font-weight:600; cursor:pointer; transition:all 0.2s; display:flex; align-items:center; gap:6px; }
.adtab.active { background:linear-gradient(135deg,#16a34a,#22c55e); color:#fff; border-color:transparent; box-shadow:0 4px 14px rgba(22,163,74,0.35); }
.badge-count { background:rgba(255,255,255,0.3); color:#fff; border-radius:20px; padding:1px 8px; font-size:11px; font-weight:700; }
.adtab:not(.active) .badge-count { background:#ef4444; color:#fff; }
.admintab-content { display:none; }
.admintab-content.active { display:block; }
.user-list { display:flex; flex-direction:column; gap:12px; }
.user-card { background:#fff; border:1px solid var(--border); border-radius:var(--radius); padding:18px 20px; display:flex; align-items:center; gap:14px; box-shadow:var(--shadow); flex-wrap:wrap; }
.uc-avatar { width:44px; height:44px; border-radius:50%; background:linear-gradient(135deg,#16a34a,#4ade80); color:#fff; font-size:18px; font-weight:700; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.uc-info { flex:1; min-width:150px; }
.uc-name { font-family:'Prompt',sans-serif; font-size:15px; font-weight:700; }
.uc-email { color:var(--text3); font-size:12px; margin-top:2px; }
.uc-status { font-size:12px; margin-top:4px; }
.uc-actions { display:flex; flex-direction:column; gap:8px; align-items:flex-end; }
.course-toggles { display:flex; gap:12px; flex-wrap:wrap; }
.toggle-label { display:flex; align-items:center; gap:6px; font-size:13px; cursor:pointer; color:#166534; font-weight:600; }
.toggle-label input { width:16px; height:16px; cursor:pointer; accent-color:#16a34a; }
.btn-approve { padding:7px 16px; border:none; border-radius:8px; background:linear-gradient(135deg,#16a34a,#22c55e); color:#fff; font-size:13px; cursor:pointer; transition:all 0.2s; font-family:'Sarabun',sans-serif; }
.btn-approve:hover { transform:scale(1.04); }
.btn-revoke { padding:7px 16px; border:none; border-radius:8px; background:#fef2f2; color:#ef4444; border:1px solid #fecaca; font-size:13px; cursor:pointer; transition:all 0.2s; font-family:'Sarabun',sans-serif; }
.btn-revoke:hover { background:#ef4444; color:#fff; }
.empty-state { text-align:center; color:var(--text3); padding:40px; font-size:15px; }

/* ── CONTENT MANAGEMENT ── */
.content-mgmt-bar { display:flex; justify-content:space-between; align-items:center; margin-bottom:18px; gap:12px; }
.filter-select { padding:9px 14px; border-radius:10px; border:1.5px solid var(--border); font-family:'Sarabun',sans-serif; font-size:14px; outline:none; background:#fff; color:#1a1a1a; cursor:pointer; }
.filter-select:focus { border-color:var(--green); }
.btn-add-content { padding:10px 20px; border:none; border-radius:10px; background:linear-gradient(135deg,#16a34a,#22c55e); color:#fff; font-family:'Sarabun',sans-serif; font-size:14px; font-weight:600; cursor:pointer; transition:all 0.2s; white-space:nowrap; box-shadow:0 2px 10px rgba(22,163,74,0.3); }
.btn-add-content:hover { transform:scale(1.04); }
.content-list { display:flex; flex-direction:column; gap:10px; }
.content-item { background:#fff; border:1px solid var(--border); border-radius:var(--radius); padding:14px 18px; display:flex; align-items:center; gap:12px; box-shadow:var(--shadow); }
.ci-order { font-family:'Prompt',sans-serif; font-size:13px; font-weight:700; color:#fff; background:#16a34a; border-radius:8px; padding:3px 9px; flex-shrink:0; min-width:36px; text-align:center; }
.ci-emoji { font-size:28px; flex-shrink:0; }
.ci-info { flex:1; }
.ci-title { font-family:'Prompt',sans-serif; font-size:14px; font-weight:700; }
.ci-meta { color:var(--text3); font-size:12px; margin-top:2px; }
.ci-actions { display:flex; gap:8px; }
.btn-edit { padding:7px 14px; border:none; border-radius:8px; background:#f0fdf4; color:#16a34a; border:1px solid #bbf7d0; font-size:13px; cursor:pointer; transition:all 0.2s; font-family:'Sarabun',sans-serif; font-weight:600; }
.btn-edit:hover { background:#16a34a; color:#fff; }
.form-modal { background:#fff; border-radius:20px; width:90%; max-width:520px; overflow:hidden; animation:mIn 0.3s cubic-bezier(0.34,1.56,0.64,1); max-height:90vh; overflow-y:auto; }
.form-modal-body { padding:24px; }

/* ── SETTINGS ── */
.settings-card { background:#fff; border-radius:var(--radius); border:1px solid var(--border); padding:32px; max-width:480px; box-shadow:var(--shadow); }
.form-group-light { margin-bottom:20px; }
.form-group-light label { display:block; font-size:14px; font-weight:600; color:#374151; margin-bottom:8px; }
.form-group-light input, .form-group-light select { width:100%; padding:12px 16px; border:1.5px solid var(--border); border-radius:10px; font-family:'Sarabun',sans-serif; font-size:15px; outline:none; transition:all 0.2s; color:#1a1a1a; background:#fff; }
.form-group-light input:focus, .form-group-light select:focus { border-color:var(--green); box-shadow:0 0 0 3px rgba(22,163,74,0.1); }
.form-group-light .pw-wrap input { padding-right:46px; }
.eye-dark { position:absolute; right:12px; top:50%; transform:translateY(-50%); background:none; border:none; cursor:pointer; font-size:17px; opacity:0.4; transition:opacity 0.2s; }
.eye-dark:hover { opacity:0.8; }
.settings-msg { min-height:20px; font-size:14px; margin-bottom:16px; font-weight:500; }
.btn-save-pw { padding:13px 28px; border:none; border-radius:11px; background:linear-gradient(135deg,#16a34a,#22c55e); color:#fff; font-family:'Prompt',sans-serif; font-size:15px; font-weight:600; cursor:pointer; transition:all 0.2s; box-shadow:0 4px 14px rgba(22,163,74,0.3); }
.btn-save-pw:hover { transform:translateY(-2px); }

/* ── TOAST ── */
.toast { position:fixed; bottom:24px; right:24px; z-index:999; background:#14532d; color:#fff; padding:13px 20px; border-radius:12px; font-size:14px; font-family:'Sarabun',sans-serif; box-shadow:0 4px 24px rgba(0,0,0,0.25); animation:tUp 0.3s ease; }
@keyframes tUp { from{opacity:0;transform:translateY(16px)} to{opacity:1;transform:none} }

/* ── CATEGORY TABS (top level) ── */
.cat-tabs { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:20px; padding-bottom:16px; border-bottom:2px solid #d1fae5; }
.cat-tab-btn { display:inline-flex; align-items:center; gap:6px; padding:7px 14px; border-radius:20px; border:1.5px solid #d1fae5; background:#fff; color:#166534; font-family:'Sarabun',sans-serif; font-size:13px; font-weight:600; cursor:pointer; transition:all 0.2s; white-space:nowrap; max-width:200px; overflow:hidden; text-overflow:ellipsis; }
.cat-tab-btn:hover { border-color:#16a34a; background:#f0fdf4; }
.cat-tab-btn.active { background:linear-gradient(135deg,#16a34a,#22c55e); color:#fff; border-color:transparent; box-shadow:0 3px 10px rgba(22,163,74,0.3); }
.cat-count { background:rgba(255,255,255,0.3); padding:1px 6px; border-radius:10px; font-size:11px; font-weight:700; }
.cat-tab-btn:not(.active) .cat-count { background:#dcfce7; color:#16a34a; }
.cat-video-list { display:grid; grid-template-columns:repeat(auto-fill, minmax(240px,1fr)); gap:16px; }

/* ── TWO COLUMN (sub menu + videos) ── */
.two-col-layout { display:flex; gap:20px; align-items:flex-start; }
.sub-menu { display:flex; flex-direction:column; gap:4px; width:200px; min-width:160px; max-width:220px; flex-shrink:0; background:#f0fdf4; border-radius:14px; padding:10px; border:1px solid #d1fae5; }
.sub-menu-btn { display:flex; align-items:flex-start; gap:8px; padding:9px 12px; border-radius:10px; border:none; background:transparent; color:#166534; font-family:'Sarabun',sans-serif; font-size:13px; font-weight:600; cursor:pointer; transition:all 0.2s; text-align:left; width:100%; white-space:normal; word-break:break-word; line-height:1.4; }
.sub-menu-btn:hover { background:#dcfce7; }
.sub-menu-btn.active { background:linear-gradient(135deg,#16a34a,#22c55e); color:#fff; box-shadow:0 2px 8px rgba(22,163,74,0.3); }
.sub-count { margin-left:auto; background:rgba(255,255,255,0.3); padding:1px 7px; border-radius:10px; font-size:11px; flex-shrink:0; }
.sub-menu-btn:not(.active) .sub-count { background:#bbf7d0; color:#14532d; }
.two-col-layout .cat-video-list { flex:1; min-width:0; }

/* ── RESPONSIVE ── */
@media (max-width:900px) {
  .two-col-layout { flex-direction:column; }
  .sub-menu { flex-direction:row; flex-wrap:wrap; width:100%; max-width:100%; min-width:unset; padding:10px; }
  .sub-menu-btn { width:auto; white-space:nowrap; word-break:normal; }
}
@media (max-width:768px) {
  .sidebar { transform:translateX(-100%); }
  .sidebar.open { transform:translateX(0); }
  .main { margin-left:0; }
  .hamburger { display:block; }
  .hero-emoji { display:none; }
}