/* ============================================================
   DOCK NAVIGATION — thanh điều hướng đáy (thay sidebar trái).
   Port từ design source ui_kits/web/DockBar.html (bản tái thiết kế: nhóm gộp thành nút + flyout,
   nhấn-giữ-kéo tùy biến). GLOBAL (icon render qua MarkupString không nhận scope attribute).
   Token dùng fallback inline. Component: Layout/DockNav.razor(.cs) · JS: wwwroot/js/dock-nav.js
   ============================================================ */

/* Chiều cao thanh dock (footer trong luồng) — 1 NGUỒN cho các overlay muốn nằm NGAY TRÊN dock
   (vd toast thông báo .ct-bottom-center). Desktop ~96px; mobile đổi trong @media 560px bên dưới. */
:root { --dock-h: 96px; }

/* Dock = FOOTER trong luồng (flex item cuối của .mud-layout app-shell), KHÔNG position:fixed nổi đè.
   → nội dung (.app-main-content) tự lấp đầy phần giữa, KHÔNG cần padding-bottom chừa chỗ. */
.dock-wrap {
    position: relative;            /* footer trong luồng; relative để flyout/popup mở-lên đè nội dung qua z-index */
    flex: 0 0 auto;
    z-index: 1300;
    display: flex; justify-content: center;
    padding: 8px 12px;            /* đệm quanh pill nổi */
    pointer-events: auto;
    opacity: 0; transition: opacity .15s ease;
}
.dock-wrap.dock-ready { opacity: 1; }

/* ── Flyout nhóm / popup chuông ĐANG MỞ → nâng CẢ .dock-wrap lên TRÊN snackbar (1500) ───────────────
   Snackbar MudBlazor (#mud-snackbar-container, z 1500) neo GIỮA-DƯỚI ngay trên dock ⇒ CÙNG vùng dọc với
   flyout nhóm (.dock-gpop) và popup chuông (.dock-notif-pop) mở-lên. Hai popup này là CON của .dock-wrap
   mà .dock-wrap có position:relative + z-index:1300 = STACKING CONTEXT → mọi z-index bên trong (dock-gpop
   z40, dock-notif-pop z61…) bị KẸP dưới tầng 1300 khi so với body ⇒ luôn nằm SAU banner alert 1500: phải
   chờ alert tự ẩn mới thấy/bấm được dropdown (YC 2026-07-18).
   Sửa ĐÚNG cách: nâng chính .dock-wrap (GỐC stacking context) lên 1600 (> snackbar 1500, < toast realtime
   .ct-viewport 2000) → cả cây con trồi theo, KHÔNG phá tương quan nội bộ (pill/badge/scrim giữ nguyên).
   CHỈ nâng khi flyout/popup THỰC SỰ mở (hover/focus nhóm, hoặc chuông mở = .dock-notif-pop render) → lúc
   bình thường dock vẫn 1300, KHÔNG đội lên trên dialog/overlay (1400). Bar dock không đè lệch snackbar vì
   nằm THẤP hơn 14px (snackbar bottom = dock-h + 14px) — chỉ vùng popup mới chồng. */
.dock-wrap:has(.dock-group:hover),
.dock-wrap:has(.dock-group:focus-within),
.dock-wrap:has(.dock-notif-pop) {
    z-index: 1600;
}

.dock {
    position: relative; z-index: 1; pointer-events: auto;
    flex: 0 0 auto; max-width: 100%;
    display: flex; align-items: stretch; gap: 7px;
    padding: 8px 10px;
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-1, #e6e9ee);
    border-radius: 16px;
    box-shadow: 0 18px 50px -12px rgba(8, 24, 40, .28);   /* bóng nổi "floating" §2 */
}

/* pill nền trượt sau item/nhóm active */
.dock-pill {
    position: absolute; top: 8px; left: 0;
    height: calc(100% - 16px);
    background: var(--brand-soft, #eaf1f8);
    box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--brand, #0a4174) 30%, transparent);
    border-radius: 11px;
    transition: transform .32s cubic-bezier(.16,1,.3,1), width .32s cubic-bezier(.16,1,.3,1), opacity .2s ease;
    pointer-events: none; z-index: 0; opacity: 0;
}

.dock-item {
    position: relative; z-index: 1;
    flex: 0 0 auto; min-width: 54px; max-width: 140px;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 9px 8px 8px;
    border: 0; background: none; cursor: pointer;
    border-radius: 10px;
    color: var(--fg-3, #6b7280);
    font-family: inherit;
    text-decoration: none;   /* tab mobile nay là <a> — bỏ gạch chân link */
    touch-action: none;   /* cho phép nhấn-giữ-kéo bằng pointer mà không cuộn trang */
    transition: color .2s ease, background .14s ease, transform .18s cubic-bezier(.16,1,.3,1);
}
.dock-item:hover { color: var(--fg-1, #0f172a); background: var(--bg-sunken, #f1f5f9); transform: translateY(-3px); }
.dock-item:active { transform: translateY(-1px); }
.dock-item.is-active { color: var(--brand, #0a4174); }
.dock-item.is-active:hover { background: transparent; }
.dock-item:focus-visible, .dock-group-btn:focus-visible, .dock-pop-item:focus-visible {
    outline: 2px solid var(--brand, #0a4174); outline-offset: 2px;
}

.dock-icon { display: flex; align-items: center; justify-content: center; position: relative; }
.dock-icon svg {
    width: 28px; height: 28px; stroke-width: 1.2;
    transition: transform .28s cubic-bezier(.16,1,.3,1);
}
.dock-item:hover .dock-icon svg { transform: scale(1.12); }
.dock-item.is-active .dock-icon svg { transform: translateY(-1px) scale(1.06); }

/* badge thông báo trên icon */
.dock-badge {
    position: absolute; top: -5px; left: calc(50% + 7px);
    min-width: 16px; height: 16px; padding: 0 4px;
    display: flex; align-items: center; justify-content: center;
    background: var(--brand, #0a4174); color: #fff;
    font-size: 10px; font-weight: 600; line-height: 1; border-radius: 999px;
    box-shadow: 0 0 0 2px var(--bg-surface, #fff);
    pointer-events: none;
}
.dock-opt-dots { position: relative; }
.dock-opt-dots .dock-badge { top: -7px; left: calc(50% + 6px); }
/* Badge chuông Thông báo = SỐ chưa đọc nền ĐỎ (ngôn ngữ cảnh báo, theo mẫu tabbar FB 2026-07-12) —
   badge navy giữ cho workload các tab khác. */
.dock-notif .dock-badge { background: var(--error-600, #e5484d); }

/* Chấm đỏ (không số) — "có nội dung mới" (vd trao đổi chưa đọc ở mục Công việc). HIỂN THỊ ĐỘC LẬP, SONG SONG
   với SỐ badge workload: số neo top-RIGHT glyph (left: 50%+7px), chấm neo top-LEFT (right: 50%+7px) → không đè. */
.dock-dot {
    position: absolute; top: -3px; right: calc(50% + 7px);
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--error-600, #e5484d);
    box-shadow: 0 0 0 2px var(--bg-surface, #fff);
    pointer-events: none;
}

.dock-label {
    font-size: 11.5px; font-weight: 600; line-height: 1.15;
    text-align: center; max-width: 134px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* tooltip — tên đầy đủ (desktop) */
.dock-tip {
    position: absolute; bottom: calc(100% + 11px); left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: 5px 10px; border-radius: 8px;
    background: var(--slate-800, #1f2937); color: #fff;
    font-size: 12px; font-weight: 600; white-space: nowrap;
    box-shadow: 0 8px 20px -6px rgba(8,24,40,.5);
    opacity: 0; pointer-events: none; z-index: 30;
    transition: opacity .13s ease, transform .13s ease;
}
.dock-tip::after {
    content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
    border: 5px solid transparent; border-top-color: var(--slate-800, #1f2937);
}
.dock-item:hover .dock-tip { opacity: 1; transform: translateX(-50%) translateY(0); }

.dock-sep {
    flex: 0 0 auto; width: 1px; margin: 8px 7px; align-self: stretch;
    background: var(--border-1, #e6e9ee);
}

/* Hiệu ứng NHẤN-GIỮ: item "lún nhẹ" báo đã bắt được, sẵn sàng kéo (áp cho tab thanh + item flyout).
   !important để thắng transform của :hover (translateY) trên dock-item. */
.dock-item.dock-held, .dock-pop-item.dock-held {
    transform: scale(.92) !important;
    transition: transform .12s cubic-bezier(.16,1,.3,1) !important;
}
.dock-item.dock-held { background: var(--bg-sunken, #f1f5f9); }
.dock-pop-item.dock-held { background: var(--bg-sunken, #f1f5f9); }

/* "Vừa ghim vào dock" — nhịp NHẸ ~1s: nảy nhẹ + nền brand mờ dần + vòng sáng + nhãn brand */
@keyframes dock-pin {
    0%   { transform: translateY(0) scale(1);      background: var(--brand-soft, #eaf1f8); }
    24%  { transform: translateY(-5px) scale(1.09); background: var(--brand-soft, #eaf1f8); }
    100% { transform: translateY(0) scale(1);      background: transparent; }
}
@keyframes dock-pin-ring {
    0%   { box-shadow: 0 0 0 0 var(--brand, #0a4174); opacity: .45; }
    100% { box-shadow: 0 0 0 11px transparent; opacity: 0; }
}
.dock-item.just-added { animation: dock-pin 1s cubic-bezier(.16,1,.3,1); }
.dock-item.just-added .dock-icon::after {
    content: ''; position: absolute; inset: -4px; border-radius: 10px;
    animation: dock-pin-ring .9s cubic-bezier(.16,1,.3,1) forwards;
}
.dock-item.just-added .dock-label { color: var(--brand, #0a4174); }

/* ── Item NHÓM (gộp) + flyout hover ── */
.dock-group { position: relative; z-index: 2; flex: 0 0 auto; display: flex; }
.dock-group-label { display: inline-flex; align-items: center; gap: 3px; }
.dock-group-label svg { opacity: .65; transition: transform .2s ease; flex: 0 0 auto; }
.dock-group:hover .dock-group-label svg,
.dock-group:focus-within .dock-group-label svg { transform: rotate(180deg); opacity: 1; }
.dock-group:hover .dock-group-btn,
.dock-group:focus-within .dock-group-btn { color: var(--fg-1, #0f172a); background: var(--bg-sunken, #f1f5f9); }
.dock-group-btn.is-active { color: var(--brand, #0a4174); }

.dock-gpop {
    position: absolute; bottom: calc(100% + 11px); left: 0;   /* canh LỀ TRÁI theo mép trái nút (không canh giữa) */
    width: max-content; min-width: 208px; max-width: min(320px, calc(100vw - 24px));
    background: var(--bg-surface, #fff);
    border: 1px solid var(--border-1, #e6e9ee);
    border-radius: 14px;
    box-shadow: 0 18px 50px -12px rgba(8, 24, 40, .28);
    padding: 6px;
    opacity: 0; transform: translateY(8px) scale(.98);
    transform-origin: bottom left;
    pointer-events: none; z-index: 40;
    transition: opacity .22s cubic-bezier(.16,1,.3,1) .2s, transform .22s cubic-bezier(.16,1,.3,1) .2s;
}
.dock-group:hover .dock-gpop,
.dock-group:focus-within .dock-gpop {
    opacity: 1; transform: translateY(0) scale(1); pointer-events: auto;
    transition-delay: 0s;
}
/* Flyout "Thêm" canh mép phải nút (tránh tràn) */
.dock-more .dock-gpop { left: auto; right: 0; transform: translateY(8px) scale(.98); transform-origin: bottom right; }
.dock-more:hover .dock-gpop,
.dock-more:focus-within .dock-gpop { transform: translateY(0) scale(1); }
.dock-more .dock-gpop::after { left: auto; right: 20px; transform: none; }
/* cầu nối vô hình để di chuột từ nút lên flyout không mất hover */
.dock-gpop::before { content: ''; position: absolute; top: 100%; left: 0; right: 0; height: 14px; }
/* mũi tên chỉ xuống nút nhóm — flyout canh trái nên mũi tên nằm ~giữa nút (≈34px từ mép trái) */
.dock-gpop::after {
    content: ''; position: absolute; top: 100%; left: 34px; transform: none;
    border: 7px solid transparent; border-top-color: var(--bg-surface, #fff);
    filter: drop-shadow(0 1px 0 var(--border-1, #e6e9ee));
}
.dock-gpop .dock-pop-label { padding: 6px 8px 5px; }
.dock-gpop-list { display: flex; flex-direction: column; gap: 1px; }
.dock-gpop-list .dock-pop-item { width: 100%; }

/* Flyout "Thêm" rộng hơn, cuộn lớp trong (không cắt mũi tên/cầu hover) */
.dock-gpop-wide { min-width: 264px; max-width: min(360px, calc(100vw - 24px)); padding: 6px; }
.dock-gpop-scroll { max-height: min(64vh, 520px); overflow-y: auto; overflow-x: hidden; }
.dock-more .dock-icon svg { stroke-width: 1.5; }

/* Scrollbar mảnh cho vùng cuộn popup (bám design mới DockBar.html) */
.dock-pop-scroll, .dock-gpop-scroll { scrollbar-width: thin; scrollbar-color: var(--border-2, #cbd5e1) transparent; }
.dock-pop-scroll::-webkit-scrollbar, .dock-gpop-scroll::-webkit-scrollbar { width: 3px; }
.dock-pop-scroll::-webkit-scrollbar-track, .dock-gpop-scroll::-webkit-scrollbar-track { background: transparent; }
.dock-pop-scroll::-webkit-scrollbar-thumb, .dock-gpop-scroll::-webkit-scrollbar-thumb { background: var(--border-2, #cbd5e1); border-radius: 999px; }
.dock-pop-scroll::-webkit-scrollbar-thumb:hover, .dock-gpop-scroll::-webkit-scrollbar-thumb:hover { background: var(--fg-4, #94a3b8); }

/* ── Item trong flyout / sheet (dùng chung desktop flyout + mobile sheet) ── */
.dock-pop-group { padding: 2px 4px; }
.dock-pop-label {
    font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    color: var(--fg-4, #9aa3af); padding: 6px 8px 3px;
}
.dock-pop-item {
    position: relative;
    /* justify-content:flex-start BẮT BUỘC: MudBlazor reset `button{justify-content:center}` (0,0,1)
       sẽ làm item canh giữa nếu không khai báo lại → chữ ngắn thụt vào, lệch cột. */
    display: flex; align-items: center; justify-content: flex-start; gap: 11px; min-width: 0;
    padding: 7px 9px; border: 0; background: none; cursor: pointer;
    border-radius: 9px; text-align: left; width: 100%;
    color: var(--fg-2, #334155); font-family: inherit;
    text-decoration: none;   /* mục sheet mobile nay là <a> — bỏ gạch chân link */
    transition: background .12s ease, color .12s ease;
}
.dock-pop-item:hover { background: var(--bg-sunken, #f1f5f9); color: var(--fg-1, #0f172a); }
.dock-pop-item.is-active { background: var(--brand-soft, #eaf1f8); color: var(--brand, #0a4174); }
.dock-pop-item svg { width: 21px; height: 21px; stroke-width: 1.3; flex: 0 0 auto; }
.dock-pop-item > span:not(.dock-pop-badge) {
    flex: 0 1 auto; min-width: 0;
    font-size: 14px; font-weight: 500; line-height: 1.2;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dock-pop-badge {
    margin-left: auto; flex: 0 0 auto;
    min-width: 20px; height: 20px; padding: 0 6px;
    display: flex; align-items: center; justify-content: center;
    background: var(--brand, #0a4174); color: #fff;
    font-size: 12px; font-weight: 600; line-height: 1; border-radius: 999px;
}
/* gợi ý "kéo để ghim" ở tiêu đề nhóm trong "Thêm" */
.dock-pin-hint {
    float: right; font-size: 9.5px; font-weight: 600; letter-spacing: 0; text-transform: none;
    color: var(--fg-4, #9aa3af); background: var(--bg-sunken, #f1f5f9); padding: 1px 6px; border-radius: 999px;
}

/* ── Nhấn-giữ-kéo tùy biến: ghost + hint + vạch chèn ── */
.dock-item.is-dragging-out, .dock-group.is-dragging-out { opacity: .35; }
.dock.is-customizing .dock-item:hover { transform: none; background: transparent; }
.dock.is-customizing .dock-gpop { display: none !important; }
/* item trong flyout (nhóm + "Thêm") kéo-ghim được → cấm cuộn-chạm khi nhấn-giữ-kéo */
.dock-gpop .dock-pop-item { touch-action: none; }

.dock-drag-ghost {
    position: fixed; z-index: 2000; left: 0; top: 0;
    transform: translate(-50%, -130%);
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 9px 13px; border-radius: 13px;
    background: var(--bg-surface, #fff); color: var(--fg-1, #0f172a);
    box-shadow: 0 14px 32px -8px rgba(8,24,40,.45); border: 1px solid var(--border-1, #e6e9ee);
    pointer-events: none; font-size: 11.5px; font-weight: 600;
}
.dock-drag-ghost svg { width: 24px; height: 24px; }
.dock-drag-ghost.is-removing {
    background: color-mix(in srgb, var(--error-600, #dc2626) 12%, var(--bg-surface, #fff));
    color: var(--error-600, #dc2626); border-color: var(--error-600, #dc2626);
}
.dock-drag-ghost.is-adding { border-color: var(--brand, #0a4174); color: var(--brand, #0a4174); background: var(--brand-soft, #eaf1f8); }
.dock-drag-ghost.is-reorder { border-color: var(--brand, #0a4174); }
.dock-drag-hint {
    position: fixed; left: 50%; bottom: 116px; transform: translateX(-50%);
    white-space: nowrap; padding: 7px 14px; border-radius: 999px;
    background: var(--fg-1, #0f172a); color: #fff; font-size: 12px; font-weight: 600;
    box-shadow: 0 18px 50px -12px rgba(8,24,40,.28); pointer-events: none; z-index: 2001;
}
.dock-drag-hint.is-armed { background: var(--error-600, #dc2626); }
.dock-drop-mark {
    position: absolute; top: 8px; bottom: 8px; width: 3px; border-radius: 2px;
    background: var(--brand, #0a4174); z-index: 6; pointer-events: none;
    box-shadow: 0 0 0 3px var(--brand-soft, #eaf1f8);
}

/* ── Nút Thông báo trong dock (góc phải) — bám design DockBar.html (DockNotif) ── */
.dock-sep-end { margin-left: 2px; }
.dock-notif { position: relative; z-index: 3; flex: 0 0 auto; display: flex; align-items: stretch; }
.dock-notif-btn { position: relative; }
.dock-notif-dot {   /* neo top-right của .dock-icon (cạnh chuông), giống cách .dock-badge bám icon */
    position: absolute; top: -2px; right: -2px;
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--error-600, #e5484d);
    box-shadow: 0 0 0 2px var(--bg-surface, #fff);
}
.dock-notif-scrim { position: fixed; inset: 0; z-index: 60; background: transparent; }
.dock-notif-pop { position: absolute; bottom: calc(100% + 12px); right: 0; z-index: 61; }
.dock-notif-pop .notif-menu {
    width: 420px; max-width: min(420px, calc(100vw - 24px));
    background: var(--bg-surface, #fff); border: 1px solid var(--border-1, #e6e9ee);
    border-radius: 16px; box-shadow: 0 18px 50px -12px rgba(8, 24, 40, .28); overflow: hidden;
}
/* Dải nắm kéo sheet — CHỈ mobile (desktop popover không có cử chỉ kéo → ẩn). */
.dock-notif-pop .notif-grab { display: none; }
.dock-notif-pop .notif-head { padding: 14px 16px 10px; border-bottom: 1px solid var(--border-1, #e6e9ee); }
.dock-notif-pop .notif-head-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dock-notif-pop .notif-title { font-size: 15px; font-weight: 700; color: var(--fg-1, #0f172a); display: flex; align-items: center; gap: 8px; }
.dock-notif-pop .notif-count { font-size: 11px; font-weight: 600; color: var(--brand, #0a4174); background: var(--brand-soft, #eaf1f8); padding: 2px 8px; border-radius: 999px; }
.dock-notif-pop .notif-head-actions { display: inline-flex; align-items: center; gap: 2px; flex: 0 0 auto; }
.dock-notif-pop .notif-icon-btn {
    width: 28px; height: 28px; border: none; background: transparent; border-radius: 7px; cursor: pointer;
    color: var(--fg-3, #6b7280); display: inline-flex; align-items: center; justify-content: center; font-family: inherit;
}
.dock-notif-pop .notif-icon-btn:hover { background: var(--bg-sunken, #f1f5f9); color: var(--fg-1, #0f172a); }
.dock-notif-pop .notif-icon-btn.is-on { color: var(--success-600, #15803d); }
.dock-notif-pop .notif-icon-btn svg { width: 16px; height: 16px; }
.dock-notif-pop .notif-body { max-height: min(60vh, 560px); overflow-y: auto; padding: 6px; }
/* scrollbar mảnh đồng bộ flyout dock */
.dock-notif-pop .notif-body { scrollbar-width: thin; scrollbar-color: var(--border-2, #cbd5e1) transparent; }
.dock-notif-pop .notif-body::-webkit-scrollbar { width: 5px; }
.dock-notif-pop .notif-body::-webkit-scrollbar-thumb { background: var(--border-2, #cbd5e1); border-radius: 999px; }
.dock-notif-pop .notif-body::-webkit-scrollbar-thumb:hover { background: var(--fg-4, #94a3b8); }
.dock-notif-empty { text-align: center; color: var(--fg-4, #9aa3af); font-size: 13px; padding: 28px 12px; }

/* ── Ô tìm kiếm thông báo (hiện khi bấm nút kính lúp ở header) ── */
.dock-notif-pop .notif-search { position: relative; display: flex; align-items: center; margin-top: 10px; }
.dock-notif-pop .notif-search > svg {
    position: absolute; left: 11px; width: 16px; height: 16px;
    color: var(--fg-4, #9aa3af); pointer-events: none; flex: 0 0 auto;
}
.dock-notif-pop .notif-search-input {
    width: 100%; padding: 9px 32px 9px 34px;
    border: 1px solid var(--border-1, #e6e9ee); border-radius: 10px;
    background: var(--bg-sunken, #f8fafc); color: var(--fg-1, #0f172a);
    font-size: 13.5px; font-family: inherit; outline: none;
    transition: border-color .14s ease, background .14s ease;
}
.dock-notif-pop .notif-search-input:focus { border-color: var(--brand, #0a4174); background: var(--bg-surface, #fff); }
.dock-notif-pop .notif-search-input::placeholder { color: var(--fg-4, #9aa3af); }
.dock-notif-pop .notif-search-clear {
    position: absolute; right: 6px; width: 24px; height: 24px;
    display: inline-flex; align-items: center; justify-content: center;
    border: none; background: transparent; border-radius: 7px; cursor: pointer;
    color: var(--fg-4, #9aa3af); font-family: inherit;
}
.dock-notif-pop .notif-search-clear:hover { background: var(--bg-sunken, #f1f5f9); color: var(--fg-1, #0f172a); }
.dock-notif-pop .notif-search-clear svg { width: 14px; height: 14px; }

/* ── Hàng tải-thêm / đang-tải / hết (infinite scroll) ── */
.dock-notif-pop .notif-sentinel { height: 1px; }
.dock-notif-pop .notif-loading, .dock-notif-pop .notif-end {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px; color: var(--fg-4, #9aa3af); font-size: 12px; text-align: center;
}
.dock-notif-pop .notif-loadmore {
    width: 100%; padding: 9px; margin-top: 2px;
    border: none; background: transparent; border-radius: 9px;
    font-size: 12.5px; font-weight: 600; color: var(--brand, #0a4174);
    cursor: pointer; font-family: inherit;
    display: flex; align-items: center; justify-content: center; gap: 6px;
}
.dock-notif-pop .notif-loadmore:hover { background: var(--brand-soft, #eaf1f8); }
.dock-notif-pop .notif-row {
    position: relative; width: 100%; display: flex; gap: 11px; align-items: flex-start; text-align: left;
    padding: 10px 12px; border: none; background: transparent; border-radius: 11px; cursor: pointer;
    font-family: inherit; color: var(--fg-1, #0f172a);
}
.dock-notif-pop .notif-row:hover { background: var(--bg-sunken, #f1f5f9); }
.dock-notif-pop .notif-row.unread { background: var(--brand-soft, #eaf1f8); }
.dock-notif-pop .notif-row-icon { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; }
.dock-notif-pop .notif-row-icon .mud-icon-root { font-size: 18px; }
.dock-notif-pop .notif-row-icon.tone-brand   { background: var(--brand-soft, #eaf1f8);  color: var(--brand, #0a4174); }
.dock-notif-pop .notif-row-icon.tone-success { background: rgba(22, 163, 74, .12);  color: #15803d; }
.dock-notif-pop .notif-row-icon.tone-warning { background: rgba(245, 158, 11, .16); color: #b45309; }
.dock-notif-pop .notif-row-icon.tone-error   { background: rgba(239, 68, 68, .12);  color: #b91c1c; }
.dock-notif-pop .notif-row-icon.tone-info    { background: rgba(14, 165, 233, .12); color: #075985; }
.dock-notif-pop .notif-row-icon.tone-neutral { background: var(--slate-100, #f1f5f9); color: var(--fg-2, #334155); }
.dock-notif-pop .notif-row-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.dock-notif-pop .notif-row-title { font-size: 13.5px; font-weight: 600; color: var(--fg-1, #0f172a); line-height: 1.3; }
.dock-notif-pop .notif-row-title .notif-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; }
.dock-notif-pop .notif-row-body {
    font-size: 12.5px; color: var(--fg-3, #6b7280); line-height: 1.4; word-break: break-word;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.dock-notif-pop .notif-row-time { font-size: 11px; color: var(--fg-4, #9aa3af); margin-top: 2px; }
.dock-notif-pop .notif-row-dot { position: absolute; top: 14px; right: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand, #0a4174); }

/* ── Item GIÀU (đồng bộ feature/web-congviec): dòng nguồn (avatar người / nhãn hệ thống) + ngữ cảnh tên việc ── */
.dock-notif-pop .notif-row-source { display: flex; align-items: center; gap: 6px; min-width: 0; margin-bottom: 1px; }
.dock-notif-pop .notif-src-sys {
    flex: 0 0 auto; width: 16px; height: 16px; border-radius: 5px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--slate-100, #eceff3); color: var(--fg-3, #6b7280);
}
.dock-notif-pop .notif-src-sys .mud-icon-root { font-size: 11px; width: 11px; height: 11px; }
.dock-notif-pop .notif-src-av {
    flex: 0 0 auto; width: 16px; height: 16px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-size: 8.5px; font-weight: 700; letter-spacing: .01em;
}
.dock-notif-pop .notif-src-name {
    font-size: 11.5px; font-weight: 700; color: var(--fg-2, #334155);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dock-notif-pop .notif-row-ctx {
    display: flex; align-items: center; gap: 5px; min-width: 0;
    font-size: 12px; font-weight: 600; color: var(--fg-2, #334155);
}
.dock-notif-pop .notif-row-ctx .mud-icon-root { font-size: 13px; width: 13px; height: 13px; color: var(--fg-3, #6b7280); flex: 0 0 auto; }
.dock-notif-pop .notif-ctx-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock-notif-pop .notif-foot { padding: 8px; border-top: 1px solid var(--border-1, #e6e9ee); }
.dock-notif-pop .notif-foot-btn { width: 100%; padding: 9px; border: none; background: transparent; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--brand, #0a4174); cursor: pointer; font-family: inherit; }
.dock-notif-pop .notif-foot-btn:hover { background: var(--brand-soft, #eaf1f8); }

/* ── Mobile (overflow) — dùng cho sheet "Thêm" ── */
.dock-opt { position: relative; z-index: 2; flex: 0 0 auto; }
/* Scrim đóng-khi-chạm-ngoài của sheet "Thêm" — CHỈ mobile (desktop flyout hover, không cần). */
.dock-opt-scrim { display: none; }
.dock-opt-btn {
    width: auto; min-width: 64px; height: 100%;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 9px 6px 8px;
    border: 0; background: none; cursor: pointer;
    border-radius: 10px; color: var(--fg-3, #6b7280); font-family: inherit;
    transition: color .2s ease, background .14s ease;
}
.dock-opt.has-active .dock-opt-btn { color: var(--brand, #0a4174); }
.dock-opt-dots { display: flex; gap: 3px; height: 28px; align-items: center; justify-content: center; }
.dock-opt-dots i { width: 5px; height: 5px; border-radius: 999px; background: currentColor; }
.dock-opt-btn .dock-label { font-size: 12.5px; font-weight: 600; }

.dock-pop {
    position: absolute; bottom: calc(100% + 12px); right: 0;
    width: min(460px, calc(100vw - 28px));
    background: var(--bg-surface, #fff);
    border: 1px solid var(--border-1, #e6e9ee);
    border-radius: 16px;
    box-shadow: 0 18px 50px -12px rgba(8, 24, 40, .28);
    opacity: 0; transform: translateY(8px) scale(.98); transform-origin: bottom right;
    pointer-events: none;
    transition: opacity .26s cubic-bezier(.16,1,.3,1), transform .26s cubic-bezier(.16,1,.3,1);
}
.dock-pop-scroll { overflow-y: auto; overflow-x: hidden; padding: 8px; max-height: 60vh; }
.dock-opt.open .dock-pop { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.dock-pop-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1px; }

.dock-sheet-backdrop { display: none; }

/* prefers-reduced-motion: tắt nảy/trượt */
@media (prefers-reduced-motion: reduce) {
    .dock-pill, .dock-item, .dock-icon svg, .dock-gpop, .dock-pop, .dock-tip { transition: none !important; }
    .dock-item.just-added, .dock-item.just-added .dock-icon::after { animation: none !important; }
    .dock-item:hover { transform: none; }
    .dock-notif-pop { animation: none !important; }
}

/* Sheet Thông báo mobile trượt từ đáy lên (dùng trong @media 560 bên dưới) */
@keyframes dock-notif-sheet-up {
    from { transform: translateY(28px); opacity: .55; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* Icon tab NẢY nhẹ khi thành active (hiệu ứng chuyển tab mobile — áp trong block ≤560). */
@keyframes dock-tab-pop {
    0%   { transform: scale(1); }
    45%  { transform: scale(1.16) translateY(-1.5px); }
    100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
    .dock-item.is-active .dock-icon { animation: none !important; }
    .dock-liquid { transition: none !important; }
}

/* ============================================================
   MOBILE ≤560 — bottom-nav full-width + sheet "Thêm" bung lên
   ============================================================ */
@media (max-width: 560px) {
    /* Dock mobile thấp hơn (item ~54px) + safe-area → cập nhật biến cho overlay nằm trên dock.
       (Icon 24→26px KHÔNG đổi chiều cao dock — item stretch theo phần tử cao nhất, đo A/B 2026-07-12.) */
    :root { --dock-h: calc(68px + env(safe-area-inset-bottom)); }
    /* Dock = footer trong luồng → KHÔNG cần chừa padding-bottom (safe-area do .dock lo bên dưới). */
    .dock-wrap { padding: 0; }   /* full-width tự nhiên (flex item); .dock width:100% */
    .dock {
        width: 100%; gap: 0; align-items: stretch; max-width: none;
        box-sizing: border-box;   /* width 100% GỒM padding+border — content-box làm dock tràn màn 3px mỗi bên */
        padding: 6px 2px calc(8px + env(safe-area-inset-bottom));
        border-radius: 16px 16px 0 0; border-bottom: 0;
        box-shadow: 0 -6px 26px -10px rgba(8,24,40,.32);
    }
    .dock-pill, .dock-sep, .dock-tip { display: none; }

    /* Mobile KHÔNG dùng cử chỉ nhấn-giữ-kéo (chỉ desktop) → GỠ touch-action:none của .dock-item base
       (vốn dành cho kéo, chặn cả tap trên vài trình duyệt). manipulation = tap nhanh, không zoom-kép,
       cho phép cuộn → nút tabbar bấm điều hướng bình thường. Đây là fix "bấm menu tabbar không hoạt động". */
    .dock-item, .dock-opt-btn, .dock-pop-item, .dock-notif-btn { touch-action: manipulation; }

    /* 5 Ô CHIA ĐỀU tuyệt đối (flex-basis 0): tâm icon các tab cách đều nhau (YC 2026-07-12).
       box-sizing: border-box BẮT BUỘC — mặc định content-box làm flex chia đều phần CONTENT,
       ô có padding ngang (.dock-item 2+2px) rộng hơn ô wrapper padding 0 đúng 4px → so le.
       Wrapper (.dock-notif/.dock-opt) PHẢI là flex + stretch để button con chiếm TRỌN ô —
       button width:auto là fit-content (không tự full như block) → thiếu là icon lệch trong ô. */
    .dock-item, .dock-opt, .dock-opt-btn, .dock-notif { flex: 1 1 0; width: auto; min-width: 0; max-width: none; box-sizing: border-box; }
    .dock-notif { align-items: stretch; }
    .dock-notif-btn { width: 100%; }
    /* Popup noti mobile → MODAL SHEET FULL MÀN HÌNH: trượt từ đáy, scrim tối phía sau,
       grabber + bo góc trên, body cuộn riêng, footer dính đáy (chừa safe-area).
       position:fixed bám VIEWPORT thật vì .dock-wrap đã GỠ will-change:transform (app.css) —
       không thêm lại, nó tạo containing-block nhốt scrim/sheet trong vùng dock.
       nav-autohide.js giữ bar hiện khi sheet mở (cuộn trong list không kéo tụt sheet). */
    /* Scrim fade-in mượt (keyframes vm-scrim-fade định nghĩa ở app.css — load trước file này). */
    .dock-notif-scrim { background: rgba(15, 23, 42, .45); animation: vm-scrim-fade .22s ease; }
    .dock-notif-pop {
        position: fixed; left: 0; right: 0; bottom: 0;
        top: max(14px, env(safe-area-inset-top));   /* lộ dải scrim trên đỉnh = ngôn ngữ sheet */
        display: flex;
        animation: dock-notif-sheet-up .3s cubic-bezier(.16, 1, .3, 1);
    }
    .dock-notif-pop .notif-menu {
        width: 100%; max-width: none; height: 100%;
        display: flex; flex-direction: column;
        border: 0; border-radius: 18px 18px 0 0;
        padding-bottom: env(safe-area-inset-bottom);
        box-shadow: 0 -18px 60px -12px rgba(8, 24, 40, .45);
    }
    /* Dải NẮM KÉO thật (thay ::before — pseudo không nhận pointer event): nhấn giữ + kéo xuống
       để đóng (js/sheet-drag.js). touch-action:none để pointermove không bị cướp làm scroll;
       cao 36px = vùng chạm rộng, thanh gợi ý 44×4 nằm giữa. */
    .dock-notif-pop .notif-grab {
        display: flex; align-items: center; justify-content: center;
        flex: 0 0 auto; height: 36px;
        touch-action: none; cursor: grab;
    }
    .dock-notif-pop .notif-grab span {
        width: 44px; height: 4px; border-radius: 999px;
        background: var(--border-2, #cbd5e1);
    }
    .dock-notif-pop .notif-head { flex: 0 0 auto; padding-top: 2px; }
    /* Icon action header sheet TO HƠN trên mobile (YC 2026-07-12 ảnh #10) — hit ≥40px (§6.19). */
    .dock-notif-pop .notif-title { font-size: 17px; }
    .dock-notif-pop .notif-head-actions { gap: 6px; }
    .dock-notif-pop .notif-icon-btn { width: 40px; height: 40px; border-radius: 10px; }
    .dock-notif-pop .notif-icon-btn svg { width: 22px; height: 22px; }
    .dock-notif-pop .notif-body {
        flex: 1 1 auto; min-height: 0;   /* min-height:0 BẮT BUỘC để vùng flex cuộn được */
        max-height: none;
        overscroll-behavior: contain;    /* chặn cuộn lan ra trang phía sau (iOS rubber-band) */
        -webkit-overflow-scrolling: touch;
    }
    .dock-notif-pop .notif-foot { flex: 0 0 auto; }
    .dock-notif-pop .notif-search-input { font-size: 16px; }   /* <16px = iOS tự zoom khi focus */
    .dock-notif-pop .dock-notif-empty { padding: 48px 16px; }
    .dock-opt { display: flex; align-items: stretch; }   /* cha flex → .dock-opt-btn (flex:1 1 0) chiếm TRỌN ô, icon hết lệch */
    .dock-item, .dock-opt-btn {
        /* padding ngang PHẢI = 0: flex-basis 0 vẫn cộng padding vào base → ô có padding 2px
           rộng hơn ô wrapper (chuông/Thêm) đúng 4px, tâm icon so le (đo A/B 2026-07-12). */
        min-height: 54px; height: auto; padding: 8px 0 6px; gap: 4px; border-radius: 12px; justify-content: center;
    }
    .dock-opt.has-active .dock-opt-btn { background: transparent; color: var(--fg-3, #6b7280); }
    .dock-opt-btn:active { background: var(--bg-sunken, #f1f5f9); }
    .dock-item:hover { transform: none; background: transparent; color: var(--fg-3, #6b7280); }
    .dock-item:hover .dock-icon svg { transform: none; }
    /* Icon tab NÉT MẢNH (YC 2026-07-12 ảnh #13 — đổi từ nét đậm 2/2.35 kiểu FB): 26px nét 1.5,
       active 1.8 — "viên nước" .dock-liquid + màu brand đã đảm nhiệm nhấn active nên không cần nét dày.
       CSS stroke-width trên svg root thắng attribute của VmIcons.Wrap()/MoreSvg và kế thừa xuống path con.
       Icon > text là NGOẠI LỆ dock đáy có chủ đích. */
    .dock-icon svg { width: 26px; height: 26px; stroke-width: 1.5; }
    .dock-item.is-active .dock-icon svg { stroke-width: 1.8; }   /* active: nhỉnh hơn chút + màu brand (rule sẵn có) */
    .dock-label, .dock-opt-btn .dock-label { font-size: 10.5px; font-weight: 600; max-width: 100%; }

    /* Hiệu ứng CHUYỂN TAB (YC 2026-07-12): icon nảy nhẹ khi thành active + màu/nét chuyển mượt.
       Transform chỉ trên .dock-icon (span TRONG button) — KHÔNG trên .dock-notif/.dock/.dock-wrap
       (ancestor của sheet fixed → containing-block trap, xem app.css). */
    .dock-item .dock-icon { transition: transform .18s ease; }
    .dock-item .dock-icon svg { transition: stroke-width .18s ease; }
    .dock-item .dock-label { transition: color .18s ease; }
    .dock-item { transition: color .18s ease; }
    .dock-item.is-active .dock-icon { animation: dock-tab-pop .32s cubic-bezier(.34, 1.56, .64, 1); }

    .dock-item.is-active { color: var(--brand, #0a4174); }
    /* (Vạch ngang trên tab active ĐÃ BỎ 2026-07-12 — thay bằng "viên nước" .dock-liquid bên dưới.) */

    /* "VIÊN NƯỚC" active kiểu iOS: pill nền TRƯỢT mượt giữa các ô khi chuyển tab.
       Ô chia đều (flex 1 1 0) → vị trí = index (--di) × 100% bề rộng ô; tổng ô qua --dn (3 tab +
       chuông + Thêm — DockNav set). Bezier lò xo overshoot nhẹ = cảm giác "liquid". Nằm TRONG .dock
       (position:static) → anchor .dock-wrap (wrap padding 0 nên toạ độ trùng .dock); đứng ĐẦU DOM
       + pointer-events:none → dưới icon, không cản chạm. KHÔNG transform ancestor nào của sheet. */
    .dock-liquid {
        position: absolute; pointer-events: none;
        top: 8px; bottom: calc(10px + env(safe-area-inset-bottom));
        left: 2px; width: calc((100% - 4px) / var(--dn, 5));
        transform: translateX(calc(var(--di, 0) * 100%));
        transition: transform .45s cubic-bezier(.3, 1.4, .5, 1);
    }
    .dock-liquid::before {
        content: ''; position: absolute; inset: 0 6px;
        border-radius: 14px;
        background: color-mix(in srgb, var(--brand, #0a4174) 12%, transparent);
    }

    /* sheet "Thêm" bung lên trên thanh; thanh tab vẫn hiện */
    .dock { position: static; }
    /* ⚠ z-index:auto BẮT BUỘC — FLEX ITEM vẫn nhận z-index dù position:static (spec flexbox):
       giữ z2 base là .dock-opt thành stacking context NHỐT scrim(50)/pop(1320) ở TẦNG 2 → thua
       .dock-notif (flex item z3) → badge chuông nổi TRÊN scrim (ảnh #13). auto = scrim/pop tự
       tham gia context .dock-wrap bằng z của chính nó. */
    .dock-opt { position: static; z-index: auto; }
    /* Sheet + scrim CÙNG position:FIXED (2026-07-12 — chạm ngoài để đóng): backdrop fixed đè sheet
       absolute là bẫy iOS chạm-lọt (§6.19) nên khi thêm scrim phải nâng sheet lên fixed theo
       (mẫu DockNotif). Sheet neo trên dock qua --dock-h (đã gồm safe-area); z 1320 > scrim (auto)
       trong stacking context .dock-wrap (1300) → mục trong sheet vẫn bấm được, chạm ngoài trúng scrim. */
    .dock-opt-scrim {
        display: block; position: fixed; inset: 0;
        background: rgba(15, 23, 42, .45);
        border: 0; padding: 0;
        animation: vm-scrim-fade .22s ease;   /* fade mượt, keyframes ở app.css */
        /* PHẢI > z các ô dock (.dock-item z1, .dock-notif z3 — base leak sang mobile) để scrim phủ
           CẢ badge số (ảnh #13: badge 7 nổi trên scrim); < .dock-pop 1320. Đồng bộ .dock-notif-scrim z60. */
        z-index: 50;
    }
    .dock-pop {
        position: fixed; left: 8px; right: 8px; bottom: calc(var(--dock-h, 68px) + 10px); width: auto;
        border-radius: 16px; transform: translateY(10px) scale(.99); opacity: 0;
        transition: transform .24s cubic-bezier(.16,1,.3,1), opacity .2s ease;
        box-shadow: 0 14px 44px -10px rgba(8,24,40,.42); z-index: 1320;
    }
    .dock-opt.open .dock-pop { transform: translateY(0) scale(1) !important; opacity: 1 !important; pointer-events: auto; }
    /* Chiều cao vùng cuộn PHẢI trừ theo viewport ĐANG THẤY, không 100vh (iOS Safari: 100vh =
       viewport lớn nhất khi ẩn thanh công cụ → sheet neo đáy cao lên bị đẩy mép TRÊN chui sau
       thanh địa chỉ, nhóm menu đầu bị che & không cuộn tới được). Dùng 100dvh (co theo thanh
       công cụ hiện/ẩn) − dock (đã gồm safe-area đáy) − safe-area đỉnh (tai thỏ/địa chỉ) − 44px
       (10px hở đáy + 16px padding + ~18px thở). Fallback vh cho trình duyệt cũ không có dvh. */
    .dock-pop-scroll {
        max-height: 78vh;
        max-height: calc(100dvh - var(--dock-h, 68px) - env(safe-area-inset-top, 0px) - 44px);
        padding: 8px;
    }
}
