/* sidebar-compact.css — Sidebar trái kiểu gọn (260px, chữ 13px, có hiệu ứng). Nạp SAU cv.css. HTML/CSS thuần, không phụ thuộc Tailwind. */
:root {
  --side-w: 260px;
  --sb-bg: #ffffff; --sb-line: #e2e8f0; --sb-text: #334155; --sb-icon: #64748b;
  --sb-hover-bg: #f8fafc; --sb-sep: #f1f5f9; --sb-brand: #991b1b;
}
:root[data-theme="dark"] {
  --sb-bg: var(--surface); --sb-line: var(--line); --sb-text: var(--ink-2); --sb-icon: var(--muted);
  --sb-hover-bg: var(--bg-soft); --sb-sep: var(--line-2); --sb-brand: #b91c1c;
}

/* Khung */
.cv-side { width: var(--side-w); background: var(--sb-bg); border-right: 1px solid var(--sb-line); }
.cv-brand { padding: 0 10px 0 12px; gap: 10px; border-bottom-color: var(--sb-line); }
.cv-logo { width: 34px; height: 34px; }
/* Tiêu đề không bao giờ bị cắt "...": thiếu chỗ thì xuống dòng */
.cv-brand-title { font-size: 12.5px; font-weight: 800; line-height: 1.2; white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
.cv-brand-sub { font-size: 11px; white-space: normal; overflow: visible; text-overflow: clip; }
.cv-nav { padding: 6px 10px 8px; gap: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
.cv-nav::-webkit-scrollbar { width: 4px; }
.cv-nav::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
.cv-nav > *, .cv-nav .el-nav-sub > * { flex: none; }   /* không để flex ép thấp hơn 36px: thiếu chỗ thì thanh menu tự cuộn */

/* Nhóm: bỏ tiêu đề chữ hoa, dùng đường kẻ mảnh */
.cv-nav-group { display: none; }
.cv-nav-sep { height: 0; margin: 4px 10px; border: 0; border-top: 1px solid var(--sb-sep); flex: none; }

/* Mục menu */
.cv-nav .sidebar-link, .cv-nav .el-nav-parent {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 32px; margin: 0 0 1px; padding: 5px 10px;
  border: 0; border-radius: 6px; background: transparent; color: var(--sb-text);
  font: inherit; font-size: 12.5px; font-weight: 500; line-height: 1.2; text-align: left; text-decoration: none; cursor: pointer;
  box-shadow: none; transition: all .2s ease;
}
.cv-nav .sidebar-link > span:not(.sidebar-icon):not(.cv-nav-badge):not(.cv-nav-ext), .cv-nav .el-nav-parent > span:not(.sidebar-icon):not(.el-nav-chev) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-nav .sidebar-icon { width: 16px; height: 16px; font-size: 16px; color: var(--sb-icon); flex: none; transition: all .2s ease; }
.cv-nav .sidebar-link > span:not(.cv-nav-badge):not(.cv-nav-ext), .cv-nav .el-nav-parent > span:not(.el-nav-chev) { transition: transform .2s ease; }
.cv-nav .sidebar-icon .cv-svg, .cv-nav .sidebar-icon svg { width: 16px; height: 16px; stroke-width: 1.75; }
.cv-nav .sidebar-link:hover:not(.active), .cv-nav .el-nav-parent:hover { padding-left: 10px; background: var(--sb-hover-bg); color: var(--sb-brand); }
.cv-nav .sidebar-link:hover:not(.active) .sidebar-icon, .cv-nav .el-nav-parent:hover .sidebar-icon { color: var(--sb-brand); }
/* Rê chuột: icon và chữ nhích nhẹ sang phải (không đẩy nền, không đẩy huy hiệu) */
.cv-nav .sidebar-link:hover:not(.active) > span:not(.cv-nav-badge):not(.cv-nav-ext), .cv-nav .el-nav-parent:hover > span:not(.el-nav-chev) { transform: translateX(3px); }
.cv-nav .sidebar-link.active { background: var(--sb-brand); color: #fff; font-weight: 600; box-shadow: none; }
.cv-nav .sidebar-link.active .sidebar-icon { color: #fff; }
[data-theme="dark"] .cv-nav .sidebar-link.active { color: #fff; }
.cv-nav .sidebar-link:focus-visible, .cv-nav .el-nav-parent:focus-visible { outline: 2px solid var(--sb-brand); outline-offset: 1px; }

/* Huy hiệu số và biểu tượng liên kết ngoài */
.cv-nav-badge { height: 18px; min-width: 20px; padding: 0 6px; font-size: 10.5px; border-radius: 9px; }
.cv-nav .sidebar-link.active .cv-nav-badge { background: rgba(255, 255, 255, .22); color: #fff; }
.cv-nav-ext { font-size: 12px; }
.cv-nav .sidebar-link.active .cv-nav-ext { color: rgba(255, 255, 255, .8); }

/* Menu đa cấp (E-Learning & Đào tạo) */
.cv-nav .el-nav-parent.has-active { color: var(--sb-brand); font-weight: 600; }
.cv-nav .el-nav-parent.has-active .sidebar-icon { color: var(--sb-brand); }
.cv-nav .el-nav-chev { margin-left: auto; width: 12px; height: 12px; font-size: 12px; color: var(--sb-icon); transition: transform .3s cubic-bezier(.4, 0, .2, 1); }
.cv-nav .el-nav-chev .cv-svg, .cv-nav .el-nav-chev svg { width: 12px; height: 12px; stroke-width: 2; }
.cv-nav .el-nav-parent[aria-expanded="true"] .el-nav-chev { transform: rotate(180deg); }
.cv-nav .el-nav-sub { display: flex; flex-direction: column; gap: 0; margin: 0; padding-left: 22px; margin-top: 1px; max-height: 0; opacity: 0; overflow: hidden; visibility: hidden;
  transition: max-height .3s cubic-bezier(.4, 0, .2, 1), opacity .3s cubic-bezier(.4, 0, .2, 1), visibility 0s linear .3s; }
.cv-nav .el-nav-sub.open { max-height: 150px; opacity: 1; visibility: visible; transition-delay: 0s; }
.cv-nav .el-nav-sub .sidebar-link { height: 30px; margin-bottom: 1px; padding: 4px 10px; font-size: 12px; }
.cv-nav .el-nav-sub .sidebar-link:hover:not(.active) { padding-left: 10px; }
.cv-nav .el-nav-sub .sidebar-link::before { content: none; }

/* Chân sidebar */
.cv-side-foot { padding: 8px 10px 6px; border-top-color: var(--sb-sep); }
/* Nút hỗ trợ: 1 hàng mảnh cao 36px */
.cv-side-foot .cv-help { height: 36px; padding: 6px 12px; gap: 8px; border-radius: 8px; border: 1px solid var(--sb-line); background: #f8fafc; font-size: 12.5px; font-weight: 600; color: var(--sb-text); }
.cv-side-foot .cv-help:hover { border-color: #cbd5e1; background: #f1f5f9; }
.cv-side-foot .cv-help-ic { width: 16px; height: 16px; flex: none; border: 0; background: transparent; border-radius: 0; color: #dc2626; font-size: 16px; display: grid; place-items: center; }
.cv-side-foot .cv-help-ic .cv-svg, .cv-side-foot .cv-help-ic svg { width: 16px; height: 16px; stroke-width: 1.75; }
[data-theme="dark"] .cv-side-foot .cv-help { background: var(--bg-soft); }
.cv-side-ver { margin-top: 4px !important; font-size: 10.5px; line-height: 1.2; }

@media (prefers-reduced-motion: reduce) { .cv-nav .sidebar-link, .cv-nav .el-nav-parent, .cv-nav .el-nav-chev, .cv-nav .sidebar-icon, .cv-nav .el-nav-sub, .cv-nav .sidebar-link > span, .cv-nav .el-nav-parent > span { transition: none !important; } .cv-nav .sidebar-link:hover > span, .cv-nav .el-nav-parent:hover > span { transform: none !important; } }
