/* ===== WISE English IELTS Mock Test – giao diện portal/quản trị ===== */
:root {
    --wise-500: #8b5cf6;
    --wise-600: #7c3aed;
    --wise-700: #6d28d9;
    --wise-800: #5b21b6;
    --wise-900: #4c1d95;
    --wise-50: #f5f3ff;
    --wise-100: #ede9fe;
    /* backwards-compatible aliases used across the stylesheet */
    --wise-purple: var(--wise-700);
    --wise-indigo: var(--wise-800);
    --wise-magenta: var(--wise-600);
    --accent: #f59e0b;
    --accent-dark: #d97706;
    --accent-50: #fffbeb;
    --accent-100: #fef3c7;
    --ink: #1f2430;
    --muted: #6b7183;
    --line: #e7e9f1;
    --bg: #f7f7fb;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow-sm: 0 1px 2px rgba(28, 20, 60, .05);
    --shadow: 0 4px 16px rgba(28, 20, 60, .07);
    --shadow-lg: 0 14px 40px rgba(28, 20, 60, .12);
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    font-size: 14.5px;
}
a { color: var(--wise-700); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1200px; width: 100%; margin: 26px auto; padding: 0 20px; flex: 1; }

/* ---------- Chung ---------- */
.page-title { font-size: 24px; margin: 0 0 6px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-sub { color: #5a6072; margin: 0 0 22px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.page-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.skill-heading { font-size: 17px; margin: 28px 0 12px; display: flex; align-items: center; gap: 8px; }
.muted { color: #8a8f9d; }
.hint { color: #8a8f9d; font-size: 13px; margin: 8px 0 0; }
.ok { color: #1d8a3c; }
.warn { color: #c47b00; font-weight: 600; }
.inline { display: inline; }
hr.soft { border: none; border-top: 1px solid #eceef3; margin: 16px 0; }

/* =====================================================================
   ADMIN SHELL — sidebar layout
   ===================================================================== */
.admin-shell { display: flex; min-height: 100vh; background: var(--bg); }

.admin-sidebar {
    width: 250px; flex: 0 0 250px; background: #fff; border-right: 1px solid var(--line);
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 30;
}
.admin-sidebar-brand {
    height: 64px; flex: 0 0 64px; display: flex; align-items: center; gap: 10px;
    padding: 0 20px; border-bottom: 1px solid var(--line); font-weight: 800; font-size: 17px; color: var(--wise-700);
}
.admin-sidebar-brand img { height: 28px; width: auto; }
.admin-sidebar-nav { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 3px; }
.admin-sidebar-nav a {
    display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px;
    color: #4a5065; font-weight: 500; font-size: 14px;
}
.admin-sidebar-nav a:hover { background: #f4f4f8; text-decoration: none; }
.admin-sidebar-nav a.active { background: var(--wise-50); color: var(--wise-700); font-weight: 700; }
.admin-sidebar-nav a .nav-ico { width: 20px; text-align: center; font-size: 15px; }
.admin-sidebar-foot { border-top: 1px solid var(--line); padding: 14px 16px; background: #fafaFc; }
.admin-sidebar-user { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.admin-sidebar-avatar {
    width: 38px; height: 38px; border-radius: 50%; background: var(--wise-700); color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: 0 0 38px;
    box-shadow: var(--shadow-sm);
}
.admin-sidebar-user-name { font-size: 13.5px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.admin-sidebar-user-role { font-size: 12px; color: var(--muted); }

.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
    height: 64px; flex: 0 0 64px; background: #fff; border-bottom: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between; padding: 0 26px;
    position: sticky; top: 0; z-index: 20; box-shadow: var(--shadow-sm);
}
.admin-topbar-title { font-size: 18px; font-weight: 700; margin: 0; }
.admin-content { padding: 26px; flex: 1; }

/* =====================================================================
   STUDENT SHELL — top navbar
   ===================================================================== */
.student-topbar { background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow-sm); position: sticky; top: 0; z-index: 30; }
.student-topbar-inner {
    max-width: 1200px; margin: 0 auto; padding: 0 20px; height: 64px;
    display: flex; align-items: center; gap: 26px;
}
.student-brand { display: flex; align-items: center; gap: 10px; color: var(--wise-700); font-weight: 800; font-size: 17px; }
.student-brand:hover { text-decoration: none; }
.student-brand-logo { width: auto; height: 46px; display: block; flex: 0 0 auto; }
.student-nav { display: flex; gap: 22px; flex: 1; height: 100%; }
.student-nav a {
    color: var(--muted); font-weight: 600; font-size: 14.5px; display: flex; align-items: center;
    height: 100%; border-bottom: 2px solid transparent;
}
.student-nav a:hover { color: var(--ink); text-decoration: none; }
.student-nav a.active { color: var(--wise-700); border-bottom-color: var(--wise-700); }
.student-topbar-user { display: flex; align-items: center; gap: 12px; }
.student-user-block { display: flex; align-items: center; gap: 9px; }
.student-avatar {
    width: 36px; height: 36px; border-radius: 50%; flex: 0 0 36px;
    background: linear-gradient(135deg, var(--wise-500), var(--wise-700)); color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
    box-shadow: var(--shadow-sm);
}
.student-user-name { font-size: 13.5px; font-weight: 700; line-height: 1.3; }
.student-user-role { font-size: 11.5px; color: var(--muted); }

/* ---------- Footer ---------- */
.sitefoot { border-top: 1px solid var(--line); background: #fff; margin-top: 30px; }
.sitefoot-inner {
    max-width: 1200px; margin: 0 auto; padding: 18px 20px;
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    color: var(--muted); font-size: 12.5px;
}
.sitefoot-logo { height: 26px; width: auto; opacity: .9; }

/* ---------- Panel / Card ---------- */
.panel {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--shadow-sm);
}
.panel-title { margin: 0 0 14px; font-size: 15.5px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.test-card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
    display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow-sm);
    transition: box-shadow .18s ease, transform .18s ease;
}
.test-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

/* ---------- Bộ đề (student) ---------- */
.hero {
    background: linear-gradient(120deg, var(--wise-50), #eef1fb);
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: 24px 26px; margin-bottom: 22px;
}
.hero .page-title { margin-bottom: 4px; }
.hero .page-sub { margin: 0; }
.set-card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); overflow: hidden;
    transition: box-shadow .18s ease, transform .18s ease;
    display: flex; flex-direction: column;
}
.set-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.flow-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.flow-head .skill-heading { margin-bottom: 8px; }
.set-card-head {
    padding: 16px 18px; background: linear-gradient(120deg, var(--wise-600), var(--wise-800));
    color: #fff; position: relative;
}
.set-card-head-exam { background: linear-gradient(120deg, #db2777, #9d174d); }
.set-card-head-practice { background: linear-gradient(120deg, #0d9488, #115e59); }
.set-card-head h3 { margin: 0; font-size: 16px; }
.set-card-head .test-desc { color: rgba(255,255,255,.85); margin: 6px 0 0; }
.set-card-count {
    position: absolute; top: 14px; right: 16px; font-size: 11px; font-weight: 700;
    background: rgba(255,255,255,.22); padding: 3px 9px; border-radius: 20px;
    backdrop-filter: blur(2px);
}
.set-skill-list { display: flex; flex-direction: column; padding: 6px 8px; }
.set-skill-row {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 10px 10px; border-radius: 10px;
}
.set-skill-row:hover { background: #faf7fc; }
.set-skill-info { display: flex; align-items: center; gap: 11px; }
.set-skill-info strong { display: block; font-size: 14px; }
.set-skill-info small { display: block; font-size: 12px; }
.set-skill-icon {
    width: 38px; height: 38px; border-radius: 10px; font-size: 18px;
    display: inline-flex; align-items: center; justify-content: center;
}
.band-pill {
    display: inline-block; min-width: 34px; text-align: center;
    background: linear-gradient(135deg, var(--wise-600), var(--wise-800));
    color: #fff; padding: 2px 10px; border-radius: 20px; font-size: 13px;
}

/* ---------- Bộ lọc kết quả ---------- */
.filter-panel { padding-bottom: 16px; }
.filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.filter-tab {
    padding: 7px 15px; border-radius: 20px; font-size: 13.5px; font-weight: 600;
    color: var(--muted); background: #f1f2f7; border: 1px solid transparent;
}
.filter-tab:hover { text-decoration: none; background: #e9eaf2; color: var(--ink); }
.filter-tab.active {
    background: linear-gradient(135deg, var(--wise-600), var(--wise-800));
    color: #fff; border-color: transparent;
}
.filter-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; align-items: end; }
.filter-row .field { margin-bottom: 0; }
.field-grow { grid-column: span 2; min-width: 260px; }
.search-field { display: flex; gap: 8px; }
.search-field input { flex: 1; }
.filter-clear { margin-top: 12px; font-size: 13px; }
.filter-clear a:hover { color: var(--wise-700); }

/* ---------- Tag phân loại bộ đề ---------- */
.tag {
    display: inline-block; margin-top: 4px; padding: 1px 9px; border-radius: 5px;
    font-size: 11px; font-weight: 700;
}
.tag-exam { background: #fce7f3; color: #be185d; }
.tag-practice { background: #ccfbf1; color: #0f766e; }
.test-card h3 { margin: 0 0 6px; font-size: 15.5px; }
.test-desc { font-size: 13px; color: #5a6072; }
.test-set-panel { padding-top: 16px; }
.test-set-head {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
    margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid #eceef3;
}
.test-set-head .panel-title { margin-bottom: 4px; font-size: 17px; }
.test-set-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.test-row-meta { font-size: 12.5px; margin-top: 2px; }
.empty-state {
    background: #fff; border: 1px dashed #cdd2e0; border-radius: var(--radius-sm);
    padding: 40px; text-align: center; color: #8a8f9d;
}

/* ---------- Stats / KPI ---------- */
.stat-grid, .kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card, .kpi-card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 18px 20px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.kpi-card { display: flex; flex-direction: column; justify-content: space-between; gap: 10px; }
.kpi-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.kpi-ico {
    width: 40px; height: 40px; border-radius: 10px; font-size: 18px; flex: 0 0 40px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--wise-50); color: var(--wise-700);
}
.stat-card::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
    background: linear-gradient(var(--wise-600), var(--wise-800));
}
.stat-num, .kpi-num { font-size: 30px; font-weight: 800; color: var(--ink); line-height: 1.1; }
.stat-label, .kpi-label { color: var(--muted); font-size: 13px; margin-top: 3px; }
.stat-alert, .kpi-alert {
    border-color: var(--accent-100);
    background: linear-gradient(160deg, var(--accent-50), var(--accent-100));
}
.stat-alert::before { background: linear-gradient(var(--accent), var(--accent-dark)); }
.kpi-alert .kpi-label { color: #92400e; font-weight: 700; text-transform: uppercase; font-size: 11.5px; letter-spacing: .3px; }
.kpi-alert .kpi-num { color: var(--accent-dark); }
.kpi-alert .btn { margin-top: 4px; }
.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }

/* ---------- Tabs (student dashboard) ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; flex-wrap: wrap; }
.tab-btn {
    border: none; background: none; cursor: pointer; font-family: inherit;
    padding: 10px 16px; font-size: 14.5px; font-weight: 600; color: var(--muted);
    border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { color: var(--wise-700); border-bottom-color: var(--wise-700); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- Biểu đồ band score (đơn giản, CSS) ---------- */
.band-chart { display: flex; align-items: flex-end; justify-content: space-around; gap: 10px; height: 200px; padding: 10px 6px 0; border-bottom: 1px solid var(--line); }
.band-chart-bar-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 1; max-width: 70px; height: 100%; justify-content: flex-end; }
.band-chart-value { font-size: 12px; font-weight: 700; color: var(--wise-700); }
.band-chart-bar { width: 100%; border-radius: 6px 6px 0 0; background: linear-gradient(180deg, var(--wise-500), var(--wise-700)); min-height: 4px; }
.band-chart-label { font-size: 11.5px; color: var(--muted); margin-top: 8px; text-align: center; }

/* ---------- Bảng ---------- */
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th {
    text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .4px;
    background: #6d28d9; color: #fff; padding: 8px 10px; border-bottom: 2px solid #5b21b6;
}
.table thead tr:first-child th:first-child { border-top-left-radius: 11px; }
.table thead tr:first-child th:last-child { border-top-right-radius: 11px; }
.table td { padding: 11px 10px; border-bottom: 1px solid #f0f1f6; vertical-align: middle; }
.table tbody tr { transition: background .12s ease; }
.table tbody tr:hover td { background: #faf8fc; }
.table tr:last-child td { border-bottom: none; }
.row-correct td { background: #f4fbf5; }
.row-wrong td { background: #fdf6f6; }
.row-pending td { background: var(--accent-50); }
.actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* ---------- Badge / Status ---------- */
.badge {
    display: inline-block; padding: 3px 10px; border-radius: 20px;
    font-size: 12px; font-weight: 700;
}
.badge-listening { background: #dbeafe; color: #1d4ed8; }
.badge-reading { background: #dcfce7; color: #15803d; }
.badge-writing { background: #ffedd5; color: #c2410c; }
.badge-speaking { background: var(--wise-100); color: var(--wise-700); }
.badge-role-admin { background: var(--wise-100); color: var(--wise-800); }
.badge-role-staff { background: #dbeafe; color: #1d4ed8; }
.badge-role-student { background: #eef0f5; color: #4a5065; }
.status { font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.status-on { background: #dcfce7; color: #15803d; }
.status-off { background: #eef0f5; color: #6b7183; }
.status-pending { background: var(--accent-100); color: #92400e; display: inline-flex; align-items: center; gap: 6px; }
.status-pending::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-dark); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-block; border: none; border-radius: 9px; cursor: pointer;
    padding: 9px 16px; font-size: 14px; font-weight: 600; font-family: inherit;
    text-decoration: none; line-height: 1.2;
}
.btn:hover { text-decoration: none; filter: brightness(1.06); }
.btn-primary { background: var(--wise-700); color: #fff; box-shadow: 0 2px 8px rgba(109,40,217,.25); }
.btn-primary:hover { background: var(--wise-800); }
.btn-success { background: #16a34a; color: #fff; }
.btn-warning { background: var(--accent); color: #4a3a00; }
.btn-danger { background: #fee2e2; color: #b91c1c; }
.btn-ghost { background: #f1f2f7; color: #2a3040; }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 7px; }
.btn-block { width: 100%; text-align: center; }

/* ---------- Form ---------- */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field > span, .field > label { font-size: 12.5px; font-weight: 600; color: #4a5065; }
.field input, .field select, .field textarea {
    border: 1px solid #d7dae3; border-radius: 8px; padding: 9px 11px;
    font-size: 14px; font-family: inherit; background: #fff; color: #1f2430;
}
.field textarea { resize: vertical; line-height: 1.55; }
.field input:focus, .field select:focus, .field textarea:focus {
    outline: 3px solid var(--wise-100); border-color: var(--wise-700);
}
.checkline { display: flex; align-items: center; gap: 7px; font-size: 13.5px; margin-bottom: 12px; cursor: pointer; }
.form-inline { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.form-inline .field { margin-bottom: 0; }
.form-inline .btn { margin-bottom: 1px; }
.form-row { display: flex; gap: 14px; flex-wrap: wrap; }
.current-file { margin-bottom: 8px; }
.current-file img { border: 1px solid #e5e7ef; border-radius: 6px; display: block; margin-bottom: 6px; }

/* ---------- Alerts ---------- */
.alert { border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; font-size: 14px; }
.alert ul { margin: 0; padding-left: 18px; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: var(--accent-50); color: #92400e; border: 1px solid var(--accent-100); }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.resume-banner { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------- Login ---------- */
.login-body {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--wise-800) 0%, var(--wise-700) 55%, var(--wise-500) 100%);
    padding: 20px;
}
.login-card {
    background: #fff; border-radius: 18px; padding: 34px 36px; width: 400px; max-width: 100%;
    box-shadow: 0 18px 50px rgba(20, 10, 50, .35);
}
.login-brand { text-align: center; margin-bottom: 24px; }
.login-logo { height: 46px; width: auto; margin: 0 auto 12px; display: block; }
.login-brand p { margin: 0; color: #8a8f9d; font-size: 13.5px; }
.login-note { margin-top: 18px; text-align: center; color: #8a8f9d; font-size: 12.5px; }
.password-input-wrap { position: relative; display: block; }
.field .password-input-wrap input { width: 100%; padding-right: 44px; }
.password-toggle {
    position: absolute; top: 50%; right: 4px; width: 36px; height: 34px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center; transform: translateY(-50%);
    border: 0; border-radius: 7px; background: transparent; color: #6b7183; cursor: pointer;
}
.password-toggle:hover { background: var(--wise-50); color: var(--wise-700); }
.password-toggle:focus-visible { outline: 3px solid var(--wise-100); color: var(--wise-700); }
.password-toggle svg { width: 20px; height: 20px; fill: currentColor; }
.password-toggle svg[hidden] { display: none; }

/* ---------- Trang soạn đề ---------- */
.section-row {
    background: #fff; border: 1px solid #e5e7ef; border-radius: var(--radius-sm);
    padding: 14px 18px; margin-bottom: 10px;
    display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap;
}
.section-row-meta { display: flex; gap: 16px; margin-top: 5px; font-size: 13px; color: #5a6072; flex-wrap: wrap; }
.section-row-actions { display: flex; gap: 8px; align-items: center; }
.group-panel { border-left: 4px solid var(--wise-700); }
.group-head-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.q-wrap { display: flex; gap: 8px; align-items: flex-start; border-top: 1px solid #f0f1f6; padding-top: 12px; margin-top: 12px; }
.q-wrap > form:last-child { margin-top: 22px; }
.q-row { display: flex; gap: 10px; flex: 1; align-items: flex-start; flex-wrap: wrap; }
.q-row .field { margin-bottom: 0; }
.q-row .btn { margin-top: 22px; }
.q-row-new { border-top: 2px dashed #e0d3ea; padding-top: 14px; margin-top: 16px; }
.hint-panel { font-size: 13.5px; }
.hint-panel summary { cursor: pointer; }
.hint-panel ul { margin: 10px 0 0; padding-left: 20px; line-height: 1.8; }
.hint-panel code { background: var(--wise-50); padding: 1px 6px; border-radius: 4px; color: var(--wise-700); }
.edit-details { position: relative; display: inline-block; }
.edit-details summary { list-style: none; }
.edit-details summary::-webkit-details-marker { display: none; }
.edit-pop {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 300px;
    background: #fff; border: 1px solid #d8dbe6; border-radius: var(--radius-sm); padding: 16px;
    box-shadow: 0 12px 30px rgba(30, 30, 60, .18);
    text-align: left;
}
.edit-pop-danger { margin-top: 12px; padding-top: 12px; border-top: 1px solid #eceef3; }

/* ---------- Import đề PDF/audio ---------- */
.import-panel-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.import-upload-form { margin-top: 12px; }
.import-table td { vertical-align: top; }
.import-review-layout {
    display: grid; grid-template-columns: minmax(320px, 42%) minmax(420px, 1fr);
    gap: 18px; align-items: start;
}
.import-source-panel { position: sticky; top: 18px; max-height: calc(100vh - 36px); overflow: auto; padding-right: 2px; }
.pdf-preview {
    width: 100%; height: 620px; margin-top: 12px;
    border: 1px solid #d8dbe6; border-radius: 8px; background: #f7f8fb;
}
.import-file {
    border-top: 1px solid #f0f1f6; padding-top: 12px; margin-top: 12px;
    display: flex; flex-direction: column; gap: 8px;
}
.import-file:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }
.import-file audio { width: 100%; height: 34px; }
.import-file img { max-width: 100%; max-height: 180px; object-fit: contain; border: 1px solid #e5e7ef; border-radius: 8px; background: #fff; }
.import-file code {
    display: block; white-space: normal; overflow-wrap: anywhere;
    background: var(--wise-50); color: var(--wise-800); padding: 7px 8px; border-radius: 6px; font-size: 12px;
}
.json-editor {
    min-height: 720px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 12.5px; line-height: 1.5; tab-size: 2;
}
.json-sample {
    white-space: pre-wrap; overflow-x: auto; background: #fbfbfd; border: 1px solid #e5e7ef;
    border-radius: 8px; padding: 14px; font-size: 12.5px; line-height: 1.5;
}
.advanced-json { margin: 8px 0 14px; }
.advanced-json summary { margin-bottom: 12px; }
.import-exam-preview {
    height: 760px; min-height: 560px; display: flex; flex-direction: column; overflow: hidden;
    border: 1px solid #cfd3dc; border-radius: 8px; background: #e8e8e8;
}
.import-exam-preview .exam-main { min-height: 0; }
.import-exam-preview .exam-header { border-radius: 8px 8px 0 0; }
.import-exam-preview .exam-footer { border-radius: 0 0 8px 8px; }
.import-exam-preview .palette { min-width: 0; }
.import-exam-preview .import-pal-part {
    border: none; background: transparent; color: #111; padding: 0; font-family: inherit;
}
.import-exam-preview .import-pal-part.current { color: #1e5fa8; text-decoration: underline; }
.empty-draft-section {
    color: #8a8f9d; border: 1px dashed #cdd2e0; border-radius: 8px; padding: 24px;
    background: #fbfbfd; text-align: center;
}

/* ---------- Chỉnh sửa trực tiếp bản nháp import ---------- */
.draft-part {
    border: 1px solid #e0e2ec; border-radius: 10px; background: #fbfbfd;
    padding: 12px 16px; margin-bottom: 12px;
}
.draft-part > summary { cursor: pointer; font-size: 15px; }
.draft-part[open] > summary { margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid #eceef3; }
.draft-group {
    background: #fff; border: 1px solid #eceef3; border-left: 3px solid var(--wise-700);
    border-radius: 0 8px 8px 0; padding: 12px 14px; margin: 14px 0;
}
.draft-q-row {
    display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap;
    border-top: 1px dashed #e5e7ef; padding-top: 10px; margin-top: 10px;
}
.draft-q-row .field { margin-bottom: 0; }
.draft-q-new { background: var(--wise-50); border-radius: 8px; padding: 10px; border-top: none; }
.draft-q-del { margin: 24px 0 0; white-space: nowrap; }
.draft-delete { color: #c22f2f; margin: 10px 0 0; font-size: 12.5px; }
.draft-editor-actions {
    position: sticky; bottom: 0; background: #fff; z-index: 5;
    display: flex; align-items: center; gap: 14px;
    padding: 12px 0 4px; border-top: 1px solid #eceef3; margin-top: 14px;
}
.draft-editor-actions .hint { margin: 0; }

/* ---------- Kết quả ---------- */
.result-summary { display: flex; gap: 16px; justify-content: center; margin: 10px 0 22px; flex-wrap: wrap; }
.result-band, .result-score {
    background: #fff; border: 1px solid #e5e7ef; border-radius: var(--radius);
    padding: 22px 40px; text-align: center; min-width: 170px;
}
.result-band { background: linear-gradient(135deg, var(--wise-800), var(--wise-600)); border: none; color: #fff; }
.result-band-num { font-size: 44px; font-weight: 800; line-height: 1; }
.result-score-num { font-size: 44px; font-weight: 800; line-height: 1; color: var(--wise-800); }
.result-band-label { margin-top: 8px; font-size: 13px; opacity: .9; }
.essay-box {
    background: #fbfbfd; border: 1px solid #e5e7ef; border-radius: 8px;
    padding: 16px 18px; line-height: 1.7; font-size: 14.5px; white-space: normal;
}
.passage-content p { line-height: 1.6; }

/* ---------- Pagination (Laravel) ---------- */
nav[role="navigation"] { margin-top: 14px; font-size: 13.5px; }
nav[role="navigation"] a, nav[role="navigation"] span[aria-current] > span {
    display: inline-block; padding: 5px 10px; border: 1px solid #e0e2ec; border-radius: 6px; margin-right: 4px;
}
nav[role="navigation"] span[aria-current] > span { background: var(--wise-700); color: #fff; border-color: var(--wise-700); }

@media (max-width: 960px) {
    .admin-shell { flex-direction: column; }
    .admin-sidebar { position: static; height: auto; width: 100%; flex: none; flex-direction: row; align-items: center; }
    .admin-sidebar-brand { border-bottom: none; border-right: 1px solid var(--line); }
    .admin-sidebar-nav { flex-direction: row; overflow-x: auto; padding: 8px; }
    .admin-sidebar-foot { display: none; }
    .admin-content { padding: 18px; }
    .student-topbar-inner { flex-wrap: wrap; height: auto; padding: 10px 20px; }
    .student-nav { order: 3; flex: 0 0 100%; width: 100%; overflow-x: auto; height: auto; }
    .student-nav a { height: 38px; }
    .import-review-layout { grid-template-columns: 1fr; }
    .import-source-panel { position: static; max-height: none; overflow: visible; }
    .pdf-preview { height: 420px; }
    .json-editor { min-height: 520px; }
}

/* =====================================================================
   ADMIN VISUAL SYSTEM — đồng bộ theo mẫu dashboard WISE IELTS
   ===================================================================== */
body { font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #111827; }
.admin-shell { background: #f9fafb; }
.admin-sidebar { width: 256px; flex-basis: 256px; border-color: #e5e7eb; }
.admin-sidebar-brand {
    height: 72px; flex-basis: 72px; padding: 0 24px; gap: 10px;
    border-color: #e5e7eb; color: #6d28d9; font-size: 20px; font-weight: 700;
    letter-spacing: -.25px;
}
.admin-sidebar-brand > svg { width: 30px; height: 30px; flex: 0 0 30px; fill: currentColor; }
.admin-sidebar-brand .admin-official-logo { width: 136px; height: auto; display: block; }
.admin-sidebar-nav { padding: 16px 12px; gap: 4px; }
.admin-sidebar-nav a {
    min-height: 44px; padding: 10px 14px; gap: 13px; border-radius: 9px;
    color: #4b5563; font-size: 16px; font-weight: 400; line-height: 1.5;
}
.admin-sidebar-nav a:hover { background: #f3f4f6; }
.admin-sidebar-nav a.active { background: #f5f3ff; color: #6d28d9; font-weight: 600; }
.admin-sidebar-nav a .nav-ico { width: 19px; height: 19px; flex: 0 0 19px; fill: currentColor; }
.admin-sidebar-foot { padding: 16px; background: #fff; border-color: #e5e7eb; }
.admin-sidebar-user { gap: 12px; margin-bottom: 12px; }
.admin-sidebar-avatar { width: 40px; height: 40px; flex-basis: 40px; font-size: 15px; box-shadow: 0 2px 5px rgba(109,40,217,.2); }
.admin-sidebar-user-name { font-size: 14px; font-weight: 600; }
.admin-sidebar-user-role { margin-top: 2px; font-size: 12px; color: #6b7280; }
.admin-sidebar-foot .btn { background: #f3f4f6; }

.admin-topbar {
    height: 72px; flex-basis: 72px; padding: 0 32px; border-color: #e5e7eb;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.admin-topbar-title { font-size: 20px; font-weight: 700; letter-spacing: -.3px; color: #1f2937; }
.admin-role-button { display: inline-flex; align-items: center; gap: 9px; padding: 11px 17px; border-radius: 9px; font-size: 14px; }
.admin-role-button svg { width: 18px; height: 18px; fill: currentColor; }
.admin-content { padding: 32px; }
.admin-content > .page-title, .admin-content .page-head .page-title { font-size: 24px; line-height: 1.25; font-weight: 700; letter-spacing: -.4px; }
.admin-content .page-sub { margin-top: 7px; color: #6b7280; font-size: 14px; line-height: 1.55; }

.admin-content .panel {
    border-color: #e5e7eb; border-radius: 12px; padding: 20px 24px;
    box-shadow: 0 1px 2px rgba(0,0,0,.05); background: #fff;
}
.admin-content .panel-title { font-size: 17px; font-weight: 700; color: #1f2937; }
.admin-content .skill-heading { font-size: 19px; font-weight: 700; color: #1f2937; }
.admin-content .field > span { color: #4b5563; font-weight: 600; }
.admin-content .field input, .admin-content .field select, .admin-content .field textarea { border-color: #d1d5db; border-radius: 8px; }

.admin-content .btn { border-radius: 8px; font-weight: 600; }
.admin-content .btn-primary, .admin-topbar .btn-primary { background: #6d28d9; box-shadow: none; }
.admin-content .btn-primary:hover, .admin-topbar .btn-primary:hover { background: #5b21b6; }
.admin-content .btn-ghost { background: #f3f4f6; color: #374151; }

/* Dashboard */
.admin-content > .kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin: 0 0 32px;
}
.admin-content .kpi-card {
    min-height: 154px; padding: 24px 20px; border: 1px solid #e5e7eb; border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,.06); overflow: visible; gap: 14px;
}
.admin-content .kpi-card-top { gap: 16px; }
.admin-content .kpi-label { margin: 0 0 8px; color: #6b7280; font-size: 14px; font-weight: 500; line-height: 1.45; }
.admin-content .kpi-num { color: #111827; font-size: 32px; font-weight: 700; line-height: 1; letter-spacing: -.8px; }
.admin-content .kpi-num span { font-size: 18px; font-weight: 400; letter-spacing: 0; }
.admin-content .kpi-ico { width: 40px; height: 40px; flex-basis: 40px; border-radius: 9px; }
.admin-content .kpi-ico svg { width: 22px; height: 22px; fill: currentColor; }
.admin-content .kpi-card-tests .kpi-ico { background: #eff6ff; color: #2563eb; }
.admin-content .kpi-card-students .kpi-ico { background: #ecfdf5; color: #16a34a; }
.admin-content .kpi-card-attempts .kpi-ico { background: #faf5ff; color: #9333ea; }
.admin-content .kpi-alert { border-color: #fed7aa; background: linear-gradient(145deg,#fff7ed,#ffedd5); }
.admin-content .kpi-alert .kpi-label { color: #9a3412; font-size: 14px; font-weight: 700; letter-spacing: .2px; }
.admin-content .kpi-alert .kpi-num { color: #ea580c; }
.admin-content .kpi-alert .btn-warning { margin-top: auto; padding: 10px 16px; background: #f97316; color: #fff; font-size: 14px; }

.admin-content .dashboard-activity { padding: 0; overflow: hidden; margin: 0; }
.dashboard-activity-head { padding: 20px 24px; background: #f9fafb; border-bottom: 1px solid #e5e7eb; }
.dashboard-activity-head h2 { margin: 0; color: #1f2937; font-size: 18px; font-weight: 700; letter-spacing: -.2px; }
.dashboard-table-wrap { overflow-x: auto; }
.dashboard-activity .table { min-width: 720px; }
.dashboard-activity .table th {
    padding: 13px 24px; background: #6d28d9; border-bottom: 1px solid #5b21b6; color: #fff;
    font-size: 12px; font-weight: 600; letter-spacing: .45px;
}
.dashboard-activity .table td { padding: 17px 24px; border-bottom: 1px solid #f0f1f3; color: #374151; font-size: 14px; }
.dashboard-activity .table tbody tr:last-child td { border-bottom: 0; }
.dashboard-activity .table th:nth-child(1) { width: 23%; }
.dashboard-activity .table th:nth-child(2) { width: 30%; }
.dashboard-activity .table th:nth-child(3) { width: 26%; }
.dashboard-activity .attempt-user { color: #111827; font-weight: 500; }
.dashboard-activity .attempt-user:hover { color: #6d28d9; text-decoration: none; }
.dashboard-activity .attempt-title { display: inline-block; margin-bottom: 7px; color: #374151; }
.dashboard-activity .attempt-time { color: #6b7280; }
.dashboard-activity .badge { padding: 3px 8px; border-radius: 5px; font-size: 11px; font-weight: 500; }
.dashboard-pending { display: inline-flex; align-items: center; gap: 7px; color: #ea580c; font-weight: 500; }
.dashboard-pending i { width: 8px; height: 8px; border-radius: 50%; background: #fdba74; }
.score-detail { color: #9ca3af; font-size: 12px; }

/* Bảng và nút ở các trang quản trị còn lại */
.admin-content .table th { padding: 11px 14px; background: #6d28d9; border-bottom: 1px solid #5b21b6; color: #fff; font-weight: 600; }
.admin-content .table td { padding: 13px 14px; border-bottom-color: #eef0f3; }
.admin-content .badge, .admin-content .status { font-weight: 600; }

/* Nhịp trang và phần mở đầu */
.admin-page-intro { margin: 0 0 24px; color: #6b7280; font-size: 14px; line-height: 1.6; }
.admin-page-intro p { margin: 0; }
.admin-page-intro-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.admin-count-pill { display: inline-flex; align-items: center; white-space: nowrap; padding: 6px 11px; border-radius: 999px; background: #f3f4f6; color: #4b5563; font-size: 12px; font-weight: 600; }
.admin-back-link { margin: 0 0 16px; font-size: 13px; }
.admin-back-link a { color: #6b7280; font-weight: 500; }
.admin-back-link a:hover { color: #6d28d9; text-decoration: none; }
.admin-detail-head { margin: 0 0 24px; padding-bottom: 20px; border-bottom: 1px solid #e5e7eb; align-items: center; }
.admin-detail-head .page-title { margin: 0; color: #111827; }
.admin-detail-head .page-sub { margin-bottom: 0; }

/* Card form dùng chung */
.admin-content .admin-form-card { margin-bottom: 24px; }
.admin-content .admin-form-card > .panel-title:first-child,
.admin-content .ai-provider-card > .panel-title:first-child,
.admin-content .ai-tools-card > .panel-title:first-child {
    margin: -20px -24px 20px; padding: 17px 24px; border-bottom: 1px solid #e5e7eb;
    border-radius: 12px 12px 0 0; background: #f9fafb; font-size: 16px;
}
.admin-content .form-row, .admin-content .form-inline { gap: 18px 20px; }
.admin-content .field { gap: 7px; margin-bottom: 14px; }
.admin-content .field > span { font-size: 12px; letter-spacing: .05px; }
.admin-content .field input:not([type="checkbox"]):not([type="file"]),
.admin-content .field select { min-height: 42px; padding: 10px 12px; font-size: 14px; }
.admin-content .field textarea { padding: 11px 12px; line-height: 1.55; }
.admin-content .field input[type="file"] { min-height: 42px; padding: 8px 10px; background: #f9fafb; }
.admin-content .field input:focus, .admin-content .field select:focus, .admin-content .field textarea:focus { outline: 3px solid #ede9fe; border-color: #7c3aed; }
.admin-content .hint { color: #6b7280; line-height: 1.55; }
.admin-content .btn { min-height: 40px; padding: 10px 16px; display: inline-flex; align-items: center; justify-content: center; }
.admin-content .btn-sm { min-height: 34px; padding: 7px 12px; font-size: 12px; }
.admin-content .btn-warning { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.admin-content .btn-success { background: #16a34a; color: #fff; }
.admin-content .btn-danger { background: #fef2f2; color: #b91c1c; }
.admin-content button:disabled { opacity: .5; cursor: not-allowed; }

/* Card dữ liệu và bảng */
.admin-content .admin-data-card { padding: 0; overflow: hidden; }
.table-scroll { width: 100%; overflow-x: auto; }
.admin-content .admin-data-card .table { min-width: 820px; }
.admin-content .admin-data-card .table th { padding: 13px 18px; background: #6d28d9; border-bottom: 1px solid #5b21b6; color: #fff; font-size: 11px; }
.admin-content .admin-data-card .table thead tr:first-child th:first-child { border-top-left-radius: 12px; }
.admin-content .admin-data-card .table thead tr:first-child th:last-child { border-top-right-radius: 12px; }
.admin-content .admin-data-card .table td { padding: 15px 18px; color: #374151; font-size: 13px; }
.admin-content .admin-data-card .table tbody tr:hover td { background: #fafafa; }
.admin-content .admin-data-card .row-pending td { background: #fff; }
.admin-content .admin-data-card nav[role="navigation"] { padding: 0 18px 18px; }
.admin-content .table strong { color: #111827; font-weight: 600; }
.admin-content .actions { justify-content: flex-end; }
.admin-content .tag { padding: 3px 8px; border-radius: 5px; font-weight: 600; }
.admin-content .badge { border-radius: 5px; padding: 4px 8px; font-size: 11px; }
.admin-content .status { border-radius: 999px; padding: 5px 9px; font-size: 11px; }
.admin-content .band-pill { background: #6d28d9; padding: 4px 9px; font-weight: 600; }

/* Bộ lọc kết quả */
.admin-content .admin-filter-card { margin-bottom: 24px; }
.admin-content .filter-tabs { gap: 8px; margin: -4px 0 20px; padding-bottom: 16px; }
.admin-content .filter-tab { padding: 8px 13px; border-radius: 8px; background: #f3f4f6; color: #4b5563; font-size: 12px; }
.admin-content .filter-tab.active { background: #ede9fe; color: #6d28d9; box-shadow: none; }
.admin-content .filter-row { grid-template-columns: repeat(3, minmax(160px, 1fr)) minmax(260px, 1.5fr); gap: 18px; }
.admin-content .filter-row .field { margin-bottom: 0; }
.admin-content .filter-row .field-grow { grid-column: auto; min-width: 0; }
.admin-content .search-field { gap: 8px; }
.admin-content .filter-clear { padding-top: 14px; margin-top: 14px; border-top: 1px solid #f0f1f3; }

/* Thư viện và danh sách bộ đề */
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.admin-content .test-manager { max-width: 1440px; margin: 0 auto; }
.admin-content .test-manager-lead {
    display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 0 0 24px;
}
.admin-content .test-manager-eyebrow {
    margin: 0 0 7px; color: #7c3aed; font-size: 11px; font-weight: 800; letter-spacing: 1.2px;
}
.admin-content .test-manager-description { max-width: 690px; margin: 0; color: #6b7280; line-height: 1.6; }
.admin-content .test-create-trigger { flex: 0 0 auto; min-width: 146px; }
.admin-content .test-create-trigger span { margin-right: 3px; font-size: 18px; font-weight: 400; line-height: 1; }
.admin-content .test-create-card { display: none; margin: -4px 0 24px; padding: 0; overflow: visible; scroll-margin-top: 84px; }
.admin-content .test-create-card[open] { display: block; }
.admin-content .test-create-card > summary {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 24px;
    border-bottom: 1px solid #e5e7eb; border-radius: 12px 12px 0 0; background: #f9fafb;
    cursor: pointer; list-style: none;
}
.admin-content .test-create-card > summary::-webkit-details-marker { display: none; }
.admin-content .test-create-card > summary strong { display: block; color: #1f2937; font-size: 16px; }
.admin-content .test-create-card > summary small { display: block; margin-top: 3px; color: #6b7280; font-size: 12px; font-weight: 400; }
.admin-content .test-create-close { color: #6d28d9; font-size: 12px; font-weight: 700; }
.admin-content .test-create-card > form { padding: 20px 24px 22px; }
.admin-content .test-create-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.admin-content .test-create-footer .hint { margin: 0; }
.admin-content .test-create-footer .btn { flex: 0 0 auto; }

.admin-content .test-flow-tabs {
    display: flex; gap: 30px; margin-bottom: 18px; border-bottom: 1px solid #dfe2e8;
}
.admin-content .test-flow-tab {
    display: inline-flex; align-items: center; gap: 9px; margin-bottom: -1px; padding: 13px 2px 14px;
    border: 0; border-bottom: 3px solid transparent; background: none; color: #6b7280;
    font: inherit; font-size: 14px; font-weight: 650; cursor: pointer;
}
.admin-content .test-flow-tab:hover { color: #374151; }
.admin-content .test-flow-tab.active { border-bottom-color: #6d28d9; color: #5b21b6; }
.admin-content .test-flow-tab span {
    min-width: 24px; padding: 3px 7px; border-radius: 999px; background: #f3f4f6;
    color: #6b7280; font-size: 11px; line-height: 1.25; text-align: center;
}
.admin-content .test-flow-tab.active span { background: #ede9fe; color: #6d28d9; }

.admin-content .test-library-toolbar {
    display: grid; grid-template-columns: minmax(280px, 1fr) repeat(3, minmax(140px, 185px));
    align-items: end; gap: 14px; margin: 0 0 13px; padding: 15px 16px;
}
.admin-content .test-search-field { position: relative; display: block; }
.admin-content .test-search-field input {
    width: 100%; min-height: 42px; padding: 10px 14px 10px 42px; border: 1px solid #d1d5db;
    border-radius: 8px; background: #fff; color: #111827; font: inherit; font-size: 13px;
}
.admin-content .test-search-field input:focus,
.admin-content .test-filter-field select:focus { outline: 3px solid #ede9fe; border-color: #7c3aed; }
.admin-content .test-search-icon {
    position: absolute; left: 15px; top: 50%; width: 14px; height: 14px; border: 2px solid #9ca3af;
    border-radius: 50%; transform: translateY(-58%); pointer-events: none;
}
.admin-content .test-search-icon::after {
    content: ""; position: absolute; width: 6px; height: 2px; right: -5px; bottom: -3px;
    border-radius: 2px; background: #9ca3af; transform: rotate(45deg);
}
.admin-content .test-filter-field { display: flex; flex-direction: column; gap: 5px; }
.admin-content .test-filter-field[hidden] { display: none; }
.admin-content .test-filter-field span { color: #6b7280; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .45px; }
.admin-content .test-filter-field select {
    width: 100%; min-height: 42px; padding: 9px 32px 9px 11px; border: 1px solid #d1d5db;
    border-radius: 8px; background: #fff; color: #374151; font: inherit; font-size: 12px;
}
.admin-content .test-library-summary {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 2px 10px;
}
.admin-content .test-library-summary p { margin: 0; color: #6b7280; font-size: 12px; }
.admin-content .test-library-summary strong { color: #374151; }
.admin-content .test-filter-clear-button {
    padding: 4px 0; border: 0; background: none; color: #6d28d9; font: inherit; font-size: 12px; font-weight: 650; cursor: pointer;
}
.admin-content .test-filter-clear-button:hover { text-decoration: underline; }

.admin-content .test-flow-panel[hidden], .admin-content .test-set-accordion[hidden] { display: none; }
.admin-content .test-set-list { display: flex; flex-direction: column; gap: 10px; }
.admin-content .test-set-accordion {
    position: relative; border: 1px solid #e2e5eb; border-radius: 11px; background: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,.035); overflow: visible;
}
.admin-content .test-set-accordion[open] { border-color: #d8d2e8; box-shadow: 0 4px 15px rgba(50,35,85,.065); }
.admin-content .test-set-summary {
    display: grid; grid-template-columns: 18px minmax(220px, 1fr) auto 68px; align-items: center; gap: 14px;
    min-height: 78px; padding: 14px 19px; border-radius: 11px; cursor: pointer; list-style: none;
}
.admin-content .test-set-summary::-webkit-details-marker { display: none; }
.admin-content .test-set-summary:hover { background: #fafafa; }
.admin-content .test-set-accordion[open] > .test-set-summary { border-bottom: 1px solid #eceef2; border-radius: 11px 11px 0 0; background: #fcfbfe; }
.admin-content .test-set-chevron {
    width: 8px; height: 8px; border-right: 2px solid #9ca3af; border-bottom: 2px solid #9ca3af;
    transform: rotate(-45deg); transition: transform .16s ease;
}
.admin-content .test-set-accordion[open] > summary .test-set-chevron { transform: rotate(45deg) translate(-2px, -2px); }
.admin-content .test-set-main { min-width: 0; }
.admin-content .test-set-title-line { display: flex; align-items: center; gap: 9px; min-width: 0; }
.admin-content .test-set-title-line strong { overflow: hidden; color: #1f2937; font-size: 15px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.admin-content .test-set-title-line .tag { flex: 0 0 auto; margin: 0; }
.admin-content .tag-midterm { background: #fef3c7; color: #a16207; }
.admin-content .tag-final { background: #fee2e2; color: #b91c1c; }
.admin-content .tag-practice { background: #dcfce7; color: #15803d; }
.admin-content .test-set-meta { display: flex; align-items: center; gap: 7px; margin-top: 7px; color: #6b7280; font-size: 11.5px; }
.admin-content .test-set-meta i { width: 3px; height: 3px; border-radius: 50%; background: #c4c8d0; }
.admin-content .test-set-skill-dots { display: flex; align-items: center; gap: 5px; }
.admin-content .test-skill-dot {
    display: inline-flex; align-items: center; justify-content: center; width: 27px; height: 27px;
    border: 1px dashed #d1d5db; border-radius: 7px; background: #f9fafb; color: #b1b5bd; font-size: 10px; font-weight: 750;
}
.admin-content .test-skill-dot.is-ready { border-style: solid; border-color: #ddd6fe; background: #f5f3ff; color: #6d28d9; }
.admin-content .test-set-open-label { color: #6d28d9; font-size: 11px; font-weight: 650; text-align: right; }
.admin-content .test-set-accordion[open] > summary .test-set-open-label { font-size: 0; }
.admin-content .test-set-accordion[open] > summary .test-set-open-label::after { content: "Thu gọn"; font-size: 11px; }
.admin-content .test-set-body { padding: 0 18px 16px; }
.admin-content .test-set-body-toolbar {
    display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 58px; padding: 10px 0;
}
.admin-content .test-set-body-toolbar > p { margin: 0; color: #6b7280; font-size: 12px; }
.admin-content .test-set-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.admin-content .test-set-table-wrap { width: 100%; margin: 0; border: 1px solid #eceef2; border-radius: 9px; }
.admin-content .test-set-table-wrap .table { min-width: 720px; }
.admin-content .test-set-table-wrap .table th { background: #6d28d9; color: #fff; font-size: 10px; }
.admin-content .test-set-table-wrap .table thead tr:first-child th:first-child { border-top-left-radius: 8px; }
.admin-content .test-set-table-wrap .table thead tr:first-child th:last-child { border-top-right-radius: 8px; }
.admin-content .test-set-table-wrap .table tbody tr:last-child td { border-bottom: 0; }
.admin-content .test-set-empty { margin: 0; padding: 22px; border: 1px dashed #d7dbe2; border-radius: 8px; color: #6b7280; text-align: center; }
.admin-content .edit-pop { z-index: 15; border-color: #e5e7eb; border-radius: 10px; box-shadow: 0 16px 36px rgba(17,24,39,.15); }
.admin-content .test-filter-empty {
    display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 48px 24px;
    border: 1px dashed #d1d5db; border-radius: 11px; background: #fff; color: #6b7280; text-align: center;
}
.admin-content .test-filter-empty[hidden] { display: none; }
.admin-content .test-filter-empty strong { color: #374151; }
.admin-content .test-filter-empty span { font-size: 12px; }
.admin-content .test-ungrouped-panel { margin-top: 20px; border-color: #fed7aa; }
.admin-content .test-ungrouped-panel .tag { background: #fff7ed; color: #c2410c; }
.admin-content .empty-state { border-color: #d1d5db; background: #fff; }

/* Tài khoản và AI */
.admin-content .ai-provider-card { margin-bottom: 18px; }
.admin-content .ai-provider-card .panel-title .badge { margin-left: 8px; vertical-align: middle; }
.admin-content form + .ai-tools-card { margin-top: 24px; }
.admin-content .ai-tools-card .form-row { align-items: flex-start; }
.admin-content .ai-tools-card .field { padding: 12px 14px; border: 1px solid #e5e7eb; border-radius: 9px; background: #f9fafb; }

/* Trang soạn đề, chấm bài và import */
.admin-content .section-row { padding: 17px 20px; border-color: #e5e7eb; border-radius: 10px; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.admin-content .section-row:hover { border-color: #d8b4fe; }
.admin-content .section-row-meta { color: #6b7280; }
.admin-content .group-panel { border-left: 3px solid #7c3aed; }
.admin-content .hint-panel > summary { color: #374151; }
.admin-content .essay-box { border-color: #e5e7eb; background: #f9fafb; border-radius: 9px; }
.admin-content .result-summary { justify-content: flex-start; margin: 0 0 24px; }
.admin-content .result-band, .admin-content .result-score { min-width: 190px; padding: 24px 36px; border-radius: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.admin-content .result-band { background: #6d28d9; }
.admin-content .result-score-num { color: #6d28d9; }
.admin-content .sp-answer-item { padding: 16px 0; }
.admin-content .import-review-layout { gap: 24px; }
.admin-content .import-source-panel .panel, .admin-content .import-draft-panel .panel { margin-bottom: 20px; }
.admin-content .draft-part { border-color: #e5e7eb; background: #f9fafb; }
.admin-content .draft-group { border-left-color: #7c3aed; }

@media (max-width: 1180px) {
    .admin-content > .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-content .filter-row { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
    .admin-content .test-library-toolbar { grid-template-columns: minmax(280px, 1fr) repeat(3, minmax(120px, 150px)); }
}
@media (max-width: 960px) {
    .admin-sidebar { width: 100%; flex-basis: auto; }
    .admin-sidebar-brand { height: 64px; flex-basis: auto; }
    .admin-topbar { height: 64px; flex-basis: 64px; padding: 0 20px; }
    .admin-content { padding: 22px 18px; }
    .admin-page-intro-row { align-items: flex-start; }
    .admin-content .admin-form-card > .panel-title:first-child,
    .admin-content .ai-provider-card > .panel-title:first-child,
    .admin-content .ai-tools-card > .panel-title:first-child { margin-left: -18px; margin-right: -18px; padding-left: 18px; padding-right: 18px; }
    .admin-content .test-library-toolbar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .admin-content .test-search-field { grid-column: 1 / -1; }
    .admin-content .test-set-summary { grid-template-columns: 18px minmax(190px, 1fr) auto; }
    .admin-content .test-set-open-label { display: none; }
}
@media (max-width: 620px) {
    .admin-topbar-title { font-size: 17px; }
    .admin-role-button { padding: 9px 11px; font-size: 0; }
    .admin-role-button svg { width: 20px; height: 20px; }
    .admin-content > .kpi-grid { grid-template-columns: 1fr; gap: 14px; }
    .admin-content .kpi-card { min-height: 130px; }
    .admin-page-intro-row { flex-direction: column; gap: 10px; }
    .admin-detail-head { align-items: flex-start; }
    .admin-content .filter-row { grid-template-columns: 1fr; }
    .admin-content .field-grow { grid-column: auto; min-width: 0; }
    .admin-content .form-row, .admin-content .form-inline { gap: 10px; }
    .admin-content .field { min-width: 100% !important; width: 100% !important; }
    .admin-content .test-set-head { flex-direction: column; align-items: flex-start; }
    .admin-content .test-manager-lead { align-items: flex-start; flex-direction: column; gap: 16px; }
    .admin-content .test-create-trigger { width: 100%; }
    .admin-content .test-create-card > form { padding: 18px; }
    .admin-content .test-create-footer { align-items: stretch; flex-direction: column; gap: 14px; }
    .admin-content .test-flow-tabs { gap: 18px; overflow-x: auto; }
    .admin-content .test-flow-tab { flex: 0 0 auto; font-size: 12.5px; }
    .admin-content .test-library-toolbar { grid-template-columns: 1fr; }
    .admin-content .test-search-field { grid-column: auto; }
    .admin-content .test-set-summary { grid-template-columns: 16px minmax(0, 1fr); gap: 10px; padding: 14px; }
    .admin-content .test-set-skill-dots { grid-column: 2; }
    .admin-content .test-set-title-line { align-items: flex-start; flex-direction: column; gap: 5px; }
    .admin-content .test-set-title-line strong { white-space: normal; }
    .admin-content .test-set-meta { flex-wrap: wrap; }
    .admin-content .test-set-body { padding: 0 12px 12px; }
    .admin-content .test-set-body-toolbar { align-items: flex-start; flex-direction: column; padding: 12px 0; }
    .admin-content .test-set-actions { justify-content: flex-start; }
}

/* ===== Kết quả Speaking – nghe lại câu trả lời ===== */
.sp-answer-item { padding: 12px 0; border-bottom: 1px solid #eceff4; }
.sp-answer-item:last-child { border-bottom: 0; }
.sp-answer-q { font-size: 14.5px; margin-bottom: 8px; line-height: 1.45; }
.sp-answer-q .q-num {
    display: inline-block; min-width: 22px; height: 22px; line-height: 22px; text-align: center;
    background: var(--wise-600); color: #fff; border-radius: 50%; font-size: 12px; font-weight: 700; margin-right: 6px;
}
.sp-answer-audio { width: 100%; max-width: 460px; height: 38px; margin-top: 2px; }

/* ===== Bảng kết quả gom nhóm (1 dòng = 1 lượt luyện trọn bộ đề) ===== */
.result-group-table th.col-skill,
.result-group-table td.col-skill { width: 52px; text-align: center; padding-left: 4px; padding-right: 4px; }
.result-group-table th.col-overall,
.result-group-table td.col-overall { width: 78px; text-align: center; }
.result-group-table th { white-space: nowrap; }

.attempt-duration-cell { white-space: nowrap; }
.attempt-duration-cell strong,
.attempt-duration-cell small { display: block; }
.attempt-duration-cell small { margin-top: 3px; color: var(--muted); font-size: 11px; }

.skill-cell {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 34px; height: 24px; padding: 0 8px; border-radius: 20px; font-size: 12.5px; font-weight: 700;
}
.skill-cell-empty { color: #c3c7d4; font-weight: 400; }
.skill-cell-wait { background: var(--accent-100); }

/* Band pill tô màu theo kỹ năng (đè màu tím mặc định của .band-pill khi có class kỹ năng) */
.band-pill.band-listening { background: #dbeafe; color: #1d4ed8; }
.band-pill.band-reading   { background: #dcfce7; color: #15803d; }
.band-pill.band-writing   { background: #ffedd5; color: #c2410c; }
.band-pill.band-speaking  { background: var(--wise-100); color: var(--wise-700); }

.overall-pill {
    display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 28px;
    padding: 0 12px; border-radius: 20px; font-size: 15px; font-weight: 800; color: #fff;
    background: linear-gradient(135deg, var(--wise-600), var(--wise-800));
    box-shadow: 0 2px 8px rgba(109,40,217,.25);
}

/* Dòng chi tiết xổ ra: mọi lần làm bài của nhóm, mới nhất trước */
.result-detail-row > td { background: #faf9fe; padding: 0; }
.result-detail-wrap { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; }
.result-detail-item {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 9px 14px;
}
.result-detail-item.is-old { opacity: .72; border-style: dashed; }
.result-detail-item .badge { min-width: 92px; text-align: center; }
.result-detail-meta { color: var(--muted); font-size: 12.5px; flex: 1; min-width: 160px; }
.result-detail-band { min-width: 74px; }
.result-toggle { white-space: nowrap; }

/* ============================================================
   MEMBERSHIP — gói thành viên, thanh toán, quản lý thành viên
   ============================================================ */

/* ---------- Thanh quyền lợi (dashboard + bảng giá) ---------- */
.entitlement-bar {
    display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
    background: linear-gradient(135deg, var(--wise-700), var(--wise-900));
    color: #fff; border-radius: var(--radius); padding: 14px 20px; margin-bottom: 20px;
    box-shadow: var(--shadow);
}
.entitlement-bar > div:first-child { display: flex; align-items: baseline; gap: 10px; }
.entitlement-label { font-size: 13px; opacity: .82; }
.entitlement-value { font-size: 24px; font-weight: 800; line-height: 1; }
.entitlement-expiry {
    margin-left: auto; font-size: 13px; background: rgba(255,255,255,.16);
    padding: 5px 12px; border-radius: 20px;
}
.entitlement-expiry.is-soon { background: var(--accent); color: #4a2c00; font-weight: 700; }
.entitlement-bar .btn-ghost { background: rgba(255,255,255,.18); color: #fff; }
.entitlement-bar .btn-ghost:hover { background: rgba(255,255,255,.28); }

/* Chip số lượt trên thanh điều hướng học viên */
.credit-chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--wise-50); color: var(--wise-800); border: 1px solid var(--wise-100);
    padding: 6px 12px; border-radius: 20px; font-size: 13px; font-weight: 700;
}
.credit-chip:hover { text-decoration: none; background: var(--wise-100); }
.credit-chip.is-empty { background: var(--accent-50); color: #92400e; border-color: var(--accent-100); }

/* ---------- Bảng giá ---------- */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-bottom: 26px; }
.plan-card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 24px 22px; box-shadow: var(--shadow-sm); position: relative;
    display: flex; flex-direction: column; gap: 12px;
}
.plan-card.is-featured {
    border-color: var(--wise-600); box-shadow: 0 10px 30px rgba(109,40,217,.18);
    transform: translateY(-4px);
}
.plan-badge {
    position: absolute; top: -11px; left: 22px;
    background: var(--accent); color: #4a2c00; font-size: 12px; font-weight: 800;
    padding: 4px 12px; border-radius: 20px;
}
.plan-name { margin: 0; font-size: 19px; color: var(--wise-800); }
.plan-desc { margin: 0; color: var(--muted); font-size: 13.5px; }
.plan-price { display: flex; align-items: baseline; gap: 10px; }
.plan-price strong { font-size: 30px; font-weight: 800; color: var(--ink); }
.plan-compare { color: var(--muted); font-size: 15px; }
.plan-unit { margin: -6px 0 0; font-size: 12.5px; color: var(--muted); }
.plan-features { list-style: none; padding: 0; margin: 6px 0; display: grid; gap: 8px; flex: 1; }
.plan-features li { font-size: 13.5px; padding-left: 22px; position: relative; }
.plan-features li::before {
    content: "✓"; position: absolute; left: 0; top: 0;
    color: #16a34a; font-weight: 800;
}
.plan-features .plan-feature-key { font-weight: 700; padding-left: 0; }
.plan-features .plan-feature-key::before { content: none; }
.pricing-faq details { border-top: 1px solid var(--line); padding: 12px 0; }
.pricing-faq details:first-of-type { border-top: none; }
.pricing-faq summary { cursor: pointer; font-weight: 600; }
.pricing-faq p { color: var(--muted); margin: 8px 0 0; }

/* ---------- Trang xác nhận đơn ---------- */
.checkout-layout { display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px; align-items: start; }
.checkout-total { margin-top: 14px; }
.checkout-total td { padding: 8px 0; border-bottom: 1px solid #f0f1f6; }
.checkout-total .num { text-align: right; }
.checkout-discount td { color: #16a34a; }
.checkout-grand td { font-size: 18px; font-weight: 800; border-bottom: none; padding-top: 12px; }
.coupon-form { display: flex; gap: 8px; margin-top: 14px; }
.coupon-form input { flex: 1; }
.coupon-error { color: #b91c1c; font-size: 13px; margin: 8px 0 0; }
.coupon-ok { color: #15803d; font-size: 13px; font-weight: 600; margin: 8px 0 0; }
.gateway-list { display: grid; gap: 10px; margin-bottom: 16px; }
.gateway-option {
    display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center;
    border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; cursor: pointer;
}
.gateway-option:hover { border-color: var(--wise-500); background: var(--wise-50); }
.gateway-option:has(input:checked) { border-color: var(--wise-700); background: var(--wise-50); }
.gateway-option .gateway-name { font-weight: 700; }
.gateway-option small { grid-column: 2; }

/* ---------- Trang đơn hàng / chuyển khoản ---------- */
.order-status {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px;
    border-left: 4px solid var(--wise-700);
}
.order-status-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.order-status-paid { border-left-color: #16a34a; }
.order-status-cancelled, .order-status-expired, .order-status-failed { border-left-color: #b91c1c; }
.transfer-layout { display: grid; grid-template-columns: 320px 1fr; gap: 20px; align-items: start; }
.transfer-qr { text-align: center; }
.qr-image { width: 100%; max-width: 280px; height: auto; border-radius: var(--radius-sm); }
.transfer-table td { padding: 9px 6px; }
.transfer-table td:first-child { color: var(--muted); width: 40%; }
.copyable {
    background: var(--wise-50); padding: 3px 8px; border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace; user-select: all;
}
.transfer-content-row .copyable { background: var(--accent-100); color: #92400e; font-size: 15px; }
.transfer-warning { margin-top: 14px; }
.order-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* ---------- Tài khoản của tôi ---------- */
.account-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 22px; }
.account-kpis .kpi-card { flex-direction: row; align-items: center; gap: 14px; }
.account-kpis .kpi-card strong { display: block; font-size: 22px; font-weight: 800; line-height: 1.2; }
.account-kpis .kpi-card .muted { font-size: 12.5px; }
.account-kpis .kpi-cta { justify-content: center; }
.password-settings-card { max-width: 620px; }
.password-settings-intro { margin: -5px 0 16px; }
.password-settings-form { max-width: 460px; }
.password-settings-form .btn { margin-top: 3px; }
.admin-profile-link { display: block; margin-bottom: 8px; }
.profile-summary { display: grid; gap: 13px; }
.profile-summary > div { display: grid; grid-template-columns: 150px 1fr; gap: 14px; align-items: baseline; }
.profile-summary span { color: var(--muted); font-size: 12.5px; }
.profile-summary strong { color: var(--ink); word-break: break-word; }
.delta-plus { color: #15803d; font-weight: 700; }
.delta-minus { color: #b91c1c; font-weight: 700; }
.num { text-align: right; }
.table th.num, .table td.num { text-align: right; }
.ledger-table { min-width: 680px; table-layout: fixed; }
.ledger-table .ledger-col-time { width: 28%; }
.ledger-table .ledger-col-content { width: 42%; }
.ledger-table .ledger-col-change,
.ledger-table .ledger-col-balance { width: 15%; }
.is-muted-row td { opacity: .55; }

/* ---------- Thẻ bộ đề bị khoá ---------- */
.set-card.is-locked { opacity: .92; }
.set-card.is-locked .set-card-head { filter: saturate(.6); }
.set-lock-tag {
    display: inline-block; margin-left: 8px; vertical-align: middle;
    font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 20px;
    background: rgba(255,255,255,.22); color: #fff;
}
.set-lock-tag.is-open { background: rgba(255,255,255,.32); }

/* ---------- Trạng thái đơn hàng ---------- */
.status-ok, .status-paid { background: #dcfce7; color: #15803d; }
.status-cancelled, .status-failed, .status-refunded { background: #fee2e2; color: #b91c1c; }
.text-warn { color: var(--accent-dark); font-weight: 700; }

/* ---------- Trang quản trị membership ---------- */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi-row .kpi-card { flex-direction: row; align-items: center; gap: 14px; }
.kpi-row .kpi-card strong { display: block; font-size: 22px; font-weight: 800; line-height: 1.2; }
.kpi-row .kpi-card .muted { font-size: 12.5px; }
.panel-head-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.gateway-panel .panel-title { display: flex; align-items: center; gap: 10px; }
.webhook-box {
    margin-top: 12px; background: var(--wise-50); border-radius: var(--radius-sm);
    padding: 10px 14px; font-size: 13px;
}
.webhook-label { display: block; color: var(--muted); margin-bottom: 4px; }
.webhook-url { user-select: all; word-break: break-all; font-weight: 600; color: var(--wise-800); }
.plan-form { display: grid; gap: 12px; }
.admin-page-intro { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- Phân trang ---------- */
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; }
.pager-link {
    padding: 7px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line);
    background: #fff; font-weight: 600; font-size: 13.5px;
}
.pager-link:hover { text-decoration: none; border-color: var(--wise-500); }
.pager-link.is-disabled { opacity: .45; pointer-events: none; }
.pager-info { font-size: 13.5px; color: var(--muted); }

/* ---------- Đăng ký / xác minh ---------- */
.login-card-wide { max-width: 480px; }
.trial-callout {
    background: linear-gradient(135deg, var(--wise-50), var(--accent-50));
    border: 1px solid var(--wise-100); border-radius: var(--radius-sm);
    padding: 12px 16px; font-size: 13.5px; margin-bottom: 18px;
}
.verify-panel { max-width: 620px; margin: 0 auto; }
.verify-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

@media (max-width: 900px) {
    .checkout-layout, .transfer-layout { grid-template-columns: 1fr; }
    .entitlement-expiry { margin-left: 0; }
}
