/* Trợ lý học vụ AI PTIT - style bổ sung cho Skodash (tabular-menu) */

:root {
  --ptit-primary: #3461ff;
  --ptit-border: #e7eaf0;
  --ptit-muted: #6c757d;
  --ptit-chat-bg: #f5f7fb;
}

.fw-500 { font-weight: 500; }
.fs-13 { font-size: 13px; }
.fs-12 { font-size: 12px; }
.min-w-0 { min-width: 0; }
.cursor-pointer { cursor: pointer; }
.text-truncate-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- header ---------- */
.top-header .page-title { font-size: 15px; font-weight: 500; color: #32393f; }
.top-header .page-title small { color: var(--ptit-muted); font-weight: 400; }
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--ptit-primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 500; font-size: 13px; flex-shrink: 0;
}
.user-avatar.lg { width: 56px; height: 56px; font-size: 18px; }
.top-header .user-setting .user-name { line-height: 1.15; text-align: left; }
.top-header .user-setting .user-name small { display: block; font-size: 11px; color: var(--ptit-muted); }
.sidebar-wrapper .textmenu .list-group-item.muted { color: #adb5bd; pointer-events: none; }

/* ---------- page blocks ---------- */
.page-content .card { border-radius: 10px; }
.kpi-card .kpi-value { font-size: 1.6rem; font-weight: 600; line-height: 1.1; }
.kpi-card .kpi-label { color: var(--ptit-muted); font-size: 13px; }
.kpi-card .kpi-sub { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-card .card-body > div:first-child { min-width: 0; }
.card-header h6 { font-weight: 600; margin: 0; }
.card-header .sub { font-size: 12px; color: var(--ptit-muted); }
.table-sm-text td, .table-sm-text th { font-size: 13px; }
.table > :not(caption) > * > * { vertical-align: middle; }
.badge-soft { font-weight: 500; }
.filter-bar .form-select, .filter-bar .form-control { font-size: 13.5px; }
.empty-state { text-align: center; color: var(--ptit-muted); padding: 40px 12px; }
.empty-state i { font-size: 34px; display: block; margin-bottom: 8px; color: #c3c8d1; }
.skeleton { background: linear-gradient(90deg, #eef1f5 25%, #f6f8fa 37%, #eef1f5 63%); background-size: 400% 100%; animation: sk 1.2s ease infinite; border-radius: 6px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- DataTables ---------- */
table.dataTable tbody tr { cursor: pointer; }
.dataTables_wrapper .dataTables_info, .dataTables_wrapper .dataTables_length { font-size: 13px; color: var(--ptit-muted); }
.dataTables_wrapper .dataTables_processing { background: rgba(255, 255, 255, .85); border: 0; box-shadow: none; }

/* ---------- chat ---------- */
.chat-shell { height: calc(100vh - 150px); min-height: 520px; display: flex; overflow: hidden; }
.cv-list { width: 340px; flex-shrink: 0; border-right: 1px solid var(--ptit-border); display: flex; flex-direction: column; background: #fff; }
.cv-list .chat-tabs { flex-wrap: nowrap; }
.cv-list .chat-tabs .nav-link { font-size: 12.5px; padding: 5px 8px; color: #495057; white-space: nowrap; }
.cv-list .chat-tabs .nav-link.active { background: var(--ptit-primary); color: #fff; }
.chat-items { overflow-y: auto; flex: 1; }
.chat-item { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid #f1f3f6; cursor: pointer; position: relative; }
.chat-item:hover { background: #f8f9fc; }
.chat-item.active { background: rgba(52, 97, 255, .08); }
.chat-item.active::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--ptit-primary); }
.chat-item img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.av-wrap { position: relative; flex-shrink: 0; line-height: 0; }
.presence { position: absolute; right: 1px; bottom: 1px; width: 11px; height: 11px; border-radius: 50%; background: #12bf24; border: 2px solid #fff; }
.chat-item .name { font-weight: 500; font-size: 14px; }
.chat-item .time { font-size: 11.5px; color: var(--ptit-muted); white-space: nowrap; }
.chat-item .preview { font-size: 12.5px; color: var(--ptit-muted); }
.chat-item .unread { background: #e72e2e; color: #fff; border-radius: 10px; font-size: 11px; padding: 0 6px; line-height: 18px; }
.chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--ptit-chat-bg); }
.chat-head { background: #fff; border-bottom: 1px solid var(--ptit-border); padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.chat-head img { width: 44px; height: 44px; border-radius: 50%; }
.chat-body { flex: 1; overflow-y: auto; padding: 18px 22px; }
.msg { display: flex; gap: 8px; margin-bottom: 14px; max-width: 78%; }
.msg .bubble { padding: 9px 13px; border-radius: 14px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.msg .meta { font-size: 11px; color: var(--ptit-muted); margin-top: 3px; }
.msg .av { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.msg.in .bubble { background: #fff; border: 1px solid #e6e9ef; border-top-left-radius: 4px; }
.msg.out { margin-left: auto; flex-direction: row-reverse; }
.msg.out .meta { text-align: right; }
.msg.out.ai .bubble { background: #e9efff; color: #1f2d5c; border-top-right-radius: 4px; }
.msg.out.agent .bubble { background: var(--ptit-primary); color: #fff; border-top-right-radius: 4px; }
.msg.system { max-width: 100%; justify-content: center; }
.msg.system .bubble { background: transparent; color: var(--ptit-muted); font-size: 12px; padding: 2px 10px; border: 1px dashed #d5dae3; }
.day-sep { text-align: center; margin: 10px 0 16px; }
.day-sep span { font-size: 11.5px; color: var(--ptit-muted); background: #e8ebf1; padding: 2px 10px; border-radius: 10px; }
.chat-compose { background: #fff; border-top: 1px solid var(--ptit-border); padding: 10px 14px; }
.chat-compose textarea { resize: none; font-size: 14px; }
.suggest-box { background: #fffaf0; border: 1px solid #ffe3a8; border-radius: 8px; padding: 8px 12px; font-size: 13px; margin-bottom: 8px; }
.chat-info { width: 290px; flex-shrink: 0; border-left: 1px solid var(--ptit-border); background: #fff; overflow-y: auto; padding: 16px; }
.chat-info dt { font-size: 12px; color: var(--ptit-muted); font-weight: 400; }
.chat-info dd { font-size: 13.5px; margin-bottom: 10px; }
.chat-empty { flex: 1; display: flex; align-items: center; justify-content: center; flex-direction: column; color: var(--ptit-muted); }
.chat-shell.expanded { position: fixed; inset: 0; z-index: 1050; height: 100vh; border-radius: 0; }
.chat-shell.expanded .cv-list { display: none; }
@media (max-width: 1399.98px) { .chat-info { display: none; } }
@media (max-width: 991.98px) {
  .cv-list { width: 100%; }
  .chat-shell.has-active .cv-list { display: none; }
  .chat-shell:not(.has-active) .chat-main { display: none; }
}

/* ---------- timeline ---------- */
.tl { position: relative; padding-left: 28px; }
.tl::before { content: ""; position: absolute; left: 11px; top: 4px; bottom: 4px; width: 2px; background: #eceff4; }
.tl-item { position: relative; padding: 0 0 16px; }
.tl-item .dot { position: absolute; left: -28px; top: 0; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #fff; }
.tl-item .when { font-size: 12px; color: var(--ptit-muted); }
.tl-item .what { font-size: 13.5px; }
.tl-day { font-size: 12px; font-weight: 600; color: #495057; margin: 4px 0 10px -28px; text-transform: uppercase; letter-spacing: .03em; }

/* ---------- login (bố cục hai cột: ảnh nền đỏ PTIT bên trái, form bên phải) ---------- */
.login-split { display: flex; min-height: 100vh; background: #fff; }
.login-hero { flex: 0 0 64%; position: relative; background: #a30f14 url("../images/brand/login-bg.jpg") center / cover no-repeat; }
.login-panel { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; }
.login-box { width: 100%; max-width: 420px; }
.login-brand { display: flex; align-items: center; gap: 14px; }
.login-brand img { height: 52px; width: auto; }
.login-brand .t1 { font-size: 17px; font-weight: 700; color: #c4161c; line-height: 1.2; }
.login-brand .t2 { font-size: 12.5px; color: #495057; }
.login-hero .login-brand { position: absolute; top: 34px; left: 44px; }
.login-brand.light img { height: 58px; }
.login-brand.light .t1 { font-size: 22px; color: #fff; }
.login-brand.light .t2 { font-size: 15px; color: rgba(255, 255, 255, .92); }
.login-hint { margin: 32px 0 16px; text-align: center; font-size: 13.5px; color: #495057; }
.login-box .form-label { font-size: 13px; margin-bottom: 4px; }
.login-box .form-control { height: 44px; }
.login-box .form-control:focus { border-color: #e39a9d; box-shadow: 0 0 0 .2rem rgba(196, 22, 28, .12); }
.login-box .form-check-input:checked { background-color: #c4161c; border-color: #c4161c; }
.login-box .form-check-label { font-size: 13px; }
.login-link { font-size: 13px; color: #c4161c; text-decoration: none; }
.login-link:hover { text-decoration: underline; color: #a30f14; }
.btn-ptit { background: #c4161c; border-color: #c4161c; color: #fff; height: 44px; font-weight: 500; }
.btn-ptit:hover, .btn-ptit:focus { background: #a30f14; border-color: #a30f14; color: #fff; }
.btn-ptit:disabled { background: #d9777a; border-color: #d9777a; color: #fff; }
.login-notes { margin: 22px 0 0; padding-left: 18px; font-size: 12.5px; color: #6c757d; }
.login-notes li { margin-bottom: 5px; }
.login-notes b { color: #c4161c; font-weight: 500; }
.login-foot { margin-top: 28px; font-size: 12px; color: #adb5bd; }
.pw-toggle { cursor: pointer; }
@media (max-width: 991.98px) { .login-panel { justify-content: flex-start; padding-top: 48px; } }
/* trang 403 dùng khung thẻ đơn giản */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #f3f5f9; padding: 16px; }
.login-card { width: 100%; border: 0; border-radius: 14px; overflow: hidden; box-shadow: 0 10px 40px rgba(20, 30, 60, .08); }

/* ---------- misc ---------- */
.toast-container { z-index: 1100; }
.module-chip { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 10px; background: rgba(52, 97, 255, .1); color: #2f55d4; margin: 0 4px 4px 0; }
.offcanvas.offcanvas-end.w-lg { width: 640px; max-width: 100%; }
.stat-inline { display: flex; gap: 18px; flex-wrap: wrap; }
.stat-inline .it { font-size: 13px; color: var(--ptit-muted); }
.stat-inline .it b { color: #212529; font-size: 15px; margin-right: 4px; }

html.dark-theme .cv-list, html.dark-theme .chat-head, html.dark-theme .chat-compose, html.dark-theme .chat-info, html.dark-theme .login-form { background: #1e2227; }
html.dark-theme .chat-main { background: #16191d; }
html.dark-theme .msg.in .bubble { background: #262b31; border-color: #333a42; color: #e9ecef; }

.bg-light-secondary { background-color: rgba(108, 117, 125, .14) !important; }
.bg-light-purple { background-color: rgba(137, 50, 255, .14) !important; }

/* ---------- trợ lý AI ---------- */
.ai-fab { position: fixed; right: 22px; bottom: 22px; width: 52px; height: 52px; border-radius: 50%; border: 0; z-index: 1040;
  background: var(--ptit-primary); color: #fff; font-size: 22px; box-shadow: 0 6px 18px rgba(52, 97, 255, .35); }
.ai-fab:hover { background: #2448d8; }
.ai-panel { position: fixed; right: 22px; bottom: 86px; width: 400px; max-width: calc(100vw - 32px); height: 560px; max-height: calc(100vh - 120px);
  background: #fff; border-radius: 14px; box-shadow: 0 12px 40px rgba(20, 30, 60, .2); z-index: 1040; display: flex; flex-direction: column; overflow: hidden; }
.ai-panel.d-none { display: none !important; }
.ai-head { background: linear-gradient(135deg, #1e2761, #3461ff); color: #fff; padding: 12px 14px; display: flex; align-items: center; }
.ai-body { flex: 1; overflow-y: auto; padding: 14px; background: var(--ptit-chat-bg); }
.ai-msg { display: flex; margin-bottom: 10px; }
.ai-msg.user { justify-content: flex-end; }
.ai-bubble { max-width: 88%; padding: 8px 12px; border-radius: 12px; font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.ai-msg.bot .ai-bubble { background: #fff; border: 1px solid #e6e9ef; border-top-left-radius: 4px; }
.ai-msg.user .ai-bubble { background: var(--ptit-primary); color: #fff; border-top-right-radius: 4px; }
.ai-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.ai-chip { border: 1px solid #cfd8f5; background: #fff; color: #2f55d4; border-radius: 14px; font-size: 12.5px; padding: 5px 10px; text-align: left; }
.ai-chip:hover { background: #eef2ff; }
.ai-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--ptit-border); background: #fff; }
.ai-input textarea { resize: none; font-size: 13.5px; }
.ai-typing i { display: inline-block; width: 6px; height: 6px; margin-right: 3px; border-radius: 50%; background: #9aa3b2; animation: aiDot 1s infinite; }
.ai-typing i:nth-child(2) { animation-delay: .15s; }
.ai-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes aiDot { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }

/* ---------- tổng quan: bảng nhân viên số 3 cột ---------- */
.dw-grid .col-md-4 { padding-right: 14px; }
.dw-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px dashed var(--ptit-border); font-size: 12.5px; }
.dw-row .badge { font-size: 10.5px; }

/* ---------- chuông việc chờ duyệt (header) ---------- */
.top-header .bell { position: relative; font-size: 20px; color: #5b6270; padding: 6px 10px; }
.top-header .bell .badge { position: absolute; top: 2px; right: 2px; font-size: 10px; }

/* ---------- phông chữ toàn hệ thống (Quản trị hệ thống → Giao diện, lưu app_settings.ui_font) ---------- */
html.font-cambria body, html.font-cambria .btn, html.font-cambria .form-control, html.font-cambria .form-select, html.font-cambria .dropdown-menu,
html.font-cambria .table, html.font-cambria h1, html.font-cambria h2, html.font-cambria h3, html.font-cambria h4, html.font-cambria h5, html.font-cambria h6,
html.font-cambria .page-title, html.font-cambria .sidebar-wrapper, html.font-cambria .top-header, html.font-cambria .badge, html.font-cambria .tooltip, html.font-cambria .toast {
  font-family: Cambria, "Times New Roman", Georgia, serif;
}
html.font-system body, html.font-system .btn, html.font-system .form-control, html.font-system .form-select, html.font-system .dropdown-menu,
html.font-system .table, html.font-system h1, html.font-system h2, html.font-system h3, html.font-system h4, html.font-system h5, html.font-system h6,
html.font-system .page-title, html.font-system .sidebar-wrapper, html.font-system .top-header, html.font-system .badge, html.font-system .tooltip, html.font-system .toast {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
html.font-system .fl text { font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
html.font-cambria .fl text { font-family: Cambria, Georgia, serif; }

/* ================================================================== Trợ lý học vụ */
.sidebar-wrapper .brand-logo a { display: flex; align-items: center; gap: 8px; text-decoration: none; }
/* sidebar một tầng sát mép trái (bỏ cột icon của template tabular-menu) */
.sidebar-wrapper .textmenu, .sidebar-wrapper .textmenu .brand-logo { left: 0; width: 270px; background-color: #fff; }
.sidebar-wrapper .textmenu { border-right: 1px solid #e2e3e4; }
.sidebar-wrapper .textmenu .brand-logo { padding: 0 18px; }
.sidebar-wrapper .textmenu div.tab-content { padding-top: .25rem; }
.wrapper.toggled .sidebar-wrapper .textmenu, .wrapper.toggled .sidebar-wrapper .textmenu .brand-logo { left: -300px; }
.wrapper.toggled .page-content { margin-left: 0; }
.wrapper.toggled .top-header .navbar { left: 0; }
@media (max-width: 1199.98px) {
  .sidebar-wrapper .textmenu { position: fixed; }
  .sidebar-wrapper .textmenu, .sidebar-wrapper .textmenu .brand-logo { left: -300px; }
  .wrapper.toggled .sidebar-wrapper, .wrapper.toggled .sidebar-wrapper .textmenu, .wrapper.toggled .sidebar-wrapper .textmenu .brand-logo { left: 0; }
}
/* nút thu gọn sidebar ở góc trái header */
.sb-toggle { width: 40px; height: 40px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #fff;
  color: #5e636b; font-size: 20px; cursor: pointer; box-shadow: 0 .125rem .25rem rgb(0 0 0 / 8%); }
.sb-toggle:hover { color: #c4161c; }
@media (min-width: 1200px) {
  html.sb-collapsed .sidebar-wrapper, html.sb-collapsed .sidebar-wrapper .textmenu, html.sb-collapsed .sidebar-wrapper .textmenu .brand-logo { left: -300px; }
  html.sb-collapsed .page-content { margin-left: 0; }
  html.sb-collapsed .top-header .navbar { left: 0; }
}
/* sidebar chia nhóm; nhóm theo quyền chỉ hiện khi <html data-mods> có mã nhóm (gắn từ sessionStorage trước khi vẽ) */
.sidebar-wrapper .menu-group[data-module], .sidebar-wrapper .menu-group a[data-perm] { display: none; }
html[data-mods~="tri-thuc"] .menu-group[data-module="tri-thuc"], html[data-mods~="admin"] .menu-group[data-module="admin"] { display: block; }
html[data-mods~="use_ai_chat"] .menu-group a[data-perm="use_ai_chat"],
html[data-mods~="view_documents"] .menu-group a[data-perm="view_documents"],
html[data-mods~="view_curriculum"] .menu-group a[data-perm="view_curriculum"],
html[data-mods~="view_forms"] .menu-group a[data-perm="view_forms"],
html[data-mods~="manage_users"] .menu-group a[data-perm="manage_users"],
html[data-mods~="system_settings"] .menu-group a[data-perm="system_settings"],
html[data-mods~="view_audit"] .menu-group a[data-perm="view_audit"],
html[data-mods~="run_benchmark"] .menu-group a[data-perm="run_benchmark"],
html[data-mods~="view_students"] .menu-group a[data-perm="view_students"] { display: block; }
.sidebar-wrapper .menu-group { border-bottom: 1px solid #f0f2f6; padding-bottom: 4px; }
.sidebar-wrapper .menu-label { padding: 14px 18px 6px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: #8a93a3; }
.sidebar-wrapper .menu-label i { margin-right: 6px; color: #c4161c; }
.sidebar-wrapper .tab-content { overflow-y: auto; height: calc(100vh - 70px); }
.sidebar-wrapper .textmenu .list-group .menu-group .list-group-item { border: 0; border-radius: 8px; margin: 1px 10px; padding: 8px 12px; font-size: 14px; color: #3d4451; }
.sidebar-wrapper .textmenu .list-group .menu-group .list-group-item:hover { background-color: #f4f6fa; }
.sidebar-wrapper .textmenu .list-group .menu-group .list-group-item.active { color: #c4161c; background-color: #fdecec; font-weight: 500; }
.brand-text { font-weight: 700; color: #c4161c; font-size: 15px; white-space: nowrap; }
.llm-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 4px 10px; border-radius: 14px; background: #f1f3f7; color: #6c757d; margin-right: 6px; }
.llm-pill.ok { background: #e7f6ef; color: #12805c; }
.llm-pill.off { background: #fdecec; color: #c4161c; }
.fs-12 { font-size: 12px; } .fs-13 { font-size: 13px; } .fs-14 { font-size: 14px; } .fw-500 { font-weight: 500; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.role-chip { display: inline-block; font-size: 11.5px; padding: 2px 8px; border-radius: 10px; background: #eef2ff; color: #2f55d4; }

/* chat 3 cột */
.as-wrap { display: flex; height: calc(100vh - 130px); min-height: 560px; border: 1px solid var(--ptit-border); border-radius: 10px; overflow: hidden; background: #fff; }
.as-side { width: 250px; flex-shrink: 0; border-right: 1px solid var(--ptit-border); display: flex; flex-direction: column; }
.as-side .as-new { padding: 12px; border-bottom: 1px solid var(--ptit-border); }
.as-sessions { flex: 1; overflow-y: auto; }
.as-sess { padding: 9px 12px; border-bottom: 1px solid #f2f4f8; cursor: pointer; font-size: 13px; position: relative; }
.as-sess:hover { background: #f7f9fc; } .as-sess.active { background: #eef2ff; }
.as-sess .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 18px; }
.as-sess .d { font-size: 11px; color: var(--ptit-muted); }
.as-sess .del { position: absolute; right: 8px; top: 9px; color: #adb5bd; display: none; }
.as-sess:hover .del { display: block; }
.as-main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--ptit-chat-bg); }
.as-head { background: #fff; border-bottom: 1px solid var(--ptit-border); padding: 10px 16px; display: flex; align-items: center; gap: 10px; }
.as-body { flex: 1; overflow-y: auto; padding: 18px 20px; }
.as-msg { display: flex; margin-bottom: 14px; gap: 10px; }
.as-msg.user { justify-content: flex-end; }
.as-msg .av { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: #c4161c; color: #fff; font-size: 15px; }
.as-bubble { max-width: 78%; padding: 10px 14px; border-radius: 12px; font-size: 14px; line-height: 1.55; word-wrap: break-word; }
.as-msg.user .as-bubble { background: var(--ptit-primary); color: #fff; border-top-right-radius: 4px; white-space: pre-wrap; }
.as-msg.bot .as-bubble { background: #fff; border: 1px solid #e6e9ef; border-top-left-radius: 4px; }
.as-msg.bot.blocked .as-bubble { border-color: #f3c2c4; background: #fff7f7; }
.as-bubble p { margin: 0 0 6px; } .as-bubble p:last-child { margin-bottom: 0; }
.as-bubble ul, .as-bubble ol { margin: 4px 0 6px; padding-left: 20px; }
.as-bubble .cite { display: inline-block; font-size: 10.5px; font-weight: 600; background: #eef2ff; color: #2f55d4; border-radius: 4px; padding: 0 4px; margin: 0 1px; cursor: pointer; vertical-align: 2px; }
.as-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; font-size: 11.5px; color: var(--ptit-muted); }
.as-meta .fb { cursor: pointer; color: #adb5bd; } .as-meta .fb.on { color: var(--ptit-primary); }
.as-meta a { color: var(--ptit-primary); cursor: pointer; text-decoration: none; }
.as-steps-inline { font-size: 12px; color: var(--ptit-muted); margin-bottom: 6px; }
.as-steps-inline .s { display: inline-flex; align-items: center; gap: 4px; margin-right: 10px; }
.as-steps-inline .s i { font-size: 11px; }
.as-tbl { margin-top: 8px; max-height: 260px; overflow: auto; border: 1px solid #eef0f4; border-radius: 6px; }
.as-tbl table { font-size: 12px; margin: 0; } .as-tbl th { position: sticky; top: 0; background: #f7f9fc; white-space: nowrap; }
.as-tbl td { white-space: nowrap; }
.as-ctx { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 12px; }
.ctx-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 4px 10px; border-radius: 12px; background: #f3f5f9; color: #4a5568; border: 1px solid #e3e7ef; }
.ctx-chip i { color: var(--ptit-primary); }
.as-presets { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
.as-chip { border: 1px solid #cfd8f5; background: #fff; color: #2f55d4; border-radius: 16px; font-size: 13px; padding: 6px 12px; }
.as-chip:hover { background: #eef2ff; }
.as-welcome { text-align: center; max-width: 640px; margin: 6vh auto 0; }
.as-welcome img { height: 54px; }
.as-compose { background: #fff; border-top: 1px solid var(--ptit-border); padding: 10px 14px; display: flex; gap: 8px; align-items: flex-end; }
.as-compose textarea { resize: none; font-size: 14px; max-height: 140px; }
.as-compose .note { font-size: 11px; color: var(--ptit-muted); }
.as-panel { width: 400px; flex-shrink: 0; border-left: 1px solid var(--ptit-border); background: #fff; display: flex; flex-direction: column; }
.as-panel .nav-tabs { padding: 0 10px; font-size: 13px; }
.as-panel-q { padding: 10px 14px 0; font-size: 12.5px; line-height: 1.4; font-weight: 500; }
.as-panel-q:empty { display: none; }
@media (min-width: 1400px) { .as-panel.collapsed { display: none; } }
.ev-open .as-msg.bot.ev-on .as-bubble { border-color: #eab0b2; box-shadow: 0 0 0 3px rgba(196,22,28,.06); }
#togglePanel.active { background: #c4161c; border-color: #c4161c; color: #fff; }
.as-panel .nav-link { padding: 9px 10px; }
.as-panel .tab-content { flex: 1; overflow-y: auto; padding: 14px; }
@media (max-width: 1399.98px) { .as-panel { position: fixed; right: 0; top: 60px; bottom: 0; z-index: 1045; box-shadow: -8px 0 24px rgba(0,0,0,.08); transform: translateX(100%); transition: transform .2s; }
  .as-panel.show { transform: none; } }
@media (max-width: 991.98px) { .as-side { display: none; } }
.tl { list-style: none; padding: 0; margin: 0; }
.tl li { position: relative; padding: 0 0 14px 26px; font-size: 13px; }
.tl li::before { content: ""; position: absolute; left: 8px; top: 18px; bottom: 0; width: 2px; background: #e9ecf2; }
.tl li:last-child::before { display: none; }
.tl .dot { position: absolute; left: 0; top: 2px; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; color: #fff; background: #1baf7a; }
.tl .dot.blocked { background: #e34948; } .tl .dot.warn { background: #eda100; } .tl .dot.skip { background: #adb5bd; }
.tl .nm { font-weight: 500; } .tl .ms { float: right; font-size: 11px; color: var(--ptit-muted); }
.tl .dt { color: var(--ptit-muted); font-size: 12.5px; }
.src-card { border: 1px solid #e9ecf2; border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; font-size: 13px; }
.src-card.hl { border-color: var(--ptit-primary); box-shadow: 0 0 0 2px rgba(52,97,255,.15); }
.src-card .h { font-weight: 500; } .src-card .sub { font-size: 12px; color: var(--ptit-muted); }
.src-card .tx { font-size: 12.5px; color: #3d4451; max-height: 130px; overflow: hidden; position: relative; white-space: pre-line; margin-top: 6px; }
.src-card .tx.open { max-height: none; }
.sql-box { background: #1e2433; color: #e6edf7; border-radius: 8px; padding: 10px 12px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; white-space: pre-wrap; word-break: break-word; }
.check-list { list-style: none; padding: 0; margin: 8px 0 0; font-size: 12.5px; }
.check-list li { padding: 2px 0; } .check-list li i { color: #1baf7a; margin-right: 6px; }
.rule-row { border-left: 3px solid #e9ecf2; padding: 6px 10px; margin-bottom: 8px; font-size: 13px; }
.rule-row.pass { border-color: #1baf7a; } .rule-row.fail { border-color: #e34948; } .rule-row.warn { border-color: #eda100; } .rule-row.info { border-color: #2a78d6; }
.rule-row .src { font-size: 11.5px; color: var(--ptit-muted); }
.factor-bar { display: flex; align-items: center; gap: 8px; font-size: 12.5px; margin-bottom: 6px; }
.factor-bar .lb { width: 190px; flex-shrink: 0; } .factor-bar .bar { flex: 1; height: 8px; background: #f1f3f7; border-radius: 4px; position: relative; }
.factor-bar .bar span { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.risk-meter { height: 10px; border-radius: 5px; background: linear-gradient(90deg, #1baf7a 0%, #eda100 40%, #e34948 75%); position: relative; }
.risk-meter i { position: absolute; top: -4px; width: 4px; height: 18px; background: #212529; border-radius: 2px; }
.disclaimer { font-size: 11.5px; color: var(--ptit-muted); border-top: 1px dashed #e3e6ec; margin-top: 8px; padding-top: 6px; }

/* sinh viên, thẻ, lịch */
.stat-ring { font-size: 1.9rem; font-weight: 600; }
.prog { height: 8px; border-radius: 4px; background: #eef0f4; overflow: hidden; } .prog span { display: block; height: 100%; background: var(--ptit-primary); }
.cond-list { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.cond-list li { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px dashed #eef0f4; }
.cond-list li:last-child { border-bottom: 0; }
.cond-list i.bi-check-circle-fill { color: #1baf7a; } .cond-list i.bi-x-circle-fill { color: #e34948; }
.week-grid { display: grid; grid-template-columns: 56px repeat(6, 1fr); gap: 4px; font-size: 12px; }
.week-grid .hd { text-align: center; font-weight: 500; color: var(--ptit-muted); padding: 4px 0; }
.week-grid .slot { background: #f7f9fc; border-radius: 6px; min-height: 46px; padding: 4px 6px; }
.week-grid .slot.has { background: #eef2ff; border-left: 3px solid var(--ptit-primary); }
.week-grid .slot.clash { background: #fdecec; border-left-color: #e34948; }
.week-grid .tm { color: var(--ptit-muted); display: flex; align-items: center; justify-content: center; }
.offer-row.disabled { opacity: .55; }
.arch-layer { border: 1px solid #e6e9ef; border-radius: 10px; padding: 14px 16px; height: 100%; background: #fff; }
.arch-layer .num { width: 28px; height: 28px; border-radius: 8px; background: #c4161c; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; margin-right: 8px; }
.arch-layer .st { font-size: 12px; }
.arch-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; }
.arch-flow .n { border: 1px solid #d6dcf5; background: #f5f7ff; border-radius: 8px; padding: 6px 10px; }
.arch-flow .ar { color: #adb5bd; }
.login-demo { margin-top: 18px; border-top: 1px dashed #e3e6ec; padding-top: 14px; }
.login-demo .acc { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border: 1px solid #eceff4; border-radius: 8px; margin-bottom: 6px; cursor: pointer; font-size: 13px; }
.login-demo .acc:hover { border-color: #e39a9d; background: #fff7f7; }
.login-demo .acc .r { margin-left: auto; font-size: 11.5px; color: #c4161c; }

/* kho tri thức: nhóm, loại chi tiết, thẻ theo ngành */
.kb-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.kb-cat { border: 1px solid #e3e6ec; background: #fff; border-radius: 10px; padding: 8px 14px; font-size: 13.5px; color: #3d4451; display: inline-flex; align-items: center; gap: 7px; }
.kb-cat i { color: #c4161c; }
.kb-cat span, .kb-kind span { font-size: 11.5px; color: #8a93a3; background: #f1f3f7; border-radius: 8px; padding: 0 6px; }
.kb-cat:hover { border-color: #e39a9d; }
.kb-cat.on { background: #c4161c; border-color: #c4161c; color: #fff; }
.kb-cat.on i { color: #fff; } .kb-cat.on span { background: rgba(255,255,255,.2); color: #fff; }
.kb-kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.kb-kind { border: 0; background: #f4f6fa; border-radius: 14px; padding: 4px 11px; font-size: 12.5px; color: #3d4451; }
.kb-kind.on { background: #fdecec; color: #c4161c; font-weight: 500; }
.kb-prog { border: 1px solid #e9ecf2; border-radius: 10px; height: 100%; overflow: hidden; }
.kb-prog-h { display: flex; align-items: center; padding: 10px 14px; background: #fafbfc; border-bottom: 1px solid #eef0f4; font-weight: 500; font-size: 14px; }
.kb-prog-h i { color: #c4161c; }
.kb-prog-row { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid #f3f4f7; cursor: pointer; font-size: 13px; }
.kb-prog-row:last-child { border-bottom: 0; } .kb-prog-row:hover { background: #f7f9fc; }
.kb-prog-row .t { color: #8a93a3; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-badge { font-size: 12px; padding: 2px 9px; border-radius: 8px; white-space: nowrap; background: #eef2ff; color: #2f55d4; }
.kb-badge.k1 { background: #e7f6ef; color: #12805c; } .kb-badge.k2 { background: #fff4de; color: #a86a00; }
.kb-badge.k3 { background: #f3ecfd; color: #6b3fbf; } .kb-badge.k4 { background: #f1f3f7; color: #5e636b; }
#docList table { table-layout: fixed; }
#docList table td, #docList table th { white-space: normal; word-break: break-word; }
#docList table th:nth-child(1) { width: auto; } #docList table th:nth-child(2) { width: 190px; }
#docList table th:nth-child(3) { width: 170px; } #docList table th:nth-child(4) { width: 100px; } #docList table th:nth-child(5) { width: 150px; }

/* tổng quan */
.home-card { border: 1px solid #eceff4; transition: border-color .15s, box-shadow .15s; }
.home-card:hover { border-color: #e39a9d; box-shadow: 0 4px 16px rgba(196,22,28,.08); }
.home-ic { width: 44px; height: 44px; border-radius: 10px; background: #fdecec; color: #c4161c; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.chat-form { display: flex; align-items: center; gap: 10px; border: 1px solid #e9ecf2; border-radius: 8px; padding: 8px 10px; margin-top: 6px; font-size: 13px; }
.chat-form > i { font-size: 22px; color: #2b579a; }
/* chương trình đào tạo */
.ctdt-list { max-height: calc(100vh - 230px); overflow-y: auto; }
.ctdt-item { display: block; padding: 8px 10px; border-radius: 8px; color: #3d4451; text-decoration: none; font-size: 13.5px; }
.ctdt-item:hover { background: #f4f6fa; } .ctdt-item.on { background: #fdecec; } .ctdt-item.on .fw-500 { color: #c4161c; }
.ctdt-sem { border: 1px solid #e9ecf2; border-radius: 10px; overflow: hidden; margin-bottom: 12px; }
.ctdt-sem-h { display: flex; align-items: center; padding: 8px 14px; background: #fafbfc; border-bottom: 1px solid #eef0f4; font-weight: 500; }
/* biểu mẫu */
.form-card { border: 1px solid #eceff4; } .form-ic { font-size: 26px; color: #2b579a; line-height: 1; }
.doc-preview { background: #fff; border: 1px solid #e3e6ec; box-shadow: 0 4px 20px rgba(20,30,60,.08); padding: 28px 30px; font-family: "Times New Roman", Times, serif;
  font-size: 14px; line-height: 1.45; color: #111; min-height: 600px; position: sticky; top: 0; }
.doc-preview .c { text-align: center; } .doc-preview .r { text-align: right; } .doc-preview .b { font-weight: 700; } .doc-preview .i { font-style: italic; }
.doc-preview .u { text-decoration: underline; } .doc-preview .t { font-size: 17px; margin: 14px 0 10px; } .doc-preview .mt { margin-top: 8px; }
.doc-preview .j { text-align: justify; text-indent: 28px; margin: 6px 0; } .doc-preview .ind { margin: 6px 0 2px 40px; } .doc-preview .ind2 { margin-left: 112px; }
.doc-preview .sign { width: 46%; margin-left: auto; text-align: center; margin-top: 14px; }
/* người dùng & ma trận quyền */
.user-table td, .user-table th { padding-top: 10px; padding-bottom: 10px; }
.act-btn { width: 34px; height: 34px; border: 1px solid #e3e6ec; background: #fff; border-radius: 8px; color: #3d4451; margin-left: 4px; }
.act-btn:hover { border-color: #b9c3d6; } .act-btn:disabled { opacity: .35; }
.perm-pill { font-size: 12px; background: #f1f3f7; border-radius: 8px; padding: 2px 8px; }
.perm-toolbar { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; border-bottom: 1px solid #e9ecf2; }
.perm-toolbar .btn, .perm-toolbar .form-select, .perm-toolbar .form-control { font-size: 13.5px; }
.perm-search-ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #8a93a3; }
.perm-grid { columns: 3 300px; column-gap: 14px; }
.perm-card { break-inside: avoid; background: #fff; border: 1px solid #e3e6ec; border-radius: 10px; margin-bottom: 14px; overflow: hidden; }
.perm-card-h { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid #eef0f4; background: #fafbfc; }
.perm-card-h > i { color: #2a78d6; font-size: 17px; }
.perm-n { font-size: 12px; border-radius: 8px; padding: 1px 7px; } .perm-n.full { background: #e7f6ef; color: #12805c; }
.perm-n.part { background: #fff4de; color: #a86a00; } .perm-n.none { background: #f1f3f7; color: #8a93a3; }
.perm-row { display: flex; gap: 12px; padding: 10px 14px; border-bottom: 1px solid #f3f4f7; cursor: pointer; font-size: 13.5px; margin: 0; }
.perm-row:last-child { border-bottom: 0; } .perm-row:hover { background: #f9fafc; }
.perm-row .form-switch .form-check-input { width: 2.4em; height: 1.3em; cursor: pointer; }
.pw-box { background: #f7f9fc; border: 1px dashed #cfd6e3; border-radius: 8px; padding: 10px 12px; }
.text-purple { color: #6b3fbf !important; } .bg-light-purple { background: #f3ecfd !important; }

/* ma trận phân quyền (admin/phan-quyen.html) */
.pm-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--ptit-border); }
.pm-tab { position: relative; display: inline-flex; align-items: center; gap: 6px; border: 1px solid #e2e8f0; background: #fff; color: #334155; border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 500; cursor: pointer; }
.pm-tab:hover { border-color: #9dbbe6; } .pm-tab.active { background: var(--ptit-primary); border-color: var(--ptit-primary); color: #fff; }
.pm-tab .n { font-size: 11.5px; opacity: .7; } .pm-tab .dot { position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%; background: #f79009; border: 2px solid #fff; }
.pm-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 16px; background: #f8fafc; border-bottom: 1px solid var(--ptit-border); font-size: 13px; }
.pm-wrap { max-height: calc(100vh - 330px); }
.pm-table th, .pm-table td { vertical-align: middle; font-size: 13px; }
.pm-table thead th { position: sticky; top: 0; background: #fff; z-index: 3; }
.pm-table th.pm-person, .pm-table td.pm-person { position: sticky; left: 0; background: #fff; z-index: 2; min-width: 280px; max-width: 320px; }
.pm-table thead th.pm-person { z-index: 4; }
.pm-table th.pm-col { text-align: center; min-width: 112px; max-width: 150px; vertical-align: bottom; }
.pm-table th.pm-col button { border: 0; background: none; font-weight: 600; font-size: 12.5px; line-height: 1.2; color: #334155; padding: 4px 6px; border-radius: 6px; }
.pm-table th.pm-col button:hover { background: #eef2ff; color: #2f55d4; }
.pm-table td.pm-cell { text-align: center; }
.pm-table td.pm-cell label { display: inline-flex; width: 32px; height: 32px; align-items: center; justify-content: center; border-radius: 6px; position: relative; cursor: pointer; margin: 0; }
.pm-table td.pm-cell label.off { cursor: not-allowed; opacity: .5; } .pm-table td.pm-cell label.changed { background: #fef0c7; }
.pm-table td.pm-cell input { width: 18px; height: 18px; cursor: pointer; accent-color: var(--ptit-primary); }
.pm-table td.pm-cell .tpl { position: absolute; bottom: 1px; left: 50%; transform: translateX(-50%); width: 6px; height: 6px; border-radius: 50%; background: #94a3b8; }
.pm-table tr.dirty td { background: #fffcf2; }
.pm-legend { display: flex; flex-wrap: wrap; gap: 16px; padding: 8px 16px; border-top: 1px solid var(--ptit-border); font-size: 12px; color: var(--ptit-muted); align-items: center; }
.pm-legend .lg-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; margin-right: 4px; vertical-align: middle; }
.pm-legend .lg-box { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: #fef0c7; margin-right: 4px; vertical-align: middle; }
.pm-savebar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 1040; background: #fff; border: 1px solid #c7d7f0; border-radius: 12px; box-shadow: 0 10px 30px rgba(16, 24, 40, .18); padding: 10px 16px; display: flex; gap: 10px; align-items: center; width: min(680px, 92vw); }
/* modal quyền từng người: nhãn lệch mẫu, cấp / thu hồi */
.perm-row.changed { background: #fffaeb; }
.pm-hint { display: inline-block; font-size: 10.5px; padding: 1px 6px; border-radius: 4px; background: #f1f5f9; color: #475569; margin-left: 6px; vertical-align: middle; }
.pm-hint.extra { background: #eef2ff; color: #2f55d4; }
.pm-tag { display: inline-block; font-size: 10.5px; font-weight: 600; text-transform: uppercase; color: #b54708; margin-left: 6px; vertical-align: middle; }
.pm-tag.rm { color: #b42318; }

/* sinh viên đơn vị */
.sv-card { border: 1px solid #eceff4; transition: border-color .15s, box-shadow .15s; }
.sv-card:hover, .sv-card.active { border-color: #e39a9d; box-shadow: 0 4px 16px rgba(196, 22, 28, .08); }
.sv-card.active .kpi-label { color: var(--ptit-primary); }

/* thẻ chào đầu trang Tổng quan (phong cách panel trắng, viền trái màu thương hiệu) */
.hero-card { border: 1px solid #e6e9ef; border-left: 4px solid var(--ptit-primary); box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.hero-title { font-size: 20px; font-weight: 600; letter-spacing: -.01em; color: #0f172a; }
.hero-clock { flex-direction: column; justify-content: center; min-width: 128px; padding: 10px 16px; border-radius: 12px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #a30f14, #c4161c 55%, #e0484d); box-shadow: 0 6px 18px rgba(196, 22, 28, .25); }
.hero-clock::after { content: ""; position: absolute; right: -26px; top: -30px; width: 90px; height: 90px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.hero-clock .t { font-size: 30px; font-weight: 600; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hero-clock .d { margin-top: 6px; font-size: 11.5px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; opacity: .85; }
.user-avatar.xl { width: 72px; height: 72px; font-size: 22px; box-shadow: 0 0 0 4px #fdecec; }
.hero-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; padding: 4px 11px; border-radius: 999px; background: #fff; color: #334155; border: 1px solid #e2e8f0; box-shadow: 0 1px 2px rgba(16, 24, 40, .06); transition: transform .12s, box-shadow .12s; }
.hero-chip:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(196, 22, 28, .14); border-color: #e39a9d; }
.hero-chip i { color: var(--ptit-primary); }
.badge.hero-role { font-size: 12.5px; padding: 5px 11px; border-radius: 999px; }
.hero-stats { gap: 10px; align-items: stretch; }
.hero-stats .st { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; border: 1px solid #eceff4; background: #f8fafc; min-width: 160px; }
.hero-stats .ic { width: 32px; height: 32px; border-radius: 8px; background: #fdecec; color: var(--ptit-primary); display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.hero-stats .l { display: block; font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; color: #64748b; }
.hero-stats .v { display: block; font-size: 14px; font-weight: 600; color: #0f172a; line-height: 1.2; }
.hero-ask { display: flex; align-items: center; gap: 8px; }
.hero-ask > i { color: var(--ptit-primary); font-size: 18px; }
.hero-ask .form-control { max-width: 720px; }
.hero-preset { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 5px 11px; border-radius: 16px; border: 1px solid #cfd8f5; background: #fff; color: #2f55d4; text-decoration: none; }
.hero-preset:hover { background: #eef2ff; }

/* =====================================================================
   Giao diện sản phẩm: một màu thương hiệu, thẻ, bảng, tiêu đề trang thống nhất
   ===================================================================== */
:root { --ptit-primary: #c4161c; --ptit-primary-strong: #a30f14; --ptit-primary-soft: #fdecec; --ptit-ink: #0f172a; --ptit-text: #334155;
        --ptit-muted: #64748b; --ptit-border: #e6e9ef; --ptit-bg: #f5f6f8; }
body, .page-content { background: var(--ptit-bg); }
.fw-600 { font-weight: 600; }
a { color: var(--ptit-primary); } a:hover { color: var(--ptit-primary-strong); }
.btn-primary { background: var(--ptit-primary); border-color: var(--ptit-primary); }
.btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary.active { background: var(--ptit-primary-strong) !important; border-color: var(--ptit-primary-strong) !important; }
.btn-outline-primary { color: var(--ptit-primary); border-color: #e9a3a6; }
.btn-outline-primary:hover { background: var(--ptit-primary); border-color: var(--ptit-primary); color: #fff; }
.btn { border-radius: 8px; font-weight: 500; }
.btn-light { background: #fff; border: 1px solid #d0d5dd; color: var(--ptit-text); }
.form-control, .form-select { border-radius: 8px; border-color: #d0d5dd; }
.form-control:focus, .form-select:focus { border-color: #e39a9d; box-shadow: 0 0 0 3px rgba(196, 22, 28, .1); }
.form-check-input:checked { background-color: var(--ptit-primary); border-color: var(--ptit-primary); }
.nav-pills .nav-link.active { background: var(--ptit-primary); }
.nav-pills .nav-link { color: var(--ptit-text); border-radius: 8px; }
.user-avatar { background: linear-gradient(135deg, #c4161c, #e0484d); font-weight: 600; }
.text-primary { color: var(--ptit-primary) !important; }
.bg-light-primary { background: var(--ptit-primary-soft) !important; }

/* thẻ */
.page-content .card { border: 1px solid var(--ptit-border); border-radius: 12px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.page-content .card-header { padding: 14px 18px; border-bottom: 1px solid var(--ptit-border); }
.card-header h6 { font-size: 15px; color: var(--ptit-ink); }
.kpi-card .kpi-label { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ptit-muted); }
.kpi-card .kpi-value { color: var(--ptit-ink); }

/* tiêu đề trang */
.page-head { display: flex; align-items: center; gap: 12px; }
.page-head .ph-ic { width: 42px; height: 42px; border-radius: 10px; background: var(--ptit-primary-soft); color: var(--ptit-primary); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.page-head h5 { font-size: 20px; font-weight: 600; letter-spacing: -.01em; color: var(--ptit-ink); }
.page-head .ph-sub { font-size: 13px; color: var(--ptit-muted); margin-top: 2px; }

/* bảng */
.page-content .table > thead th { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ptit-muted); background: #f8fafc; border-bottom: 1px solid var(--ptit-border); padding-top: 10px; padding-bottom: 10px; white-space: nowrap; }
.page-content .table > tbody td { border-color: #eef1f5; color: var(--ptit-text); }
.page-content .table > tbody tr:hover > td { background: #fafbfc; }
.badge-soft { border-radius: 6px; padding: 4px 8px; font-size: 11.5px; }

/* sidebar */
.sidebar-wrapper .menu-label { font-size: 11px; letter-spacing: .06em; color: #94a3b8; }
.sidebar-wrapper .menu-label i { color: var(--ptit-primary); }
.sidebar-wrapper .textmenu .list-group .menu-group .list-group-item { border-radius: 8px; margin: 1px 8px; padding: 8px 12px; color: var(--ptit-text); font-size: 13.5px; }
.sidebar-wrapper .textmenu .list-group .menu-group .list-group-item i { color: #94a3b8; margin-right: 8px; }
.sidebar-wrapper .textmenu .list-group .menu-group .list-group-item:hover { background: #f5f6f8; }
.sidebar-wrapper .textmenu .list-group .menu-group .list-group-item.active { color: var(--ptit-primary); background: var(--ptit-primary-soft); font-weight: 600; box-shadow: inset 3px 0 0 var(--ptit-primary); }
.sidebar-wrapper .textmenu .list-group .menu-group .list-group-item.active i { color: var(--ptit-primary); }

/* thẻ lối tắt trang chủ */
.home-card { border: 1px solid var(--ptit-border) !important; transition: transform .12s, border-color .15s, box-shadow .15s; }
.home-card:hover { transform: translateY(-2px); border-color: #e39a9d !important; box-shadow: 0 8px 20px rgba(196, 22, 28, .08); }
.home-ic { width: 40px; height: 40px; border-radius: 10px; font-size: 19px; }

/* trợ lý: chip, gợi ý dùng màu thương hiệu */
.as-chip, .hero-preset { border-color: #f1c4c6; color: var(--ptit-primary); }
.as-chip:hover, .hero-preset:hover { background: var(--ptit-primary-soft); }
.role-chip { background: var(--ptit-primary-soft); color: var(--ptit-primary); }
.cite { background: var(--ptit-primary-soft) !important; color: var(--ptit-primary) !important; }
.pm-tab.active { background: var(--ptit-primary); border-color: var(--ptit-primary); }
.pm-table th.pm-col button:hover { background: var(--ptit-primary-soft); color: var(--ptit-primary); }
.sv-card { border: 1px solid var(--ptit-border); }
.sv-card .kpi-value { color: var(--ptit-primary); }

/* lối tắt: một dòng, tự co giãn theo màn hình */
.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.quick-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #fff; border: 1px solid var(--ptit-border); border-radius: 12px;
  text-decoration: none; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); transition: transform .12s, border-color .15s, box-shadow .15s; }
.quick-card:hover { transform: translateY(-2px); border-color: #e39a9d; box-shadow: 0 8px 20px rgba(196, 22, 28, .08); }
.quick-card .home-ic { width: 38px; height: 38px; font-size: 18px; }
.quick-card .qt { display: block; font-weight: 600; font-size: 13.5px; color: var(--ptit-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quick-card .qs { display: block; font-size: 12px; color: var(--ptit-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quick-card .qa { margin-left: auto; color: #cbd5e1; }
.quick-card:hover .qa { color: var(--ptit-primary); }

/* thẻ chào: thu gọn trên màn hẹp */
@media (max-width: 991px) { .hero-card .card-body { gap: 12px !important; } .hero-title { font-size: 18px; } }
@media (max-width: 575px) {
  .page-head .ph-ic { width: 36px; height: 36px; font-size: 17px; }
  .page-head h5 { font-size: 17px; }
  .hero-ask { flex-wrap: wrap; } .hero-ask > i { display: none; } .hero-ask .btn { width: 100%; }
  .page-content > .d-flex > input.form-control, .page-content > .d-flex > .form-select, .page-content > .d-flex > .btn { flex: 1 1 calc(50% - 4px); width: auto !important; min-width: 0; }
}

/* bảng thành thẻ trên điện thoại (data-label gắn bởi ptit-core.js) */
@media (max-width: 639px) {
  .page-content table.rt { min-width: 0 !important; width: 100% !important; }
  .page-content table.rt > thead { display: none; }
  .page-content table.rt > tbody > tr { display: block; border-bottom: 1px solid #e9ecef; padding: 10px 14px; }
  .page-content table.rt > tbody > tr > td { display: grid; grid-template-columns: minmax(0, 38%) minmax(0, 1fr); column-gap: 12px; align-items: start; justify-items: end;
    padding: 4px 0 !important; border: 0 !important; text-align: right; white-space: normal !important; overflow-wrap: anywhere; }
  .page-content table.rt > tbody > tr > td::before { content: attr(data-label); justify-self: start; text-align: left; font-size: 11px; font-weight: 600;
    letter-spacing: .03em; text-transform: uppercase; color: var(--ptit-muted); }
  .page-content table.rt > tbody > tr > td > * { grid-column: 2; max-width: 100%; min-width: 0; }
  .page-content table.rt > tbody > tr > td:is([data-label=""], :not([data-label])) { grid-template-columns: minmax(0, 1fr); }
  .page-content table.rt > tbody > tr > td:is([data-label=""], :not([data-label]))::before { display: none; }
  .page-content table.rt > tbody > tr > td:is([data-label=""], :not([data-label])) > * { grid-column: 1; }
  .page-content table.rt > tbody > tr > td.empty-state { display: block; text-align: center; }
}

.quick-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.quick-card .qt { white-space: normal; line-height: 1.25; }
@media (max-width: 1499.98px) {                    /* màn HD: biểu tượng trên, tên dưới, đủ chữ trên một hàng 6 thẻ */
  .quick-grid { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; }
  .quick-card { flex-direction: column; justify-content: center; text-align: center; gap: 6px; padding: 12px 8px; }
  .quick-card .qa { display: none; }
  .quick-card .qt { font-size: 13px; }
}
@media (max-width: 1599.98px) { .col-unit { display: none; } }

/* bảng markdown trong câu trả lời */
.as-bubble .md-tbl { margin: 8px 0; max-width: 100%; overflow-x: auto; }
.as-bubble .md-tbl table { font-size: 12.5px; margin: 0; min-width: 260px; }
.as-bubble .md-tbl th { background: #f8fafc; font-weight: 600; font-size: 11.5px; text-transform: none; letter-spacing: 0; color: var(--ptit-text); white-space: nowrap; }
.as-bubble .md-tbl td, .as-bubble .md-tbl th { padding: 5px 9px; border-color: #eef1f5; }

/* nhãn vai trò trên thẻ chào: màu đặc, chữ trắng */
.hero-role { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 4px 12px; border-radius: 999px; color: #fff; background: var(--ptit-primary); box-shadow: 0 2px 6px rgba(196, 22, 28, .25); }
.hero-role.r-student { background: #16a34a; box-shadow: 0 2px 6px rgba(22, 163, 74, .25); }
.hero-role.r-lecturer, .hero-role.r-advisor { background: #2563eb; box-shadow: 0 2px 6px rgba(37, 99, 235, .25); }
.hero-role.r-head_dept, .hero-role.r-vice_dean, .hero-role.r-dean { background: #c2410c; box-shadow: 0 2px 6px rgba(194, 65, 12, .25); }
.hero-role.r-staff { background: #0e7490; } .hero-role.r-leader { background: #6d28d9; } .hero-role.r-admin { background: #b91c1c; }

/* bộ lọc người dùng: nhóm + đơn vị / bộ môn / lớp / vai trò */
.ufilter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--ptit-border); background: #fff; border-radius: 12px 12px 0 0; }
.ufilter .form-select { width: auto; min-width: 140px; max-width: 240px; }
.ufilter .seg { display: inline-flex; padding: 3px; background: #f1f5f9; border-radius: 10px; gap: 2px; }
.ufilter .seg button { border: 0; background: transparent; color: var(--ptit-text); font-size: 13px; font-weight: 500; padding: 5px 12px; border-radius: 8px; }
.ufilter .seg button span { font-size: 11.5px; color: var(--ptit-muted); margin-left: 4px; }
.ufilter .seg button.active { background: #fff; color: var(--ptit-primary); box-shadow: 0 1px 3px rgba(15, 23, 42, .1); }
.ufilter .seg button.active span { color: var(--ptit-primary); }
.page-head .ph-sub:empty { display: none; }
@media (max-width: 639px) { .ufilter .seg { width: 100%; } .ufilter .seg button { flex: 1; padding: 5px 6px; } .ufilter .form-select { flex: 1 1 calc(50% - 4px); max-width: none; min-width: 0; } }

.hero-clock { min-width: 150px; }
.hero-clock .t { display: flex; align-items: baseline; }
.hero-clock .sec { font-size: 16px; font-weight: 500; opacity: .75; margin-left: 1px; }
.hero-clock .d { display: flex; align-items: center; gap: 6px; }
.hero-clock .live { width: 6px; height: 6px; border-radius: 50%; background: #86efac; animation: livepulse 1.6s ease-in-out infinite; }
@keyframes livepulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

/* thông tin tài khoản */
.pf-head { background: linear-gradient(120deg, #fff, #fdf3f3); }
.pf-title { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--ptit-muted); margin-bottom: 8px; }
.pf-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed #eef1f5; font-size: 13px; }
.pf-row span { color: var(--ptit-muted); white-space: nowrap; }
.pf-row b { font-weight: 500; color: var(--ptit-ink); text-align: right; overflow-wrap: anywhere; }

/* danh sách văn bản kèm link trong câu trả lời */
.doc-links { margin-top: 8px; border: 1px solid var(--ptit-border); border-radius: 10px; overflow: hidden; max-height: 340px; overflow-y: auto; }
.doc-link { display: grid; grid-template-columns: 26px 1fr auto 16px; gap: 8px; align-items: center; padding: 7px 10px; font-size: 12.5px; color: var(--ptit-text); text-decoration: none; border-bottom: 1px solid #f1f3f6; }
.doc-link:last-child { border-bottom: 0; }
.doc-link:hover { background: var(--ptit-primary-soft); color: var(--ptit-primary); }
.doc-link .n { width: 22px; height: 22px; border-radius: 6px; background: #f1f5f9; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; }
.doc-link .m { font-size: 11.5px; color: var(--ptit-muted); white-space: nowrap; }
.doc-link i { color: #94a3b8; font-size: 12px; }

/* đường link trong câu trả lời: xanh, gạch chân, mở thẻ mới */
.as-bubble a.md-link { color: #1d4ed8; text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.as-bubble a.md-link:hover { color: #1e3a8a; }
.as-bubble a.md-link::after { content: "\2197"; font-size: 10px; margin-left: 2px; text-decoration: none; display: inline-block; }
.doc-link .t { color: #1d4ed8; text-decoration: underline; text-underline-offset: 2px; }

.as-text .think { font-size: 12.5px; color: var(--ptit-muted); margin-top: 6px; display: flex; align-items: center; gap: 8px; }
.as-text .think::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #f1c4c6; border-top-color: var(--ptit-primary); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* chỉnh sửa đơn như Word */
.doc-toolbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.doc-toolbar .tools { display: inline-flex; align-items: center; gap: 2px; padding: 2px 4px; border: 1px solid var(--ptit-border); border-radius: 8px; background: #fff; }
.doc-toolbar .tools button { border: 0; background: transparent; width: 30px; height: 28px; border-radius: 6px; color: var(--ptit-text); }
.doc-toolbar .tools button:hover { background: var(--ptit-primary-soft); color: var(--ptit-primary); }
.doc-toolbar .tools .sep { width: 1px; height: 18px; background: var(--ptit-border); margin: 0 3px; }
#editDoc.active { background: var(--ptit-primary); color: #fff; }
.doc-preview.editing { outline: 2px dashed #e39a9d; outline-offset: 4px; cursor: text; }
.doc-preview table { border-collapse: collapse; width: 100%; margin: 6px 0; font-size: 13px; }
.doc-preview th, .doc-preview td { border: 1px solid #333; padding: 3px 6px; }
#editor.locked { opacity: .55; pointer-events: none; position: relative; }

.my-doc { padding: 12px 16px; } .my-doc:hover { background: #fafbfc; }
#editFoot #saveState { margin-right: auto; }
