/* Hộp kiểm theo CMIT CP Design System v5.9 (.cbx): 18px, bo 4px, viền vật thao tác --cmit-border-control (#828e9c —
   --cmit-border #d0d7de trên nền trắng quá mờ cho ô bấm được), đã tích nền --cmit-blue + dấu tích trắng.
   Một nguồn cho cả 3 host — host không định nghĩa lại .cmit-checkbox. */
.cmit-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 1.125rem;
    height: 1.125rem;
    margin: 0;
    flex-shrink: 0;
    border: 1px solid var(--cmit-border-control);
    border-radius: 4px;
    background-color: var(--cmit-white);
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    transition: background-color 0.22s ease, border-color 0.22s ease;
}

.cmit-checkbox:hover:not(:disabled) {
    border-color: var(--cmit-blue);
}

.cmit-checkbox:checked {
    background-color: var(--cmit-blue);
    border-color: var(--cmit-blue);
}

.cmit-checkbox:checked:hover:not(:disabled) {
    background-color: var(--cmit-blue-hover);
    border-color: var(--cmit-blue-hover);
}

.cmit-checkbox:checked::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.5 8.2L6.4 11.1L12.5 4.5' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 75% 75%;
}

/* Chọn một phần (ô "chọn tất cả" khi mới tick vài dòng): nền như đã tick, dấu "–" thay dấu tích. */
.cmit-checkbox.cmit-checkbox--mixed:not(:checked) {
    background-color: var(--cmit-blue);
    border-color: var(--cmit-blue);
}

.cmit-checkbox.cmit-checkbox--mixed:not(:checked)::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 8H12' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 75% 75%;
}

/* Khoá: màu disabled của design system (--dis-bg / --dis-tx), không làm mờ bằng opacity — vẫn đọc được đã tích hay chưa. */
.cmit-checkbox:disabled {
    background-color: var(--cmit-disabled);
    border-color: var(--cmit-button-disabled-text);
    cursor: not-allowed;
}

.cmit-checkbox:disabled:checked,
.cmit-checkbox.cmit-checkbox--mixed:disabled:not(:checked) {
    background-color: var(--cmit-button-disabled-text);
    border-color: var(--cmit-button-disabled-text);
}

.cmit-checkbox:focus-visible {
    outline: 2px solid var(--cmit-blue);
    outline-offset: 2px;
}
