/*
 * Style tổng thể cho Landing Page và khu vực quản trị.
 * Dùng CSS Variables lấy màu từ SQLite: --primary-color, --secondary-color, --background-color, --text-color.
 */
:root {
    --primary-color: #ff6b1a;
    --secondary-color: #1e56b7;
    --background-color: #f8fafc;
    --text-color: #334155;
    --dark: #111827;
    --muted: #64748b;
    --line: #e2e8f0;
    --white: #ffffff;
    --green: #16a34a;
    --red: #ef4444;
    --shadow: 0 22px 60px rgba(15, 23, 42, .12);
    --radius: 26px;
    --max: 1180px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    color: var(--text-color);
    background: var(--background-color);
    line-height: 1.65;
    overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; }
.container { width: min(var(--max), calc(100% - 32px)); margin: 0 auto; }
.center { text-align: center; }
.left { text-align: left; margin-left: 0 !important; }
.section { padding: var(--section-padding-pc, 90px) 0; position: relative; }
.section-white { background: #fff; }
.section-tint { background: linear-gradient(135deg, color-mix(in srgb, var(--secondary-color) 5%, white), color-mix(in srgb, var(--primary-color) 6%, white)); }
.section-soft { background: rgba(255,255,255,.62); }
.eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 14px; border-radius: 999px;
    background: color-mix(in srgb, var(--primary-color) 12%, white);
    color: var(--primary-color); font-size: 14px; margin-bottom: 16px;
}
.section-title { margin: 0; color: var(--dark); font-size: var(--section-title-size, clamp(30px, 4vw, 52px)); line-height: 1.12; letter-spacing: -1px; }
.section-subtitle { margin: 16px auto 0; max-width: 780px; color: var(--muted); font-size: 18px; }
.topbar {
    position: sticky; top: 0; z-index: 1000; background: rgba(255,255,255,.88);
    border-bottom: 1px solid rgba(226,232,240,.82); backdrop-filter: blur(16px);
}
.nav { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--dark); font-weight: 800; }
.brand img { width: 128px; max-height: 48px; object-fit: contain; }
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 310px; }
.main-nav { display: flex; align-items: center; gap: 8px; }
.main-nav a { padding: 10px 12px; border-radius: 999px; color: #334155; font-size: 15px; }
.main-nav a:hover { background: #f1f5f9; color: var(--secondary-color); }
.nav-cta { background: var(--dark) !important; color: #fff !important; }
.nav-toggle { display: none; border: 0; background: var(--primary-color); color: #fff; border-radius: 14px; padding: 9px 12px; }
.hero { padding: 84px 0 92px; background: radial-gradient(circle at 10% 20%, color-mix(in srgb, var(--primary-color) 16%, transparent), transparent 30%), radial-gradient(circle at 85% 20%, color-mix(in srgb, var(--secondary-color) 18%, transparent), transparent 32%); }
.hero-grid { display: grid; grid-template-columns: 1.02fr .98fr; align-items: center; gap: 44px; }
.hero h1 { margin: 0; font-size: var(--section-title-size, clamp(42px, 6vw, 76px)); line-height: 1.02; letter-spacing: -2px; color: var(--dark); }
.hero-subtitle { color: var(--muted); font-size: 20px; margin: 22px 0; max-width: 680px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0; }
.btn { border: 0; border-radius: 999px; padding: 13px 22px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; transition: .22s ease; }
.btn.primary { background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); color: #fff; box-shadow: 0 16px 34px color-mix(in srgb, var(--primary-color) 22%, transparent); }
.btn.secondary { background: #fff; color: var(--dark); border: 1px solid var(--line); }
.btn:hover { transform: translateY(-2px); }
.btn.small { padding: 9px 14px; font-size: 14px; }
.btn.full { width: 100%; }
.hero-badges { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 20px; }
.hero-badges span { background: rgba(255,255,255,.86); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; color: var(--dark); font-size: 14px; }
.hero-media { position: relative; }
.hero-media img { width: 100%; border-radius: 42px; filter: drop-shadow(0 28px 44px rgba(15,23,42,.18)); }
.section-head { margin-bottom: 38px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.feature-card, .review-card, .timeline-card, .pricing-card, .teacher-box, .faq-item {
    background: #fff; border: 1px solid rgba(226,232,240,.9); border-radius: var(--radius); box-shadow: 0 14px 34px rgba(15,23,42,.06);
}
.feature-card { padding: 22px; display: flex; gap: 14px; min-height: 112px; }
.feature-card p { margin: 0; color: #334155; }
.check { width: 30px; height: 30px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--green); }
.timeline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.timeline-card { padding: 24px; position: relative; overflow: hidden; }
.timeline-card span { display: inline-flex; color: #fff; background: var(--secondary-color); padding: 6px 12px; border-radius: 999px; margin-bottom: 18px; }
.timeline-card p { margin: 0; }
.review-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.review-card { padding: 24px; }
.review-card p { color: #334155; }
.stars { color: #f59e0b; letter-spacing: 1px; }
.faq-wrap { max-width: 860px; margin: 0 auto; display: grid; gap: 12px; }
.faq-item { overflow: hidden; }
.faq-q { width: 100%; border: 0; background: transparent; display: flex; justify-content: space-between; gap: 14px; padding: 22px; cursor: pointer; text-align: left; color: var(--dark); }
.faq-q b { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #f1f5f9; }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .25s ease; }
.faq-a p { margin: 0; padding: 0 22px 22px; color: var(--muted); }
.faq-item.open .faq-a { max-height: 220px; }
.faq-item.open .faq-q b { background: var(--primary-color); color: #fff; }
.pricing-card { display: grid; grid-template-columns: 1fr 1fr auto; align-items: center; gap: 22px; padding: 34px; }
.pricing-card h3 { margin: 0 0 10px; font-size: clamp(28px, 4vw, 48px); color: var(--dark); }
.pricing-card ul { margin: 0; padding-left: 0; list-style: none; columns: 1; }
.pricing-card li { margin: 8px 0; }
.teacher-box { display: grid; grid-template-columns: 280px 1fr; align-items: center; gap: 22px; padding: 26px; }
.teacher-avatar { width: 220px; height: 220px; border-radius: 38px; display: grid; place-items: center; background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); color: #fff; font-size: 52px; font-weight: 900; }
.register-section { background: linear-gradient(135deg, color-mix(in srgb, var(--secondary-color) 9%, white), color-mix(in srgb, var(--primary-color) 10%, white)); }
.register-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 34px; align-items: start; }
.lead-form { background: #fff; border: 1px solid var(--line); border-radius: 32px; padding: 28px; box-shadow: var(--shadow); display: grid; gap: 14px; }
label { display: grid; gap: 7px; color: var(--dark); }
input, textarea, select { width: 100%; border: 1px solid #dbe4ee; border-radius: 16px; padding: 12px 14px; outline: 0; background: #fff; color: var(--dark); }
input:focus, textarea:focus, select:focus { border-color: var(--secondary-color); box-shadow: 0 0 0 4px color-mix(in srgb, var(--secondary-color) 14%, transparent); }
.error { min-height: 18px; color: var(--red); font-size: 13px; }
.success-msg { display: none; color: var(--green); background: #ecfdf5; border-radius: 14px; padding: 10px; }
.register-card { background: #fff; border: 1px solid var(--line); border-radius: 32px; padding: 30px; box-shadow: var(--shadow); align-self: stretch; display: grid; align-content: center; gap: 12px; }
.register-card h3 { margin: 0; color: var(--dark); font-size: 30px; }
.register-card p { margin: 0 0 10px; color: var(--muted); }
.contact-mini { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.contact-mini a { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px; }
.footer { padding: 48px 0; background: #0f172a; color: #cbd5e1; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 28px; }
.footer h3 { color: #fff; margin: 0 0 10px; }
.footer-logo { max-width: 160px; max-height: 62px; margin-bottom: 12px; }
.floating-contact { position: fixed; left: 14px; top: 45%; transform: translateY(-50%); display: grid; gap: 10px; z-index: 900; }
.floating-contact a { width: 48px; height: 48px; border-radius: 999px; display: flex; align-items: center; justify-content: center; gap: 8px; color: #fff; background: var(--btn-color); box-shadow: 0 12px 28px rgba(15,23,42,.22); animation: shakePulse 2.9s infinite; overflow: hidden; transition: width .22s ease; }
.floating-contact a span { display: none; white-space: nowrap; font-size: 14px; padding-right: 14px; }
.floating-contact a:hover { width: 150px; justify-content: flex-start; padding-left: 16px; }
.floating-contact a:hover span { display: inline; }
.floating-contact i { font-style: normal; font-weight: 800; }
@keyframes shakePulse { 0%, 80%, 100% { transform: translateX(0) scale(1); } 84% { transform: translateX(-2px) scale(1.05); } 88% { transform: translateX(2px) scale(1.05); } 92% { transform: translateX(-1px) scale(1.05); } }
.right-scroll-nav { position: fixed; right: 14px; top: 50%; transform: translateY(-50%); z-index: 850; display: grid; gap: 10px; }
.right-scroll-nav a { width: 13px; height: 13px; border-radius: 999px; background: #cbd5e1; position: relative; transition: .2s; }
.right-scroll-nav a.active, .right-scroll-nav a:hover { background: var(--primary-color); transform: scale(1.2); }
.right-scroll-nav span { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); background: #0f172a; color: #fff; padding: 6px 10px; border-radius: 9px; font-size: 12px; white-space: nowrap; opacity: 0; pointer-events: none; transition: .2s; }
.right-scroll-nav a:hover span { opacity: 1; }
.back-to-top { position: fixed; right: 22px; bottom: 22px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--dark); color: #fff; opacity: 0; pointer-events: none; transition: .2s; z-index: 920; }
.back-to-top.show { opacity: 1; pointer-events: auto; }
.fade-item { opacity: 0; transform: translateY(18px); transition: .55s ease; }
.fade-item.show { opacity: 1; transform: translateY(0); }
/* Admin */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 10% 10%, #fff0e8, transparent 34%), radial-gradient(circle at 90% 20%, #eaf1ff, transparent 34%), #f8fafc; }
.login-card, .card { background: #fff; border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow); padding: 26px; }
.login-card { width: min(440px, 100%); display: grid; gap: 15px; }
.login-card h1 { margin: 0; color: var(--dark); }
.login-card p { margin: 0; color: var(--muted); }
.alert { padding: 12px 14px; border-radius: 16px; margin-bottom: 16px; }
.alert.success { background: #ecfdf5; color: #047857; }
.alert.error { background: #fef2f2; color: #b91c1c; }
.admin-body { background: #f1f5f9; }
.admin-layout { min-height: 100vh; display: grid; grid-template-columns: 270px 1fr; }
.admin-sidebar { position: sticky; top: 0; height: 100vh; background: #0f172a; color: #cbd5e1; padding: 24px; }
.admin-logo { display: block; color: #fff; font-size: 22px; font-weight: 900; margin-bottom: 22px; }
.admin-sidebar nav { display: grid; gap: 8px; }
.admin-sidebar a { padding: 12px 14px; border-radius: 14px; }
.admin-sidebar a:hover, .admin-sidebar a.active { background: rgba(255,255,255,.1); color: #fff; }
.admin-main { padding: 28px; min-width: 0; }
.admin-top { display: flex; justify-content: space-between; gap: 18px; align-items: center; margin-bottom: 20px; }
.admin-top p { margin: 0; color: var(--muted); }
.admin-top h1 { margin: 2px 0 0; color: var(--dark); font-size: clamp(26px, 3vw, 40px); }
.dashboard-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.dash-card { background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 22px; box-shadow: 0 14px 34px rgba(15,23,42,.05); }
.dash-card span, .tag { color: var(--primary-color); font-size: 13px; }
.dash-card h2 { margin: 8px 0; color: var(--dark); }
.dash-card p { color: var(--muted); }
.dash-card a { color: var(--secondary-color); }
.admin-note { margin-top: 22px; background: #fff; border-radius: 24px; padding: 24px; border: 1px solid var(--line); }
.form-grid { display: grid; gap: 16px; margin-bottom: 24px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.full-row { grid-column: 1 / -1; }
.admin-form h2 { margin: 20px 0 16px; color: var(--dark); }
.preview-logo { max-width: 190px; max-height: 76px; border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: #f8fafc; margin-bottom: 8px; }
.mini-preview { width: 90px; height: 62px; object-fit: contain; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; }
.content-form { display: grid; gap: 18px; }
.content-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.content-card h2 { margin: 4px 0 0; color: var(--dark); }
.switch { display: inline-flex; grid-template-columns: auto; align-items: center; gap: 8px; }
.switch input { display: none; }
.switch span { width: 42px; height: 24px; border-radius: 999px; background: #cbd5e1; position: relative; }
.switch span::after { content: ''; position: absolute; width: 18px; height: 18px; top: 3px; left: 3px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { left: 21px; }
.sticky-actions { position: sticky; top: 90px; z-index: 30; display: flex; gap: 10px; justify-content: flex-end; background: rgba(241,245,249,.9); backdrop-filter: blur(10px); padding: 10px; border-radius: 18px; }
.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; min-width: 920px; }
.admin-table th, .admin-table td { border-bottom: 1px solid var(--line); padding: 10px; text-align: left; }
.admin-table th { color: var(--dark); background: #f8fafc; }
.admin-table input { min-width: 90px; padding: 9px 10px; border-radius: 12px; }
.danger-link { border: 0; background: #fef2f2; color: #b91c1c; border-radius: 12px; padding: 9px 12px; cursor: pointer; }
@media (max-width: 1024px) {
    .hero-grid, .register-grid, .teacher-box { grid-template-columns: 1fr; }
    .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .timeline, .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pricing-card { grid-template-columns: 1fr; }
    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar { position: relative; height: auto; }
    .admin-sidebar nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
    .nav-toggle { display: inline-flex; }
    .main-nav { position: absolute; left: 16px; right: 16px; top: 76px; display: none; flex-direction: column; align-items: stretch; padding: 14px; border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: var(--shadow); }
    .main-nav.open { display: flex; }
    .main-nav a { border-radius: 14px; }
    .brand span { display: none; }
    .hero-badges, .feature-grid, .review-grid, .timeline, .footer-grid, .form-grid.two, .form-grid.four, .dashboard-grid { grid-template-columns: 1fr; }
    .section { padding: 64px 0; }
    .right-scroll-nav { right: 8px; gap: 8px; }
    .floating-contact { left: 8px; }
    .floating-contact a { width: 42px; height: 42px; }
    .floating-contact a:hover { width: 42px; padding-left: 0; justify-content: center; }
    .floating-contact a:hover span, .floating-contact span { display: none !important; }
    .admin-main { padding: 16px; }
    .admin-top { flex-direction: column; align-items: flex-start; }
    .sticky-actions { top: 8px; justify-content: flex-start; flex-wrap: wrap; }
}

/* Video tab YouTube */
.video-tabs { max-width: 980px; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 30px; padding: 18px; box-shadow: var(--shadow); }
.video-tab-buttons { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 12px; margin-bottom: 14px; }
.video-tab { border: 1px solid var(--line); background: #fff; color: var(--dark); border-radius: 999px; padding: 10px 16px; white-space: nowrap; cursor: pointer; transition: .2s; }
.video-tab:hover, .video-tab.active { background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); color: #fff; border-color: transparent; }
.video-frame-wrap { position: relative; overflow: hidden; border-radius: 24px; background: #0f172a; aspect-ratio: 16 / 9; }
.video-frame-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Popup đăng ký */
.modal-open { overflow: hidden; }
.register-modal { position: fixed; inset: 0; z-index: 2000; display: none; align-items: center; justify-content: center; padding: 18px; }
.register-modal.open { display: flex; }
.register-modal-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.62); backdrop-filter: blur(8px); }
.register-modal-card { position: relative; z-index: 1; width: min(520px, 100%); max-height: calc(100vh - 36px); overflow-y: auto; background: #fff; border-radius: 32px; padding: 28px; box-shadow: 0 28px 70px rgba(15,23,42,.32); animation: modalPop .2s ease; }
.register-modal-card h2 { margin: 0 42px 18px 0; color: var(--dark); font-size: clamp(26px, 4vw, 36px); line-height: 1.15; }
.modal-close { position: absolute; top: 16px; right: 16px; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--dark); font-size: 28px; line-height: 1; cursor: pointer; }
.modal-form { box-shadow: none; padding: 0; border: 0; border-radius: 0; }
@keyframes modalPop { from { transform: translateY(12px) scale(.98); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }

.preview-favicon { width: 48px; height: 48px; object-fit: contain; border: 1px solid var(--line); border-radius: 12px; padding: 6px; background: #f8fafc; margin-bottom: 8px; }
.inline-check { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.inline-check input { width: auto; }
.video-table input[type="checkbox"] { width: auto; min-width: 0; }

/* Bổ sung SePay, sản phẩm, học viên */
.muted-text { color: var(--muted); margin: -6px 0 18px; }
.is-hidden { display: none !important; }
.copy-field { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.admin-actions-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.path-preview { width: 150px; height: 110px; object-fit: contain; border: 1px solid var(--line); border-radius: 16px; padding: 8px; background: #f8fafc; margin-top: 8px; }
.path-preview.wide { width: 280px; height: 150px; }
.old-price { text-decoration: line-through; color: var(--muted); margin: 6px 0; }
.discount-text { display: inline-flex; width: fit-content; background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; border-radius: 999px; padding: 6px 12px; margin: 6px 0; }
.payment-modal { position: fixed; inset: 0; z-index: 2100; display: none; align-items: center; justify-content: center; padding: 18px; }
.payment-modal.open { display: flex; }
.payment-modal-card { position: relative; z-index: 1; width: min(920px, 100%); max-height: calc(100vh - 36px); overflow-y: auto; background: #fff; border-radius: 34px; padding: 28px; box-shadow: 0 28px 80px rgba(15,23,42,.34); animation: modalPop .2s ease; }
.payment-modal-head h2 { margin: 0; color: var(--dark); font-size: clamp(28px, 4vw, 44px); line-height: 1.12; }
.payment-status { display: inline-flex; margin: 14px 0 22px; padding: 9px 14px; border-radius: 999px; background: #eff6ff; color: #1d4ed8; }
.payment-status.success { background: #ecfdf5; color: #047857; }
.payment-status.error { background: #fef2f2; color: #b91c1c; }
.payment-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 22px; align-items: stretch; }
.payment-qr-box { min-height: 360px; display: grid; place-items: center; border: 1px dashed #cbd5e1; border-radius: 26px; background: linear-gradient(135deg, #f8fafc, #fff); padding: 18px; }
.payment-qr { width: min(340px, 100%); border-radius: 22px; border: 1px solid var(--line); background: #fff; }
.payment-qr-empty { text-align: center; color: var(--muted); padding: 22px; }
.payment-detail-box { display: grid; gap: 12px; align-content: start; }
.payment-row { display: grid; grid-template-columns: 150px 1fr auto; gap: 10px; align-items: center; padding: 13px 14px; border: 1px solid var(--line); border-radius: 18px; background: #f8fafc; }
.payment-row span { color: var(--muted); }
.payment-row strong { color: var(--dark); word-break: break-word; }
.copy-payment { border: 0; border-radius: 999px; background: var(--dark); color: #fff; padding: 7px 10px; cursor: pointer; font-size: 13px; }
.payment-note { color: var(--muted); display: block; margin-top: 6px; }
.payment-success .payment-modal-card { border: 2px solid #86efac; box-shadow: 0 28px 80px rgba(22,163,74,.22); }
.thank-body { min-height: 100vh; display: grid; place-items: center; padding: 22px; background: radial-gradient(circle at 10% 20%, #dcfce7, transparent 30%), radial-gradient(circle at 90% 10%, #dbeafe, transparent 32%), #f8fafc; }
.thank-card { width: min(680px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 34px; padding: 34px; box-shadow: var(--shadow); text-align: center; }
.thank-card h1 { margin: 0 0 14px; color: var(--dark); font-size: clamp(34px, 6vw, 58px); line-height: 1.08; }
.thank-info { text-align: left; background: #f8fafc; border: 1px solid var(--line); border-radius: 22px; padding: 16px; margin: 20px 0; }
.thank-info p { margin: 8px 0; }
.thank-info span { color: var(--muted); display: inline-block; min-width: 150px; }
.filter-form { margin: 18px 0; }
.students-summary { margin-bottom: 18px; }
.student-table-wrap { padding: 0; }
.status-pill { display: inline-flex; white-space: nowrap; border-radius: 999px; padding: 6px 10px; background: #f1f5f9; color: #334155; font-size: 13px; }
.status-pending { background: #fff7ed; color: #c2410c; }
.status-paid { background: #ecfdf5; color: #047857; }
.status-canceled { background: #fef2f2; color: #b91c1c; }
.student-actions { display: flex; flex-wrap: wrap; gap: 7px; min-width: 280px; }
.student-actions .btn, .student-actions .danger-link { white-space: nowrap; }
.student-detail-row pre { max-height: 280px; overflow: auto; background: #0f172a; color: #e2e8f0; border-radius: 16px; padding: 14px; }
code { background: #f1f5f9; border-radius: 8px; padding: 3px 6px; color: var(--dark); }

@media (max-width: 820px) {
    .payment-grid, .payment-row { grid-template-columns: 1fr; }
    .payment-qr-box { min-height: auto; }
    .payment-modal-card { padding: 22px; border-radius: 26px; }
    .copy-field { grid-template-columns: 1fr; }
    .path-preview.wide { width: 100%; }
    .admin-actions-row { align-items: stretch; }
    .admin-actions-row .btn { width: 100%; }
}

/* Tối ưu bảng quản lý học viên: co giãn 100%, giảm chiều cao dòng, cập nhật trạng thái bằng dropdown */
.student-filter-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.student-table-wrap { width: 100%; overflow-x: visible; border: 1px solid var(--line); border-radius: 24px; background: #fff; }
.student-table { width: 100%; min-width: 0; table-layout: fixed; border-collapse: collapse; }
.student-table col.col-stt { width: 3%; }
.student-table col.col-name { width: 8%; }
.student-table col.col-phone { width: 8%; }
.student-table col.col-email { width: 14%; }
.student-table col.col-course { width: 10%; }
.student-table col.col-price { width: 7%; }
.student-table col.col-code { width: 7%; }
.student-table col.col-bank { width: 7%; }
.student-table col.col-date { width: 7%; }
.student-table col.col-status { width: 7%; }
.student-table col.col-note { width: 6%; }
.student-table col.col-action { width: 12%; }
.student-table th, .student-table td { padding: 12px 10px; vertical-align: middle; font-size: 14px; line-height: 1.45; word-break: break-word; overflow-wrap: anywhere; }
.student-table th { position: sticky; top: 0; z-index: 2; color: #0f172a; background: #f8fafc; font-size: 13px; line-height: 1.35; }
.student-table tbody tr:hover { background: #f8fafc; }
.student-table small { display: block; color: var(--muted); margin-top: 2px; }
.student-name-cell, .money-cell { color: var(--dark); }
.break-cell { word-break: break-word; }
.note-cell { color: #475569; }
.empty-row { text-align: center; color: var(--muted); padding: 30px 14px !important; }
.student-status-form { display: grid; grid-template-columns: 1fr; gap: 8px; min-width: 0; }
.student-status-form select { min-width: 0; width: 100%; padding: 8px 10px; border-radius: 12px; font-size: 13px; }
.student-status-form .btn.small { width: 100%; padding: 8px 10px; font-size: 13px; }
.student-row-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.student-row-links form { margin: 0; }
.student-row-links .btn.small, .danger-link.small { width: 100%; min-height: 36px; padding: 8px 10px; border-radius: 12px; font-size: 13px; }
.status-pill { justify-content: center; max-width: 100%; }

@media (max-width: 1280px) {
    .student-table th, .student-table td { padding: 10px 8px; font-size: 13px; }
    .student-table th { font-size: 12px; }
    .student-status-form select, .student-status-form .btn.small, .student-row-links .btn.small, .danger-link.small { font-size: 12px; }
}

@media (max-width: 820px) {
    .student-table-wrap { overflow: visible; padding: 0; border: 0; background: transparent; }
    .student-table, .student-table thead, .student-table tbody, .student-table th, .student-table td, .student-table tr { display: block; width: 100%; }
    .student-table colgroup, .student-table thead { display: none; }
    .student-table tbody { display: grid; gap: 14px; }
    .student-table tbody tr { border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: 0 10px 26px rgba(15,23,42,.05); overflow: hidden; }
    .student-table tbody tr:hover { background: #fff; }
    .student-table td { display: grid; grid-template-columns: 122px 1fr; gap: 10px; align-items: start; padding: 10px 12px; border-bottom: 1px dashed #e2e8f0; font-size: 14px; }
    .student-table td:last-child { border-bottom: 0; }
    .student-table td::before { content: attr(data-label); color: var(--muted); font-size: 12px; }
    .student-table .empty-row { display: block; }
    .student-table .empty-row::before { content: ''; display: none; }
    .student-status-form { grid-template-columns: 1fr auto; align-items: center; }
    .student-status-form .btn.small { width: auto; white-space: nowrap; }
    .student-row-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .student-detail-row td { display: block; }
    .student-detail-row td::before { content: ''; display: none; }
}

@media (max-width: 480px) {
    .student-filter-actions .btn { width: 100%; }
    .student-table td { grid-template-columns: 104px 1fr; font-size: 13px; }
    .student-status-form { grid-template-columns: 1fr; }
    .student-status-form .btn.small { width: 100%; }
}

/* Email automation bổ sung */
.admin-top-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.login-help-link { display: inline-flex; justify-content: center; margin-top: 10px; color: var(--primary); text-decoration: none; font-size: 14px; }
.five-cards { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.password-input-wrap { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.inline-checks { display: flex; flex-wrap: wrap; gap: 14px 24px; margin: 14px 0; }
.inline-checks label, .checkbox-line { display: inline-flex; gap: 8px; align-items: center; color: #334155; }
.smtp-test-row { margin-top: 14px; }
.row-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-actions form { margin: 0; }
.compact-table th, .compact-table td { padding: 12px 14px; vertical-align: top; }
.text-danger { color: #dc2626; }
.email-mini-status { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0; color: #475569; font-size: 14px; }
.email-preview-modal { position: fixed; inset: 0; z-index: 9999; background: rgba(15,23,42,.68); padding: 30px; overflow: auto; }
.email-preview-modal[hidden] { display: none; }
.email-preview-card { max-width: 980px; margin: 0 auto; background: #fff; border-radius: 24px; padding: 18px; box-shadow: 0 28px 80px rgba(15,23,42,.25); }
.email-preview-head, .email-preview-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.email-preview-head p { margin: 4px 0 0; color: var(--muted); }
.email-preview-card iframe { width: 100%; height: 620px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.progress-bar { height: 16px; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
.progress-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #2563eb, #16a34a); transition: width .25s ease; }
.bulk-progress-head, .bulk-stats { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.bulk-stats { margin: 16px 0; justify-content: flex-start; }
.bulk-stats span { background: #f8fafc; border: 1px solid var(--line); padding: 8px 12px; border-radius: 999px; }
.bulk-log-box { max-height: 320px; overflow: auto; background: #0f172a; color: #dbeafe; border-radius: 18px; padding: 12px; display: grid; gap: 6px; }
.bulk-log-box div { border-bottom: 1px dashed rgba(255,255,255,.12); padding-bottom: 6px; font-size: 13px; }
.bulk-log-box .ok { color: #bbf7d0; }
.bulk-log-box .bad { color: #fecaca; }
.auth-card-admin { max-width: 680px; }
.three-links { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 1180px) {
    .five-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid.three { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
    .admin-top-actions { width: 100%; }
    .admin-top-actions .btn { flex: 1; }
    .five-cards { grid-template-columns: 1fr; }
    .password-input-wrap { grid-template-columns: 1fr; }
    .email-preview-modal { padding: 12px; }
    .email-preview-card iframe { height: 70vh; }
    .row-actions { display: grid; grid-template-columns: 1fr; }
    .compact-table, .compact-table thead, .compact-table tbody, .compact-table th, .compact-table td, .compact-table tr { display: block; width: 100%; }
    .compact-table thead { display: none; }
    .compact-table tr { border: 1px solid var(--line); border-radius: 18px; margin-bottom: 12px; padding: 10px; }
    .compact-table td { border-bottom: 1px dashed #e2e8f0; }
    .compact-table td:last-child { border-bottom: 0; }
    .three-links { grid-template-columns: 1fr; }
}
