/* ============================================================
   tln.css — CSS tuỳ chỉnh cho frontend Tài liệu NEU
   Gom toàn bộ CSS trước đây viết inline trong các Blade view.
   Biến động --color-primary vẫn được nạp inline trong <head> layout.
   ============================================================ */

/* --- Vô hiệu hoá hiệu ứng "intro" của template Midone ---------
   (vốn cần JS chạy animation) để phần tử luôn hiển thị đúng chỗ. */
[class*="intro-x"],
[class*="intro-y"],
[class*="intro-menu"] {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
}

/* --- Núm công tắc Dark Mode (mẫu gốc cần JS mới có màu núm) --- */
.tln-switch::before { background: #e2e8f0; transition: transform .2s, background .2s; }
.tln-switch[data-on="1"] { background: #1e293b; }
.tln-switch[data-on="1"]::before { transform: translateX(14px); background: #fff; }

/* --- Nút Dark Mode nổi cho mobile --- */
#mobile-dark-toggle .icon-sun { display: none; }
#mobile-dark-toggle[data-on="1"] .icon-moon { display: none; }
#mobile-dark-toggle[data-on="1"] .icon-sun { display: inline; }

/* --- Menu tài khoản (details) — ẩn mũi tên mặc định --- */
.user-menu > summary { list-style: none; }
.user-menu > summary::-webkit-details-marker { display: none; }

/* --- Bù các lớp opacity bị loại khỏi bundle CSS đã tree-shake ---
   Thiếu chúng, tên môn học trong sidebar không được tô trắng nên "bị chìm". */
.text-white\/90 { color: rgba(255,255,255,.90); }
.text-white\/85 { color: rgba(255,255,255,.85); }
.text-white\/70 { color: rgba(255,255,255,.70); }
.text-white\/60 { color: rgba(255,255,255,.60); }
.bg-white\/10, .bg-white\/\[0\.1\] { background-color: rgba(255,255,255,.10); }
.border-white\/60 { border-color: rgba(255,255,255,.60); }
.hover\:bg-white\/10:hover { background-color: rgba(255,255,255,.10); }
.hover\:text-white:hover { color: #fff; }

/* --- Bù cho dropdown tài khoản (lớp có thể bị tree-shake) --- */
.w-72 { width: 18rem; }
.w-11 { width: 2.75rem; }
.h-11 { height: 2.75rem; }
.bg-white\/20 { background-color: rgba(255,255,255,.2); }
.border-white\/70 { border-color: rgba(255,255,255,.7); }
.bg-amber-300 { background-color: #fcd34d; }
.text-amber-900 { color: #78350f; }
.space-y-0\.5 > * + * { margin-top: .125rem; }
.text-\[11px\] { font-size: 11px; }
.text-\[12\.5px\] { font-size: 12.5px; }

/* ============================================================
   Toast thông báo (lỗi / thành công)
   ============================================================ */
#toast-root { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; max-width: 360px; width: calc(100% - 40px); }
.tln-toast { display: flex; align-items: flex-start; gap: 10px; background: #fff; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.14); padding: 14px 14px 14px 16px; border-left: 4px solid #64748b; transform: translateX(120%); opacity: 0; transition: transform .35s cubic-bezier(.21,1.02,.73,1), opacity .35s; }
.tln-toast.show { transform: translateX(0); opacity: 1; }
.tln-toast.hide { transform: translateX(120%); opacity: 0; }
.tln-toast.error { border-left-color: #ef4444; }
.tln-toast.success { border-left-color: #22c55e; }
.tln-toast .ic { flex: none; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; margin-top: 1px; }
.tln-toast.error .ic { background: #ef4444; }
.tln-toast.success .ic { background: #22c55e; }
.tln-toast .tx { flex: 1; font-size: 13.5px; line-height: 1.45; color: #334155; }
.tln-toast .tt { font-weight: 600; color: #0f172a; margin-bottom: 1px; }
.tln-toast .cl { flex: none; cursor: pointer; color: #94a3b8; background: none; border: 0; font-size: 18px; line-height: 1; padding: 0 2px; }
.tln-toast .cl:hover { color: #475569; }
@media (prefers-color-scheme: dark) {
  .tln-toast { background: #1e293b; }
  .tln-toast .tx { color: #cbd5e1; }
  .tln-toast .tt { color: #f1f5f9; }
}

/* ============================================================
   Trang Tài khoản (/tai-khoan)
   ============================================================ */
.acc-wrap { max-width: 980px; margin: 0 auto; }
.acc-hero { background: #fff; border-radius: 22px; overflow: hidden; box-shadow: 0 12px 34px rgba(15,23,42,.08); margin-bottom: 22px; }
.acc-hero-banner { height: 78px; background: linear-gradient(120deg, rgb(var(--color-primary)) 0%, rgb(var(--color-primary) / .78) 55%, rgb(var(--color-primary)) 100%); position: relative; }
.acc-hero-banner::after { content: ""; position: absolute; inset: 0; background: radial-gradient(120px 120px at 85% -20%, rgba(255,255,255,.25), transparent 70%); }
.acc-hero-body { padding: 0 30px 26px; display: flex; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.acc-avatar { width: 112px; height: 112px; border-radius: 50%; border: 5px solid #fff; margin-top: -56px; object-fit: cover; box-shadow: 0 8px 20px rgba(15,23,42,.18); background: #fff; }
.acc-id { flex: 1; min-width: 200px; padding-bottom: 2px; }
.acc-name { font-size: 22px; font-weight: 700; color: #0f172a; line-height: 1.2; }
.acc-email { color: #64748b; font-size: 14px; margin-top: 2px; }
.acc-badge { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 5px 13px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #f1f5f9; color: #475569; }
.acc-badge.premium { background: #fef3c7; color: #b45309; }
.acc-grid { display: grid; grid-template-columns: 1fr; gap: 22px; align-items: start; }
.acc-card { background: #fff; border-radius: 20px; box-shadow: 0 12px 34px rgba(15,23,42,.07); padding: 26px; }
.acc-card h2 { font-size: 17px; font-weight: 700; color: #0f172a; }
.acc-card .sub { font-size: 13px; color: #94a3b8; margin-top: 2px; margin-bottom: 20px; }
.acc-balance-box { background: linear-gradient(135deg, rgb(var(--color-primary) / .09), rgb(var(--color-primary) / .03)); border: 1px solid rgb(var(--color-primary) / .16); border-radius: 16px; padding: 20px; text-align: center; }
.acc-balance-box .lbl { font-size: 12px; color: #64748b; }
.acc-balance-box .val { font-size: 30px; font-weight: 800; color: rgb(var(--color-primary)); margin-top: 4px; line-height: 1; }
.acc-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; font-weight: 600; cursor: pointer; transition: .2s; font-size: 14px; text-decoration: none; }
.acc-cur { font-size: 16px; }
.acc-btn-primary { background: rgb(var(--color-primary)); color: #fff; padding: 12px 22px; }
.acc-btn-primary:hover { filter: brightness(1.06); }
.acc-btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.acc-btn-premium { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; padding: 12px 22px; }
.acc-btn-premium:hover { filter: brightness(1.05); }
.acc-btn-premium:disabled { opacity: .55; cursor: not-allowed; }
.acc-btn-ghost { background: #fff; border: 1.5px solid #e2e8f0; color: #475569; padding: 11px 22px; }
.acc-btn-ghost:hover { border-color: rgb(var(--color-primary)); color: rgb(var(--color-primary)); }
.acc-btn-ghost:disabled { opacity: .55; cursor: not-allowed; }
.acc-btn-block { width: 100%; margin-top: 16px; }
.acc-meta { margin-top: 14px; font-size: 12.5px; color: #64748b; text-align: center; }
.acc-form { display: grid; grid-template-columns: 1fr; gap: 16px; }
.acc-field label { display: block; font-size: 13px; font-weight: 600; color: #334155; margin-bottom: 6px; }
.acc-input { width: 100%; border: 1px solid #e2e8f0; border-radius: 11px; padding: 11px 14px; font-size: 14px; color: #0f172a; background: #fff; outline: none; transition: .15s; }
.acc-input:focus { border-color: rgb(var(--color-primary)); box-shadow: 0 0 0 4px rgb(var(--color-primary) / .14); }
.acc-divider { grid-column: 1 / -1; border-top: 1px solid #eef2f6; padding-top: 6px; margin-top: 2px; }
.acc-divider p { font-size: 13px; font-weight: 600; color: #334155; }
.acc-divider span { font-weight: 400; color: #94a3b8; }
@media (min-width: 620px) {
  .acc-form { grid-template-columns: 1fr 1fr; }
  .acc-form .full { grid-column: 1 / -1; }
}
@media (min-width: 900px) {
  .acc-grid { grid-template-columns: 330px 1fr; }
}
@media (prefers-color-scheme: dark) {
  .acc-hero, .acc-card { background: #1e293b; box-shadow: 0 12px 34px rgba(0,0,0,.35); }
  .acc-name, .acc-card h2 { color: #f1f5f9; }
  .acc-email { color: #94a3b8; }
  .acc-input { background: #0f172a; border-color: #334155; color: #e2e8f0; }
  .acc-field label, .acc-divider p { color: #cbd5e1; }
  .acc-avatar { border-color: #1e293b; }
}

/* ============================================================
   Trang Nạp tiền (/nap-tien)
   ============================================================ */
.dep-wrap { max-width: 980px; margin: 0 auto; }
.dep-card { background: #fff; border-radius: 20px; box-shadow: 0 12px 34px rgba(15,23,42,.07); padding: 26px; }
.dep-card h2 { font-size: 17px; font-weight: 700; color: #0f172a; }
.dep-card .sub { font-size: 13px; color: #94a3b8; margin-top: 2px; margin-bottom: 18px; }
.dep-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.dep-title { font-size: 22px; font-weight: 800; color: #0f172a; }
.dep-balance { background: linear-gradient(135deg, rgb(var(--color-primary)), rgb(var(--color-primary) / .82)); color: #fff; border-radius: 16px; padding: 14px 22px; text-align: right; box-shadow: 0 8px 20px rgb(var(--color-primary) / .25); }
.dep-balance .l { font-size: 12px; opacity: .85; }
.dep-balance .v { font-size: 22px; font-weight: 800; }
.dep-grid { display: grid; grid-template-columns: 1fr; gap: 22px; align-items: start; }
.dep-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.dep-preset { border: 1.5px solid #e2e8f0; background: #fff; border-radius: 12px; padding: 12px 8px; font-weight: 700; color: #334155; cursor: pointer; transition: .15s; font-size: 14px; }
.dep-preset:hover { border-color: rgb(var(--color-primary)); color: rgb(var(--color-primary)); }
.dep-preset.active { border-color: rgb(var(--color-primary)); background: rgb(var(--color-primary) / .08); color: rgb(var(--color-primary)); }
.dep-input { width: 100%; border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px 14px; font-size: 15px; font-weight: 600; color: #0f172a; outline: none; }
.dep-input:focus { border-color: rgb(var(--color-primary)); box-shadow: 0 0 0 4px rgb(var(--color-primary) / .14); }
.dep-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; font-weight: 700; cursor: pointer; transition: .2s; font-size: 14px; padding: 12px 22px; }
.dep-btn-primary { background: rgb(var(--color-primary)); color: #fff; }
.dep-btn-primary:hover { filter: brightness(1.06); }
.dep-btn-block { width: 100%; margin-top: 16px; }
.dep-btn-ghost { background: #fff; border: 1.5px solid #e2e8f0; color: #64748b; }
.dep-btn-ghost:hover { border-color: #ef4444; color: #ef4444; }
.dep-pending { border: 2px dashed rgb(var(--color-primary) / .4); border-radius: 16px; padding: 20px; background: rgb(var(--color-primary) / .04); }
.dep-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed #e2e8f0; font-size: 14px; }
.dep-row:last-child { border-bottom: 0; }
.dep-row .k { color: #64748b; }
.dep-row .v { font-weight: 700; color: #0f172a; text-align: right; }
.dep-copy { color: rgb(var(--color-primary)); cursor: pointer; font-weight: 700; }
.dep-hint { margin-top: 12px; font-size: 12.5px; color: #64748b; background: #fff; border: 1px solid #eef2f6; border-radius: 10px; padding: 10px 12px; }
.dep-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.dep-table th { text-align: left; color: #94a3b8; font-weight: 600; padding: 10px 8px; border-bottom: 1px solid #eef2f6; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.dep-table td { padding: 12px 8px; border-bottom: 1px solid #f1f5f9; color: #334155; }
.dep-table .code { font-family: monospace; }
.dep-table .amt { font-weight: 700; }
.dep-empty { text-align: center; color: #94a3b8; padding: 26px; font-size: 14px; }
/* Header dropdown tài khoản */
.user-menu-head { background: linear-gradient(135deg, rgb(var(--color-primary)), rgb(var(--color-primary) / .82)); }

/* Khối khoá nội dung (freemium) ở trang môn học */
.lock-box { margin-top: 16px; text-align: center; padding: 26px 20px; border-radius: 16px;
  border: 1px dashed rgb(var(--color-primary) / .4);
  background: linear-gradient(180deg, rgb(var(--color-primary) / .06), rgb(var(--color-primary) / .02)); }
.lock-ic { width: 52px; height: 52px; margin: 0 auto 10px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgb(var(--color-primary)); color: #fff; box-shadow: 0 8px 20px rgb(var(--color-primary) / .3); }
.lock-title { font-size: 18px; font-weight: 800; color: #0f172a; }
.lock-msg { color: #475569; font-size: 14px; margin: 6px auto 4px; max-width: 520px; }
.lock-sub { color: #64748b; font-size: 12.5px; margin-bottom: 12px; }
.lock-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.lock-btn { display: inline-flex; align-items: center; gap: 6px; padding: 11px 22px; border-radius: 12px; font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none; border: 0; }
.lock-btn-primary { background: rgb(var(--color-primary)); color: #fff; }
.lock-btn-primary:hover { filter: brightness(1.06); }
.lock-btn-ghost { background: #fff; border: 1.5px solid #e2e8f0; color: #475569; }
.lock-btn-ghost:hover { border-color: rgb(var(--color-primary)); color: rgb(var(--color-primary)); }
@media (prefers-color-scheme: dark) { .lock-title { color: #f1f5f9; } .lock-btn-ghost { background: #0f172a; border-color: #334155; color: #cbd5e1; } }

/* Khối tài liệu tải về ở trang môn học */
.doc-box { background: #fff; border: 1px solid #e8edf2; border-radius: 14px; padding: 14px 16px; margin-bottom: 18px; box-shadow: 0 4px 16px rgba(15,23,42,.05); }
.doc-head { display: flex; align-items: center; gap: 8px; color: rgb(var(--color-primary)); font-weight: 700; font-size: 14px; margin-bottom: 10px; }
.doc-list { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 640px) { .doc-list { grid-template-columns: 1fr 1fr; } }
.doc-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 10px; text-decoration: none; color: #334155; transition: .15s; }
.doc-item:hover { border-color: rgb(var(--color-primary)); background: rgb(var(--color-primary) / .04); }
.doc-ic { color: rgb(var(--color-primary)); display: inline-flex; flex: none; }
.doc-title { flex: 1; font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-meta { font-size: 11.5px; color: #94a3b8; white-space: nowrap; }
.doc-dl { color: #94a3b8; flex: none; }
.doc-item:hover .doc-dl { color: rgb(var(--color-primary)); }
@media (prefers-color-scheme: dark) {
  .doc-box { background: #1e293b; border-color: #334155; }
  .doc-item { background: #0f172a; border-color: #334155; color: #cbd5e1; }
}

/* Nhóm môn học thu/mở trong sidebar (chỉ ẩn ở màn rộng có nhãn; md chỉ có icon nên luôn hiện) */
@media (min-width: 1280px) { .cat-collapsed { display: none; } }
.cat-collapsed-m { display: none; }
.js-cat-toggle { transition: background .15s; }
.js-cat-toggle:hover { background: rgba(255,255,255,.16) !important; }
.js-cat-caret { transition: transform .2s ease; }
.js-cat-caret.rotate-180 { transform: rotate(180deg); }

/* ===== Trang tra cứu điểm ===== */
.er-form { display: flex; gap: 10px; flex-wrap: wrap; }
.er-form .dep-input { flex: 1; min-width: 220px; }
.er-empty { text-align: center; color: #64748b; padding: 30px; }
.er-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.er-table th, .er-table td { white-space: nowrap; }
.er-table .er-num { text-align: center; }
.er-picklist { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 640px) { .er-picklist { grid-template-columns: 1fr 1fr; } }
.er-pick { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border: 1px solid #e2e8f0; border-radius: 12px; text-decoration: none; transition: .15s; }
.er-pick:hover { border-color: rgb(var(--color-primary)); background: rgb(var(--color-primary) / .04); }
.er-pick-name { font-weight: 600; color: #0f172a; }
.er-pick-code { font-size: 12.5px; color: #64748b; }
.er-pick-cnt { font-size: 12px; font-weight: 600; color: rgb(var(--color-primary)); white-space: nowrap; }
@media (prefers-color-scheme: dark) {
  .er-pick { background: #0f172a; border-color: #334155; }
  .er-pick-name { color: #e2e8f0; }
}
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.success { background: #dcfce7; color: #166534; }
.badge.warning { background: #fef9c3; color: #854d0e; }
.badge.danger { background: #fee2e2; color: #991b1b; }
@media (min-width: 900px) {
  .dep-grid { grid-template-columns: 1fr 1fr; }
}
@media (prefers-color-scheme: dark) {
  .dep-card { background: #1e293b; }
  .dep-card h2, .dep-title, .dep-row .v { color: #f1f5f9; }
  .dep-input, .dep-preset { background: #0f172a; border-color: #334155; color: #e2e8f0; }
}
