/* ==========================================================================
   Trang quản trị Key for Aptis — CSS RIÊNG, không dùng chung với web chính.
   (public/css/style.css của web chính đã ~1100 dòng; nhồi thêm là không ai đọc nổi.)

   ⚠️ LUẬT BẮT BUỘC — đọc trước khi thêm selector mới:
   Selector nào set `display` mà phần tử đó dùng thuộc tính `hidden` thì PHẢI kèm
   rule `[hidden] { display: none }`. CSS của tác giả luôn thắng stylesheet mặc định
   của trình duyệt, nên `display: ...` sẽ ĐÈ MẤT `[hidden]` -> phần tử tưởng là ẩn
   vẫn hiện; nếu nó `position: fixed` thì che kín màn hình và nuốt sạch click cả trang.
   Đã xảy ra thật ở web chính với `.ovl`. Tiền lệ đúng: `.modal-overlay[hidden]`,
   `.vocab-popup[hidden]`, `.ovl[hidden]` trong public/css/style.css.
   ========================================================================== */

:root {
  --navy: #1E3A8A;
  --navy-700: #172e6e;
  --navy-900: #0f1f4d;
  --emerald: #10B981;
  --emerald-600: #0ea371;
  --orange: #F97316;
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-400: #9CA3AF;
  --gray-600: #4B5563;
  --gray-800: #1F2937;
  --white: #fff;
  --red: #DC2626;
  --radius: 12px;
  --font: 'Segoe UI', Roboto, system-ui, -apple-system, Arial, sans-serif;
  --side-w: 240px;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); background: var(--gray-50); color: var(--gray-800); }
a { color: inherit; }

/* ===== Bố cục ===== */
.adm { display: flex; min-height: 100vh; }

/* ===== Sidebar ===== */
.adm-side {
  width: var(--side-w); flex-shrink: 0; background: var(--navy-900); color: #fff;
  display: flex; flex-direction: column; padding: 18px 14px;
  position: sticky; top: 0; height: 100vh;
}
.adm-brand { display: flex; align-items: center; gap: 9px; text-decoration: none; }
/* Logo trắng đầy đủ (icon + KEY4APTIS + slogan) — hợp nền sidebar navy tối */
.adm-brand-logo { width: 160px; max-width: 100%; height: auto; display: block; }
.adm-brand-text { font-size: 16px; font-weight: 800; }
/* Nền tối -> chữ "Aptis" (vốn navy đậm) phải đổi sang trắng, không thì mất hút. */
.adm-brand-text .brand-key { color: var(--emerald); }
.adm-brand-text .brand-for { color: var(--orange); }
.adm-brand-text .brand-aptis { color: #fff; }
.adm-badge {
  display: inline-block; margin: 10px 0 18px; padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  background: rgba(249, 115, 22, .2); color: #FDBA74; align-self: flex-start;
}
.adm-nav { display: flex; flex-direction: column; gap: 2px; }
.adm-nav-link {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px;
  text-decoration: none; color: rgba(255, 255, 255, .72); font-size: 14px; font-weight: 600;
  transition: background .12s ease, color .12s ease;
}
.adm-nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.adm-nav-link.is-active { background: var(--emerald); color: #fff; }
.adm-nav-icon { font-size: 16px; line-height: 1; }
.adm-nav-soon {
  margin-left: auto; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 999px;
  background: rgba(255, 255, 255, .12); color: rgba(255, 255, 255, .6);
}
.adm-nav-link.is-active .adm-nav-soon { background: rgba(0, 0, 0, .18); color: rgba(255, 255, 255, .85); }

/* Nhóm menu có mục con (Học liệu) */
.adm-nav-group { display: flex; flex-direction: column; gap: 2px; }
.adm-nav-sub { display: none; flex-direction: column; gap: 2px; margin: 2px 0 4px 14px; padding-left: 10px; border-left: 1px solid rgba(255, 255, 255, .12); }
.adm-nav-group.is-open .adm-nav-sub { display: flex; }
.adm-nav-sublink {
  display: flex; align-items: center; gap: 8px; padding: 8px 11px; border-radius: 8px;
  text-decoration: none; color: rgba(255, 255, 255, .62); font-size: 13px; font-weight: 600;
  transition: background .12s ease, color .12s ease;
}
.adm-nav-sublink:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.adm-nav-sublink.is-active { background: var(--emerald); color: #fff; }
.adm-nav-sublink .adm-nav-soon { margin-left: auto; }
.adm-side-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .1); }
.adm-side-back { font-size: 13px; color: rgba(255, 255, 255, .6); text-decoration: none; }
.adm-side-back:hover { color: #fff; }

/* ===== Vùng chính ===== */
.adm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.adm-top {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 16px 26px; background: #fff; border-bottom: 1px solid var(--gray-200);
}
.adm-top-title { margin: 0; font-size: 20px; color: var(--navy); }
.adm-top-right { display: flex; align-items: center; gap: 14px; }
.adm-who { font-size: 13px; color: var(--gray-600); }
.adm-logout-form { margin: 0; display: inline; }
.adm-logout {
  font-size: 13px; font-weight: 700; color: var(--red); text-decoration: none;
  padding: 6px 12px; border-radius: 8px; border: 1px solid var(--gray-200);
  background: none; cursor: pointer; font-family: inherit;
}
.adm-logout:hover { background: #FEF2F2; border-color: #FECACA; }
.adm-content { flex: 1; padding: 26px; }
.adm-foot { padding: 14px 26px; font-size: 12px; color: var(--gray-400); }

/* ===== Khối nội dung ===== */
.adm-sec { margin-bottom: 30px; }
.adm-sec-title { margin: 0 0 14px; font-size: 15px; color: var(--gray-600); text-transform: uppercase; letter-spacing: .04em; }
.adm-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.adm-card {
  background: #fff; border: 1px solid var(--gray-200); border-left: 4px solid var(--gray-200);
  border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 6px;
}
.adm-card.is-good { border-left-color: var(--emerald); }
.adm-card.is-warn { border-left-color: var(--orange); }
.adm-card.is-accent { border-left-color: var(--navy); }
.adm-card-label { font-size: 12.5px; color: var(--gray-600); font-weight: 600; }
.adm-card-value { font-size: 27px; font-weight: 800; color: var(--navy); line-height: 1.15; }
.adm-card-value small { font-size: 15px; font-weight: 700; color: var(--gray-400); }

/* ===== Biểu đồ tăng trưởng theo tuần (cột thuần CSS) ===== */
.adm-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.adm-chart { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 16px 18px 12px; }
.adm-chart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.adm-chart-head h3 { margin: 0; font-size: 14px; color: var(--navy); }
.adm-chart-sum { font-size: 13px; font-weight: 700; color: var(--gray-600); }
.adm-bars { display: flex; align-items: flex-end; gap: 8px; height: 170px; }
.adm-bar-col {
  flex: 1 1 0; height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end; gap: 4px; min-width: 0;
}
.adm-bar {
  width: 68%; max-width: 40px; min-height: 2px; border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-700) 100%);
  transition: filter .12s;
}
.adm-bar.is-rev { background: linear-gradient(180deg, var(--emerald, #059669) 0%, #047857 100%); }
.adm-bar-col:hover .adm-bar { filter: brightness(1.12); }
.adm-bar-val { font-size: 11px; font-weight: 700; color: var(--gray-600); white-space: nowrap; }
.adm-bar-lbl { font-size: 10.5px; color: var(--gray-400); white-space: nowrap; }

/* ===== Bảng ===== */
/* Bảng rộng phải tự cuộn TRONG khung, không được làm cả trang trượt ngang. */
.adm-table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); }
.adm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.adm-table th, .adm-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--gray-100); }
.adm-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--gray-600); background: var(--gray-50); }
.adm-table tr:last-child td { border-bottom: 0; }
.adm-num { text-align: right; font-variant-numeric: tabular-nums; }
.adm-muted { color: var(--gray-400); font-size: 13px; }
.adm-note { margin: 10px 2px 0; font-size: 12.5px; color: var(--gray-400); }

/* ===== Khối thông tin ===== */
.adm-info { background: #fff; border: 1px dashed var(--gray-200); border-radius: var(--radius); padding: 20px 22px; }
.adm-info h3 { margin: 0 0 8px; font-size: 15px; color: var(--navy); }
.adm-info p { margin: 0 0 8px; font-size: 13.5px; line-height: 1.65; color: var(--gray-600); }
.adm-info p:last-child { margin-bottom: 0; }

/* ===== Nút / form ===== */
.adm-btn {
  display: inline-block; padding: 11px 20px; border: 0; border-radius: 9px; cursor: pointer;
  background: var(--orange); color: #fff; font-size: 14px; font-weight: 700; font-family: var(--font);
  text-decoration: none; text-align: center;
}
.adm-btn:hover { background: #ea6a0c; }
.adm-btn-ghost { background: transparent; color: var(--gray-600); border: 1px solid var(--gray-200); }
.adm-btn-ghost:hover { background: var(--gray-100); color: var(--gray-800); }
.adm-form { display: flex; flex-direction: column; }
.adm-label { font-size: 13px; font-weight: 700; color: var(--gray-600); margin-bottom: 6px; }
.adm-input {
  padding: 11px 13px; border: 1px solid var(--gray-200); border-radius: 9px;
  font-size: 14px; font-family: var(--font); margin-bottom: 16px; background: #fff;
}
.adm-input:focus { outline: 2px solid var(--emerald); outline-offset: -1px; border-color: transparent; }
.adm-alert {
  background: #FEF2F2; border: 1px solid #FECACA; color: #991B1B;
  padding: 11px 14px; border-radius: 9px; font-size: 13.5px; margin-bottom: 16px;
}

/* ===== Layout blank (đăng nhập / trang lỗi) ===== */
.adm-blank { background: var(--navy-900); }
.adm-blank-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.adm-login, .adm-msg {
  width: 100%; max-width: 400px; background: #fff; border-radius: 16px;
  padding: 34px 30px; box-shadow: 0 18px 50px rgba(0, 0, 0, .3);
}
.adm-login-head { display: flex; flex-direction: column; align-items: center; margin-bottom: 22px; }
.adm-login-logo { display: block; width: 240px; max-width: 100%; height: auto; margin-bottom: 6px; }
.adm-login-brand { font-size: 20px; font-weight: 800; margin-top: 8px; }
.adm-login-note { margin: 16px 0 0; font-size: 12px; color: var(--gray-400); text-align: center; }
.adm-msg { text-align: center; }
.adm-msg-code { font-size: 44px; font-weight: 800; color: var(--gray-200); line-height: 1; margin-bottom: 6px; }
.adm-msg h2 { margin: 0 0 8px; font-size: 19px; color: var(--navy); }
.adm-msg-text { margin: 0 0 20px; font-size: 14px; color: var(--gray-600); }

/* ===== Trang đang xây dựng ===== */
.adm-soon {
  background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius);
  padding: 56px 24px; text-align: center;
}
.adm-soon-icon { font-size: 42px; margin-bottom: 12px; }
.adm-soon h2 { margin: 0 0 8px; font-size: 19px; color: var(--navy); }
.adm-soon-note { margin: 0 auto 22px; font-size: 13.5px; color: var(--gray-600); max-width: 460px; line-height: 1.6; }

/* ===== Mobile ===== */
@media (max-width: 820px) {
  .adm { flex-direction: column; }
  .adm-side { width: 100%; height: auto; position: static; padding: 14px; }
  .adm-nav { flex-direction: row; flex-wrap: wrap; }
  .adm-nav-soon { display: none; }
  .adm-side-foot { margin-top: 14px; }
  .adm-content, .adm-top { padding: 16px; }
}

/* ==========================================================================
   Trang Người dùng
   ========================================================================== */

/* ===== Thông báo kết quả thao tác ===== */
.adm-flash { padding: 12px 16px; border-radius: 9px; font-size: 13.5px; margin-bottom: 16px; }
.adm-flash.is-ok { background: #ECFDF5; border: 1px solid #A7F3D0; color: #065F46; }
.adm-flash.is-err { background: #FEF2F2; border: 1px solid #FECACA; color: #991B1B; }

/* ===== Tìm kiếm + lọc ===== */
.adm-filter { display: flex; gap: 8px; margin-bottom: 14px; }
.adm-filter-input { margin-bottom: 0; flex: 1; max-width: 380px; }
.adm-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.adm-tab {
  padding: 6px 13px; border-radius: 999px; font-size: 13px; font-weight: 600;
  text-decoration: none; color: var(--gray-600); background: #fff; border: 1px solid var(--gray-200);
}
.adm-tab:hover { border-color: var(--gray-400); }
.adm-tab.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }
.adm-count { margin: 0 0 12px; font-size: 13px; color: var(--gray-600); }
.adm-empty {
  background: #fff; border: 1px dashed var(--gray-200); border-radius: var(--radius);
  padding: 40px; text-align: center; color: var(--gray-400); font-size: 14px;
}

/* ===== Nhãn trạng thái ===== */
.adm-pill {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px;
  font-weight: 700; background: var(--gray-100); color: var(--gray-600); white-space: nowrap;
}
.adm-pill.is-ok { background: #D1FAE5; color: #065F46; }
.adm-pill.is-warn { background: #FEF3C7; color: #92400E; }
.adm-pill.is-err { background: #FEE2E2; color: #991B1B; }
/* Pill bấm được (vd "link kích hoạt hết hạn → gia hạn"). */
.adm-pill-btn { border: none; cursor: pointer; font-family: inherit; line-height: 1.4; }
.adm-pill-btn:hover { filter: brightness(.94); text-decoration: underline; }
.adm-pill.is-admin { background: #DBEAFE; color: #1E3A8A; }
.adm-pill.is-review { background: #FFEDD5; color: #9A3412; }
.adm-pill.is-new { background: #DCFCE7; color: #166534; }

.adm-link { color: var(--navy); font-weight: 600; text-decoration: none; }
.adm-link:hover { text-decoration: underline; }
.adm-back { display: inline-block; margin-bottom: 14px; font-size: 13px; color: var(--gray-600); text-decoration: none; }
.adm-back:hover { color: var(--navy); }

.adm-btn-sm { padding: 6px 12px; font-size: 12.5px; }
.adm-btn-block { width: 100%; }
.adm-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; font-size: 13px; }

/* ===== Chi tiết ===== */
/* Cột phụ 320px cho khu thao tác; hẹp màn thì xếp dọc (xem media query cuối file). */
.adm-cols { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start; }
.adm-panel {
  background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 16px;
}
.adm-panel-title { margin: 0 0 14px; font-size: 14px; color: var(--navy); }
.adm-dl { display: grid; grid-template-columns: 150px 1fr; gap: 9px 12px; margin: 0; font-size: 13.5px; }
.adm-dl dt { color: var(--gray-600); font-weight: 600; }
.adm-dl dd { margin: 0; }
.adm-code {
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 12.5px;
  background: var(--gray-100); padding: 2px 6px; border-radius: 5px;
}
.adm-hint { margin: 0 0 12px; font-size: 12.5px; color: var(--gray-600); line-height: 1.6; }
.adm-hint:last-child { margin-bottom: 0; margin-top: 10px; }
.adm-inline-form { display: flex; gap: 8px; }
.adm-input-sm { margin-bottom: 0; width: 90px; }
.adm-stack { margin-bottom: 8px; }

@media (max-width: 1080px) {
  .adm-cols { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .adm-dl { grid-template-columns: 1fr; gap: 2px 0; }
  .adm-dl dd { margin-bottom: 8px; }
  .adm-filter { flex-wrap: wrap; }
  .adm-filter-input { max-width: none; }
}

/* ===== Tài khoản trả phí (VIP) ===== */
.adm-pill.is-vip { background: linear-gradient(135deg, #FDE68A, #FBBF24); color: #7C2D12; }
.adm-card.is-vip { border-left-color: #F59E0B; }

/* ==========================================================================
   Học liệu — overview
   ========================================================================== */
.adm-content-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.adm-content-card {
  display: block; text-decoration: none; background: #fff;
  border: 1px solid var(--gray-200); border-left: 4px solid var(--navy);
  border-radius: var(--radius); padding: 16px 18px; transition: box-shadow .12s ease, transform .12s ease;
}
.adm-content-card:hover { box-shadow: 0 6px 20px rgba(0, 0, 0, .08); transform: translateY(-1px); }
.adm-content-card.is-soon { border-left-color: var(--gray-200); opacity: .7; cursor: default; }
.adm-content-card.is-soon:hover { box-shadow: none; transform: none; }
.adm-content-card-top { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.adm-content-icon { font-size: 20px; }
.adm-content-name { font-weight: 700; color: var(--navy); }
.adm-content-num { font-size: 14px; color: var(--gray-800); }
.adm-content-num strong { font-size: 20px; color: var(--navy); }
.adm-content-detail { font-size: 12.5px; color: var(--gray-400); margin-top: 4px; }

/* ===== Học liệu — danh sách + form CRUD ===== */
.adm-list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.adm-list-head .adm-count { margin: 0; }
.adm-form-hint { display: block; font-size: 12px; color: var(--gray-400); margin-top: -10px; margin-bottom: 12px; }

.ce-form { background: transparent; border: 0; padding: 0; }
.ce-rows { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 10px; }
.ce-row {
  position: relative; background: var(--gray-50); border: 1px solid var(--gray-200);
  border-radius: 10px; padding: 12px 14px 12px; padding-right: 34px;
}
.ce-row-block { display: flex; flex-direction: column; }
.ce-del {
  position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; line-height: 1;
  border: 1px solid var(--gray-200); background: #fff; border-radius: 6px; cursor: pointer;
  color: var(--red); font-size: 13px;
}
.ce-del:hover { background: #FEF2F2; border-color: #FECACA; }
.ce-actions { display: flex; gap: 10px; align-items: center; margin-top: 18px; }

/* Đáp án theo band gấp gọn trong mỗi câu con Speaking (đỡ rối khi chưa cần) */
.ce-bands { margin-top: 6px; border-top: 1px dashed var(--gray-200); padding-top: 6px; }
.ce-bands > summary { cursor: pointer; font-size: 13px; color: var(--gray-600); user-select: none; }
.ce-bands[open] > summary { margin-bottom: 8px; font-weight: 600; }

/* Tiêu đề phần trong form Writing (1 CLB = 4 phần) */
.ce-part-title { margin: 22px 0 8px; font-size: 15px; font-weight: 700; color: var(--navy, #1e3a5f); }
.ce-part-sub { margin: 12px 0 4px; font-size: 13px; font-weight: 600; color: var(--gray-600); }

/* Ảnh thu nhỏ ở danh sách học liệu (Speaking Part 2 & 3) — hover để phóng to */
.adm-thumbs { display: flex; gap: 6px; align-items: center; }
.adm-thumb-wrap { position: relative; display: inline-block; line-height: 0; }
.adm-thumb {
  height: 46px; width: auto; max-width: 84px; object-fit: cover; cursor: zoom-in;
  border: 1px solid var(--gray-200); border-radius: 6px; display: block; background: var(--gray-50);
}
.adm-thumb-wrap:hover .adm-thumb { border-color: var(--gray-400, #9ca3af); }
/* Ảnh phóng to hiện khi rê chuột — không đụng layout (position absolute + z-index cao) */
.adm-thumb-zoom {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  display: none; z-index: 200; max-width: 460px; max-height: 340px; width: auto; height: auto;
  border: 1px solid var(--gray-300, #d1d5db); border-radius: 8px; background: #fff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .28);
}
.adm-thumb-wrap:hover .adm-thumb-zoom { display: block; }
/* Mô tả ảnh (tiếng Việt) hiện dưới thumbnail trong danh sách Speaking */
.adm-thumb-desc { margin-top: 5px; font-size: 12px; color: var(--gray-600); max-width: 210px; line-height: 1.35; }

/* 3 câu hỏi con của 1 bộ Speaking hiện thẳng ở danh sách */
.adm-subq { margin: 4px 0 0; padding-left: 20px; }
.adm-subq li { margin: 2px 0; font-size: 13px; line-height: 1.4; }

/* ===== Modal (popup) — dùng cho "thêm review trúng đề" ===== */
.adm-modal[hidden] { display: none; }
.adm-modal {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
  background: rgba(15, 31, 77, .45); padding: 20px;
}
.adm-modal-card {
  background: #fff; border-radius: var(--radius); width: 100%; max-width: 460px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .3); padding: 20px 22px; max-height: 90vh; overflow-y: auto;
}
.adm-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.adm-modal-title { margin: 0; font-size: 17px; color: var(--navy); }
.adm-modal-close {
  border: 0; background: none; font-size: 26px; line-height: 1; color: var(--gray-400);
  cursor: pointer; padding: 0 4px;
}
.adm-modal-close:hover { color: var(--gray-600); }
.adm-modal-sub { margin: 0 0 12px; color: var(--gray-600); font-size: 13px; }
.adm-req { color: var(--red, #dc2626); }

/* Tải file học liệu (audio/ảnh) — nút chọn file + trạng thái */
.adm-upload { display: flex; align-items: center; gap: 10px; margin: -2px 0 8px; flex-wrap: wrap; }
.adm-upload-btn { cursor: pointer; margin: 0; }
.adm-upload-status { font-size: 13px; color: var(--gray-600); }
.adm-upload-status.is-load { color: var(--gray-600); }
.adm-upload-status.is-ok { color: var(--green, #059669); }
.adm-upload-status.is-err { color: var(--red, #dc2626); }

/* Nút thao tác dạng icon (danh sách học liệu) */
.adm-actions-col { width: 1%; white-space: nowrap; }
.adm-icon-actions { display: inline-flex; gap: 4px; }
.adm-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--gray-200); background: #fff; font-size: 15px; line-height: 1;
  text-decoration: none; transition: background .12s ease, border-color .12s ease;
}
.adm-icon-btn:hover { background: var(--gray-100); border-color: var(--gray-400); }
.adm-icon-btn.is-on { background: #FEF3C7; border-color: #FBBF24; } /* VIP đang bật */
.adm-icon-btn.is-danger:hover { background: #FEF2F2; border-color: #FECACA; }

/* ==========================================================================
   Dùng chung: nút xoá + khối gập (details) + form nhiều field
   ========================================================================== */
.adm-btn-danger { background: transparent; color: var(--red); border: 1px solid #FECACA; }
.adm-btn-danger:hover { background: #FEF2F2; color: #991B1B; }
.adm-row-off td { opacity: .55; }

.adm-disclose { margin: 8px 0 4px; }
.adm-disclose > summary { display: inline-block; list-style: none; user-select: none; }
.adm-disclose > summary::-webkit-details-marker { display: none; }
.adm-disclose[open] > summary { margin-bottom: 12px; }
.adm-disclose-inline { display: inline-block; margin: 0; }

/* Form nhiều field: label trên, input dưới; hàng field co giãn được */
.adm-ann-form {
  border: 1px solid var(--gray-200); border-radius: var(--radius);
  padding: 16px; background: var(--gray-50); margin-bottom: 4px;
}
.adm-ann-grid { display: flex; flex-wrap: wrap; gap: 0 14px; }
.adm-field { display: flex; flex-direction: column; flex: 1 1 180px; }
.adm-field .adm-label { display: block; }
.adm-field-icon { flex: 0 0 72px; }
.adm-field-grow { flex: 3 1 260px; }
.adm-ann-form textarea.adm-input { resize: vertical; }
.adm-ann-checks { display: flex; gap: 20px; margin: 2px 0 14px; flex-wrap: wrap; }
.adm-check { display: flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--gray-800); font-weight: 600; }

/* ==========================================================================
   Trang Thông báo
   ========================================================================== */
.adm-ann-overlay-state {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 9px;
  padding: 10px 14px; margin-bottom: 14px; font-size: 13.5px;
}
.adm-ann-list { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.adm-ann {
  border: 1px solid var(--gray-200); border-left: 4px solid var(--emerald);
  border-radius: var(--radius); padding: 14px 16px;
}
.adm-ann.is-hidden { border-left-color: var(--gray-200); background: var(--gray-50); }
.adm-ann-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.adm-ann-icon { font-size: 18px; }
.adm-ann-title { font-weight: 700; color: var(--navy); }
.adm-ann-pills { display: flex; gap: 6px; margin-left: auto; }
.adm-ann-meta { font-size: 12.5px; margin: 6px 0; }
.adm-ann-text { margin: 6px 0 0; font-size: 13.5px; color: var(--gray-600); line-height: 1.6; }
.adm-ann-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* ===== Review tích đức ===== */
.rva-card { border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; background: var(--white); }
.rva-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.rva-user { color: var(--navy); }
.rva-anon { font-size: 12px; color: var(--gray-600); background: var(--gray-100); padding: 2px 8px; border-radius: 999px; }
.rva-meta { font-size: 12.5px; color: var(--gray-600); }
.rva-bonus { color: var(--emerald-600); font-weight: 600; }
.rva-items { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.rva-items li { display: flex; align-items: baseline; gap: 8px; font-size: 13.5px; flex-wrap: wrap; }
.rva-skill { font-weight: 600; color: var(--navy); min-width: 150px; }
.rva-text { color: var(--gray-800); }
.rva-tag { font-size: 11px; font-weight: 700; color: var(--orange); background: rgba(249, 115, 22, .12); padding: 1px 7px; border-radius: 999px; }
.rva-matches { background: var(--gray-50); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.rva-matches-title { font-size: 12px; font-weight: 700; color: var(--gray-600); margin-bottom: 6px; }
.rva-match { font-size: 13px; margin: 3px 0; }
.rva-match.is-miss { color: var(--gray-600); }
.rva-raw { font-style: italic; }
.rva-score { color: var(--gray-400); font-size: 12px; }
.rva-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rva-grant { font-size: 12.5px; color: var(--gray-800); display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.rva-approve { display: inline-flex; align-items: center; gap: 8px; }

/* ===== Email marketing: nhóm user · tag · chiến dịch ===== */
.adm-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.adm-panel-head .adm-panel-title { margin-bottom: 0; }

/* Bảng "nhãn — giá trị" ở trang chi tiết chiến dịch */
.adm-kv { width: 100%; border-collapse: collapse; margin-top: 12px; }
.adm-kv th { text-align: left; width: 160px; padding: 7px 10px 7px 0; font-size: 13px; color: #6b7280; font-weight: 600; vertical-align: top; }
.adm-kv td { padding: 7px 0; font-size: 14px; border-bottom: 1px dashed #e5e7eb; }
.adm-kv tr:last-child td { border-bottom: none; }

.adm-tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.adm-tag { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
  background: #eef2ff; color: #3730a3; font-size: 13px; font-weight: 600; text-decoration: none; }
.adm-tag:hover { background: #e0e7ff; }
.adm-tag span { background: #fff; border-radius: 999px; padding: 0 7px; font-size: 12px; color: #4b5563; }

.adm-chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 160px; overflow: auto; }
.adm-chip { background: #f3f4f6; border-radius: 999px; padding: 3px 10px; font-size: 12px; color: #374151; }

/* Khối lựa chọn người nhận: thụt vào cho thấy rõ nó thuộc radio phía trên */
.adm-aud-box { margin: 6px 0 4px 24px; padding-left: 12px; border-left: 2px solid #e5e7eb;
  display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow: auto; }

.adm-mono { font-family: 'Consolas', 'Courier New', monospace; font-size: 13px; line-height: 1.6; }

/* Khung xem trước email — dựng lại cảm giác hộp thư (nền trắng, viền, hẹp) */
.adm-mail-preview { border: 1px solid #e5e7eb; border-radius: 10px; background: #fff; padding: 20px;
  max-width: 640px; overflow-x: auto; }
.adm-mail-preview img { max-width: 100%; }

.adm-inline-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.adm-inline-row .adm-input { max-width: 280px; }
.adm-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.adm-actions form { margin: 0; }

/* Chọn nhiều user ở danh sách rồi soạn email */
.adm-bulkbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0;
  padding: 10px 14px; background: #eef2ff; border: 1px solid #c7d2fe; border-radius: 8px; }
.adm-bulkbar strong { color: #3730a3; }
.adm-row-check { width: 34px; text-align: center; }
.adm-tagline { font-size: 12px; color: #6b7280; }

/* ===== Pop-up tra cứu điểm trong admin ===== */
.sct-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.55); display: flex; align-items: flex-start;
  justify-content: center; padding: 40px 16px; z-index: 60; overflow: auto; }
.sct-overlay[hidden] { display: none; }
.sct-card { position: relative; background: #fff; border-radius: 14px; padding: 24px 26px; width: 100%;
  max-width: 620px; box-shadow: 0 20px 60px rgba(15,23,42,.3); }
.sct-close { position: absolute; top: 10px; right: 14px; border: none; background: none; font-size: 26px;
  line-height: 1; color: #9ca3af; cursor: pointer; }
.sct-close:hover { color: #374151; }
.sct-title { margin: 0 0 2px; font-size: 19px; color: #1E3A8A; }
.sct-sub { margin: 0 0 14px; font-size: 14px; color: #6b7280; }
.sct-attempt { border: 1px solid #e5e7eb; border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.sct-attempt-head { margin-bottom: 8px; font-size: 14px; }
.sct-table { margin: 0; font-size: 13px; }
.sct-table th, .sct-table td { padding: 5px 10px; }
.sct-total { margin: 8px 0 0; font-size: 13px; color: #374151; }
.sct-err { color: #b91c1c; }
.sct-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 12px;
  border-top: 1px dashed #e5e7eb; }
.sct-mail { margin-top: 14px; padding-top: 12px; border-top: 1px dashed #e5e7eb; }
.sct-mail-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
.sct-mail-row .adm-input { flex: 1 1 180px; }
.sct-mail-row select.adm-input { flex: 0 0 auto; }
.sct-msg { margin: 12px 0 0; font-size: 14px; padding: 9px 12px; border-radius: 8px; background: #f3f4f6; }
.sct-msg.is-ok { background: #ecfdf5; color: #047857; }
.sct-msg.is-err { background: #fef2f2; color: #b91c1c; }
/* Ô "có điểm" bấm được -> mở pop-up xem bản đã lưu (nút nhưng trông như nội dung ô). */
.sct-link { display: block; width: 100%; text-align: left; background: none; border: none; padding: 0;
  font: inherit; cursor: pointer; }
.sct-link:hover .adm-pill { filter: brightness(.94); }
.sct-link:hover .adm-tagline { text-decoration: underline; }
.sct-link .adm-tagline { display: block; }
.sct-fetch:empty { display: none; }
.sct-fetch { margin: 4px 0 10px; }
.adm-pill.is-star { background: #fef3c7; color: #92400e; }

/* Thanh tiến độ upload video */
.adm-progress { position: relative; height: 22px; background: #eef2f7; border-radius: 8px; overflow: hidden; margin: 12px 0; }
.adm-progress-bar { height: 100%; width: 0; background: #10B981; transition: width .2s; }
.adm-progress-txt { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #1f2937; }

/* Trình soạn thảo bài viết (blog) */
.blog-ed-toolbar { display:flex; flex-wrap:wrap; gap:4px; padding:8px; border:1px solid #d1d5db; border-bottom:0; border-radius:8px 8px 0 0; background:#f8fafc; }
.blog-ed-btn { min-width:34px; height:32px; padding:0 8px; border:1px solid #d1d5db; background:#fff; border-radius:6px; cursor:pointer; font-size:13px; line-height:1; }
.blog-ed-btn:hover { background:#eef2f7; }
.blog-ed-sep { width:1px; background:#e5e7eb; margin:2px 4px; }
.blog-ed-area { min-height:320px; max-height:70vh; overflow-y:auto; padding:14px 16px; border:1px solid #d1d5db; border-radius:0 0 8px 8px; background:#fff; font-size:15px; line-height:1.75; }
.blog-ed-area:empty:before { content: attr(data-placeholder); color:#9ca3af; }
.blog-ed-area:focus { outline:2px solid #bfdbfe; outline-offset:-1px; }
.blog-ed-area img, .blog-ed-area video { max-width:100%; border-radius:8px; }
.blog-ed-area iframe { width:100%; aspect-ratio:16/9; border:0; border-radius:8px; }
.blog-ed-area h2 { font-size:22px; color:#1E3A8A; }
.blog-ed-area h3 { font-size:18px; color:#1E3A8A; }
.blog-ed-area blockquote { border-left:4px solid #10B981; margin:10px 0; padding:6px 14px; background:#F0FDF4; }
