/* ============================================================================
   DataFlow - màn hình người dùng của workflow (Servers/Components/DataFlow).
   Class prefix df-. Màu trạng thái dùng chung cho bảng bước / sơ đồ / badge:
     hoàn tất = xanh lá · đang xử lý = đỏ · chờ = xám nhạt · từ chối = xám đậm
   ============================================================================ */

:root {
    --df-done: #2eb85c;
    --df-doing: #e55353;
    --df-wait: #c8ced3;
    --df-reject: #5c6873;
    --df-skip: #9da5b1;
    --df-pending-badge: #f39c12;
}

/* ---------- Lưới: cột thao tác cố định ---------- */
/* Bỏ padding mặc định của ô Radzen (~16px mỗi bên) - cột 48px mà giữ padding thì
   icon 28px bị xén. rz-cell-data mặc định overflow hidden nên phải mở ra cho badge. */
.rz-data-grid td.df-col-action,
.rz-data-grid th.df-col-action {
    padding: 0 !important;
    text-align: center;
}

.rz-data-grid .df-col-action .rz-cell-data,
.rz-data-grid .df-col-action .rz-column-title,
.rz-data-grid .df-col-action .rz-column-title-content {
    overflow: visible !important;
    text-overflow: clip !important;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.df-action-cell {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    min-height: 32px;
    width: 100%;
}

.df-action-cell .mud-icon-button {
    padding: 4px;
}

.df-action-cell .mud-tooltip-root {
    display: inline-flex;
}

.df-muted { color: #b0b7c3 !important; }

/* Bình luận luôn bấm được - không để xám kẻo trông như bị disable. */
.df-comment { color: #f39c12 !important; }

/* Nút Từ chối / Từ chối nhiều: đỏ, đè màu chung của common-button-control. */
.common-button-control.df-btn-reject:not(:disabled) { background-color: #c62828 !important; }
.common-button-control.df-btn-reject:disabled { opacity: .55; }
/* Nút Không ý kiến (bước tick "Cho phép Không ý kiến") */
.common-button-control.df-btn-kyk:not(:disabled) { background-color: #607d8b !important; }
.common-button-control.df-btn-kyk:disabled { opacity: .55; }
/* Nút Trả bước (bước tick "Có thể trả bước") */
.common-button-control.df-btn-trabuoc:not(:disabled) { background-color: #f9a825 !important; }
.common-button-control.df-btn-trabuoc:disabled { opacity: .55; }
.df-has-data { color: #e55353 !important; }
.df-turn { color: #e55353 !important; }
.df-flow { color: #2f6fb2 !important; }

.df-count {
    position: relative;
}

.df-count > .df-count-badge {
    position: absolute;
    top: -2px;
    right: -6px;
    min-width: 15px;
    height: 15px;
    padding: 0 3px;
    border-radius: 8px;
    background: #2f6fb2;
    color: #fff;
    font-size: 10px;
    line-height: 15px;
    text-align: center;
    pointer-events: none;
}

.df-toolbar-sep {
    width: 1px;
    height: 26px;
    background: #c8ced3;
    margin: 0 4px;
}

/* ---------- Badge trạng thái ---------- */
.df-status {
    display: inline-block;
    min-width: 92px;
    padding: 2px 10px;
    border-radius: 3px;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

.df-status.done { background: var(--df-done); }
.df-status.doing { background: var(--df-pending-badge); }
.df-status.wait { background: var(--df-wait); color: #4f5d73; }
.df-status.reject { background: var(--df-reject); }
.df-status.skip { background: var(--df-skip); }

/* ---------- Dialog Quy trình: bảng bước ---------- */
.df-steps {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.df-steps td {
    padding: 7px 10px;
    border-bottom: 1px solid #edf0f3;
    vertical-align: middle;
}

.df-steps tr:nth-child(odd) td { background: #f8f9fb; }
.df-steps .df-step-child td:nth-child(2) { padding-left: 28px; }

/* ---------- Dialog Quy trình: sơ đồ ---------- */
.df-flow-wrap {
    display: flex;
    gap: 16px;
    padding: 16px 8px;
}

.df-legend {
    flex: 0 0 150px;
    font-size: 12px;
    color: #2f6fb2;
}

.df-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.df-legend-line {
    display: inline-block;
    width: 30px;
    border-top: 2px solid;
}

.df-chart {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
}

.df-node {
    width: 380px;
    max-width: 100%;
    border: 2px solid var(--df-wait);
    background: #fff;
    padding: 8px 10px;
    font-size: 12px;
}

.df-node.done { border-color: var(--df-done); }
.df-node.doing { border-color: var(--df-doing); }
.df-node.reject { border-color: var(--df-reject); }
.df-node.skip { border-color: var(--df-skip); }
.df-node.child { border-style: dashed; width: 260px; }

.df-node-title {
    font-weight: 600;
    color: #2d3a4a;
    margin-bottom: 6px;
}

.df-children {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #c8ced3;
}

.df-children.tuan-tu { flex-direction: column; align-items: center; }

.df-arrow {
    width: 2px;
    height: 36px;
    background: var(--df-wait);
    position: relative;
}

.df-arrow::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: -5px;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 7px solid var(--df-wait);
}

.df-arrow.done { background: var(--df-done); }
.df-arrow.done::after { border-top-color: var(--df-done); }
.df-arrow.doing { background: var(--df-doing); }
.df-arrow.doing::after { border-top-color: var(--df-doing); }
.df-arrow.reject { background: var(--df-reject); }
.df-arrow.reject::after { border-top-color: var(--df-reject); }

.df-person {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.df-person-name {
    font-weight: 600;
    color: #2d3a4a;
    text-transform: uppercase;
}

.df-person-sub {
    color: #5c6873;
    font-size: 11px;
}

/* ---------- Avatar chữ cái đầu ---------- */
.df-avatar {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

/* ---------- Dialog Quy trình: lịch sử (timeline) ---------- */
.df-timeline {
    position: relative;
    padding: 16px 16px 16px 70px;
}

.df-timeline::before {
    content: "";
    position: absolute;
    left: 45px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #e4e7ea;
}

.df-tl-item {
    position: relative;
    margin-bottom: 18px;
    background: #fff;
    border: 1px solid #e4e7ea;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
    padding: 10px 14px;
    font-size: 13px;
}

.df-tl-item::before {
    content: "";
    position: absolute;
    left: -40px;
    top: 50%;
    width: 28px;
    height: 28px;
    margin-top: -14px;
    border-radius: 50%;
    background: #5bc0de;
}

.df-tl-item.duyet::before { background: var(--df-done); }
.df-tl-item.tuchoi::before { background: var(--df-doing); }
.df-tl-item.trabuoc::before { background: #f9a825; }
.df-tl-item.trabuoc .df-tl-title { color: #b26a00; }

.df-tl-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.df-tl-title { font-weight: 600; font-size: 15px; flex: 1 1 auto; }
.df-tl-meta { color: #5c6873; font-size: 12px; white-space: nowrap; }
.df-tl-meta.toi { color: #2d3a4a; font-weight: 700; }   /* dòng do chính người đăng nhập làm */
.df-tl-body { margin-top: 4px; }
.df-tl-note { margin-top: 4px; color: #5c6873; font-style: italic; white-space: pre-wrap; }

/* ---------- Dialog Bình luận ---------- */
.df-chat-list {
    flex: 1 1 auto;
    overflow: auto;
    background: #eef2fb;
    padding: 14px;
}

.df-msg-row {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    align-items: flex-start;
}

.df-msg-row.mine { flex-direction: row-reverse; }

.df-msg {
    max-width: 70%;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
    padding: 8px 12px;
}

.df-msg-row.mine .df-msg { background: #e3f0ff; }

/* Trả lời / thu hồi: nút cạnh bong bóng, chỉ hiện khi rê chuột vào dòng tin */
.df-msg-actions {
    align-self: center;
    flex: none;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity .15s;
}
.df-msg-row:hover .df-msg-actions { opacity: 1; }
.df-msg-reply {
    flex: none;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: #fff;
    color: #5c6873;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.df-msg-reply:hover { color: #2f6fb2; }
.df-msg-reply.thu-hoi:hover { color: #c62828; }

/* Tin đã thu hồi */
.df-msg-thuhoi { margin: 6px 0; font-size: 14px; font-style: italic; color: #9da5b1; }

/* Khối trích dẫn tin được trả lời, đầu bong bóng */
.df-msg-quote {
    margin: 6px 0 2px;
    padding: 4px 8px;
    border-left: 3px solid #2f6fb2;
    border-radius: 4px;
    background: rgba(47, 111, 178, .08);
    cursor: pointer;
    max-width: 100%;
}
.df-msg-quote:hover { background: rgba(47, 111, 178, .15); }
.df-msg-quote-ten { font-size: 12px; font-weight: 600; color: #2f6fb2; }
.df-msg-quote-nd { font-size: 13px; color: #5c6873; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Tin gốc vừa cuộn tới: nháy viền */
.df-msg.nhay { animation: df-nhay 1.5s ease-out; }
@keyframes df-nhay { 0%, 40% { box-shadow: 0 0 0 3px #f9a825; } 100% { box-shadow: 0 1px 3px rgba(0, 0, 0, .12); } }

/* Khung "Đang trả lời" trên ô nhập */
.df-reply-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: #f1f4f9;
    border-top: 1px solid #e4e7ea;
    border-left: 3px solid #2f6fb2;
    font-size: 13px;
}
.df-reply-bar-nd { flex: 1 1 auto; min-width: 0; cursor: pointer; }
.df-reply-bar-text { color: #5c6873; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.df-msg-name { font-size: 12px; color: #5c6873; text-transform: uppercase; }
.df-msg-text { margin: 6px 0; font-size: 15px; white-space: pre-wrap; word-break: break-word; }
.df-msg-time { font-size: 11px; color: #5c6873; }

/* Ảnh trong bình luận: thu nhỏ ngay trong bong bóng, bấm mở file như cũ */
.df-msg-img { margin: 6px 0; cursor: pointer; line-height: 0; }
/* Cao CỐ ĐỊNH 180px (rộng theo tỉ lệ, tối đa 280px): ảnh nạp sau không làm bong bóng cao thêm
   -> khung chat không bị đẩy, chỉ cuộn xuống đáy 1 lần lúc mở. */
.df-msg-img img { height: 180px; width: auto; max-width: 280px; border-radius: 8px; border: 1px solid #e0e4e8; object-fit: cover; background: #eef1f4; }
.df-msg-img:hover img { border-color: #2f6fb2; }
.df-msg-img-cho { width: 240px; height: 180px; box-sizing: border-box; border-radius: 8px; background: #eef1f4; display: flex; align-items: center; justify-content: center; }

/* "{Tên} đang nhập" cuối khung chat */
.df-msg-typing {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 2px 46px;
    padding: 6px 12px;
    border-radius: 14px;
    background: #fff;
    color: #5c6873;
    font-size: 13px;
    font-style: italic;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}
.df-typing-dots { display: inline-flex; gap: 3px; }
.df-typing-dots i { width: 5px; height: 5px; border-radius: 50%; background: #9da5b1; animation: df-typing 1.2s infinite ease-in-out; }
.df-typing-dots i:nth-child(2) { animation-delay: .2s; }
.df-typing-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes df-typing { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.df-msg-file {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 2px 0 6px 0;
    color: #2f6fb2;
    cursor: pointer;
    font-size: 13px;
}

.df-chat-input {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: #fff;
    border-top: 1px solid #e4e7ea;
}

/* ---------- Danh sách file đính kèm ---------- */
.df-file-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-bottom: 1px solid #edf0f3;
    font-size: 13px;
    cursor: pointer;
}

.df-file-row:hover { background: #f4f7fb; }
.df-file-row.active { background: #e3f0ff; border-left: 3px solid #2f6fb2; }
.df-file-name { flex: 1 1 auto; min-width: 0; word-break: break-word; }
.df-file-meta { color: #5c6873; font-size: 11px; font-style: italic; white-space: nowrap; }

.df-file-layout {
    display: flex;
    height: 100%;
    gap: 8px;
    min-height: 0;
}

.df-file-list {
    flex: 0 0 380px;
    border: 1px solid #c8ddf0;
    overflow: auto;
    background: #fff;
}

.df-file-preview {
    flex: 1 1 auto;
    min-width: 0;
    border: 1px solid #c8ddf0;
    display: flex;
    flex-direction: column;
    background: #fff;
}

/* ---------- Tabs lấp đầy chiều cao dialog (dialog Quy trình) ----------
   Mặc định MudTabs chỉ cao theo nội dung nên khung viền dừng giữa dialog. Cho khung
   cao 100%, phần panel nở hết chỗ còn lại và tự cuộn bên trong. */
.df-tabs-full {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.df-tabs-full > .mud-tabs-panels,
.df-tabs-full .mud-tabs-panels {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

/* ---------- Popup người / nhóm được khai báo (icon người ở bước chưa mở) ---------- */
.df-luat-list {
    min-width: 280px;
    max-width: 380px;
    max-height: 360px;
    overflow: auto;
    padding: 4px 0;
}

.df-luat-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 14px;
    border-bottom: 1px solid #edf0f3;
    font-size: 12px;
}

.df-luat-item:last-child { border-bottom: none; }

.df-luat-title {
    font-weight: 600;
    color: #2d3a4a;
    word-break: break-word;
}

/* ---------- Lưới chọn người duyệt (DataFlow_ChonNguoi) ---------- */
.df-chon {
    border: 1px solid #c8ddf0;
    margin-inline: 20px;
    margin-bottom: 10px;
}
.df-chon-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0px 10px;
    background: #e8f1fb;
    border-bottom: 1px solid #c8ddf0;
}
.df-chon-title {
    color: #e65100;
    font-weight: 600;
}
.df-chon-note {
    color: #5c6873;
    font-size: 0.85rem;
}
.df-chon .rz-data-grid {
    border: none;
}
/* Giãn hết chiều cao còn lại của cha (dialog Duyệt lớn) - chỉ lưới cuộn */
.df-chon.df-chon-fill {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
}
.df-chon.df-chon-fill > .df-chon-head {
    flex: none;
}

/* Sơ đồ quy trình: công việc tạo ở lượt duyệt cuối - mũi tên sang phải tới thẻ công việc.
   Thẻ nằm tuyệt đối bên phải bước để cột bước vẫn thẳng hàng giữa. */
.df-node-wrap { position: relative; max-width: 100%; }


/* ---------- Dialog Quy trình: sơ đồ NGANG (12/10/2026) ----------
   Lưới: cột = bước lớn (chia đều), dòng lẻ = 1 lượt chạy, dòng chẵn = đường trả bước.
   Đường nối 2 điểm cạnh nhau: ::after của ô trái, từ tâm ô này tới tâm ô kế (các cột bằng
   nhau nên width = 100% - đường kính chấm). Màu đường = --df-st-line (xanh khi ô trái xong). */
.df-st-wrap { overflow-x: auto; padding: 14px 4px 6px; }
.df-st { display: grid; min-width: max-content; }
.df-st-cell {
    position: relative;
    padding: 0 8px 10px;
    cursor: pointer;
    border-radius: 8px;
    min-width: 0;
}
.df-st-cell:hover { background: #f5f7fa; }
.df-st-cell.chon { background: #eef4fc; }
.df-st-cell.has-next::after {
    content: "";
    position: absolute;
    top: 20px;
    left: 44px;                     /* 8px padding + 30px chấm + 6px khoảng */
    width: calc(100% - 42px);       /* tới trước chấm ô kế 6px */
    height: 2px;
    background: var(--df-st-line, #d5dae0);
}
.df-st-dot {
    width: 30px;
    height: 30px;
    margin-top: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: #fff;
    border: 2px dashed #b0b8c1;
    color: #5c6873;
    box-sizing: border-box;
}
.df-st-dot.done   { background: var(--df-done); border: 0; color: #fff; }
.df-st-dot.doing  { background: #2f6fb2; border: 0; color: #fff; box-shadow: 0 0 0 4px #d6e4f5; }
.df-st-dot.reject { background: #c62828; border: 0; color: #fff; }
.df-st-dot.skip   { background: var(--df-skip); border: 0; color: #fff; }
.df-st-dot.tra    { background: #f9a825; border: 0; color: #fff; }
.df-st-ten {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #2d3a4a;
    line-height: 1.25;
}
.df-st-ten.doing { color: #2f6fb2; }
.df-st-ten.wait { color: #5c6873; font-weight: 500; }
.df-st-ten.tra { color: #b26a00; }
.df-st-sub {
    margin-top: 3px;
    font-size: 12px;
    color: #5c6873;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.df-st-cham { display: inline-flex; gap: 3px; }
.df-st-cham i { width: 9px; height: 9px; border-radius: 50%; background: #c8ced3; display: inline-block; }
.df-st-cham i.done { background: var(--df-done); }
.df-st-cham i.doing { background: #2f6fb2; }
.df-st-cham i.skip { background: var(--df-skip); }
.df-st-cham i.reject { background: #c62828; }
.df-st-cham i.tra { background: #f9a825; }

/* Đường trả bước giữa 2 dòng: xuống từ chấm bước bấm trả (left tính ở razor), ngang về cột
   bước được trả về, xuống tiếp vào chấm (đầu mũi tên). Tâm chấm = 23px từ mép trái cột. */
.df-st-noi { position: relative; height: 38px; cursor: help; }
.df-st-noi-v1, .df-st-noi-v2, .df-st-noi-h { position: absolute; border-color: #f9a825; border-style: dashed; border-width: 0; }
.df-st-noi-v1 { top: -8px; height: calc(50% + 8px); border-left-width: 2px; }
.df-st-noi-h  { top: 50%; left: 22px; border-top-width: 2px; }
/* v2 dừng trên mép dòng dưới: mũi nhọn chạm mép, chấm (margin-top 6px, vòng sáng 4px) không bị đè */
.df-st-noi-v2 { top: 50%; bottom: 7px; left: 22px; border-left-width: 2px; }
.df-st-noi-v2::after {
    content: "";
    position: absolute;
    left: -6px;
    bottom: -7px;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 7px solid #f9a825;
}
.df-st-noi-nhan {
    position: absolute;
    top: 50%;
    left: 34px;
    transform: translateY(-100%);
    padding: 0 6px 2px;
    background: #fff;
    pointer-events: none;
    font-size: 11px;
    font-weight: 600;
    color: #b26a00;
    white-space: nowrap;
}

/* Khung chi tiết bước đang chọn */
.df-st-detail {
    margin: 10px 4px 4px;
    border: 1px solid #2f6fb2;
    border-radius: 10px;
    padding: 12px 16px;
    background: #fff;
}
.df-st-detail.done { border-color: var(--df-done); }
.df-st-detail.wait { border-color: #c8ced3; }
.df-st-detail.reject { border-color: #c62828; }
.df-st-detail.tra { border-color: #f9a825; }
.df-st-detail.skip { border-color: var(--df-skip); }
.df-st-detail-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.df-st-detail-nhan { font-size: 11px; font-weight: 700; color: #2f6fb2; text-transform: uppercase; letter-spacing: .3px; }
.df-st-detail-ten { font-size: 16px; font-weight: 600; color: #2d3a4a; }
.df-st-chip {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    background: #eef1f4;
    color: #5c6873;
    white-space: nowrap;
}
.df-st-chip.done { background: #e3f5e9; color: #1e7e3e; }
.df-st-chip.doing { background: #e3edf9; color: #2f6fb2; }
.df-st-chip.reject { background: #fdecea; color: #c62828; }
.df-st-chip.skip { background: #eef0f2; color: #5c6873; }
.df-st-chip.tra { background: #fff4d6; color: #b26a00; }
.df-st-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.df-st-table th {
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: #5c6873;
    text-transform: uppercase;
    background: #eef1f4;
    padding: 8px 10px;
}
.df-st-table td { padding: 8px 10px; border-bottom: 1px solid #eef1f4; vertical-align: top; }
.df-st-so { color: #5c6873; font-size: 12px; margin-right: 4px; }
.df-st-ykien { color: #5c6873; white-space: pre-wrap; }
.df-st-note { margin-top: 10px; font-size: 12px; color: #5c6873; }
.df-st-tra {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 8px 10px;
    margin-bottom: 10px;
    border-radius: 8px;
    background: #fff8e6;
    color: #8a5300;
    font-size: 13px;
}
.df-st-cv {
    display: inline-block;
    min-width: 320px;
    border: 2px solid #c8ced3;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 12px;
    cursor: pointer;
}
.df-st-cv:hover { border-color: #2f6fb2; }
.df-cv-side {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
}
.df-arrow-h {
    width: 44px;
    height: 2px;
    background: var(--df-wait);
    position: relative;
    flex: none;
}
.df-arrow-h::after {
    content: "";
    position: absolute;
    right: -1px;
    top: -5px;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 7px solid var(--df-wait);
}
.df-arrow-h.done { background: var(--df-done); }
.df-arrow-h.done::after { border-left-color: var(--df-done); }
.df-arrow-h.doing { background: var(--df-doing); }
.df-arrow-h.doing::after { border-left-color: var(--df-doing); }
.df-arrow-h.reject { background: var(--df-reject); }
.df-arrow-h.reject::after { border-left-color: var(--df-reject); }
.df-cv-node { width: 300px; cursor: pointer; border-style: solid; }
.df-cv-node:hover { box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
.df-cv-tieude { margin-bottom: 6px; color: #2d3a4a; }

/* Dialog Duyệt nhiều: hỏi lại các phiếu ở lượt cuối của loại "Tạo công việc" */
.df-tcv-hoi {
    margin-bottom: 12px;
    padding: 8px 12px;
    border-left: 4px solid #fb8c00;
    background: #fff6e8;
    border-radius: 4px;
}

/* Nhãn Tình trạng phiếu trên lưới - màu theo TinhTrangFlowMau (cùng bảng màu Công việc) */
.df-tinh-trang {
    display: inline-block;
    padding: 1px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    background: var(--df-tt, #78909c);
    white-space: nowrap;
}


/* ---------- Chuông thông báo (ThongBaoBell / ThongBaoDialog) - 14/10/2026 ---------- */
.tb-popover { width: 400px; max-width: 95vw; }
/* Số chưa đọc: nhỏ + hạ xuống trong lòng icon chuông (header cao 50px - để mặc định MudBadge
   đẩy số lên trên mép icon thì bị cắt / đè). */
.tb-badge .mud-badge {
    inset: 4px 2px auto auto !important;
    transform: none !important;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 10px;
    line-height: 16px;
    border: 1.5px solid #f3f6f9;
    box-sizing: content-box;
}
.tb-menu-list { padding: 0 !important; }
.tb-head { display: flex; align-items: baseline; gap: 8px; padding: 10px 14px 6px; border-bottom: 1px solid #eef1f4; }
.tb-head-title { font-size: 15px; font-weight: 700; color: #2d3a4a; }
.tb-head-sub { font-size: 12px; color: #c62828; }
.tb-list { max-height: 60vh; overflow-y: auto; }
.tb-menu-item { padding: 0 !important; }
.tb-menu-item .mud-menu-item-text { width: 100%; }
.tb-xem-tat-ca { justify-content: center; text-align: center; font-weight: 600; color: #2f6fb2; border-top: 1px solid #eef1f4; }
.tb-empty { padding: 24px; text-align: center; color: #9da5b1; font-style: italic; }
.tb-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 14px; width: 100%; box-sizing: border-box; white-space: normal; }
.tb-item.chua-doc { background: #f1f6fd; }
.tb-icon { flex: none; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
           color: var(--tb-c); background: color-mix(in srgb, var(--tb-c) 14%, white); }
.tb-body { flex: 1 1 auto; min-width: 0; }
.tb-tieude { font-size: 13px; color: #2d3a4a; line-height: 1.3; }
.tb-item.chua-doc .tb-tieude { font-weight: 700; }
.tb-noidung { font-size: 12px; color: #5c6873; line-height: 1.3; margin-top: 2px;
              display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tb-time { font-size: 11px; color: #9da5b1; margin-top: 3px; }
.tb-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: #1e88e5; margin-top: 6px; }
.tb-loc { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; padding: 8px 12px; border-bottom: 1px solid #eef1f4; }
.tb-list-full { flex: 1 1 auto; overflow-y: auto; }
.tb-row { cursor: pointer; border-bottom: 1px solid #f3f5f7; }
.tb-row:hover .tb-item { background: #f5f7fa; }
.tb-pager { display: flex; align-items: center; padding: 6px 12px; border-top: 1px solid #eef1f4; }

/* ---------- Admin > Sync Log (16/10/2026) ---------- */
.sl-wrap { height: 100%; display: flex; flex-direction: column; gap: 10px; padding: 10px; box-sizing: border-box; background: #fff; }
.sl-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; flex: none; }
.sl-card { border: 1px solid #e0e4e8; border-left: 4px solid #2eb85c; border-radius: 8px; padding: 8px 12px; cursor: pointer; background: #fff; min-width: 0; }
.sl-card.loi { border-left-color: #c62828; }
.sl-card.chon { background: #eef4fc; border-color: #2f6fb2; }
.sl-card:hover { box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.sl-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sl-card-ten { font-weight: 700; color: #2d3a4a; }
.sl-card-time { font-size: 12px; color: #5c6873; margin-top: 4px; }
.sl-card-note { font-size: 12px; color: #5c6873; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sl-card-err { font-size: 12px; color: #c62828; font-weight: 600; margin-top: 2px; }
.sl-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: none; }
/* Ô Mud có margin trên/dưới riêng -> bỏ để hàng thẳng; nút cao bằng ô dense (40px). */
.sl-filter .mud-input-control { margin-top: 0 !important; margin-bottom: 0 !important; flex: 0 0 auto; }
.sl-filter .sl-btn { height: 40px; text-transform: none; }
/* Độ rộng ô ngày đặt ở div bọc (không đặt Style trên MudDatePicker vì bị áp cả cho popup lịch). */
.sl-filter .sl-date { width: 160px; flex: none; }
.sl-filter .sl-date .mud-input-control { width: 100%; }
.sl-chip { display: inline-block; padding: 1px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.sl-chip.ok { background: #e3f5e9; color: #1e7e3e; }
.sl-chip.loi { background: #fdecea; color: #c62828; }
.sl-loai { font-weight: 600; color: #2d3a4a; }
.sl-ghichu { white-space: pre-wrap; word-break: break-word; }
