/* Workspace Tab Rail (Phase 2) — tab của workspace đang mở hiện ở rail trái */
body.ws-tabmode .app-sidebar .sidebar-nav { display: none; }   /* danh sách workspace đã vào ⊞ launcher */
.ws-tabrail { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-bottom: 6px; }
.ws-tabrail::-webkit-scrollbar { width: 6px; }
.ws-tabrail::-webkit-scrollbar-thumb { background: #4b5563; border-radius: 3px; }
.wtr-app { display: flex; align-items: center; gap: 9px; padding: 11px 14px 9px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 6px; }
.wtr-app-ic { font-size: 19px; flex-shrink: 0; }
.wtr-app-nm { font-size: 13px; font-weight: 800; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wtr-list { display: flex; flex-direction: column; gap: 1px; }
.wtr-item { display: flex; align-items: center; gap: 11px; padding: 9px 15px; background: transparent; border: none; border-left: 3px solid transparent; color: #cbd5e1; cursor: pointer; font-size: 13.5px; text-align: left; width: 100%; }
.wtr-item:hover { background: #374151; color: #fff; }
.wtr-item.active { background: #1f2937; color: #fff; border-left-color: #6366f1; font-weight: 700; }
.wtr-ic { width: 20px; text-align: center; font-size: 16px; flex-shrink: 0; }
.wtr-lb { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Kho vận: ★ yêu thích + kéo thả sắp xếp (super_admin) */
.wtr-star { margin-left: auto; flex-shrink: 0; font-size: 15px; line-height: 1; color: #8a94a6; opacity: .55; cursor: pointer; padding: 2px 4px; border-radius: 4px; transition: opacity .12s, color .12s; }
.wtr-item:hover .wtr-star { opacity: 1; }
.wtr-star.on { opacity: 1; color: #f5c518; }
.wtr-star:hover { color: #f5c518; background: rgba(255,255,255,.08); }
body.ws-sidebar-collapsed .wtr-star { display: none; }
.wtr-item[draggable="true"] { cursor: grab; }
.wtr-item.wtr-dragging { opacity: .4; }
.wtr-item.wtr-over { box-shadow: inset 0 2px 0 #6366f1; }
/* Rail mini + RÊ CHUỘT bung (ĐẨY nội dung sang phải, không đè); rê ra tự thu. ☰ ẩn. */
.app-sidebar .sidebar-toggle { display: none !important; }
body.ws-sidebar-collapsed .wtr-app-nm,
body.ws-sidebar-collapsed .wtr-lb { display: none; }
body.ws-sidebar-collapsed .wtr-item,
body.ws-sidebar-collapsed .wtr-app { justify-content: center; padding-left: 0; padding-right: 0; }
body.ws-sidebar-collapsed.ws-rail-hover { margin-left: var(--ws-sidebar-width, 220px); }
body.ws-sidebar-collapsed.ws-rail-hover .app-sidebar { width: var(--ws-sidebar-width, 220px); }
body.ws-sidebar-collapsed.ws-rail-hover .wtr-app-nm,
body.ws-sidebar-collapsed.ws-rail-hover .wtr-lb { display: inline; }
body.ws-sidebar-collapsed.ws-rail-hover .wtr-item,
body.ws-sidebar-collapsed.ws-rail-hover .wtr-app { justify-content: flex-start; padding-left: 15px; padding-right: 15px; }
body.ws-sidebar-collapsed.ws-rail-hover .sidebar-brand { opacity: 1 !important; pointer-events: auto; }
/* khối account đáy rail: sidebar.css ẩn opacity khi collapsed nhưng thiếu rule bung khi rê chuột
   → tên + role user mất hẳn dù rail đã mở (avatar không dính rule đó nên vẫn hiện) */
body.ws-sidebar-collapsed.ws-rail-hover .account-info,
body.ws-sidebar-collapsed.ws-rail-hover .account-caret { opacity: 1; pointer-events: auto; }
/* nút "Báo lỗi / Yêu cầu" (bug-report.js chèn vào #sidebar-account, trên account-trigger).
   Rail mặc định THU GỌN 56px nên nút phải có bản chỉ-icon: style inline full-width cũ làm chữ
   gãy 4 dòng, nút cao 105px, icon + chữ tràn ra ngoài, ăn 33px chiều cao rail (cắt tab cuối). */
#bugrep-fab.bugrep-side {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: calc(100% - 16px); margin: 0 8px 8px; padding: 9px 12px;
  border: none; border-radius: 9px; background: #dc2626; color: #fff;
  font-family: inherit; font-size: 13px; font-weight: 700; line-height: 1.25;
  white-space: nowrap; cursor: pointer; box-shadow: 0 2px 6px rgba(220,38,38,.3);
}
#bugrep-fab.bugrep-side:hover { filter: brightness(1.08); }
#bugrep-fab.bugrep-side .bugrep-ic { font-size: 15px; line-height: 1; flex-shrink: 0; }
/* thu gọn: ô vuông 40px chỉ còn icon, canh đúng cột icon của rail (nhãn .wtr-lb tự ẩn theo rule trên) */
body.ws-sidebar-collapsed #bugrep-fab.bugrep-side { width: 40px; margin: 0 auto 8px; padding: 9px 0; }
/* rê chuột bung rail: trả lại nút full ngang, chữ đủ 1 dòng */
body.ws-sidebar-collapsed.ws-rail-hover #bugrep-fab.bugrep-side { width: calc(100% - 16px); margin: 0 8px 8px; padding: 9px 12px; }
/* khối account khi thu gọn: bỏ padding ngang để nút + avatar 32px (không co được) nằm ĐÚNG tâm rail.
   sidebar.css chỉ ẩn tên + caret bằng opacity → chúng VẪN chiếm chỗ, đẩy avatar lệch khỏi tâm;
   phải display:none mới thật sự nhả layout, rê chuột bung thì trả lại. */
body.ws-sidebar-collapsed .sidebar-account { padding-left: 8px; padding-right: 8px; }
body.ws-sidebar-collapsed .account-trigger { padding-left: 0; padding-right: 0; justify-content: center; }
body.ws-sidebar-collapsed .account-info,
body.ws-sidebar-collapsed .account-caret { display: none; }
body.ws-sidebar-collapsed.ws-rail-hover .sidebar-account { padding-left: 12px; padding-right: 12px; }
body.ws-sidebar-collapsed.ws-rail-hover .account-trigger { padding-left: 10px; padding-right: 10px; justify-content: flex-start; }
body.ws-sidebar-collapsed.ws-rail-hover .account-info { display: flex; }
body.ws-sidebar-collapsed.ws-rail-hover .account-caret { display: inline; }
/* ẩn thanh tab gốc trong content (đã mirror sang rail trái) */
.wtr-src-hidden { display: none !important; }

/* 3 kho (warehouse domain) mirror lên rail trái — trên các tab */
.wtr-domwrap { display: flex; flex-direction: column; gap: 1px; padding-bottom: 6px; margin-bottom: 6px; border-bottom: 1px solid rgba(255,255,255,.08); }
.wtr-domhd { font-size: 10px; font-weight: 700; letter-spacing: .6px; color: #94a3b8; padding: 5px 15px 2px; text-transform: uppercase; }
.wtr-dom.active { background: rgba(220,38,38,.2); color: #fff; border-left-color: #dc2626; }
body.ws-sidebar-collapsed .wtr-domhd { display: none; }
.wtr-grouphd { font-size: 10px; font-weight: 700; letter-spacing: .6px; color: #94a3b8; padding: 9px 15px 3px; text-transform: uppercase; }
.wtr-list > .wtr-grouphd:first-child { padding-top: 2px; }
body.ws-sidebar-collapsed .wtr-grouphd { display: none; }

/* SVG icon (RTM OS tab) trong rail: size + stroke trắng */
.wtr-ic svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
