/* =========================================================
   Tra cứu Danh mục Kỹ thuật — style.css
   Bảng màu ngành y: xanh dương / xanh ngọc, sạch và dễ đọc
   ========================================================= */

:root {
    --c-primary:      #0b6e99;
    --c-primary-dark: #095676;
    --c-accent:       #0fb5ad;
    --c-bg:           #f4f7fa;
    --c-surface:      #ffffff;
    --c-border:       #dce4ec;
    --c-text:         #1f2a37;
    --c-text-soft:    #5b6b7b;
    --c-mark:         #fff3b0;
    --radius:         10px;
    --shadow:         0 1px 3px rgba(16, 42, 67, .08), 0 4px 14px rgba(16, 42, 67, .05);
    --font: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

.ui-icon {
    display: inline-flex;
    width: 1.1em;
    height: 1.1em;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: currentColor;
    vertical-align: -0.18em;
}
.ui-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}
.btn,
.user-bar__logout,
.admin-nav__item,
.profile-tab,
.dm-tab,
.admin-toolbar__info,
.profile-header__title,
.modal-box__title,
.alert,
.profile-form__label {
    gap: 7px;
}

/* ---------- Custom checkbox & select ---------- */
input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--c-border);
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: background .15s, border-color .15s;
}
input[type="checkbox"]:checked {
    background: var(--c-primary);
    border-color: var(--c-primary);
}
input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--c-primary);
    outline-offset: 2px;
}

/* ---------- Custom radio ---------- */
input[type="radio"] {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--c-border);
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: border-color .15s;
}
input[type="radio"]:checked {
    border-color: var(--c-primary);
}
input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--c-primary);
}
input[type="radio"]:focus-visible {
    outline: 2px solid var(--c-primary);
    outline-offset: 2px;
}

input[type="checkbox"].chk-row,
input[type="checkbox"].chk-chuong,
input[type="checkbox"]#chkAll {
    -webkit-appearance: auto;
    appearance: auto;
    accent-color: var(--c-primary);
}

select.profile-form__input,
.profile-form select {
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235b6b7b' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--c-bg);
    color: var(--c-text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
}

.container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ---------- Thanh tiêu đề ---------- */
.topbar {
    background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark));
    color: #fff;
    box-shadow: var(--shadow);
}
.topbar__inner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-top: 14px;
    padding-bottom: 14px;
}
.topbar__nav {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 20px;
    margin-right: auto;
    flex-wrap: wrap;
}
.topbar__nav-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 14px;
    border-radius: 8px;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    opacity: .85;
    transition: background .15s, opacity .15s;
    white-space: nowrap;
}
.topbar__nav-link:hover { background: rgba(255,255,255,.12); opacity: 1; }
.topbar__nav-link.is-active { background: rgba(255,255,255,.2); opacity: 1; }
.topbar__home {
    display: flex;
    align-items: center;
    gap: 14px;
    color: inherit;
    text-decoration: none;
}
.topbar__home:hover { opacity: .85; }
.topbar__logo { width: 42px; height: 42px; }
.topbar__unit {
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: .04em;
    opacity: .85;
}
.topbar__title {
    margin: 0;
    font-size: 21px;
    font-weight: 600;
}
/* ---------- Form tìm kiếm ---------- */
.search {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    margin: 22px 0 18px;
    /* Luôn hiện khi cuộn trang — cùng tầng z-index với các thanh sticky khác (.td-info-panel,
       .td-form-actions--sticky = 120); topbar không sticky nên không cần chừa top offset. */
    position: sticky;
    top: 0;
    z-index: 120;
}
.search__row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: stretch;
}
.search__field {
    position: relative;
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    padding: 0 10px 0 36px;
    min-height: 44px;
    min-width: 220px;
}
.search__field--grow { flex: 1 1 320px; }
.search__icon {
    position: absolute;
    left: 10px;
    width: 18px;
    height: 18px;
    opacity: .55;
}
.search__field input,
.search__field select {
    border: 0;
    outline: 0;
    background: transparent;
    width: 100%;
    height: 44px;
    font-size: 15px;
    color: var(--c-text);
}
.search__field select { cursor: pointer; }
.search__field input { padding-right: 28px; }
.search__clear {
    position: absolute;
    right: 8px;
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 50%;
    background: var(--c-text-soft);
    color: #fff;
    cursor: pointer;
    font-size: 0;
    line-height: 1;
    display: none;
    transition: background .15s, transform .15s;
}
.search__clear:hover {
    background: var(--c-text);
    transform: scale(1.12);
}
.search__clear:active {
    transform: scale(.92);
}
.search__clear.is-visible { display: inline-flex; align-items: center; justify-content: center; }
.search__clear .ui-icon {
    width: 14px;
    height: 14px;
}
.search__field--combo {
    flex: 0 1 360px;
    padding-right: 10px;
}
.search__field--combo .combo__input {
    cursor: text;
    padding-right: 0;
}
.combo__menu {
    position: absolute;
    /* Cao hơn thanh nút sticky của form (120), thấp hơn modal (1000). */
    z-index: 300;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 280px;
    overflow-y: auto;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(16, 42, 67, .14);
    display: none;
}
.search__field--combo.is-open .combo__menu { display: block; }
.combo__option {
    display: block;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--c-text);
    cursor: pointer;
    font: inherit;
    text-align: left;
}
.combo__option:hover,
.combo__option.is-active {
    background: #eef7f8;
    color: var(--c-primary-dark);
}
.combo__option[aria-selected="true"] {
    font-weight: 600;
    color: var(--c-primary-dark);
}
.combo__option[hidden] { display: none; }
.combo__empty {
    padding: 10px;
    color: var(--c-text-soft);
    font-size: 13.5px;
}
.search__field:focus-within {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(11, 110, 153, .12);
}

/* ---------- Nút ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 20px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, border-color .15s;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--primary { background: var(--c-primary); color: #fff; }
.btn--primary:hover { background: var(--c-primary-dark); }
.btn--ghost {
    background: #fff;
    color: var(--c-text-soft);
    border-color: var(--c-border);
}
.btn--ghost:hover { border-color: var(--c-primary); color: var(--c-primary); }

/* ---------- Thông báo / lỗi ---------- */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 12px 0;
}
.alert--error {
    background: #fdecec;
    border: 1px solid #f5c2c2;
    color: #a11717;
}
.alert--warning {
    background: #fff8e6;
    border: 1px solid #f5deb0;
    color: #8a5a00;
}

/* ---------- Tóm tắt kết quả ---------- */
.result-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--c-text-soft);
    margin: 4px 2px 10px;
    font-size: 14.5px;
}
.result-meta strong { color: var(--c-text); }
.result-meta__pp {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    white-space: nowrap;
}
.result-meta__pp select {
    border: 1px solid var(--c-border);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 13.5px;
    color: var(--c-text);
    background: #fff;
    cursor: pointer;
    outline: none;
}
.result-meta__pp select:focus {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(11, 110, 153, .12);
}

/* ---------- Bảng dữ liệu ---------- */
.table-wrap {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
    scrollbar-width: auto;
}
.table-wrap::-webkit-scrollbar {
    height: 16px;
}
.table-wrap::-webkit-scrollbar-track {
    background: var(--c-bg);
    border-radius: 8px;
}
.table-wrap::-webkit-scrollbar-thumb {
    background: #9aa5b1;
    border-radius: 8px;
    border: 3px solid transparent;
    background-clip: padding-box;
}
.table-wrap::-webkit-scrollbar-thumb:hover {
    background: var(--c-primary);
    background-clip: padding-box;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14.5px;
}
.data-table thead th {
    background: #eef3f8;
    color: var(--c-text-soft);
    text-align: left;
    font-weight: 600;
    padding: 12px 14px;
    border-bottom: 2px solid var(--c-border);
    white-space: nowrap;
    position: sticky;
    top: 0;
}
.data-table tbody td {
    padding: 11px 14px;
    border-bottom: 1px solid #eef2f6;
    vertical-align: top;
}
.data-table thead th.td-sortable {
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}
.data-table thead th.td-sortable:hover { color: var(--c-primary); }
.data-table thead th.td-sortable::after {
    content: '';
    display: inline-block;
    margin-left: 5px;
    vertical-align: middle;
    border: 4px solid transparent;
    border-top-color: currentColor;
    opacity: .3;
}
.data-table thead th.td-sortable.td-sort-asc::after { opacity: 1; transform: rotate(180deg); }
.data-table thead th.td-sortable.td-sort-desc::after { opacity: 1; }
.data-table tbody tr:hover { background: #f6fafd; }
.data-table tbody tr[data-href] { cursor: pointer; }
.data-table tbody tr[data-chuong] { cursor: pointer; -webkit-user-select: none; user-select: none; }
.data-table tbody tr.row-chuong { cursor: pointer; -webkit-user-select: none; user-select: none; }
.col-stt   { width: 64px;  text-align: right; color: var(--c-text-soft); }
.col-ma    { width: 110px; white-space: nowrap; }
.col-chuong{ width: 250px; color: var(--c-text-soft); font-size: 13.5px; }
.col-phanloai { width: 120px; text-align: center; color: var(--c-text-soft); white-space: nowrap; }
.col-ten   { font-weight: 500; }
.col-chuan { width: 56px; text-align: center; }

/* ---------- Cột "Chuẩn SYT": icon cảnh báo + popover khi rê chuột/click ---------- */
.chuan-warn {
    position: relative;
    display: inline-flex;
    cursor: help;
    outline: none;
}
.chuan-warn__icon {
    display: inline-flex;
    color: #f5a524;
}
.chuan-warn__icon--hanh-nghe { color: var(--c-primary); }
.chuan-warn__icon .ui-icon { width: 1.3em; height: 1.3em; }
/* Nội dung "nguồn" nằm ngay trong ô — luôn ẩn, JS chỉ đọc innerHTML rồi copy sang
   #chuanFloatPop (xem bên dưới), không hiển thị trực tiếp. */
.chuan-warn__src { display: none; }
/* #chuanFloatPop: 1 phần tử popover DÙNG CHUNG, JS gắn thẳng vào <body> khi cần hiện —
   KHÔNG lồng trong .chuan-warn. Lý do: (1) thoát khỏi .table-wrap { overflow-x: auto } cắt
   mất phần tràn ra ngoài bảng; (2) khi bảng nằm trong modal, .modal-box có transform (để
   canh giữa/hiệu ứng mở), mà transform trên bất kỳ tổ tiên nào sẽ đổi hệ toạ độ tham chiếu
   của con position:fixed bên trong nó — khiến toạ độ JS tính (theo viewport) bị lệch. Gắn
   thẳng vào <body> (không có transform) thì luôn định vị đúng theo viewport bất kể ngữ cảnh. */
.chuan-warn__pop {
    display: none;
    position: fixed;
    z-index: 2000;
    width: 320px;
    max-width: 80vw;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 12px 14px;
    text-align: left;
    white-space: normal;
    font-size: 13.5px;
    color: var(--c-text);
    cursor: default;
}
.chuan-warn__pop p { margin: 0 0 6px; }
.chuan-warn__pop p:last-child { margin-bottom: 0; }
.chuan-warn__pop.is-visible { display: block; }

.badge {
    display: inline-block;
    background: #e6f4f1;
    color: #0a7a72;
    border: 1px solid #bfe6e0;
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 13px;
    font-weight: 600;
}

/* ---------- Cột "Hành nghề": icon info + popover (Html::hanhNgheTags()), mỗi chức danh
   1 tag màu trên 1 hàng trong popover — xem cơ chế hover dùng chung ở .chuan-warn phía trên ---------- */
.col-hanh-nghe { width: 56px; text-align: center; }
.tag-hn {
    display: inline-block;
    border-radius: 6px;
    padding: 2px 8px;
    margin: 2px 4px 2px 0;
    font-size: 12.5px;
    font-weight: 600;
    border: 1px solid transparent;
    white-space: nowrap;
}
.tag-hn--blue   { background: #e3f0f8; color: #0b6e99; border-color: #c4e0ef; }
.tag-hn--teal   { background: #e1f5f0; color: #0f8a72; border-color: #bfe6da; }
.tag-hn--rose   { background: #fbe7ef; color: #b23b6b; border-color: #f3cddf; }
.tag-hn--purple { background: #f0e9fb; color: #6b3fa0; border-color: #ddccf2; }
.tag-hn--orange { background: #fdece0; color: #b25a1a; border-color: #f6d3b6; }
.tag-hn--red    { background: #fbe6e6; color: #b23a3a; border-color: #f3caca; }
.tag-hn--amber  { background: #f7ecd9; color: #8a6516; border-color: #ecd8ac; }
.tag-hn--indigo { background: #e6e9fb; color: #40469e; border-color: #ccd2f2; }
.tag-hn--olive  { background: #eef3d9; color: #62751a; border-color: #dbe6ae; }
.tag-hn--green  { background: #dfeee6; color: #2c6e52; border-color: #bfe0cf; }
mark { background: var(--c-mark); padding: 0 1px; border-radius: 3px; }

.empty {
    text-align: center;
    color: var(--c-text-soft);
    padding: 32px 14px !important;
    font-style: italic;
}

/* ---------- Checkbox & Export ---------- */
.col-chk { width: 40px; text-align: center; }
.col-chk input[type="checkbox"],
.chk-chuong { cursor: pointer; width: 17px; height: 17px; accent-color: var(--c-primary); }

.row-chuong { background: #eef3f8; }
.row-chuong td { padding: 8px 14px; }
.chuong-label { font-weight: 600; color: var(--c-primary-dark); font-size: 13.5px; }

.data-table tbody tr.is-selected { background: #e8f4fd; }

.btn--sm { min-height: 36px; padding: 0 16px; font-size: 14px; }

.export-bar {
    position: sticky;
    bottom: 0;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: 0 -2px 12px rgba(16,42,67,.1);
    padding: 12px 18px;
    margin: 12px 0;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 14.5px;
    color: var(--c-text-soft);
    z-index: 10;
}

/* ---------- Panel chọn kỹ thuật ---------- */
.selection-panel {
    position: fixed;
    /* Chừa chỗ cho nút chat nổi góc dưới phải (.chat-widget: bottom 22px + cao 58px) để 2 khối
       không đè lên nhau. */
    bottom: 96px;
    right: 20px;
    width: 300px;
    z-index: 50;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: 16px;
    box-shadow: 0 6px 28px rgba(16, 42, 67, .14);
    display: none;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow .2s;
}
.selection-panel.is-visible { display: flex; }

.selection-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark));
    color: #fff;
    cursor: pointer;
    user-select: none;
    gap: 8px;
}
.selection-panel__summary {
    font-size: 14px;
    font-weight: 600;
    flex: 1;
}
.selection-panel__summary strong {
    font-size: 18px;
}
.selection-panel__toggle {
    border: 0;
    background: rgba(255,255,255,.2);
    color: #fff;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, transform .25s;
    flex-shrink: 0;
}
.selection-panel__toggle:hover { background: rgba(255,255,255,.35); }
.selection-panel.is-expanded .selection-panel__toggle { transform: rotate(180deg); }

.selection-panel__body {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
}
.selection-panel.is-expanded .selection-panel__body {
    max-height: 400px;
    overflow-y: auto;
}

.selection-panel__list {
    padding: 8px 14px;
}
.sidebar-chuong {
    display: flex;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid #eef2f6;
    font-size: 13.5px;
    color: var(--c-text);
    cursor: pointer;
    gap: 6px;
    user-select: none;
    border-radius: 6px;
    padding: 7px 8px;
    margin: 0 -8px;
    transition: background .15s;
}
.sidebar-chuong:last-child { border-bottom: 0; }
.sidebar-chuong:hover { background: #eef7f8; color: var(--c-primary); }
.sidebar-chuong.is-active-chuong { background: #ddf0f8; color: var(--c-primary-dark); font-weight: 600; }
.sidebar-chuong__name {
    flex: 1;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-chuong__count {
    flex-shrink: 0;
    background: var(--c-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 10px;
    min-width: 24px;
    text-align: center;
}

.btn-show-all {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 8px;
    margin-top: 4px;
    border: 1px dashed var(--c-border);
    border-radius: 8px;
    background: transparent;
    color: var(--c-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.btn-show-all:hover { background: #eef7f8; }


/* ---------- Phân trang ---------- */
.pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 18px 0 30px;
}
.pager__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    background: #fff;
    color: var(--c-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}
.pager__btn:hover { border-color: var(--c-primary); color: var(--c-primary); }
.pager__btn.is-active {
    background: var(--c-primary);
    border-color: var(--c-primary);
    color: #fff;
}
.pager__info { margin-left: 8px; color: var(--c-text-soft); font-size: 13.5px; }
.pager__pp {
    margin-left: 4px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    color: var(--c-text-soft);
    white-space: nowrap;
}
.pager__pp select {
    border: 1px solid var(--c-border);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 13.5px;
    color: var(--c-text);
    background: #fff;
    cursor: pointer;
    outline: none;
}
.pager__pp select:focus {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(11, 110, 153, .12);
}

/* ---------- Toast báo tự động lưu / lưu nháp ---------- */
.autosave-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translate(-50%, 16px);
    z-index: 2000;
    padding: 10px 18px;
    border-radius: 8px;
    background: #1f2937;
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .25);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s, transform .2s, visibility .2s;
}
.autosave-toast.is-show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}
.autosave-toast.is-error { background: #c62828; }

/* ---------- Modal xác nhận ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    /* Luôn phủ lên các thanh sticky (thông tin hồ sơ/thao tác form: z-index 120). */
    z-index: 1000;
    background: rgba(15, 23, 42, .45);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s, visibility .2s;
}
.modal-overlay.is-open { opacity: 1; visibility: visible; }

.modal-box {
    background: var(--c-surface);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(16, 42, 67, .2);
    padding: 32px 28px 24px;
    width: 92%;
    max-width: 380px;
    text-align: center;
    transform: scale(.9) translateY(12px);
    transition: transform .25s ease;
}
.modal-overlay.is-open .modal-box { transform: scale(1) translateY(0); }

.modal-box__icon { margin-bottom: 14px; line-height: 0; }
.modal-box__title {
    margin: 0 0 8px;
    font-size: 17px;
    font-weight: 700;
    color: var(--c-text);
}
.modal-box__msg {
    margin: 0 0 22px;
    font-size: 14px;
    color: var(--c-text-soft);
    line-height: 1.55;
}
.modal-box__actions { display: flex; gap: 10px; justify-content: center; }
.modal-box__actions .btn { min-width: 105px; }
.btn--danger { background: #dc3545; color: #fff; border-color: transparent; }
.btn--danger:hover { background: #b52a37; }
.btn--clear { background: #f57c00; color: #fff; border-color: transparent; }
.btn--clear:hover { background: #e65100; }
.btn--orange { background: #f0ad4e; color: #fff; border-color: transparent; }
.btn--orange:hover { background: #ec971f; }
.btn--navy { background: #2b579a; color: #fff; border-color: transparent; }
.btn--navy:hover { background: #1e3d6f; }
.btn--green { background: #28a745; color: #fff; border-color: transparent; }
.btn--green:hover { background: #1e7e34; }
.btn--purple { background: #8b5cf6; color: #fff; border-color: transparent; }
.btn--purple:hover { background: #7440e6; }
.btn--purple-light { background: #ede9fe; color: #6d28d9; border-color: transparent; }
.btn--purple-light:hover { background: #ddd6fe; }
.btn--pink { background: #ec4899; color: #fff; border-color: transparent; }
.btn--pink:hover { background: #db2777; }
.qty-clear-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 0;
    background: #f57c00;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    vertical-align: middle;
    margin-left: 4px;
    transition: background .15s;
}
.qty-clear-btn:hover { background: #e65100; }

/* ---------- Đăng nhập ---------- */
.login-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 16px;
}
.login-form {
    width: 100%;
    max-width: 400px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px 28px;
}
.login-form__title {
    margin: 0 0 24px;
    font-size: 22px;
    font-weight: 700;
    color: var(--c-primary-dark);
    text-align: center;
}
.login-form__label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--c-text);
}
.login-form__input {
    display: block;
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 18px;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    font-size: 15px;
    color: var(--c-text);
    background: #fff;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.login-form__input:focus {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(11, 110, 153, .12);
}
.login-form__btn {
    width: 100%;
    margin-top: 6px;
}
.login-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0;
    color: var(--c-text-soft, #8a94a6);
    font-size: 13px;
}
.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--c-border);
}

/* ---------- User bar ---------- */
.user-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    font-size: 13.5px;
    color: rgba(255,255,255,.85);
}
.user-bar__name {
    font-weight: 600;
    color: #fff;
    text-decoration: none;
}
.user-bar__name:hover { text-decoration: underline; }
.user-bar__role {
    background: rgba(255,255,255,.18);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
}
.user-bar__logout {
    color: rgba(255,255,255,.7);
    text-decoration: none;
    font-size: 13px;
    padding: 4px 10px;
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 6px;
    transition: background .15s, color .15s;
}
.user-bar__logout:hover {
    background: rgba(255,255,255,.15);
    color: #fff;
}

/* ---------- Alert thành công ---------- */
.alert--success {
    background: #e8f8ef;
    border: 1px solid #b5e6ca;
    color: #1a7a42;
}

/* ---------- Trang cá nhân ---------- */
.profile-wrap {
    max-width: 600px;
    margin: 30px auto;
    padding: 0 16px;
}
.profile-wrap--wide {
    max-width: 960px;
}
.profile-header {
    margin-bottom: 20px;
}
.profile-back {
    font-size: 14px;
    color: var(--c-primary);
    text-decoration: none;
}
.profile-back:hover { text-decoration: underline; }
.profile-header__title {
    margin: 10px 0 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--c-primary-dark);
}
.profile-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--c-border);
    margin-bottom: 24px;
}
.profile-tab {
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 600;
    color: var(--c-text-soft);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color .15s, border-color .15s;
}

/* ---------- Tab segmented cho danh sách hồ sơ (Tôi khởi tạo / Đã hoàn thành) ---------- */
.td-list-tabs {
    display: inline-flex;
    gap: 4px;
    background: var(--c-bg, #f1f5f9);
    border: 1px solid var(--c-border);
    border-radius: 12px;
    padding: 5px;
    margin-bottom: 20px;
    max-width: 100%;
    flex-wrap: wrap;
}
.td-list-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    font-size: 14px;
    font-weight: 600;
    color: var(--c-text-soft);
    background: none;
    border: 0;
    border-radius: 9px;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: background .15s, color .15s, box-shadow .15s;
}
.td-list-tab:hover { color: var(--c-primary); }
.td-list-tab.is-active {
    background: var(--c-surface, #fff);
    color: var(--c-primary);
    box-shadow: 0 1px 4px rgba(15, 23, 42, .12);
}
.td-list-tab__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    color: var(--c-text-soft);
    background: rgba(15, 23, 42, .08);
    border-radius: 999px;
}
.td-list-tab.is-active .td-list-tab__badge {
    color: #fff;
    background: var(--c-primary);
}
.td-list-tab__badge--danger,
.td-list-tab.is-active .td-list-tab__badge--danger {
    color: #fff;
    background: #dc3545;
}
.td-list-tab__badge--orange,
.td-list-tab.is-active .td-list-tab__badge--orange {
    color: #fff;
    background: #f0ad4e;
}
.td-list-tab__badge--orange-dark,
.td-list-tab.is-active .td-list-tab__badge--orange-dark {
    color: #fff;
    background: #e65100;
}
.td-list-tab__badge--black,
.td-list-tab.is-active .td-list-tab__badge--black {
    color: #fff;
    background: #212529;
}
.td-list-tab__badge--blue,
.td-list-tab.is-active .td-list-tab__badge--blue {
    color: #fff;
    background: var(--c-primary);
}
.td-list-tab__badge--green,
.td-list-tab.is-active .td-list-tab__badge--green {
    color: #fff;
    background: #28a745;
}
.profile-tab:hover { color: var(--c-primary); }
.profile-tab.is-active {
    color: var(--c-primary);
    border-bottom-color: var(--c-primary);
}
.profile-form {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px 24px;
}
.profile-form__group {
    margin-bottom: 18px;
}
.profile-form--grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 20px;
}
.profile-form--grid .profile-form__group--full {
    grid-column: 1 / -1;
}
@media (max-width: 640px) {
    .profile-form--grid { grid-template-columns: 1fr; }
}
.profile-form__label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--c-text);
}
.required { color: #dc3545; }
.profile-form__input {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    font-size: 15px;
    color: var(--c-text);
    background: #fff;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.profile-form__input:focus {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(11, 110, 153, .12);
}
/* .profile-form__input dùng chung cho input/select/textarea — textarea cần thêm font-family
   (trình duyệt không tự kế thừa font-family cho textarea, mặc định fallback về UI monospace)
   và line-height dễ đọc hơn cho văn bản nhiều dòng, cộng chiều cao tối thiểu cao hơn rows="3". */
textarea.profile-form__input {
    font-family: inherit;
    line-height: 1.6;
    min-height: 110px;
    resize: vertical;
}

/* ---------- Rich-text editor thay textarea plain-text (assets/js/rich_markup_editor.js) ----------
   Toolbar B/I/U để người dùng bôi đen rồi bấm, không cần biết cú pháp markup đậm/nghiêng/gạch chân. */
.rich-markup-editor {
    border: 2px solid #aab8c5;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}
.rich-markup-editor__toolbar {
    display: flex;
    gap: 2px;
    padding: 6px;
    background: #f6f8fa;
    border-bottom: 1px solid var(--c-border);
}
.rich-markup-editor__btn {
    width: 30px;
    height: 28px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--c-text);
    font-size: 14px;
    cursor: pointer;
    line-height: 1;
}
.rich-markup-editor__btn:hover {
    background: #fff;
    border-color: var(--c-border);
}
.rich-markup-editor__body {
    padding: 10px 12px;
    min-height: 110px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--c-text);
    outline: none;
}
.rich-markup-editor__body:focus {
    box-shadow: inset 0 0 0 2px rgba(11, 110, 153, .12);
}
.profile-form__input:disabled {
    background: #f0f3f6;
    color: var(--c-text-soft);
    cursor: not-allowed;
}
.profile-form__hint {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    color: var(--c-text-soft);
}
.profile-form__meta {
    background: #f8fafc;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.8;
    color: var(--c-text-soft);
}
.profile-form__meta strong {
    color: var(--c-text);
}
.profile-form__btn {
    margin-top: 6px;
}

/* ---------- Chân trang ---------- */
.footer {
    margin-top: 10px;
    padding: 18px 0;
    color: var(--c-text-soft);
    font-size: 13px;
    text-align: center;
    border-top: 1px solid var(--c-border);
}

/* ---------- Nút accent ---------- */
.btn--accent { background: var(--c-accent); color: #fff; }
.btn--accent:hover { background: #0d9e97; }

/* ---------- Panel danh mục đã lưu ---------- */
.cache-panel {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin: 14px 0;
    overflow: hidden;
}
.cache-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    cursor: pointer;
    user-select: none;
    background: #f8fafc;
    border-bottom: 1px solid var(--c-border);
}
.cache-panel__title {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--c-primary-dark);
}
.cache-panel__toggle {
    border: 0;
    background: transparent;
    color: var(--c-text-soft);
    font-size: 14px;
    cursor: pointer;
    transition: transform .25s;
}
.cache-panel.is-open .cache-panel__toggle { transform: rotate(180deg); }
.cache-panel__body {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
}
.cache-panel.is-open .cache-panel__body {
    max-height: 600px;
    overflow-y: auto;
}

.cache-list { padding: 8px 12px; }
.cache-list__empty {
    text-align: center;
    color: var(--c-text-soft);
    padding: 16px;
    font-size: 14px;
    font-style: italic;
}

.cache-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid #eef2f6;
    border-radius: 8px;
    transition: background .15s;
}
.cache-item:last-child { border-bottom: 0; }
.cache-item:hover { background: #f6fafd; }
.cache-item__info {
    flex: 1;
    min-width: 0;
}
.cache-item__name {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--c-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cache-item__owner {
    display: inline-block;
    background: #e8eaf6;
    color: #283593;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 8px;
    margin-left: 6px;
    vertical-align: middle;
}
.cache-item__meta {
    font-size: 12px;
    color: var(--c-text-soft);
    margin-top: 2px;
}
.cache-item__count {
    flex-shrink: 0;
    background: var(--c-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 24px;
    text-align: center;
}
.cache-item__actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
.cache-btn {
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 600;
    transition: background .15s;
}
.cache-btn--load { color: var(--c-primary); }
.cache-btn--load:hover { background: #e3f2fd; }
.cache-btn--save { color: #0d9e97; }
.cache-btn--save:hover { background: #e0f7f5; }
.cache-btn--rename { color: #e65100; }
.cache-btn--rename:hover { background: #fff3e0; }
.cache-btn--del { color: #c62828; }
.cache-btn--del:hover { background: #fce4ec; }
.cache-btn--saved-flash {
    background: #e0f7e9 !important;
    color: #2e7d32 !important;
    transition: background .2s, color .2s;
}

/* ---------- Kéo thả sắp xếp lại thứ tự (hội đồng thẩm định) ---------- */
.hdtd-drag-cell { width: 28px; padding-left: 6px !important; padding-right: 0 !important; }
.hdtd-drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    color: var(--c-text-soft);
    padding: 4px;
    border-radius: 4px;
}
.hdtd-drag-handle:hover { background: #eef3f8; color: var(--c-text); }
.hdtd-drag-handle:active { cursor: grabbing; }
.hdtd-row.hdtd-dragging { opacity: .4; background: #eef3f8; }

/* Kéo thả sắp xếp dòng nhân sự (form tạo/sửa hồ sơ) */
.ns-drag-cell { width: 28px; padding-left: 6px !important; padding-right: 0 !important; }
.ns-drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    color: var(--c-text-soft);
    padding: 4px;
    border-radius: 4px;
}
.ns-drag-handle:hover { background: #eef3f8; color: var(--c-text); }
.ns-drag-handle:active { cursor: grabbing; }
.ns-row.ns-dragging { opacity: .4; background: #eef3f8; }

/* ---------- Chia sẻ hồ sơ ---------- */
.td-share-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 16px;
    background: #f8fafc;
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    margin-bottom: 12px;
}
.td-share-bar__label {
    font-size: 13px;
    font-weight: 600;
    color: var(--c-text-soft);
    margin-right: 2px;
}
.td-share-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #e8eaf6;
    color: #283593;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}
.td-share-tag__remove {
    border: 0;
    background: transparent;
    color: #5c6bc0;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
    margin-left: 2px;
    border-radius: 50%;
    transition: all .15s;
}
.td-share-tag__remove:hover { color: #fff; background: #c62828; }
.share-modal__search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding: 0 12px;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    background: #fff;
}
.share-modal__search .ui-icon { width: 16px; height: 16px; opacity: .55; flex-shrink: 0; }
.share-modal__search input {
    flex: 1;
    border: 0;
    outline: 0;
    height: 40px;
    font-size: 14.5px;
    background: transparent;
}
.share-modal__list {
    margin-top: 10px;
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid var(--c-border);
    border-radius: 8px;
}
.share-modal__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f0f3f7;
    font-size: 14.5px;
}
.share-modal__item:last-child { border-bottom: 0; }
.share-modal__item:hover { background: #f6fafd; }
.share-modal__item[hidden] { display: none; }
.share-modal__checkbox { width: 16px; height: 16px; flex-shrink: 0; cursor: pointer; }
.share-modal__empty { padding: 20px 14px; text-align: center; color: var(--c-text-soft); font-size: 13.5px; }
.td-share-select {
    display: block;
    width: 100%;
    font-size: 14.5px;
    padding: 10px 36px 10px 14px;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    background: #fff;
    color: var(--c-text);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235b6b7b' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: border-color .2s, box-shadow .2s;
}
.td-share-select:focus {
    outline: none;
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(11,110,153,.12);
}
.td-share-select:hover { border-color: var(--c-primary); }

/* ---------- Trạng thái hồ sơ thẩm định ---------- */
.td-status {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 8px;
    vertical-align: middle;
}
.td-status--draft  { background: #f3f4f6; color: #6b7280; }
.td-status--new    { background: #dbeafe; color: #1d4ed8; }
.td-status--invite { background: #fef3c7; color: #b45309; }

/* ---------- Nhân sự chứng chỉ ---------- */
.ns-cc-summary { background: #f8fafc; }
.ns-cc-summary td { border-top: 0 !important; padding-top: 0 !important; padding-bottom: 6px !important; }
.ns-cc-text { padding-left: 20px !important; }
.ns-cc-line {
    font-size: 14px;
    color: var(--c-text-soft);
    padding: 4px 0;
    line-height: 1.6;
}
.ns-cc-line strong { color: var(--c-text); }
@media (max-width: 720px) {
    .ns-cc-line { font-size: 11px; padding: 2px 0; line-height: 1.4; }
    .ns-cc-line strong { font-size: 11px; }
    .ns-cc-text { padding-left: 8px !important; }
}

/* CC Modal items */
.cc-item {
    background: #f8fafc;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 10px;
    position: relative;
}
.cc-item__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.cc-item__field { display: flex; flex-direction: column; }
.cc-item__label {
    font-size: 12px;
    font-weight: 600;
    color: var(--c-text-soft);
    margin-bottom: 4px;
}
.cc-item__field .profile-form__input { font-size: 14px; padding: 8px 10px; }
.cc-field-invalid.profile-form__input { border-color: #dc3545 !important; box-shadow: 0 0 0 2px rgba(220,53,69,.15); }
.profile-form__group.cc-field-invalid {
    outline: 2px solid #dc3545;
    outline-offset: 4px;
    border-radius: 6px;
}
.cc-item__actions {
    text-align: right;
    margin-top: 8px;
}

/* ---------- Step tabs ---------- */
.step-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    background: var(--c-surface);
    color: var(--c-text-soft);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all .15s;
    cursor: pointer;
}
.step-tab__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 800;
    flex-shrink: 0;
    color: #fff;
}
.step-tab--1 .step-tab__num { background: #0b6e99; }
.step-tab--2 .step-tab__num { background: #e65100; }
.step-tab--3 .step-tab__num { background: #2e7d32; }
.step-tab--1:hover, .step-tab--1.is-active { border-color: #0b6e99; color: #0b6e99; }
.step-tab--2:hover, .step-tab--2.is-active { border-color: #e65100; color: #e65100; }
.step-tab--3:hover, .step-tab--3.is-active { border-color: #2e7d32; color: #2e7d32; }
.step-tab--1.is-active { background: #0b6e99; color: #fff; }
.step-tab--2.is-active { background: #e65100; color: #fff; }
.step-tab--3.is-active { background: #2e7d32; color: #fff; }
.step-tab.is-active .step-tab__num { background: rgba(255,255,255,.3); }

/* ---------- PD modal rows ---------- */
.pd-row {
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* ---------- KT list button ---------- */
.kt-list-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--c-primary);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: transform .12s, box-shadow .12s;
    box-shadow: 0 2px 6px rgba(11,110,153,.2);
}
.kt-list-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(11,110,153,.3);
}
.kt-list-btn--accent {
    background: var(--c-accent);
}

/* ---------- Ngày trả KQ urgent ---------- */
.td-date-urgent {
    color: #dc3545 !important;
    font-weight: 700;
}
.td-date-countdown {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #dc3545;
}

/* ---------- KT count badge ---------- */
.kt-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
    color: #fff;
    padding: 12px 20px;
    border-radius: 12px;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    box-shadow: 0 2px 8px rgba(11,110,153,.2);
}
.kt-count-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(11,110,153,.3);
}
.kt-count-badge__num {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
}
.kt-count-badge__label {
    font-size: 14px;
    font-weight: 600;
    opacity: .9;
}

/* ---------- Danh mục tabs ---------- */
.dm-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}
.dm-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid var(--c-border);
    border-radius: 10px;
    background: var(--c-surface);
    color: var(--c-text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all .15s;
    cursor: pointer;
}
.dm-tab:hover {
    background: #eef6fb;
    border-color: var(--c-primary);
    color: var(--c-primary);
}
.dm-tab.is-active {
    background: var(--c-primary);
    border-color: var(--c-primary);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(11,110,153,.2);
}
.dm-tab__icon { font-size: 16px; line-height: 1; }
.dm-tab__label { white-space: nowrap; }

/* ---------- Quy trình tags ---------- */
.qt-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}
.qt-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #e8eaf6;
    color: #283593;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}
.qt-tag__del {
    border: 0;
    background: transparent;
    color: #5c6bc0;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
    margin-left: 2px;
    border-radius: 50%;
    transition: all .15s;
}
.qt-tag__del:hover { color: #fff; background: #c62828; }

/* ---------- Toggle theo bảng kê ---------- */
.td-toggle-bk {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--c-primary-dark);
    cursor: pointer;
    padding: 8px 16px;
    background: #eef6fb;
    border: 1px solid #c4dff0;
    border-radius: 8px;
    transition: background .15s, border-color .15s;
}
.td-toggle-bk:hover {
    background: #dceef8;
    border-color: var(--c-primary);
}
.td-toggle-bk input[type="checkbox"]:checked ~ .td-toggle-bk__text {
    color: var(--c-primary);
}

/* ---------- Detail view ---------- */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 24px;
    margin-bottom: 12px;
}
.detail-item { display: flex; flex-direction: column; gap: 2px; }
.detail-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--c-text-soft);
    text-transform: uppercase;
    letter-spacing: .3px;
}
.detail-value {
    font-size: 14.5px;
    color: var(--c-text);
}

/* ---------- Datepicker ---------- */
.datepicker {
    position: absolute;
    z-index: 1000;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    padding: 12px;
    width: 280px;
    display: none;
    user-select: none;
}
.datepicker.is-open { display: block; }
.datepicker__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.datepicker__title {
    font-size: 14px;
    font-weight: 700;
    color: var(--c-text);
}
.datepicker__nav {
    border: 0;
    background: transparent;
    font-size: 20px;
    color: var(--c-text-soft);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}
.datepicker__nav:hover { background: var(--c-bg); color: var(--c-text); }
.datepicker__days,
.datepicker__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    gap: 2px;
}
.datepicker__dow {
    font-size: 11px;
    font-weight: 700;
    color: var(--c-text-soft);
    padding: 4px 0;
}
.datepicker__blank { }
.datepicker__day {
    font-size: 13px;
    padding: 6px 0;
    border-radius: 50%;
    cursor: pointer;
    transition: background .12s, color .12s;
    line-height: 1;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.datepicker__day:hover { background: #e3f2fd; color: var(--c-primary); }
.datepicker__day.is-today { font-weight: 700; color: var(--c-primary); background: #e0f7fa; }
.datepicker__day.is-selected { background: var(--c-primary); color: #fff; font-weight: 700; }
.datepicker__title-month,
.datepicker__title-year {
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background .12s;
}
.datepicker__title-month:hover,
.datepicker__title-year:hover { background: var(--c-bg); }
.datepicker__month-grid,
.datepicker__year-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 4px 0;
}
.datepicker__month-btn,
.datepicker__year-btn {
    padding: 8px 4px;
    text-align: center;
    font-size: 13px;
    border-radius: 8px;
    cursor: pointer;
    transition: background .12s, color .12s;
}
.datepicker__month-btn:hover,
.datepicker__year-btn:hover { background: #e3f2fd; color: var(--c-primary); }
.datepicker__month-btn.is-selected,
.datepicker__year-btn.is-selected { background: var(--c-primary); color: #fff; font-weight: 700; }

.timepicker {
    position: absolute;
    z-index: 1000;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    display: none;
    user-select: none;
    overflow: hidden;
}
.timepicker.is-open { display: flex; }
.timepicker__col {
    width: 60px;
    max-height: 220px;
    overflow-y: auto;
    padding: 4px 0;
}
.timepicker__col + .timepicker__col { border-left: 1px solid var(--c-border); }
.timepicker__opt {
    padding: 6px 0;
    text-align: center;
    font-size: 13px;
    cursor: pointer;
    transition: background .12s, color .12s;
}
.timepicker__opt:hover { background: #e3f2fd; color: var(--c-primary); }
.timepicker__opt.is-selected { background: var(--c-primary); color: #fff; font-weight: 700; }

/* ---------- Toast thông báo ---------- */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1f2a37;
    color: #fff;
    padding: 10px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 6px 24px rgba(0,0,0,.2);
    z-index: 200;
    opacity: 0;
    transition: opacity .25s, transform .25s;
    pointer-events: none;
}
.toast.is-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.toast--center {
    bottom: auto;
    top: 50%;
    transform: translate(-50%, -50%) scale(.92);
    font-size: 15px;
    padding: 14px 28px;
}
.toast--center.is-show {
    transform: translate(-50%, -50%) scale(1);
}

.open-hint-arrow {
    position: fixed;
    bottom: 80px;
    right: 150px;
    z-index: 60;
    font-size: 54px;
    line-height: 1;
    color: #dc3545;
    opacity: 0;
    transition: opacity .25s;
    pointer-events: none;
    text-shadow: 0 2px 8px rgba(0,0,0,.18);
    animation: openHintBounce .8s ease-in-out infinite;
}
.open-hint-arrow.is-show { opacity: 1; }
@keyframes openHintBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(10px); }
}

/* ---------- Admin nav chung ---------- */
.admin-nav {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    padding: 4px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
}
.admin-nav__item {
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 600;
    color: var(--c-text-soft);
    text-decoration: none;
    border-radius: 8px;
    transition: background .15s, color .15s;
}
.admin-nav__item:hover { background: #f0f4f8; color: var(--c-primary); }
.admin-nav__item.is-active {
    background: var(--c-primary);
    color: #fff;
}

/* ---------- Trang quản lý tài khoản ---------- */
.admin-wrap {
    max-width: 1600px;
    margin: 30px auto;
    padding: 0 16px;
}
/* .admin-shell: modifier riêng cho các trang có sidebar Quản lý (xem _admin_sidebar.php) —
   KHÔNG gộp thẳng vào .admin-wrap vì class đó còn được dùng làm khung nội dung thường (không
   sidebar) ở rất nhiều trang khác (dashboard*.php, tham_dinh.php, tra_cuu_chuyen_gia.php,
   viber_notify.php...). */
.admin-wrap.admin-shell {
    display: flex;
    align-items: flex-start;
    gap: 24px;
}
.admin-main { flex: 1 1 auto; min-width: 0; }

/* ---------- Sidebar dọc khu vực Quản lý ---------- */
.admin-sidebar {
    display: flex;
    flex-direction: column;
    width: 250px;
    flex: 0 0 250px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 12px;
    position: sticky;
    top: 16px;
    transition: width .18s ease, flex-basis .18s ease;
}
.admin-sidebar.is-collapsed { width: 68px; flex-basis: 68px; }
.admin-sidebar.is-collapsed .admin-sidebar__label,
.admin-sidebar.is-collapsed .admin-sidebar__chevron,
.admin-sidebar.is-collapsed .admin-sidebar__group.is-open > .admin-sidebar__submenu,
.admin-sidebar.is-collapsed .admin-sidebar__submenu { display: none; }
.admin-sidebar.is-collapsed .admin-sidebar__collapse .ui-icon { transform: rotate(180deg); }

.admin-sidebar__nav { display: flex; flex-direction: column; gap: 3px; }
.admin-sidebar__item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    background: transparent;
    border-radius: 8px;
    color: var(--c-text-soft);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}
.admin-sidebar__item .ui-icon { width: 18px; height: 18px; flex: 0 0 18px; }
.admin-sidebar__label { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-sidebar__item:hover { background: #f0f4f8; color: var(--c-primary); }
.admin-sidebar__item.is-active { background: var(--c-primary); color: #fff; }
.admin-sidebar__chevron { width: 15px !important; height: 15px !important; flex: 0 0 15px !important; transition: transform .15s ease; }
.admin-sidebar__group.is-open > .admin-sidebar__item--parent .admin-sidebar__chevron { transform: rotate(180deg); }

.admin-sidebar__submenu {
    display: none;
    flex-direction: column;
    gap: 2px;
    margin: 2px 0 6px 14px;
    padding-left: 14px;
    border-left: 2px solid var(--c-border);
}
.admin-sidebar__group.is-open > .admin-sidebar__submenu { display: flex; }
.admin-sidebar__subitem {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--c-text-soft);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
}
.admin-sidebar__subitem .ui-icon { width: 16px; height: 16px; flex: 0 0 16px; }
.admin-sidebar__subitem:hover { background: #f0f4f8; color: var(--c-primary); }
.admin-sidebar__subitem.is-active { background: var(--c-primary-light, #e8f0fe); color: var(--c-primary); font-weight: 700; }

.admin-sidebar__collapse {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 9px 12px;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    background: transparent;
    color: var(--c-text-soft);
    font-size: 12.5px;
    font-family: inherit;
    cursor: pointer;
}
.admin-sidebar__collapse:hover { color: var(--c-primary); border-color: var(--c-primary); }
.admin-sidebar__collapse .ui-icon { width: 15px; height: 15px; transition: transform .18s ease; }

@media (max-width: 880px) {
    .admin-wrap.admin-shell { flex-direction: column; }
    .admin-sidebar { width: 100%; flex-basis: auto; position: static; }
    .admin-sidebar.is-collapsed { width: 100%; }
    .admin-sidebar__collapse { display: none; }
}
.admin-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}
.admin-toolbar__info {
    font-size: 14.5px;
    color: var(--c-text-soft);
}
.admin-toolbar__info strong { color: var(--c-text); }

.admin-table th { font-size: 13.5px; }
.col-center { text-align: center; }
.text-soft { color: var(--c-text-soft); font-size: 13.5px; }

.row-inactive { opacity: .55; }

.role-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.role-badge--1 { background: #fce4ec; color: #c62828; }
.role-badge--2 { background: #e8eaf6; color: #283593; }
.role-badge--3 { background: #e8f5e9; color: #2e7d32; }

.status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.status-badge--active { background: #e8f5e9; color: #2e7d32; }
.status-badge--locked { background: #fce4ec; color: #c62828; }

.action-btns {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}
.btn-action {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background .15s;
}
.btn-action--edit {
    background: #e3f2fd;
    color: #1565c0;
}
.btn-action--edit:hover { background: #bbdefb; }
.btn-action--delete {
    background: #fce4ec;
    color: #c62828;
}
.btn-action--delete:hover { background: #f8bbd0; }
.btn-action--assign {
    background: #ede7f6;
    color: #5e35b1;
}
.btn-action--assign:hover { background: #d1c4e9; }
.btn-action--log {
    background: #e8eaf6;
    color: #283593;
}
.btn-action--log:hover { background: #c5cae9; }
.btn-action--view {
    background: #e8f5e9;
    color: #2e7d32;
}
.btn-action--view:hover { background: #c8e6c9; }

.admin-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 24px;
}
.admin-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--c-border);
}
.td-form-actions--sticky {
    position: sticky;
    bottom: 8px;
    z-index: 120;
    align-items: center;
    flex-wrap: wrap;
    margin: 24px -10px 0;
    padding: 12px 14px;
    border: 1px solid var(--c-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, .12);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}
.admin-section-divider {
    height: 1px;
    background: var(--c-border);
    margin: 28px 0 20px;
}
.admin-section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--c-primary-dark);
    margin: 0 0 16px;
}

/* ---------- Thẩm định MKT ---------- */
.td-workflow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 20px 0 16px;
}
.td-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.td-step__num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    background: var(--c-border);
    color: var(--c-text-soft);
    transition: background .2s, color .2s;
}
.td-step.is-done .td-step__num {
    background: var(--c-primary);
    color: #fff;
}
.td-step.is-current .td-step__num {
    background: var(--c-accent);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(15, 181, 173, .2);
}
.td-step__label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--c-text-soft);
    white-space: nowrap;
}
.td-step.is-done .td-step__label { color: var(--c-primary-dark); }
.td-step.is-current .td-step__label { color: var(--c-accent); }
.td-step__line {
    flex: 0 0 60px;
    height: 3px;
    background: var(--c-border);
    margin: 0 6px;
    margin-bottom: 20px;
    border-radius: 2px;
    transition: background .2s;
}
.td-step__line.is-done { background: var(--c-primary); }

.td-info-panel {
    position: sticky;
    top: 8px;
    z-index: 120;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    background: rgba(248, 250, 252, .96);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .12);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}
.td-info-bar {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
    flex: 1 1 280px;
    min-width: 0;
}
.td-info-bar > div { max-width: 100%; overflow-wrap: break-word; }
.td-info-bar strong { color: var(--c-text); margin-right: 4px; }
.td-export-bar {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    justify-content: flex-end;
    flex: 0 0 auto;
    gap: 6px;
}

.td-status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.td-status--hidden  { background: #f5f5f5; color: #bdbdbd; border: 1px dashed #ccc; text-decoration: line-through; }
.td-status--draft   { background: #f5f5f5; color: #9e9e9e; border: 1px dashed #bdbdbd; }
.td-status--new     { background: #e3f2fd; color: #1565c0; }
.td-status--invite  { background: #fff3e0; color: #e65100; }
.td-status--minutes { background: #e8eaf6; color: #283593; }
.td-status--done    { background: #e8f5e9; color: #2e7d32; }

.td-substatus {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
    vertical-align: middle;
}
.td-substatus--warn { background: #fff3e0; color: #b45309; }
.td-substatus--info { background: #e3f2fd; color: #1565c0; }
.td-substatus--danger { background: #dc3545; color: #fff; }

.td-combo {
    min-width: 0;
    width: 100%;
    padding-left: 10px;
}
.td-combo .combo__input { padding-left: 0; height: 40px; }
.td-combo .combo__menu { max-height: 300px; }

.td-form-heading {
    font-size: 15px;
    font-weight: 700;
    color: var(--c-primary-dark);
    margin: 20px 0 10px;
    padding-top: 14px;
    border-top: 1px solid var(--c-border);
}
.td-form-heading--first {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

/* ---------- Đính kèm hình/PDF trong tab Trao đổi nội bộ ---------- */
.td-trao-doi-attach-img {
    display: block;
    max-width: 220px;
    max-height: 220px;
    margin-top: 6px;
    border-radius: 10px;
    border: 1px solid var(--c-border);
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
}
.td-trao-doi-attach-img:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 14px rgba(16, 42, 67, .16);
}
.td-trao-doi-attach-pdf {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 6px;
    padding: 8px 12px;
    max-width: 260px;
    border: 1px solid var(--c-border);
    border-radius: 10px;
    background: var(--c-bg);
    font-size: 13px;
    color: var(--c-text);
    text-decoration: none;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}
.td-trao-doi-attach-pdf:hover { background: #eef4f8; border-color: var(--c-primary); }
.td-trao-doi-attach-pdf span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-trao-doi-attach-pdf .ui-icon { flex: 0 0 auto; color: #d03b3b; }
.td-trao-doi-filechip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
    padding: 6px 10px;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    background: var(--c-bg);
    font-size: 12.5px;
    color: var(--c-text-soft);
}
.td-trao-doi-filechip button {
    display: inline-flex;
    appearance: none;
    background: transparent;
    border: 0;
    padding: 2px;
    cursor: pointer;
    color: var(--c-text-soft);
}
.td-trao-doi-filechip button:hover { color: #d03b3b; }
.td-trao-doi-filechip .ui-icon { width: 15px; height: 15px; }
.td-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 6px 16px;
}
.td-ck-label {
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}
.td-ck-label:hover { color: var(--c-primary); }

/* ---------- Searchable Multiselect ---------- */
.multiselect {
    position: relative;
}
.multiselect.cc-field-invalid .multiselect__tags { border-color: #dc3545; box-shadow: 0 0 0 2px rgba(220,53,69,.15); }
.multiselect__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 10px;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    background: #fff;
    min-height: 44px;
    cursor: text;
    transition: border-color .15s, box-shadow .15s;
}
.multiselect__tags:focus-within {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(11, 110, 153, .12);
}
.multiselect__tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #e3f2fd;
    color: var(--c-primary-dark);
    font-size: 13px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
}
.multiselect__tag-remove {
    border: 0;
    background: transparent;
    color: var(--c-primary);
    font-size: 16px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}
.multiselect__tag-remove:hover { color: #c62828; }
.multiselect__input {
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 14px;
    color: var(--c-text);
    flex: 1;
    min-width: 120px;
    padding: 2px 0;
}
.multiselect__dropdown {
    position: absolute;
    /* Cao hơn thanh nút sticky của form (120), thấp hơn modal (1000). */
    z-index: 300;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 240px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(16, 42, 67, .14);
    padding: 4px;
    display: none;
}
.multiselect.is-open .multiselect__dropdown { display: block; }
.multiselect__option {
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background .1s;
}
.multiselect__option:hover { background: #eef7f8; }
.multiselect__option.is-selected {
    background: #e3f2fd;
    color: var(--c-primary-dark);
    font-weight: 600;
}
.multiselect__option[hidden] { display: none; }
.multiselect__option.is-excluded-elsewhere { display: none !important; }
.multiselect__empty {
    padding: 10px;
    color: var(--c-text-soft);
    font-size: 13.5px;
    text-align: center;
}

/* ---------- Nhật ký hoạt động ---------- */
.log-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
}
.log-filters__label {
    font-size: 14px;
    font-weight: 600;
    color: var(--c-text);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.log-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.log-badge--auth    { background: #e3f2fd; color: #1565c0; }
.log-badge--warning { background: #fff3e0; color: #e65100; }
.log-badge--danger  { background: #fce4ec; color: #c62828; }
.log-badge--user    { background: #e8eaf6; color: #283593; }
.log-badge--dmkt    { background: #e8f5e9; color: #2e7d32; }
.log-badge--tham-dinh { background: #ede7f6; color: #5e35b1; }

/* ---------- Chuông thông báo (topbar) ---------- */
.tb-bell { position: relative; }
.tb-bell__btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    color: #fff;
    cursor: pointer;
    transition: background .15s;
}
.tb-bell__btn:hover { background: rgba(255,255,255,.25); }
.tb-bell__btn .ui-icon { width: 18px; height: 18px; }
.tb-bell__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #dc3545;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}
.tb-noti {
    position: absolute;
    top: calc(100% + 10px);
    right: -60px;
    width: 380px;
    max-width: 92vw;
    background: #fff;
    color: var(--c-text);
    border: 1px solid var(--c-border);
    border-radius: 10px;
    box-shadow: 0 10px 32px rgba(16, 42, 67, .2);
    display: none;
    z-index: 500;
}
.tb-noti.is-open { display: block; }
.tb-noti__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--c-border);
    font-size: 14px;
}
.tb-noti__head strong { display: inline-flex; align-items: center; gap: 6px; }
.tb-noti__mark-all {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 0;
    background: transparent;
    color: var(--c-primary);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
}
.tb-noti__mark-all:hover { background: #eef7f8; }
.tb-noti__mark-all .ui-icon { width: 14px; height: 14px; }
.tb-noti__list { max-height: 380px; overflow-y: auto; }
.tb-noti__item {
    padding: 11px 14px;
    border-bottom: 1px solid #f0f3f7;
    cursor: pointer;
    transition: background .12s;
}
.tb-noti__item:last-child { border-bottom: 0; }
.tb-noti__item:hover { background: #f6fafd; }
.tb-noti__item.is-unread { background: #eef6fb; }
.tb-noti__item.is-unread .tb-noti__content { font-weight: 600; }
.tb-noti__content { font-size: 13.5px; line-height: 1.45; }
.tb-noti__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 5px;
}
.tb-noti__time { font-size: 12px; color: var(--c-text-soft); }
.tb-noti__toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 0;
    background: transparent;
    color: var(--c-text-soft);
    font-size: 12px;
    cursor: pointer;
    padding: 3px 6px;
    border-radius: 6px;
}
.tb-noti__toggle:hover { background: #eef3f8; color: var(--c-primary); }
.tb-noti__toggle .ui-icon { width: 13px; height: 13px; }
.tb-noti__empty { padding: 24px 14px; text-align: center; color: var(--c-text-soft); font-size: 13.5px; }
.tb-noti__view-all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    border-top: 1px solid #f0f3f7;
    color: var(--c-primary);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}
.tb-noti__view-all:hover { background: #f6fafd; }
.tb-noti__view-all .ui-icon { width: 14px; height: 14px; }

.topbar-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 17px;
    height: 17px;
    padding: 0 5px;
    margin-left: 2px;
    border-radius: 9px;
    background: #dc3545;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 17px;
    vertical-align: middle;
}

/* ---------- Dropdown gợi ý thay datalist (assets/js/datalist-combo.js) ---------- */
.dlc-menu {
    position: fixed;
    z-index: 2000;
    max-height: 240px;
    overflow-y: auto;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(16, 42, 67, .14);
    display: none;
}
.dlc-menu .combo__option {
    font-size: 14px;
    padding: 8px 12px;
    line-height: 1.35;
}

/* ---------- Tra cứu chuyên gia: hàng 3 bộ lọc chia đều ---------- */
.cg-filter-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 100%;
}
.cg-filter-cell {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.cg-filter-cell__label {
    font-size: 14px;
    color: var(--c-text);
    white-space: nowrap;
}
.cg-combo {
    flex: 1;
    min-width: 0;
    padding-right: 10px;
}
.cg-combo .combo__input { font-size: 14px; }
.cg-combo .combo__menu { max-height: 260px; }
.cg-combo .combo__option {
    font-size: 14px;
    padding: 9px 12px;
    line-height: 1.35;
}
@media (max-width: 720px) {
    .cg-filter-row { grid-template-columns: 1fr; }
}

/* ---------- Header sort (bảng admin) ---------- */
.hd-sort {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: inherit;
    text-decoration: none;
}
.hd-sort:hover { color: var(--c-primary); }
.hd-sort .ui-icon { width: 13px; height: 13px; }

/* ---------- Dashboard ---------- */
.dash-exec-hero {
    position: relative;
    display: flex;
    justify-content: space-between;
    gap: 28px;
    overflow: hidden;
    margin: 2px 0 18px;
    padding: 28px 30px;
    border-radius: 20px;
    color: #fff;
    background: linear-gradient(125deg, #073b67 0%, #096b91 52%, #0b8b89 100%);
    box-shadow: 0 18px 42px rgba(4, 71, 105, .2);
}
.dash-exec-hero::after {
    content: '';
    position: absolute;
    right: -70px;
    top: -100px;
    width: 310px;
    height: 310px;
    border: 55px solid rgba(255,255,255,.07);
    border-radius: 50%;
}
.dash-exec-hero > * { position: relative; z-index: 1; }
.dash-exec-hero__eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #bcecf0; }
.dash-exec-hero__eyebrow .ui-icon { width: 15px; height: 15px; }
.dash-exec-hero h1 { margin: 8px 0 5px; font-size: clamp(25px, 3vw, 36px); letter-spacing: -.035em; }
.dash-exec-hero p { max-width: 660px; margin: 0; color: rgba(255,255,255,.78); font-size: 14px; }
.dash-exec-hero__meta { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 7px; min-width: 220px; font-size: 12.5px; color: rgba(255,255,255,.82); }
.dash-exec-hero__meta span, .dash-exec-hero__meta a { display: inline-flex; align-items: center; gap: 6px; }
.dash-exec-hero__meta .ui-icon { width: 14px; height: 14px; }
.dash-exec-hero__meta a { margin-top: 4px; padding: 7px 11px; border: 1px solid rgba(255,255,255,.22); border-radius: 9px; color: #fff; text-decoration: none; background: rgba(255,255,255,.09); }

/* Nút "Đổi giao diện" (v1/v2) trên các trang Dashboard — kiểu độc lập dùng ở mọi ngữ cảnh nền
   (trên .dash-exec-hero tối màu thì .dash-exec-hero__meta a ở trên ghi đè do specificity cao hơn). */
.dash-theme-switch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--c-border);
    border-radius: 999px;
    background: var(--c-surface);
    color: var(--c-primary);
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    box-shadow: var(--shadow);
}
.dash-theme-switch:hover { border-color: var(--c-primary); }
.dash-theme-switch .ui-icon { width: 13px; height: 13px; }
.dash-exec-filter { padding: 12px 14px; border: 1px solid var(--c-border); border-radius: 14px; background: var(--c-surface); box-shadow: 0 5px 18px rgba(30, 72, 102, .06); }
.dash-exec-summary { display: grid; grid-template-columns: 1.25fr repeat(3, 1fr); gap: 14px; margin-bottom: 16px; }
.dash-exec-focus, .dash-exec-rate { min-width: 0; border: 1px solid #dce7ee; border-radius: 16px; padding: 17px 18px; background: linear-gradient(150deg, #fff, #f8fbfd); box-shadow: 0 7px 22px rgba(32, 75, 104, .07); }
.dash-exec-focus { display: flex; align-items: center; gap: 14px; }
.dash-exec-focus.is-alert { border-color: #f0c9c4; background: linear-gradient(145deg, #fff, #fff5f3); }
.dash-exec-focus.is-clear { border-color: #bfe1d1; background: linear-gradient(145deg, #fff, #f2fbf6); }
.dash-exec-focus__icon { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; border-radius: 13px; color: #c63e36; background: #fde8e5; }
.dash-exec-focus.is-clear .dash-exec-focus__icon { color: #18845d; background: #def4e9; }
.dash-exec-focus__icon .ui-icon { width: 22px; height: 22px; }
.dash-exec-focus__label, .dash-exec-rate__label { display: block; font-size: 11.5px; font-weight: 750; letter-spacing: .025em; color: var(--c-text-soft); }
.dash-exec-focus strong, .dash-exec-rate strong { display: block; margin: 2px 0; font-size: 27px; line-height: 1.05; color: var(--c-text); }
.dash-exec-focus small, .dash-exec-rate small { display: block; color: var(--c-text-soft); font-size: 11.5px; }
.dash-exec-rate strong em { font-size: 12px; font-style: normal; font-weight: 600; color: var(--c-text-soft); }
.dash-exec-rate a { display: inline-flex; align-items: center; gap: 4px; margin-top: 7px; font-size: 11.5px; font-weight: 700; color: var(--c-primary); text-decoration: none; }
.dash-exec-rate a .ui-icon { width: 12px; height: 12px; }
.dash-exec-progress { display: block; height: 5px; overflow: hidden; margin: 8px 0 6px; border-radius: 10px; background: #e8eef2; }
.dash-exec-progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #0b8b89, #38b79a); }
.dash-exec-rate--danger .dash-exec-progress i { background: linear-gradient(90deg, #dd554d, #ef8a64); }
.dash-exec-rate--danger strong { color: #ba3e38; }
.dash-kpi { position: relative; overflow: hidden; transition: transform .18s ease, box-shadow .18s ease; }
.dash-kpi::after { content: ''; position: absolute; inset: auto 0 0; height: 3px; background: currentColor; opacity: .65; }
.dash-kpi:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(31, 74, 105, .12); }
.dash-status-visual { display: flex; align-items: center; justify-content: center; gap: 22px; min-height: 165px; }
.dash-donut { display: grid; place-items: center; width: 132px; height: 132px; flex: 0 0 132px; border-radius: 50%; background: conic-gradient(#86b6ef 0 var(--s1), #5598e7 var(--s1) var(--s2), #2a78d6 var(--s2) var(--s3), #1c5cab var(--s3) 100%); box-shadow: inset 0 0 0 1px rgba(0,0,0,.03); }
.dash-donut > div { display: grid; place-items: center; width: 82px; height: 82px; border-radius: 50%; background: var(--c-surface); box-shadow: 0 2px 12px rgba(25,65,95,.13); }
.dash-donut strong { font-size: 24px; line-height: 1; }
.dash-donut span { font-size: 11px; color: var(--c-text-soft); }
.dash-status-legend { display: flex; flex-direction: column; gap: 8px; min-width: 115px; }
.dash-status-legend span { display: grid; grid-template-columns: 9px 1fr auto; align-items: center; gap: 7px; font-size: 12px; color: var(--c-text-soft); }
.dash-status-legend i { width: 9px; height: 9px; border-radius: 50%; }
.dash-status-legend strong { color: var(--c-text); }
@media (max-width: 1100px) {
    .dash-exec-summary { grid-template-columns: repeat(2, 1fr); }
}
.dash-kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
.dash-kpi {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 18px;
}
.dash-kpi .ui-icon { width: 26px; height: 26px; flex-shrink: 0; }
.dash-kpi__value { display: block; font-size: 26px; font-weight: 700; line-height: 1.2; color: var(--c-text); }
.dash-kpi__label { display: block; font-size: 13px; color: var(--c-text-soft); }
.dash-kpi--neutral  .ui-icon { color: var(--c-primary); }
.dash-kpi--warning  .ui-icon { color: #b8860b; }
.dash-kpi--good     .ui-icon { color: #0ca30c; }
.dash-kpi--critical .ui-icon { color: #d03b3b; }
.dash-kpi--upcoming  .ui-icon { color: #e0791e; }
.dash-kpi--stalled   .ui-icon { color: #6a4fb3; }

.dash-kpi__delta {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-top: 3px;
    font-size: 11.5px;
    font-weight: 600;
}
.dash-kpi__delta .ui-icon { width: 12px; height: 12px; }
.dash-kpi__delta--up { color: #0ca30c; }
.dash-kpi__delta--down { color: #d03b3b; }
.dash-kpi__delta--flat { color: var(--c-text-soft); font-weight: 400; }

.num-danger { color: #d03b3b; font-weight: 700; }
.assign-workload { margin-left: auto; font-size: 12px; color: var(--c-text-soft); white-space: nowrap; }
.assign-suggest {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 10px;
    background: #e8f5e9;
    color: #2e7d32;
    font-size: 10.5px;
    font-weight: 700;
    white-space: nowrap;
}

.dash-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.dash-panel {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 18px;
}
.viec-hom-nay-item {
    display: block;
    padding: 6px 8px;
    margin: 0 -8px 2px;
    border-radius: 6px;
    font-size: 13.5px;
    color: var(--c-text);
    text-decoration: none;
}
.viec-hom-nay-item:hover {
    background: var(--c-bg);
}
.dash-panel__title {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 14px;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--c-text);
}

.dash-barlist { display: flex; flex-direction: column; gap: 9px; }
.dash-bar-row { display: grid; grid-template-columns: 1fr 2fr auto; align-items: center; gap: 10px; }
.dash-bar-row__label {
    font-size: 13px;
    color: var(--c-text-soft);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dash-bar-row__track { height: 10px; background: var(--c-bg); border-radius: 6px; overflow: hidden; }
.dash-bar-row__fill { display: block; height: 100%; border-radius: 6px; }
.dash-bar-row__value { font-size: 13px; font-weight: 600; color: var(--c-text); min-width: 24px; text-align: right; }

.dash-columns {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 160px;
    padding-top: 20px;
}
.dash-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    min-width: 0;
}
.dash-column__value { font-size: 12px; font-weight: 600; color: var(--c-text); margin-bottom: 4px; }
.dash-column__bar { width: 100%; max-width: 28px; border-radius: 4px 4px 0 0; transition: height .2s; }
.dash-column__label { font-size: 11px; color: var(--c-text-soft); margin-top: 6px; white-space: nowrap; }

.dash-columns-wrap { position: relative; }
.dash-target-line {
    position: absolute;
    left: 0;
    right: 0;
    border-top: 2px dashed #e65100;
    z-index: 2;
}
.dash-target-line__label {
    position: absolute;
    right: 0;
    top: -18px;
    font-size: 10.5px;
    font-weight: 700;
    color: #e65100;
    background: var(--c-surface);
    padding: 0 4px;
    white-space: nowrap;
}

/* ---------- Biểu đồ đường/vùng SVG (xu hướng theo thời gian) ---------- */
.dash-linechart { width: 100%; }
.dash-linechart__svg { width: 100%; height: 220px; display: block; overflow: visible; }
.dash-linechart__grid { stroke: var(--c-border); stroke-width: 1; }
.dash-linechart__axislabel { font-size: 11px; fill: var(--c-text-soft); }
.dash-linechart__target { stroke: #e65100; stroke-width: 1.5; stroke-dasharray: 5 4; }
.dash-linechart__targetlabel { font-size: 10.5px; fill: #e65100; font-weight: 700; }
.dash-linechart__line {
    stroke-width: 2.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 2px 3px rgba(20, 60, 90, .12));
}
.dash-linechart__line--dashed { stroke-dasharray: 7 6; opacity: .7; filter: none; }
.dash-linechart__dot { stroke: var(--c-surface); stroke-width: 2; transition: r .15s ease; cursor: pointer; }
.dash-linechart__dot:hover { r: 6.5; }
.dash-linechart__dot--dashed { opacity: .85; }

/* ---------- Lịch họp thẩm định (tuần/tháng) ---------- */
.lich-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
}
.lich-week__day {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 10px;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.lich-week__day.is-today { border-color: var(--c-primary); box-shadow: 0 0 0 1px var(--c-primary) inset; }
.lich-week__day-head {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--c-border);
    font-size: 12.5px;
    color: var(--c-text-soft);
}
.lich-week__day-head strong { font-size: 15px; color: var(--c-text); }
.lich-week__empty { font-size: 12.5px; color: var(--c-text-soft); text-align: center; padding: 16px 0; }

.lich-meeting {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 8px 9px;
    border-radius: 8px;
    background: #eef6fb;
    border: 1px solid #dceefb;
    text-decoration: none;
    color: var(--c-text);
    font-size: 12.5px;
    transition: background .15s;
}
.lich-meeting:hover { background: #dceefb; }
.lich-meeting--warn { background: #fff3e0; border-color: #ffe0b2; }
.lich-meeting--warn:hover { background: #ffe6bf; }
.lich-meeting__gio { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--c-primary); }
.lich-meeting__gio .ui-icon { width: 12px; height: 12px; }
.lich-meeting__ma { font-weight: 700; }
.lich-meeting__cs { color: var(--c-text-soft); }
.lich-meeting__dd, .lich-meeting__hd {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--c-text-soft);
    font-size: 11.5px;
}
.lich-meeting__dd .ui-icon, .lich-meeting__hd .ui-icon { width: 11px; height: 11px; flex-shrink: 0; }

.lich-month {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}
.lich-month__head {
    text-align: center;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--c-text-soft);
    padding-bottom: 6px;
}
.lich-month__cell {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: 8px;
    padding: 6px;
    min-height: 96px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.lich-month__cell.is-outside { background: var(--c-bg); opacity: .55; }
.lich-month__cell.is-today { border-color: var(--c-primary); box-shadow: 0 0 0 1px var(--c-primary) inset; }
.lich-month__cell-date { font-size: 12px; font-weight: 700; color: var(--c-text-soft); margin-bottom: 2px; }
.lich-month__chip {
    display: block;
    padding: 2px 6px;
    border-radius: 5px;
    background: #eef6fb;
    color: var(--c-primary);
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lich-month__chip:hover { background: #dceefb; }
.lich-month__chip.is-warn { background: #fff3e0; color: #e65100; }
.lich-month__more { font-size: 10.5px; color: var(--c-text-soft); padding: 0 6px; }

/* ---------- Dashboard rút gọn cho điện thoại (dashboard_mobile.php) ---------- */
.mob-body { background: var(--c-bg); max-width: 480px; margin: 0 auto; }
.mob-header {
    background: linear-gradient(135deg, #1c5cab, #2a78d6);
    color: #fff;
    padding: 14px 16px;
    position: sticky;
    top: 0;
    z-index: 10;
}
.mob-header__unit { font-size: 11.5px; opacity: .85; text-transform: uppercase; letter-spacing: .03em; }
.mob-header__title { display: flex; align-items: center; gap: 6px; font-size: 18px; margin: 3px 0 0; }
.mob-header__title .ui-icon { width: 19px; height: 19px; flex-shrink: 0; }
.mob-header__full { display: inline-block; margin-top: 6px; color: #fff; font-size: 13px; text-decoration: none; opacity: .9; }
.mob-header__full:hover { text-decoration: underline; }

.mob-main { padding: 16px; }

.mob-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 22px;
}
.mob-kpi {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.mob-kpi__value { font-size: 28px; font-weight: 700; color: var(--c-text); line-height: 1.1; }
.mob-kpi__label { font-size: 12.5px; color: var(--c-text-soft); }
.mob-kpi--critical .mob-kpi__value { color: #d03b3b; }
.mob-kpi--warning .mob-kpi__value { color: #e0791e; }

.mob-section-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 15px;
    color: var(--c-text);
    margin: 0 0 10px;
}
.mob-section-title .ui-icon { width: 17px; height: 17px; color: var(--c-primary); }

.mob-empty {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 20px 14px;
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 12px;
    font-size: 13.5px;
}

.mob-list { display: flex; flex-direction: column; gap: 8px; }
.mob-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: 12px;
    padding: 12px 14px;
    text-decoration: none;
    color: var(--c-text);
}
.mob-card__icon { flex-shrink: 0; }
.mob-card__icon .ui-icon { width: 22px; height: 22px; }
.mob-card__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.mob-card__title { font-weight: 700; font-size: 14.5px; }
.mob-card__sub {
    font-size: 12.5px;
    color: var(--c-text-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mob-card__reason { font-size: 12px; font-weight: 600; }
.mob-card__chevron { flex-shrink: 0; opacity: .4; }
.mob-card__chevron .ui-icon { width: 16px; height: 16px; transform: rotate(-90deg); }

/* ---------- Trợ lý AI (dashboard_tro_ly.php) ---------- */
.troly-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 480px;
    overflow-y: auto;
    padding: 4px 4px 14px;
    margin-bottom: 12px;
}
.troly-msg { display: flex; align-items: flex-start; gap: 10px; }
.troly-msg .ui-icon { width: 22px; height: 22px; flex-shrink: 0; margin-top: 2px; color: var(--c-primary); }
.troly-msg--user .ui-icon { color: var(--c-text-soft); }
.troly-msg__body {
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    max-width: 640px;
}
.troly-msg--user .troly-msg__body { background: #eef6fb; }
.troly-input-row { display: flex; gap: 10px; align-items: flex-end; }
.troly-input-row textarea { flex: 1; resize: vertical; }

/* ---------- Chat nội bộ ---------- */
.chat-page {
    margin: 22px 0 30px;
}
.chat-shell {
    display: grid;
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
    min-height: 660px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.chat-contacts {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border-right: 1px solid var(--c-border);
    background: #f8fbfd;
}
.chat-contacts__head,
.chat-room__head {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 62px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--c-border);
}
.chat-contacts__head {
    justify-content: space-between;
}
.chat-chip,
.chat-contact__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 19px;
    height: 19px;
    padding: 0 6px;
    border-radius: 10px;
    background: #dc3545;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 19px;
}
.chat-search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px;
    padding: 0 10px;
    min-height: 40px;
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: 8px;
}
.chat-search .ui-icon {
    color: var(--c-text-soft);
}
.chat-search input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    color: var(--c-text);
}
.chat-contact-list {
    flex: 1;
    overflow-y: auto;
}
.chat-contact {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    padding: 11px 12px;
    border: 0;
    border-bottom: 1px solid #edf2f6;
    background: transparent;
    color: var(--c-text);
    cursor: pointer;
    text-align: left;
}
.chat-contact:hover,
.chat-contact.is-active {
    background: #eef7f8;
}
.chat-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 50%;
    background: var(--c-primary);
    color: #fff;
    font-weight: 700;
}
.chat-avatar--large {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
}
.chat-contact__body {
    min-width: 0;
    flex: 1;
}
.chat-contact__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.chat-contact__top strong,
#chatRoomName {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chat-contact__top strong {
    font-size: 14px;
}
.chat-contact__top small {
    flex: 0 0 auto;
    color: var(--c-text-soft);
    font-size: 11.5px;
}
.chat-contact__meta,
.chat-contact__last,
#chatRoomMeta {
    display: block;
    overflow: hidden;
    color: var(--c-text-soft);
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chat-contact__meta {
    font-size: 12px;
}
.chat-contact__last {
    margin-top: 2px;
    font-size: 12.5px;
}
.chat-contact__badge {
    position: absolute;
    right: 10px;
    bottom: 10px;
}
/* .chat-contact__badge{display:inline-flex} (khai báo ở trên, dùng chung với .chat-chip) có độ ưu
   tiên bằng [hidden] của UA stylesheet nên thắng — phải khai báo tường minh để "hidden" (JS dùng để
   ẩn số 0 khi không có tin chưa đọc) có tác dụng. */
.chat-contact__badge[hidden] {
    display: none;
}
.chat-room {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #fff;
}
.chat-room__head > div {
    min-width: 0;
}
.chat-messages {
    flex: 1;
    min-height: 420px;
    max-height: 560px;
    overflow-y: auto;
    padding: 18px;
    background: #f5f8fb;
}
.chat-msg {
    display: flex;
    margin-bottom: 10px;
}
.chat-msg--mine {
    justify-content: flex-end;
}
.chat-msg__bubble {
    max-width: min(620px, 78%);
    padding: 9px 12px;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 42, 67, .04);
}
.chat-msg--mine .chat-msg__bubble {
    border-color: #bfdee8;
    background: #e7f5f8;
}
.chat-msg__body {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 14px;
    line-height: 1.45;
}
.chat-msg__time {
    margin-top: 4px;
    color: var(--c-text-soft);
    font-size: 11.5px;
    text-align: right;
}
.chat-compose {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    padding: 12px;
    border-top: 1px solid var(--c-border);
    background: #fff;
}
.chat-compose textarea {
    flex: 1;
    min-height: 44px;
    max-height: 130px;
    resize: vertical;
    padding: 10px 12px;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    font: inherit;
    color: var(--c-text);
}
.chat-compose textarea:focus {
    border-color: var(--c-primary);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(11, 110, 153, .12);
}
.chat-empty {
    padding: 24px 14px;
    color: var(--c-text-soft);
    font-size: 13.5px;
    text-align: center;
}
.chat-widget {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1600;
}
.chat-fab {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    border: 0;
    border-radius: 50%;
    background: var(--c-primary);
    color: #fff;
    box-shadow: 0 10px 28px rgba(16, 42, 67, .24);
    cursor: pointer;
    transition: background .15s, transform .15s;
}
.chat-fab:hover {
    background: var(--c-primary-dark);
    transform: translateY(-1px);
}
.chat-fab .ui-icon {
    width: 25px;
    height: 25px;
}
.chat-fab__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 21px;
    height: 21px;
    padding: 0 6px;
    border: 2px solid #fff;
    border-radius: 12px;
    background: #dc3545;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 17px;
    text-align: center;
}
.net-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px 8px 10px;
    border-radius: 100px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    box-shadow: 0 6px 20px rgba(16, 42, 67, .18);
    font-size: 13px;
    font-weight: 600;
    color: var(--c-text);
    pointer-events: none;
    animation: netStatusIn .18s ease-out;
}
#netStatus {
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 1600;
}
.net-status-form {
    font-size: 12.5px;
    padding: 6px 12px 6px 9px;
    box-shadow: none;
}
@keyframes netStatusIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.net-status__dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #8695a3;
    flex-shrink: 0;
    animation: netStatusBlink 1.3s ease-in-out infinite;
}
.net-status--connected .net-status__dot,
.net-status--reconnected .net-status__dot {
    background: #217346;
    animation-duration: 1.6s;
}
.net-status--slow .net-status__dot {
    background: #e65100;
    animation-duration: 1s;
}
.net-status--disconnected .net-status__dot,
.net-status--reconnecting .net-status__dot {
    background: #dc3545;
    animation-duration: .7s;
}
@keyframes netStatusBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: .25; }
}
@media (prefers-reduced-motion: reduce) {
    .net-status { animation: none; }
    .net-status__dot { animation: none; }
}
.chat-pop {
    position: absolute;
    right: 0;
    bottom: 72px;
    display: none;
    width: min(390px, calc(100vw - 24px));
    height: min(590px, calc(100vh - 110px));
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    box-shadow: 0 18px 46px rgba(16, 42, 67, .26);
    color: var(--c-text);
}
.chat-pop.is-open {
    display: flex;
    flex-direction: column;
}
.chat-pop__head {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 52px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--c-border);
    background: var(--c-primary);
    color: #fff;
}
.chat-pop__head strong {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chat-pop__close,
.chat-pop__back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.14);
    color: #fff;
    cursor: pointer;
}
.chat-pop__close:hover,
.chat-pop__back:hover {
    background: rgba(255,255,255,.26);
}
.chat-pop__contacts,
.chat-pop__room {
    min-height: 0;
    flex: 1;
}
.chat-pop__contacts[hidden],
.chat-pop__room[hidden] {
    display: none !important;
}
.chat-pop__contacts {
    display: flex;
    flex-direction: column;
    background: #f8fbfd;
}
.chat-pop__search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px;
    padding: 0 10px;
    min-height: 39px;
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: 8px;
}
.chat-pop__search .ui-icon {
    color: var(--c-text-soft);
}
.chat-pop__search input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--c-text);
    font: inherit;
}
.chat-pop__list {
    min-height: 0;
    flex: 1;
    overflow-y: auto;
}
.chat-pop-contact {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    padding: 11px 12px;
    border: 0;
    border-bottom: 1px solid #edf2f6;
    background: transparent;
    color: var(--c-text);
    cursor: pointer;
    text-align: left;
}
/* .chat-pop-contact{display:flex} có độ ưu tiên bằng [hidden] của UA stylesheet nên thắng —
   phải khai báo tường minh để thuộc tính "hidden" (JS dùng để ẩn/hiện khi lọc danh sách) có tác dụng. */
.chat-pop-contact[hidden] {
    display: none;
}
.chat-pop-contact:hover {
    background: #eef7f8;
}
.chat-pop-contact__body {
    min-width: 0;
    flex: 1;
    padding-right: 28px;
}
.chat-pop-contact__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.chat-pop-contact__top strong,
.chat-pop-contact__last {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chat-pop-contact__top strong {
    font-size: 13.5px;
}
.chat-pop-contact__top small {
    flex: 0 0 auto;
    color: var(--c-text-soft);
    font-size: 11.5px;
}
.chat-pop-contact__last {
    margin-top: 3px;
    color: var(--c-text-soft);
    font-size: 12.5px;
}
.chat-pop__room {
    display: flex;
    flex-direction: column;
    background: #fff;
}
.chat-pop__messages {
    min-height: 0;
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    background: #f5f8fb;
}
.chat-pop__messages .chat-msg__bubble {
    max-width: min(620px, 82%);
}
.chat-pop__compose {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    padding: 10px;
    border-top: 1px solid var(--c-border);
    background: #fff;
}
.chat-pop__compose textarea {
    flex: 1;
    min-height: 40px;
    max-height: 105px;
    resize: vertical;
    padding: 9px 10px;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    color: var(--c-text);
    font: inherit;
}
.chat-pop__compose textarea:focus {
    border-color: var(--c-primary);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(11, 110, 153, .12);
}
.chat-pop__compose .btn {
    width: 44px;
    min-width: 44px;
    padding: 0;
}

.chat-emoji-wrap {
    position: relative;
    flex: 0 0 auto;
    align-self: center;
}
.chat-emoji-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--c-border);
    border-radius: 50%;
    background: #fff8c9;
    color: #8a6500;
    font-size: 23px;
    line-height: 1;
    cursor: pointer;
    transition: transform .15s, background .15s, box-shadow .15s;
}
.chat-emoji-btn:hover {
    transform: scale(1.06);
    background: #ffef8a;
    box-shadow: 0 3px 9px rgba(138, 101, 0, .16);
}
.chat-emoji-picker {
    position: absolute;
    z-index: 80;
    left: 0;
    bottom: calc(100% + 9px);
    display: grid;
    grid-template-columns: repeat(7, 34px);
    gap: 3px;
    width: max-content;
    max-width: min(280px, 88vw);
    padding: 9px;
    border: 1px solid var(--c-border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(16, 42, 67, .2);
}
.chat-emoji-picker[hidden] { display: none !important; }
.chat-emoji-picker--pop {
    left: -4px;
    grid-template-columns: repeat(6, 34px);
}
.chat-emoji-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}
.chat-emoji-item:hover,
.chat-emoji-item:focus-visible {
    background: #fff3b0;
    outline: none;
    transform: scale(1.12);
}

/* ---------- Viber notification composer ---------- */
.viber-page {
    max-width: 1050px;
    margin: 0 auto;
    padding: 24px 0 48px;
}
.viber-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 20px;
    align-items: start;
}
.viber-compose {
    padding: 20px;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    background: #fff;
}
.viber-compose .profile-form__group + .profile-form__group {
    margin-top: 16px;
}
.viber-recipient {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-top: 10px;
    padding: 11px 12px;
    border-left: 3px solid #665cac;
    background: #f6f5fb;
}
.viber-recipient[hidden] { display: none; }
.viber-recipient div { min-width: 0; }
.viber-recipient strong,
.viber-recipient span,
.viber-recipient small { display: block; }
.viber-recipient span,
.viber-recipient small {
    margin-top: 2px;
    color: var(--c-text-soft);
    font-size: 12.5px;
}
.viber-subject { min-height: 82px; resize: vertical; }
.viber-message { min-height: 220px; resize: vertical; line-height: 1.55; }
.viber-count {
    margin-top: 5px;
    color: var(--c-text-soft);
    font-size: 12px;
    text-align: right;
}
.viber-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 18px;
}
.viber-status {
    min-height: 20px;
    margin-top: 9px;
    color: #18794e;
    font-size: 13px;
    text-align: right;
}
.viber-status.is-error { color: #b42318; }
.viber-guide {
    padding: 18px;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    background: #f8fbfd;
}
.viber-guide h3 { margin: 0 0 13px; font-size: 16px; }
.viber-guide dl { margin: 0; }
.viber-guide dl div {
    padding: 10px 0;
    border-bottom: 1px solid var(--c-border);
}
.viber-guide dt { color: var(--c-text-soft); font-size: 12px; }
.viber-guide dd { margin: 3px 0 0; font-size: 13.5px; font-weight: 600; }
.viber-guide p { margin: 15px 0 0; color: var(--c-text-soft); font-size: 12.5px; line-height: 1.55; }
.viber-admin { padding-bottom: 48px; }
.viber-section {
    margin-bottom: 18px;
    padding: 20px;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    background: #fff;
}
.viber-section__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.viber-section__head h3 { margin: 0; font-size: 17px; }
.viber-section__head > span { color: var(--c-text-soft); font-size: 12.5px; }
.viber-state {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 2px 8px;
    border-radius: 5px;
    background: #eef1f4;
    color: #59636e;
    font-size: 11.5px;
    font-weight: 700;
}
.viber-state.is-on,
.viber-state--delivered,
.viber-state--seen { background: #e8f6ef; color: #18794e; }
.viber-state--sent { background: #e9f2fb; color: #1769aa; }
.viber-state--pending,
.viber-state--sending { background: #fff4d6; color: #8a5a00; }
.viber-state--failed { background: #fdecec; color: #b42318; }
.viber-webhook {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin-top: 18px;
    padding-top: 15px;
    border-top: 1px solid var(--c-border);
}
.viber-webhook > div { min-width: 0; flex: 1; }
.viber-webhook small,
.viber-webhook code { display: block; }
.viber-webhook code { margin-top: 4px; overflow-wrap: anywhere; }
.viber-map { display: flex; align-items: center; gap: 8px; }
.viber-map select { min-width: 230px; }
.viber-recipients {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 15px;
}
.viber-recipients label {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid var(--c-border);
    border-radius: 6px;
    cursor: pointer;
}
.viber-recipients span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viber-outbox-message { max-width: 430px; white-space: pre-line; }
.viber-outbox-message small { display: block; margin-top: 4px; color: #b42318; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
    .search__field, .search__field--grow { flex: 1 1 100%; min-width: 0; }
    .btn { flex: 1 1 calc(50% - 5px); }
    .col-chuong { display: none; }
    .topbar__title { font-size: 17px; }
    .selection-panel { left: 12px; right: 12px; width: auto; bottom: 80px; }
    .open-hint-arrow { right: 50%; transform: translateX(50%); bottom: 70px; }
    .admin-form-grid { grid-template-columns: 1fr; }
    .admin-wrap { padding: 0 8px; }
    .dash-kpi-row { grid-template-columns: repeat(2, 1fr); }
    .dash-exec-hero { flex-direction: column; padding: 22px 20px; }
    .dash-exec-hero__meta { align-items: flex-start; min-width: 0; }
    .dash-exec-summary { grid-template-columns: 1fr 1fr; }
    .dash-exec-focus { grid-column: span 2; }
    .dash-exec-rate--sla { grid-column: span 2; }
    .dash-grid { grid-template-columns: 1fr; }
    .dash-panel[style*="span 2"] { grid-column: auto; }
    .topbar__inner { flex-wrap: wrap; }
    .topbar__nav { margin-left: 0; width: 100%; order: 3; }
    .topbar__nav-link { padding: 7px 10px; font-size: 13px; }
    .td-info-panel { top: 4px; max-height: 62vh; overflow-y: auto; padding: 10px 12px; gap: 10px; }
    .td-export-bar { justify-content: flex-start; width: 100%; }
    .td-form-actions--sticky {
        bottom: max(4px, env(safe-area-inset-bottom));
        margin-left: -4px;
        margin-right: -4px;
        padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
    }
    .chat-shell { grid-template-columns: 1fr; min-height: auto; }
    .chat-contacts { max-height: 300px; border-right: 0; border-bottom: 1px solid var(--c-border); }
    .chat-messages { min-height: 380px; max-height: 52vh; padding: 12px; }
    .chat-compose { align-items: stretch; flex-direction: column; }
    .chat-compose .btn { width: 100%; }
    .chat-msg__bubble { max-width: 90%; }
    .chat-widget { right: 14px; bottom: 14px; }
    .chat-fab { width: 54px; height: 54px; }
    .chat-pop {
        right: -2px;
        bottom: 66px;
        width: calc(100vw - 24px);
        height: min(620px, calc(100vh - 92px));
    }
    .viber-page { padding: 14px 0 90px; }
    .viber-layout { grid-template-columns: 1fr; }
    .viber-compose { padding: 14px; }
    .viber-actions { flex-direction: column; }
    .viber-actions .btn { width: 100%; }
    .viber-status { text-align: left; }
    .viber-section { padding: 14px; }
    .viber-section__head { align-items: flex-start; flex-direction: column; }
    .viber-webhook { align-items: stretch; flex-direction: column; }
    .viber-webhook .btn { width: 100%; }
    .viber-map { align-items: stretch; flex-direction: column; }
    .viber-map select { min-width: 0; }
    .viber-recipients { grid-template-columns: 1fr; }
    .lich-week { grid-template-columns: 1fr; }
    .lich-month { grid-template-columns: repeat(7, minmax(38px, 1fr)); overflow-x: auto; }
    .lich-month__chip { font-size: 10px; }
}
/* Thanh tab dạng cuộn ngang 1 hàng duy nhất (không xuống hàng) — gọn và co giãn tốt khi số lượng
   tab tăng dần theo thời gian, thay vì lưới cố định 4 cột dễ lệch khi số tab không chia hết 4. */
.config-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    margin: -4px 0 24px;
    padding: 6px;
    background: linear-gradient(135deg, #eef6fa 0%, #f5f9fc 100%);
    border: 1px solid #d8e7ef;
    border-radius: 14px;
    box-shadow: inset 0 1px 2px rgba(9, 86, 118, .04);
    overflow-x: auto;
    scrollbar-width: thin;
    /* Mờ dần 2 mép khi còn tab bị che khuất ngoài vùng nhìn thấy — gợi ý có thể cuộn ngang */
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
}
.config-tabs .profile-tab {
    appearance: none;
    background: transparent;
    border: 0;
    border-radius: 10px;
    font: inherit;
    font-size: 13.5px;
    font-weight: 650;
    color: var(--c-text-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    flex: 0 0 auto;
    min-height: 42px;
    margin: 0;
    padding: 9px 13px;
    white-space: nowrap;
    cursor: pointer;
    transition: color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}
.config-tabs .profile-tab .ui-icon {
    width: 18px;
    height: 18px;
    color: currentColor;
    transition: transform .18s ease;
}
.config-tabs .profile-tab:hover {
    color: var(--c-primary-dark);
    background: rgba(255, 255, 255, .72);
    transform: translateY(-1px);
}
.config-tabs .profile-tab:hover .ui-icon { transform: scale(1.08); }
.config-tabs .profile-tab.is-active {
    color: #fff;
    background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-dark) 100%);
    box-shadow: 0 5px 14px rgba(11, 110, 153, .24);
}

/* ---------- Admin · System Status ---------- */
.status-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 24px 26px;
    margin-bottom: 18px;
    color: #fff;
    border-radius: 18px;
    background: radial-gradient(circle at 85% 10%, rgba(56,189,248,.28), transparent 32%), linear-gradient(135deg,#0f172a,#1e3a5f);
    box-shadow: 0 16px 40px rgba(15,23,42,.16);
}
.status-eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .16em; color: #7dd3fc; }
.status-title { margin: 5px 0 4px; font-size: 25px; line-height: 1.2; }
.status-subtitle { margin: 0; color: #cbd5e1; font-size: 13px; }
.status-hero__actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.status-hero .btn { color: #fff; border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.08); }
.status-health { display:inline-flex;align-items:center;gap:8px;padding:8px 12px;border-radius:999px;font-size:12.5px;font-weight:700;background:rgba(255,255,255,.1); }
.status-health__dot { width:9px;height:9px;border-radius:50%;background:#94a3b8;box-shadow:0 0 0 4px rgba(148,163,184,.15); }
.status-health.is-healthy .status-health__dot { background:#22c55e;box-shadow:0 0 0 4px rgba(34,197,94,.18); }
.status-health.is-warning .status-health__dot { background:#f59e0b;box-shadow:0 0 0 4px rgba(245,158,11,.18); }
.status-health.is-danger .status-health__dot { background:#ef4444;box-shadow:0 0 0 4px rgba(239,68,68,.18); }
.status-grid { display:grid;gap:14px;margin-bottom:14px; }
.status-grid--gauges { grid-template-columns:repeat(4,minmax(0,1fr)); }
.status-grid--details { grid-template-columns:repeat(2,minmax(0,1fr)); }
.status-card { min-width:0;padding:18px;background:var(--c-surface,#fff);border:1px solid var(--c-border,#e2e8f0);border-radius:15px;box-shadow:0 5px 18px rgba(15,23,42,.05); }
.status-card__label { margin-bottom:12px;color:var(--c-text-soft);font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.07em; }
.status-card__heading { display:flex;align-items:center;gap:8px;margin-bottom:13px;font-size:15px;font-weight:750;color:var(--c-text); }
.status-gauge { --value:0;position:relative;width:112px;height:112px;margin:2px auto 12px;border-radius:50%;display:grid;place-items:center;background:conic-gradient(#0ea5e9 calc(var(--value)*1%),#e8eef5 0); }
.status-gauge::before { content:"";position:absolute;inset:10px;border-radius:50%;background:var(--c-surface,#fff); }
.status-gauge > div { position:relative;text-align:center;display:flex;flex-direction:column; }
.status-gauge strong { font-size:22px;line-height:1.15;color:var(--c-text); }
.status-gauge small { font-size:10px;color:var(--c-text-soft); }
.status-gauge.is-warning { background:conic-gradient(#f59e0b calc(var(--value)*1%),#e8eef5 0); }
.status-gauge.is-danger { background:conic-gradient(#ef4444 calc(var(--value)*1%),#e8eef5 0); }
.status-card__meta { min-height:32px;text-align:center;color:var(--c-text-soft);font-size:11.5px;line-height:1.45; }
.status-latency { display:flex;align-items:baseline;gap:6px;margin:5px 0; }
.status-latency strong { font-size:31px;line-height:1;color:#0ea5e9; }
.status-latency span { color:var(--c-text-soft);font-size:11px; }
.status-latency--secondary strong { font-size:21px;color:#6366f1; }
.status-db-card .status-card__meta { margin-top:10px;text-align:left; }
.status-kv { margin:0; }
.status-kv > div { display:flex;justify-content:space-between;gap:20px;padding:8px 0;border-bottom:1px solid var(--c-border,#e2e8f0); }
.status-kv > div:last-child { border-bottom:0; }
.status-kv dt { color:var(--c-text-soft);font-size:12.5px; }
.status-kv dd { margin:0;max-width:62%;text-align:right;font-size:12.5px;font-weight:650;overflow-wrap:anywhere; }
.status-extensions-card { margin-bottom:14px; }
.status-extension-count { display:inline-flex;align-items:center;justify-content:center;min-width:24px;height:22px;padding:0 7px;border-radius:999px;color:#fff;background:#0f172a;font-size:11px; }
.status-extension-list { display:flex;flex-wrap:wrap;gap:8px;max-height:240px;overflow-y:auto;padding:2px; }
.status-extension { display:inline-flex;align-items:center;gap:6px;padding:6px 9px;border:1px solid #dbe5ef;border-radius:8px;background:#f8fafc;color:#334155;font-size:11.5px; }
.status-extension strong { font-weight:700; }
.status-extension small { padding-left:6px;border-left:1px solid #cbd5e1;color:#64748b;font-size:10px; }
.status-footnote { display:flex;justify-content:space-between;gap:12px;padding:5px 2px;color:var(--c-text-soft);font-size:11.5px; }
@media (max-width:900px) { .status-grid--gauges{grid-template-columns:repeat(2,minmax(0,1fr));} }
@media (max-width:640px) {
    .status-hero{flex-direction:column;padding:20px}.status-hero__actions{justify-content:flex-start}
    .status-grid--gauges,.status-grid--details{grid-template-columns:1fr}.status-footnote{flex-direction:column}
}
.config-tabs .profile-tab:focus-visible {
    outline: 3px solid rgba(15, 181, 173, .28);
    outline-offset: 2px;
}
[data-config-panel][hidden] { display: none !important; }

@media (max-width: 720px) {
    .config-tabs {
        margin-left: -4px;
        margin-right: -4px;
        border-radius: 12px;
    }
    .config-tabs .profile-tab {
        min-width: 120px;
    }
}
