/* =====================================================================
   AT UI — bộ giao diện dùng chung của AnhTester LMS (từ 17/11/2026)
   ---------------------------------------------------------------------
   Người dùng chốt phong cách này ở trang "Bài tập của tôi": nút gradient
   bóng bẩy, đổ bóng nhẹ cùng màu, panel bo 16px, tab dạng segmented,
   thẻ chọn, pill trạng thái có chấm màu. MỌI chỗ chỉnh UI về sau dùng
   lại các class ở đây — KHÔNG viết lại kiểu riêng cho từng trang.
   Trang xem mẫu (super admin): /ui-kit  ·  Tài liệu: .claude/plans/06-ui-general.md
   mục "AT UI kit".

   Quy ước màu (theo brand, xem 06-ui-general "Đổi tông màu thương hiệu"):
     • CAM  (--at-grad-orange) — HÀNH ĐỘNG CHÍNH của màn hình: Nộp bài,
       Lưu, Tạo mới, Đăng ký... Mỗi màn hình chỉ 1 nút cam nổi bật.
     • XANH LÁ LOGO (--at-grad-green, #42BC40 → #268A24) — hành động phụ / lọc / tìm, trạng thái
       đang chọn (thẻ, tab, đếm), nút đi tiếp.
     • XANH DƯƠNG (--at-grad-blue) — thông tin, xem trước, liên kết ngoài.
     • ĐỎ   (--at-grad-red) — xoá, huỷ, thao tác nguy hiểm.
     • SLATE (--at-grad-slate) — nút trung tính tối (in, xuất file...).
   Gradient chỉ dùng cho NÚT và ĐIỂM NHẤN đang chọn — không phủ nền trang/card.
   ===================================================================== */

:root {
    /* Gradient stops (stop 1 sáng → stop 2 = màu brand gốc) */
    --at-orange-1: #FB8A2E; --at-orange-2: #E06004;
    --at-green-1:  #42BC40; --at-green-2:  #268A24;   /* xanh lá logo #42BC40 (đo từ logo PNG) */
    --at-blue-1:   #3B8FE8; --at-blue-2:   #1570CD;
    --at-red-1:    #F0605D; --at-red-2:    #C9302C;
    --at-slate-1:  #475569; --at-slate-2:  #1E293B;
    /* Tone bổ sung 17/11/2026 (người dùng: "bổ sung thêm màu hồng, tím, teal, mint") —
       dùng cho điểm nhấn/biểu đồ/nhãn phân loại; KHÔNG thay quy ước cam = hành động chính. */
    --at-pink-1:   #F472B6; --at-pink-2:   #DB2777;
    --at-purple-1: #A78BFA; --at-purple-2: #7C3AED;
    --at-teal-1:   #2DD4BF; --at-teal-2:   #0D9488;
    --at-mint-1:   #6EE7B7; --at-mint-2:   #059669;

    --at-grad-pink:   linear-gradient(135deg, var(--at-pink-1), var(--at-pink-2));
    --at-grad-purple: linear-gradient(135deg, var(--at-purple-1), var(--at-purple-2));
    --at-grad-teal:   linear-gradient(135deg, var(--at-teal-1), var(--at-teal-2));
    --at-grad-mint:   linear-gradient(135deg, var(--at-mint-1), var(--at-mint-2));
    --at-glow-pink:   0 4px 12px rgba(219, 39, 119, .26);
    --at-glow-purple: 0 4px 12px rgba(124, 58, 237, .26);
    --at-glow-teal:   0 4px 12px rgba(13, 148, 136, .26);
    --at-glow-mint:   0 4px 12px rgba(5, 150, 105, .24);
    --at-pink-bg:   #FCE7F3; --at-pink-ink:   #BE185D;
    --at-purple-bg: #EDE9FE; --at-purple-ink: #6D28D9;
    --at-teal-bg:   #CCFBF1; --at-teal-ink:   #0F766E;
    --at-mint-bg:   #D1FAE5; --at-mint-ink:   #047857;

    --at-grad-orange: linear-gradient(135deg, var(--at-orange-1), var(--at-orange-2));
    --at-grad-green:  linear-gradient(135deg, var(--at-green-1), var(--at-green-2));
    --at-grad-blue:   linear-gradient(135deg, var(--at-blue-1), var(--at-blue-2));
    --at-grad-red:    linear-gradient(135deg, var(--at-red-1), var(--at-red-2));
    --at-grad-slate:  linear-gradient(135deg, var(--at-slate-1), var(--at-slate-2));

    /* Bóng màu dưới nút (glow) + viền sáng phía trên cho cảm giác "bóng" */
    --at-gloss: inset 0 1px 0 rgba(255, 255, 255, .2);
    --at-glow-orange: 0 4px 12px rgba(224, 96, 4, .30);
    --at-glow-green:  0 4px 12px rgba(38, 138, 36, .28);
    --at-glow-blue:   0 4px 12px rgba(21, 112, 205, .28);
    --at-glow-red:    0 4px 12px rgba(201, 48, 44, .28);
    --at-glow-slate:  0 4px 12px rgba(15, 23, 42, .25);

    /* Bề mặt + chữ */
    --at-brand: #268A24; --at-brand-soft: #EBF7EA; --at-brand-line: #BCE5BB;
    --at-surface: #FFFFFF; --at-sunken: #F3F5F8; --at-line: #E5E9F0;
    --at-ink: #0F172A; --at-muted: #64748B;
    --at-shadow-sm: 0 1px 2px rgba(15, 23, 42, .08), 0 2px 6px rgba(15, 23, 42, .08);
    --at-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 14px rgba(15, 23, 42, .06);
    --at-focus: 0 0 0 3px rgba(66, 188, 64, .2);

    /* Pill / đếm theo trạng thái: nền nhạt + chữ đậm cùng hue */
    --at-amber-bg: #FEF3C7; --at-amber-ink: #B45309;
    --at-blue-bg:  #DBEAFE; --at-blue-ink:  #1D4ED8;
    --at-red-bg:   #FEE2E2; --at-red-ink:   #B91C1C;
    --at-green-bg: #DCFCE7; --at-green-ink: #15803D;
    --at-gray-bg:  #F1F5F9; --at-gray-ink:  #475569;
    --at-orange-bg:#FFEDD5; --at-orange-ink:#C2410C;

    --at-radius-sm: 10px; --at-radius: 12px; --at-radius-lg: 16px;
    --at-ease: .15s ease;
}

html.dark-mode {
    --at-brand: #62D160; --at-brand-soft: rgba(66, 188, 64, .14); --at-brand-line: rgba(66, 188, 64, .4);
    --at-surface: #161B26; --at-sunken: #0F131B; --at-line: #273042;
    --at-ink: #E6EAF2; --at-muted: #94A3B8;
    --at-shadow-sm: 0 1px 2px rgba(0, 0, 0, .4), 0 2px 6px rgba(0, 0, 0, .3);
    --at-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .35);
    --at-focus: 0 0 0 3px rgba(66, 188, 64, .25);
    --at-amber-bg: rgba(245, 158, 11, .16); --at-amber-ink: #FBBF24;
    --at-blue-bg:  rgba(59, 130, 246, .16); --at-blue-ink:  #93C5FD;
    --at-red-bg:   rgba(239, 68, 68, .16);  --at-red-ink:   #FCA5A5;
    --at-green-bg: rgba(34, 197, 94, .16);  --at-green-ink: #86EFAC;
    --at-gray-bg:  rgba(148, 163, 184, .14); --at-gray-ink: #CBD5E1;
    --at-orange-bg:rgba(251, 138, 46, .16); --at-orange-ink:#FDBA74;
    --at-pink-bg:   rgba(236, 72, 153, .16); --at-pink-ink:   #F9A8D4;
    --at-purple-bg: rgba(139, 92, 246, .18); --at-purple-ink: #C4B5FD;
    --at-teal-bg:   rgba(20, 184, 166, .16); --at-teal-ink:   #5EEAD4;
    --at-mint-bg:   rgba(16, 185, 129, .16); --at-mint-ink:   #6EE7B7;
}

/* ---------- Nút ----------------------------------------------------- */
.at-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 42px; padding: 0 18px; border: 0; border-radius: 11px;
    font-size: 14px; font-weight: 600; line-height: 1; white-space: nowrap;
    text-decoration: none; cursor: pointer; user-select: none;
    transition: background-color var(--at-ease), color var(--at-ease), border-color var(--at-ease), box-shadow var(--at-ease), filter var(--at-ease), transform .08s ease;
}
.at-btn i { font-size: 1.05em; line-height: 1; }
.at-btn:focus-visible { outline: none; box-shadow: var(--at-focus); }
.at-btn:disabled, .at-btn.disabled { opacity: .55; pointer-events: none; box-shadow: none; }
/* Đang gửi: class is-loading + <span class="at-spinner"></span> (at-ui.js tự gắn khi submit
   form / bấm a.at-btn; tự viết thì window.atLoading(btn, true)). Giữ nguyên màu, không mờ đi. */
.at-btn.is-loading, .at-btn.is-loading:disabled { opacity: .9; cursor: progress; }
.is-loading { cursor: progress !important; }
.btn.is-loading, .btn.is-loading:disabled { opacity: .85; }
:not(.at-btn).is-loading > .at-spinner { margin-right: .45rem; vertical-align: -2px; width: 14px; height: 14px; }
/* Nhấn là thấy: nhún nhẹ khi bấm (mọi nút/thẻ/tab của kit) */
.at-btn:active:not(:disabled):not(.is-loading) { transform: translateY(1px) scale(.97); }
.at-select-card:active, .at-tab:active { transform: scale(.98); }
/* Thẻ/tab vừa bấm (đang chuyển trang): vòng xoay nhỏ ở góc, giữ nguyên nội dung */
.at-select-card.is-pending, .at-tab.is-pending { position: relative; cursor: progress; }
.at-select-card.is-pending::after, .at-tab.is-pending::after { content: ""; position: absolute; top: 6px; right: 6px; width: 12px; height: 12px; border: 2px solid var(--at-brand); border-right-color: transparent; border-radius: 50%; animation: at-spin .7s linear infinite; }
.at-spinner { width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: at-spin .7s linear infinite; flex: 0 0 auto; }
@keyframes at-spin { to { transform: rotate(360deg); } }
.at-btn--xs { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.at-btn--sm { height: 34px; padding: 0 14px; font-size: 13px; border-radius: 10px; }
.at-btn--lg { height: 46px; padding: 0 22px; font-size: 14.5px; border-radius: 12px; }
.at-btn--pill { border-radius: 999px; }
.at-btn--block { display: flex; width: 100%; }

/* Gradient đặc: chữ trắng, glow cùng màu, sáng lên khi hover, lún nhẹ khi bấm */
.at-btn--orange, .at-btn--green, .at-btn--blue, .at-btn--red, .at-btn--slate { color: #fff; }
.at-btn--orange { background: var(--at-grad-orange); box-shadow: var(--at-glow-orange), var(--at-gloss); text-shadow: 0 1px 1px rgba(120, 45, 0, .25); }
.at-btn--green  { background: var(--at-grad-green);  box-shadow: var(--at-glow-green), var(--at-gloss); }
.at-btn--blue   { background: var(--at-grad-blue);   box-shadow: var(--at-glow-blue), var(--at-gloss); }
.at-btn--red    { background: var(--at-grad-red);    box-shadow: var(--at-glow-red), var(--at-gloss); }
.at-btn--slate  { background: var(--at-grad-slate);  box-shadow: var(--at-glow-slate), var(--at-gloss); }
:is(.at-btn--orange, .at-btn--green, .at-btn--blue, .at-btn--red, .at-btn--slate):hover { color: #fff; filter: brightness(1.06) saturate(1.05); }
.at-btn--orange:hover { box-shadow: 0 6px 16px rgba(224, 96, 4, .38), var(--at-gloss); }
.at-btn--green:hover  { box-shadow: 0 6px 16px rgba(38, 138, 36, .34), var(--at-gloss); }
.at-btn--blue:hover   { box-shadow: 0 6px 16px rgba(21, 112, 205, .34), var(--at-gloss); }
.at-btn--red:hover    { box-shadow: 0 6px 16px rgba(201, 48, 44, .34), var(--at-gloss); }
.at-btn--slate:hover  { box-shadow: 0 6px 16px rgba(15, 23, 42, .32), var(--at-gloss); }
:is(.at-btn--orange, .at-btn--green, .at-btn--blue, .at-btn--red, .at-btn--slate):active { filter: brightness(.96); box-shadow: 0 2px 6px rgba(15, 23, 42, .2), inset 0 1px 0 rgba(255, 255, 255, .12); }

/* Viền màu → đổ gradient khi hover (nút phụ trong danh sách, "Xem chi tiết") */
.at-btn--outline-green { background: var(--at-surface); color: var(--at-brand); box-shadow: inset 0 0 0 1.5px var(--at-brand-line); }
.at-btn--outline-green:hover, .at-hover-parent:hover .at-btn--outline-green { background: var(--at-grad-green); color: #fff; box-shadow: var(--at-glow-green); }
.at-btn--outline-orange { background: var(--at-surface); color: var(--at-orange-2); box-shadow: inset 0 0 0 1.5px #FBCB9F; }
.at-btn--outline-orange:hover { background: var(--at-grad-orange); color: #fff; box-shadow: var(--at-glow-orange); }

/* Nền nhạt cùng hue (nút nhỏ trong sidebar, nút "Bài tập") */
.at-btn--soft-green { background: var(--at-brand-soft); color: var(--at-brand); box-shadow: inset 0 0 0 1px var(--at-brand-line), 0 1px 2px rgba(38, 138, 36, .12); }
.at-btn--soft-green:hover { background: var(--at-grad-green); color: #fff; box-shadow: var(--at-glow-green); }
.at-btn--soft-orange { background: var(--at-orange-bg); color: var(--at-orange-ink); box-shadow: inset 0 0 0 1px #FBCB9F; }
.at-btn--soft-orange:hover { background: var(--at-grad-orange); color: #fff; box-shadow: var(--at-glow-orange); }

/* Trung tính: viền xám, hover nhẹ. --ghost-danger hover đỏ (Xoá lọc, Huỷ) */
.at-btn--ghost { background: var(--at-surface); color: var(--at-muted); box-shadow: inset 0 0 0 1.5px var(--at-line); }
.at-btn--ghost:hover { color: var(--at-ink); background: var(--at-sunken); }
.at-btn--ghost-danger { background: var(--at-surface); color: var(--at-muted); box-shadow: inset 0 0 0 1.5px var(--at-line); }
.at-btn--ghost-danger:hover { color: #DC2626; background: #FEF2F2; box-shadow: inset 0 0 0 1.5px #FCA5A5; }
html.dark-mode .at-btn--ghost-danger:hover { background: rgba(239, 68, 68, .12); color: #FCA5A5; }

/* ---------- Panel + nhãn ------------------------------------------- */
.at-panel { background: var(--at-surface); border: 1px solid var(--at-line); border-radius: var(--at-radius-lg); padding: 18px 20px; box-shadow: var(--at-shadow); }
.at-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--at-muted); margin-bottom: 10px; }
.at-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--at-line); }
.at-divider { border: 0; border-top: 1px dashed var(--at-line); margin: 16px 0; }

/* ---------- Thẻ chọn (chọn khoá / chọn mục, thay dropdown) ---------- */
.at-select-cards { display: flex; flex-wrap: wrap; gap: 10px; }
.at-select-card { flex: 0 1 auto; display: flex; align-items: center; gap: 12px; min-width: 0; padding: 12px 14px; border: 1.5px solid var(--at-line); border-radius: var(--at-radius); background: var(--at-surface); color: var(--at-ink); text-decoration: none; transition: border-color var(--at-ease), background-color var(--at-ease), box-shadow var(--at-ease); }
.at-select-card--wide { flex: 1 1 420px; max-width: 640px; }
.at-select-card:hover { border-color: var(--at-brand-line); box-shadow: var(--at-shadow); color: var(--at-ink); }
.at-select-card.active { border-color: var(--at-brand); background: var(--at-brand-soft); box-shadow: 0 0 0 3px rgba(66, 188, 64, .16); }
.at-select-card__icon { flex: 0 0 36px; height: 36px; border-radius: var(--at-radius-sm); display: grid; place-items: center; background: var(--at-sunken); color: var(--at-muted); font-size: 18px; transition: background-color var(--at-ease), color var(--at-ease); }
.at-select-card.active .at-select-card__icon { background: var(--at-grad-green); color: #fff; }
.at-select-card__name { flex: 1 1 auto; min-width: 0; font-size: 14px; font-weight: 600; line-height: 1.35; white-space: normal; overflow-wrap: anywhere; }
.at-select-card__count { flex: 0 0 auto; min-width: 28px; padding: 2px 8px; border-radius: 999px; background: var(--at-sunken); color: var(--at-muted); font-size: 12px; font-weight: 700; text-align: center; }
.at-select-card.active .at-select-card__count { background: var(--at-brand); color: #fff; }

/* ---------- Tab dạng segmented ------------------------------------ */
.at-tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--at-sunken); border-radius: var(--at-radius); }
.at-tab { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 0; border-radius: 9px; background: transparent; font-size: 13px; font-weight: 600; color: var(--at-muted); text-decoration: none; white-space: nowrap; cursor: pointer; transition: background-color var(--at-ease), color var(--at-ease), box-shadow var(--at-ease); }
.at-tab:hover { color: var(--at-ink); }
.at-tab.active { background: var(--at-surface); color: var(--at-ink); box-shadow: var(--at-shadow-sm); }

/* ---------- Số đếm + pill trạng thái + tag ------------------------ */
.at-count { display: inline-block; min-width: 22px; padding: 1px 7px; border-radius: 999px; font-size: 11.5px; font-weight: 700; line-height: 1.5; text-align: center; background: var(--at-gray-bg); color: var(--at-gray-ink); }
.at-count--brand  { background: var(--at-brand); color: #fff; }
.at-count--amber  { background: var(--at-amber-bg); color: var(--at-amber-ink); }
.at-count--blue   { background: var(--at-blue-bg); color: var(--at-blue-ink); }
.at-count--red    { background: var(--at-red-bg); color: var(--at-red-ink); }
.at-count--green  { background: var(--at-green-bg); color: var(--at-green-ink); }
.at-count--orange { background: var(--at-orange-bg); color: var(--at-orange-ink); }

.at-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; line-height: 1.3; white-space: nowrap; background: var(--at-gray-bg); color: var(--at-gray-ink); }
.at-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.at-pill--no-dot::before { display: none; }
.at-pill--amber  { background: var(--at-amber-bg); color: var(--at-amber-ink); }
.at-pill--blue   { background: var(--at-blue-bg); color: var(--at-blue-ink); }
.at-pill--red    { background: var(--at-red-bg); color: var(--at-red-ink); }
.at-pill--green  { background: var(--at-green-bg); color: var(--at-green-ink); }
.at-pill--orange { background: var(--at-orange-bg); color: var(--at-orange-ink); }

.at-tag { display: inline-flex; align-items: center; justify-content: center; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: rgba(21, 112, 205, .1); color: #1570CD; white-space: nowrap; }
html.dark-mode .at-tag { background: rgba(59, 130, 246, .16); color: #93C5FD; }

/* ---------- Ô nhập + ô tìm --------------------------------------- */
.at-input { width: 100%; height: 42px; padding: 0 14px; border: 1.5px solid var(--at-line); border-radius: 11px; background: var(--at-surface); color: var(--at-ink); font-size: 14px; outline: none; transition: border-color var(--at-ease), box-shadow var(--at-ease); }
textarea.at-input { height: auto; min-height: 96px; padding: 10px 14px; line-height: 1.5; }
.at-input:focus { border-color: var(--at-brand); box-shadow: var(--at-focus); }
.at-input::placeholder { color: var(--at-muted); opacity: .8; }
.at-search { display: flex; align-items: center; gap: 8px; margin: 0; min-width: 0; }
.at-search__box { position: relative; flex: 1 1 auto; min-width: 0; }
.at-search__box > i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--at-muted); font-size: 16px; pointer-events: none; }
.at-search__box > .at-input { padding-left: 38px; }

/* ---------- Bổ sung 17/11/2026 (trang chấm bài + form bài tập) ---------- */
/* Viền đỏ → đổ gradient đỏ khi hover (Yêu cầu sửa, Từ chối) */
.at-btn--outline-red { background: var(--at-surface); color: var(--at-red-2); box-shadow: inset 0 0 0 1.5px #F5B5B3; }
.at-btn--outline-red:hover { background: var(--at-grad-red); color: #fff; box-shadow: var(--at-glow-red); }
html.dark-mode .at-btn--outline-red { color: #FCA5A5; box-shadow: inset 0 0 0 1.5px rgba(239, 68, 68, .45); }

/* Ô chọn: <select class="at-input at-select"> hoặc bọc Select2 trong .at-select2 */
select.at-input.at-select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.at-select2 .select2-container { width: 100% !important; }
.at-select2 > .select2-container--open:not(.select2) { width: 0 !important; min-width: 0 !important; }
.at-select2 .select2-container .select2-selection--single { box-sizing: border-box; height: auto; min-height: 42px; display: flex; align-items: center; padding: 6px 36px 6px 14px; border: 1.5px solid var(--at-line); border-radius: 11px; background: var(--at-surface); transition: border-color var(--at-ease), box-shadow var(--at-ease); }
.at-select2 .select2-container--focus .select2-selection--single, .at-select2 .select2-container--open .select2-selection--single { border-color: var(--at-brand); box-shadow: var(--at-focus); }
.at-select2 .select2-selection__rendered { padding: 0 !important; color: var(--at-ink) !important; white-space: normal !important; overflow-wrap: anywhere; word-break: break-word; text-overflow: clip !important; line-height: 1.4 !important; font-size: 14px; }
.at-select2 .select2-selection__arrow { height: 100% !important; right: 10px !important; top: 0 !important; }
.at-select2 .select2-dropdown { border: 1.5px solid var(--at-line); border-radius: 11px; overflow: hidden; box-shadow: var(--at-shadow); }

/* Nhãn trường + chữ phụ */
.at-field-label { display: block; margin-bottom: 6px; font-size: 13.5px; font-weight: 600; color: var(--at-ink); }
.at-field-label .at-optional { font-weight: 400; color: var(--at-muted); }
.at-field-help { margin-top: 6px; font-size: 12.5px; color: var(--at-muted); }
.at-field-error { margin-top: 6px; font-size: 12.5px; color: #DC2626; }
.at-input.is-invalid { border-color: #F87171; }

/* Thẻ bật/tắt: <label class="at-check-card"><input type="checkbox" class="form-check-input">…</label> */
.at-check-card { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--at-line); border-radius: var(--at-radius); background: var(--at-surface); cursor: pointer; transition: border-color var(--at-ease), background-color var(--at-ease); }
.at-check-card:hover { border-color: var(--at-brand-line); }
.at-check-card:has(input:checked) { border-color: var(--at-brand); background: var(--at-brand-soft); }
.at-check-card .form-check-input { flex: 0 0 auto; margin: 2px 0 0; width: 2.2em; height: 1.2em; cursor: pointer; }
.at-check-card .form-check-input:checked { background-color: var(--at-green-2); border-color: var(--at-green-2); }
.at-check-card__text { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.at-check-card__text strong { display: block; font-size: 14px; color: var(--at-ink); }
.at-check-card__text span { display: block; margin-top: 2px; font-size: 12.5px; color: var(--at-muted); }

/* Tab dạng radio: <div class="at-tabs"><label class="at-tab"><input type="radio" …>Công khai</label></div> */
.at-tabs label.at-tab { margin: 0; }
.at-tabs label.at-tab input { position: absolute; opacity: 0; pointer-events: none; }
.at-tabs label.at-tab:has(input:checked) { background: var(--at-surface); color: var(--at-ink); box-shadow: var(--at-shadow-sm); }
.at-tabs label.at-tab:has(input:focus-visible) { box-shadow: var(--at-focus); }

/* Khối thu gọn: <details class="at-details"><summary>Xem đề bài</summary>…</details> */
.at-details { border: 1px solid var(--at-line); border-radius: var(--at-radius); background: var(--at-surface); }
.at-details > summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 12px 16px; cursor: pointer; font-weight: 600; color: var(--at-ink); }
.at-details > summary::-webkit-details-marker { display: none; }
.at-details > summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--at-muted); border-bottom: 2px solid var(--at-muted); transform: rotate(45deg); transition: transform var(--at-ease); }
.at-details[open] > summary::after { transform: rotate(-135deg); }
.at-details > .at-details__body { padding: 0 16px 16px; border-top: 1px dashed var(--at-line); padding-top: 14px; }

@media (prefers-reduced-motion: reduce) {
    :is(.at-check-card, .at-details > summary::after) { transition: none; }
    :is(.at-btn, .at-select-card, .at-select-card__icon, .at-tab, .at-input) { transition: none; }
    :is(.at-btn, .at-select-card, .at-tab):active { transform: none !important; }
    .at-spinner { animation-duration: 1.6s; }
}

/* ---------- Select2 — danh sách xổ ra theo kit (17/11/2026) ----------
   Người dùng: "Dropdown kiểu này sao bạn không chỉnh luôn, cả việt hoá nữa" — phần
   khung đã theo kit nhưng danh sách xổ ra (ô tìm, các mục, "No results found") vẫn là
   mặc định. Áp cho Select2 bọc trong .at-select2 (khởi tạo với dropdownParent = wrapper).
   Chữ tiếng Việt: mặc định toàn site trong public/build/js/at-ui.js. */
.at-select2 .select2-dropdown { margin-top: 6px; border: 1.5px solid var(--at-line) !important; border-radius: 12px !important; background: var(--at-surface); box-shadow: 0 12px 28px rgba(15, 23, 42, .14); overflow: hidden; }
.at-select2 .select2-dropdown--above { margin-top: 0; margin-bottom: 6px; }
.at-select2 .select2-search--dropdown { padding: 10px 10px 6px; }
.at-select2 .select2-search--dropdown .select2-search__field {
    height: 38px; padding: 0 12px 0 34px; border: 1.5px solid var(--at-line) !important; border-radius: 10px; outline: none;
    background: var(--at-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 11px center;
    color: var(--at-ink); font-size: 14px; transition: border-color var(--at-ease), box-shadow var(--at-ease);
}
.at-select2 .select2-search--dropdown .select2-search__field:focus { border-color: var(--at-brand) !important; box-shadow: var(--at-focus); }
/* No top padding: a sticky group header pins to the scrollport edge, and rows scrolling
   through a padded strip above it showed as half-cut text (user, 17/11/2026). */
.at-select2 .select2-results > .select2-results__options { max-height: 300px; padding: 0 6px 8px; }
.at-select2 .select2-results__option { margin: 1px 0; padding: 9px 12px; border-radius: 8px; font-size: 14px; line-height: 1.4; color: var(--at-ink); white-space: normal; overflow-wrap: anywhere; }
.at-select2 .select2-results__option--selectable { cursor: pointer; }
.at-select2 .select2-results__option[aria-selected="true"], .at-select2 .select2-results__option--selected { background: var(--at-sunken) !important; color: var(--at-ink) !important; font-weight: 600; }
.at-select2 .select2-results__option--highlighted, .at-select2 .select2-results__option--highlighted[aria-selected] { background: var(--at-brand-soft) !important; color: var(--at-brand) !important; }
.at-select2 .select2-results__message, .at-select2 .select2-results__option[role="alert"] { padding: 14px 12px; text-align: center; font-size: 13.5px; color: var(--at-muted) !important; background: transparent !important; cursor: default; }
/* Mũi tên khi mở: để theme tự xoay (style.css .select2-container--open … __arrow b) — tự xoay 180° làm nó thành "⌟". */
.at-select2 .select2-container--disabled .select2-selection--single { background: var(--at-sunken) !important; cursor: not-allowed; opacity: .75; }
.at-select2 .select2-container--disabled .select2-selection__rendered { color: var(--at-muted) !important; }
.at-select2 .select2-selection__placeholder { color: var(--at-muted) !important; }
/* Công tắc thẻ bật/tắt luôn xanh lá — bản tối theme ép màu cam cho .form-check-input:checked. */
.at-check-card .form-check-input:checked, html.dark-mode .at-check-card .form-check-input:checked { background-color: var(--at-green-2) !important; border-color: var(--at-green-2) !important; }
/* Select2 nhóm (optgroup) — vd bài học gom theo chương: tiêu đề nhóm nhỏ in hoa, dính trên khi cuộn.
   ⚠️ QUY TẮC KIT (lỗi đã gặp 17/11/2026): vùng cuộn .select2-results__options KHÔNG được có
   padding-top, và tiêu đề nhóm phải có NỀN ĐẶC + phủ hết chiều ngang (margin âm = padding ngang).
   Tiêu đề dính vào mép vùng cuộn; còn đệm trên thì các dòng cuộn qua khe đệm đó lộ ra thành
   chữ bị cắt nửa phía trên tiêu đề. Mẫu kiểm tra: /ui-kit mục 6 "Select2 có nhóm + danh sách dài". */
.at-select2 .select2-results__option[role="group"] { padding: 0; margin: 0; border-radius: 0; background: transparent !important; }
.at-select2 .select2-results__group { position: sticky; top: 0; z-index: 2; display: block; margin: 0 -6px; padding: 10px 18px 7px; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--at-muted); background: var(--at-surface); box-shadow: 0 1px 0 var(--at-line); }
.at-select2 .select2-results__options--nested .select2-results__option { padding-left: 14px; }
/* Dòng đang trượt dưới tiêu đề nhóm: mờ dần thay vì bị vạch cắt sắc ngang chữ. */
.at-select2 .select2-results__group::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 14px; background: linear-gradient(var(--at-surface), rgba(255, 255, 255, 0)); pointer-events: none; }
html.dark-mode .at-select2 .select2-results__group::after { background: linear-gradient(var(--at-surface), rgba(22, 27, 38, 0)); }
/* Theme dark paints the dropdown a different shade than --at-surface: keep list, search and group headers one colour. */
html.dark-mode .at-select2 .select2-dropdown, html.dark-mode .at-select2 .select2-results, html.dark-mode .at-select2 .select2-results > .select2-results__options { background: var(--at-surface) !important; }
.at-select2 .select2-search--dropdown { border-bottom: 1px solid var(--at-line); padding-bottom: 10px; }
.at-select2 .select2-results__option[role="group"] + .select2-results__option[role="group"] { margin-top: 4px; }
