﻿/* ============================================================
   MỤC LỤC
   1.  Theme variables
   2.  Blazor error UI & loading progress
   3.  Loading screens (splash, overlay, spinner)
   4.  Layout fixes (navbar, page content, dashboard)
   5.  Forms & inputs
   6.  Validation
   7.  Tables
   8.  Dropdowns, typeahead & date picker
   9.  Components (info-box, btn-app, badge, progress...)
   10. Màu nền ngày (thứ 7, CN, ngày lễ)
   11. QuillJS view
   12. FullCalendar / RoomPlan / RoomMap
   13. Occupancy & Leads
   14. SweetAlert2
   15. Keyframes
   16. Responsive
   ============================================================ */

/* ============================================================
   1. THEME VARIABLES
   ============================================================ */

/* ============================================================
   2. BLAZOR ERROR UI & LOADING PROGRESS
   ============================================================ */
#blazor-error-ui {
    display: none;
    position: fixed;
    width: 100%;
    z-index: 1200;
}

    /* Blazor hiện màn lỗi bằng style="display: block" → hiện dần (animation chạy lại mỗi lần đổi display) */
    #blazor-error-ui .modal-backdrop {
        animation: error-ui-fade .2s ease-out;
    }

    #blazor-error-ui .modal-dialog {
        animation: error-ui-in .25s ease-out;
    }

/* Không cuộn trang phía sau khi màn lỗi đang hiện (thay cho .modal-open của Bootstrap) */
body:has(> #blazor-error-ui[style*="block"]) {
    overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
    #blazor-error-ui .modal-backdrop,
    #blazor-error-ui .modal-dialog {
        animation: none;
    }
}

.loading-progress {
    position: relative;
    display: block;
    width: 10rem;
    height: 8rem;
    margin: 45vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.3rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: var(--vz-primary);
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    color: var(--vz-primary);
    text-align: center;
    font-weight: bold;
    inset: calc(45vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }


/* ============================================================
   3. LOADING SCREENS
   ============================================================ */
/* Phần chung: MỘT lớp phủ toàn màn hình, nội dung căn giữa bằng flex
   (thay cho lớp phủ + khối căn giữa riêng -> bớt 1 phần tử fixed mỗi lần hiện) */
.loading-screen,
.loading {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-screen {
    z-index: 1200;
    background: white;
}

.loading {
    z-index: 1160;
    background: rgba(255, 255, 255, 0.7);
}

/* Logo hiệu ứng — giữ logo đứng yên, vòng tròn quay quanh */
.loading-wrapper {
    position: relative;
    width: 110px;
    height: 110px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loading-logo {
    width: 110px;
    height: auto;
    position: relative;
    z-index: 10;
}

.loading-wrapper::before {
    content: "";
    position: absolute;
    top: -10px;
    left: -10px;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    border: 2px solid #D3D3D3; /* Xám nhạt tinh tế */
    border-right-color: transparent; /* Trong suốt để giữ hiệu ứng quay */
    box-shadow: 0 0 10px rgba(211, 211, 211, 0.3);
    animation: spin 1.2s ease-in-out infinite;
}

.spinner-gradient {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 4px solid #ecf0f1; /* Xám trắng nhạt */
    border-right-color: var(--vz-primary);
    animation: spin 0.8s linear infinite;
}


/* ============================================================
   4. LAYOUT FIXES
   ============================================================ */
.dashboard-content {
    height: calc(100vh - 162px);
    text-align: center;
    position: relative;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 60%;
}

.error-page {
    padding-top: 100px;
}

/* Modal chồng nhau: modal trên cao hơn màn hình → hiện scrollbar riêng → dialog lệch trái nửa scrollbar,
   lòi mép modal dưới ra bên phải. Chừa sẵn rãnh scrollbar 2 bên → mọi modal luôn căn giữa như nhau.
   Modal fullscreen (rộng 100vw) giữ mặc định. */
.modal {
    scrollbar-gutter: stable both-edges;
}

.modal:has(> .modal-fullscreen) {
    scrollbar-gutter: auto;
}

@media (max-width: 767.98px) {
    .modal:has(> .modal-fullscreen-md-down) {
        scrollbar-gutter: auto;
    }
}

@media (max-width: 575.98px) {
    .modal:has(> .modal-fullscreen-sm-down) {
        scrollbar-gutter: auto;
    }
}

/* ============================================================
   5. FORMS & INPUTS
   ============================================================ */
.form-group {
    margin-bottom: 0.4rem !important;
}

.form-label {
    font-weight: 600 !important;
    color: var(--vz-heading-color);
    margin-bottom: 0.1rem !important;
}

.col-form-label {
    font-weight: 600;
    padding-top: calc(0.3rem + var(--vz-border-width));
}

.form-control-sm, .input-group-sm .form-control-sm, .input-group-sm > .input-group-text {
    font-size: var(--vz-font-13);
}

.btn-sm {
    font-size: var(--vz-font-13);
}

[class*="icheck-"] > input:first-child:not(:checked) + label::before {
    border-color: var(--vz-border-color);
}

/* Checkbox icheck-bootstrap */
[class*="icheck-"] > input:first-child + input[type="hidden"] + label::before,
[class*="icheck-"] > input:first-child + label::before {
    border-radius: 6px;
}

/* Input gạch chân (underline style) */
.form-control.form-control-border {
    border-top: 0;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    box-shadow: inherit;
}

    .form-control.form-control-border.border-width-2 {
        border-bottom-width: 2px;
    }

.none-border {
    border: 0;
    outline: 0;
}

.search-box .form-control-lg {
    padding-left: 30px;
}

input[type="search"]::-webkit-search-cancel-button {
    cursor: pointer;
}

/* ============================================================
   6. VALIDATION
   ============================================================ */
/* Ô có lỗi → viền đỏ.
   InputText/InputSelect/InputTextArea được Blazor gắn .invalid;
   select/input @bind thường và selectpicker dựa vào .validation-message ngay sau */
:is(.form-control.invalid,
    .form-select.invalid,
    .form-control:has(+ .validation-message),
    .form-select:has(+ .validation-message),
    .form-icon:has(+ .validation-message) > .form-control,
    .input-group:has(+ .validation-message) > .form-control,
    .input-group:has(+ .validation-message) > .form-select,
    .bootstrap-select:has(> select.invalid) > .dropdown-toggle,
    .bootstrap-select:has(+ .validation-message) > .dropdown-toggle,
    .input-group:has(+ .validation-message) > .bootstrap-select > .dropdown-toggle) {
    border-color: var(--vz-danger) !important;
}

.validation-message {
    width: 100%;
    margin-top: .25rem;
    font-size: 85%;
    color: #f06548;
}


/* ============================================================
   7. TABLES
   ============================================================ */
.table-sm,
.table-sm td input {
    font-size: var(--vz-font-12);
}

.table .sticky-top {
    z-index: 3 !important;
}

/* Cột cố định — thân bảng + tfoot: nền xám */
.table .sticky-col {
    position: sticky;
    left: var(--sticky-left, 0);
    background-color: #f3f6f9;
    z-index: 2;
    --vz-table-accent-bg: transparent;
}

/* Dòng đang chọn (table-info): cột cố định theo màu dòng */
.table > tbody > tr.table-info > .sticky-col {
    background-color: var(--vz-table-bg);
}

/* Cột cố định TRONG header: đồng màu table-primary + nâng z-index tại giao điểm */
.table thead.sticky-top .sticky-col {
    background-color: var(--vz-table-bg, var(--vz-primary-bg-subtle));
    z-index: 3;
}

.square-td {
    font-weight: bold;
    padding: 0 2px !important;
    min-width: 57px;
}

.dutyroster-input {
    text-align: center;
    font-weight: bold;
    padding: 1px;
    border: 0;
    outline: 0;
    font-size: var(--vz-font-12);
}

/* Ô ca (Phân ca, Chấm công) — Components/HR/ShiftEntry.cs + shiftEntry.module.js
   (nền ngày nằm ở <td>, màu ca ở ô mã ca) */
.sc-cell {
    padding: 3px 2px !important;
    vertical-align: middle;
}

/* Khung ô nhập: nhãn ca gãy + vòng quay phủ lên */
.sc-box {
    position: relative;
    display: block;
}

/* display: block (không flex) để mã dài cắt bằng dấu … thay vì tràn hai bên */
/* .sc-cell .sc-input: thắng .table-sm td input (font-size) */
.sc-code,
.sc-cell .sc-input {
    display: block;
    width: 100%;
    height: 30px;
    padding: 0 2px;
    border-radius: var(--vz-border-radius);
    font-size: 12px;
    font-weight: 700;
    line-height: 30px;
    letter-spacing: .02em;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

    /* Ca gãy "OFF/HC": chữ nhỏ lại cho vừa ô */
    .sc-code.is-long,
    .sc-cell .sc-input.is-long {
        font-size: 11px;
        letter-spacing: -.04em;
        padding: 0;
    }

.sc-input {
    line-height: normal;
    border: 1px solid transparent;
    background: transparent;
    color: var(--vz-body-color);
    text-transform: uppercase;
    transition: border-color .15s, box-shadow .15s;
}

    /* Ô trống sửa được: viền nét đứt để thấy ngày chưa xếp ca */
    .sc-input.is-empty {
        border-style: dashed;
        border-color: rgba(var(--vz-body-color-rgb), .16);
    }

    .sc-input:hover {
        border-color: rgba(var(--vz-primary-rgb), .35);
    }

    .sc-input:focus {
        position: relative;
        z-index: 1;
        outline: none;
        border-style: solid;
        border-color: rgba(var(--vz-primary-rgb), .6);
        box-shadow: 0 0 0 3px rgba(var(--vz-primary-rgb), .15);
    }

    /* Vừa lưu xong: viền xanh mờ dần */
    .sc-input.is-saved {
        animation: sc-saved 1.6s ease-out;
    }

    /* Mã sai / lưu lỗi: viền đỏ, rê chuột xem lý do (title) */
    .sc-input.has-error,
    .sc-input.has-error:focus {
        border-style: solid;
        border-color: rgba(var(--vz-danger-rgb), .85);
        box-shadow: 0 0 0 3px rgba(var(--vz-danger-rgb), .15);
    }

    /* Đang lưu: giữ ô nhập (không mất chỗ khi gõ tiếp), mờ đi + vòng quay giữa ô */
    .sc-input.is-saving {
        opacity: .5;
        cursor: progress;
    }

@keyframes sc-saved {
    from {
        box-shadow: 0 0 0 3px rgba(var(--vz-success-rgb), .55);
    }

    to {
        box-shadow: 0 0 0 3px rgba(var(--vz-success-rgb), 0);
    }
}

.sc-spin {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    border-width: 2px;
    color: var(--vz-body-color);
    pointer-events: none;
}

/* Ca gãy "A/B": 2 dòng, A trên B dưới, mỗi nửa tô màu của ca đó (style inline theo Bảng ca) */
.sc-split {
    display: grid;
    grid-template-rows: 1fr 1fr;
    overflow: hidden;
    border-radius: var(--vz-border-radius);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .02em;
    text-align: center;
    text-transform: uppercase;
    color: var(--vz-body-color);
}

    .sc-split > span {
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 0;
        overflow: hidden;
        white-space: nowrap;
    }

        /* Vạch mảnh giữa hai nửa: hai ca cùng màu / cùng không màu vẫn tách được */
        .sc-split > span + span {
            box-shadow: inset 0 1px 0 rgba(var(--vz-body-color-rgb), .14);
        }

    /* Ô chỉ xem (đã khóa, kỳ đóng, không có quyền): cùng khung với .sc-code */
    .sc-split.is-static {
        height: 30px;
    }

/* Ô nhập ca gãy: nhãn phủ lên phần trong viền, không nhận chuột → bấm vẫn vào ô nhập; vào ô thì ẩn nhãn, ô hiện "A/B" để sửa */
.sc-input + .sc-split {
    position: absolute;
    inset: 1px;
    border-radius: calc(var(--vz-border-radius) - 1px);
    pointer-events: none;
}

.sc-input:focus + .sc-split {
    display: none;
}

/* Ẩn chữ "A/B" và màu ca đầu của ô nhập khi nhãn đang phủ (style inline có color/background → cần !important) */
.sc-input.is-split:not(:focus) {
    color: transparent !important;
    background: transparent !important;
}

    .sc-input.is-split:not(:focus)::selection {
        background: transparent;
        color: transparent;
    }

/* Ô chỉ xem trong ngày đã khóa */
.sc-cell.is-locked {
    cursor: not-allowed;
}

/* Chưa vào làm / đã nghỉ việc: sọc chéo */
.sc-cell.is-out {
    background-image: repeating-linear-gradient(135deg, rgba(var(--vz-body-color-rgb), .07) 0 4px, transparent 4px 9px);
}

/* Tiêu đề cột của ô đang nhập */
.shift-sheet thead th.is-focus {
    box-shadow: inset 0 -3px 0 var(--vz-primary);
}

/* Ô Nhân viên (Phân ca, Chấm công) — Components/HR/EmployeeBadge */
.ep-cell {
    padding-top: 3px !important;
    padding-bottom: 3px !important;
    font-weight: 400;
}

/* Dòng đang nhập ca: vạch màu bên trái ô nhân viên */
.shift-sheet tbody tr:has(.sc-input:focus) > .ep-cell {
    box-shadow: inset 3px 0 0 var(--vz-primary);
}

    .shift-sheet tbody tr:has(.sc-input:focus) > .ep-cell .ep-name {
        color: var(--vz-primary);
    }

.ep-person {
    display: flex;
    align-items: center;
    gap: .55rem;
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
}

button.ep-person {
    cursor: pointer;
}

    button.ep-person:hover .ep-name {
        color: var(--vz-primary);
    }

/* Avatar: chữ viết tắt nằm dưới, ảnh phủ lên; ảnh lỗi → ẩn ảnh, còn chữ */
.ep-avatar {
    position: relative;
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12.5px;
    font-weight: 700;
}

    .ep-avatar img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        background: var(--vz-secondary-bg);
    }

.ep-tone-0 {
    background: var(--vz-primary-bg-subtle);
    color: var(--vz-primary-text-emphasis);
}

.ep-tone-1 {
    background: var(--vz-secondary-bg-subtle);
    color: var(--vz-secondary-text-emphasis);
}

.ep-tone-2 {
    background: var(--vz-success-bg-subtle);
    color: var(--vz-success-text-emphasis);
}

.ep-tone-3 {
    background: var(--vz-info-bg-subtle);
    color: var(--vz-info-text-emphasis);
}

.ep-tone-4 {
    background: var(--vz-warning-bg-subtle);
    color: var(--vz-warning-text-emphasis);
}

/* Tên + dòng phụ: hiện đủ chữ (không cắt), cột rộng theo tên dài nhất */
.ep-main {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    line-height: 1.3;
}

.ep-name,
.ep-meta {
    white-space: nowrap;
}

.ep-name {
    font-size: 13px;
    font-weight: 600;
    transition: color .15s;
}

.ep-meta {
    font-size: 11.5px;
    color: var(--vz-secondary-color);
}

/* Cột Vị trí + Bộ phận (lưới Phân ca — DutyRosterRow): vị trí trên, bộ phận dưới (chỉ khi xem tất cả bộ phận).
   Cùng nhịp chữ với ô Nhân viên (13px / 11.5px); hiện đủ chữ (không cắt), cột rộng theo nội dung dài nhất */
.pd-head {
    line-height: 1.25;
}

.pd-head-sub {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: var(--vz-secondary-color);
}

.pd-cell {
    padding-top: 3px !important;
    padding-bottom: 3px !important;
}

.pd-stack {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
    line-height: 1.3;
}

.pd-pos,
.pd-dept {
    white-space: nowrap;
}

.pd-pos {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--vz-body-color);
}

    .pd-pos.is-empty {
        color: var(--vz-secondary-color);
        font-weight: 400;
    }

.pd-dept {
    font-size: 11.5px;
    color: var(--vz-secondary-color);
}

    .pd-dept > i {
        margin-right: .3rem;
        font-size: 10px;
        opacity: .7;
    }

/* Chọn kỳ (Phân ca, Chấm công) — Components/HR/PeriodPicker, cao 31px cho bằng các ô lọc form-control-sm cùng hàng */
.pp-period {
    position: relative;
    display: flex;
    align-items: stretch;
    width: 100%;
    height: 30px;
    border: 1px solid var(--vz-border-color);
    border-radius: var(--vz-border-radius);
    background: var(--vz-secondary-bg);
}

.pp-nav {
    flex: 0 0 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--vz-secondary-color);
    transition: background-color .15s, color .15s;
}

    .pp-nav.is-prev {
        border-radius: var(--vz-border-radius) 0 0 var(--vz-border-radius);
    }

    .pp-nav.is-next {
        border-radius: 0 var(--vz-border-radius) var(--vz-border-radius) 0;
    }

    .pp-nav:hover:not(:disabled) {
        background: rgba(var(--vz-primary-rgb), .05);
        color: var(--vz-primary);
    }

    .pp-nav:disabled {
        opacity: .35;
        cursor: default;
    }

.pp-label {
    flex: 1 1 auto;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: 0 .75rem;
    border: 0;
    border-left: 1px solid var(--vz-border-color);
    border-right: 1px solid var(--vz-border-color);
    background: transparent;
    color: var(--vz-body-color);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: background-color .15s;
}

    .pp-label:hover,
    .pp-label[aria-expanded="true"] {
        background: rgba(var(--vz-primary-rgb), .05);
    }

    .pp-label > .fa-calendar {
        color: var(--vz-primary);
    }

/* Điện thoại: "09/2026" thay cho "Tháng 09/2026" */
.pp-short {
    display: none;
}

.pp-caret {
    font-size: 10px;
    color: var(--vz-secondary-color);
    transition: transform .15s;
}

.pp-label[aria-expanded="true"] .pp-caret {
    transform: rotate(180deg);
}

/* Lớp trong suốt phủ màn hình: bấm ra ngoài thì đóng bảng chọn tháng */
.pp-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1050;
}

.pp-pop {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 1051;
    width: 264px;
    padding: .65rem;
    border: 1px solid var(--vz-border-color);
    border-radius: 12px;
    background: var(--vz-secondary-bg);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .14);
}

.pp-pop-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .5rem;
    font-size: 14px;
    font-weight: 700;
}

.pp-icon-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--vz-border-color);
    border-radius: var(--vz-border-radius);
    background: var(--vz-secondary-bg);
    color: var(--vz-secondary-color);
    transition: background-color .15s, border-color .15s, color .15s;
}

    .pp-icon-btn:hover:not(:disabled) {
        border-color: rgba(var(--vz-primary-rgb), .35);
        background: rgba(var(--vz-primary-rgb), .05);
        color: var(--vz-primary);
    }

    .pp-icon-btn:disabled {
        opacity: .4;
        cursor: default;
    }

.pp-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .35rem;
}

.pp-month {
    height: 36px;
    border: 1px solid transparent;
    border-radius: var(--vz-border-radius);
    background: transparent;
    color: var(--vz-body-color);
    font-size: 13px;
    white-space: nowrap;
    transition: background-color .15s, border-color .15s;
}

    .pp-month:hover {
        background: rgba(var(--vz-primary-rgb), .05);
        border-color: rgba(var(--vz-primary-rgb), .35);
    }

    .pp-month.is-now {
        border-color: var(--vz-border-color);
        font-weight: 600;
    }

    .pp-month.active,
    .pp-month.active:hover {
        background: var(--vz-primary);
        border-color: var(--vz-primary);
        color: #fff;
        font-weight: 600;
    }

/* Nút "Cả năm" (AllowWholeYear): một hàng riêng dưới 12 tháng */
.pp-whole-year {
    grid-column: 1 / -1;
    border-color: var(--vz-border-color);
}

@media (max-width: 767.98px) {
    .pp-long,
    .pp-caret,
    .pp-label > .fa-calendar {
        display: none;
    }

    .pp-short {
        display: inline;
    }
}



/* ============================================================
   8. DROPDOWNS, TYPEAHEAD & DATE PICKER
   ============================================================ */
.dropdown-item.active,
.dropdown-item:active {
    color: white;
    background-color: var(--vz-primary) !important;
}

.bootstrap-select .dropdown-toggle {
    min-height: calc(1.5em + 0.5rem + calc(var(--vz-border-width, 1px) * 2));
    border: var(--vz-border-width) solid var(--vz-input-border-custom) !important;
    box-shadow: none;
}

/* bootstrap-select mặc định vẽ vòng focus đen của trình duyệt (!important) → viền giống .form-control:focus */
.bootstrap-select > .dropdown-toggle:focus,
.bootstrap-select > .dropdown-toggle.show,
.bootstrap-select > select.mobile-device:focus + .dropdown-toggle {
    outline: none !important;
}

.bootstrap-select > .dropdown-toggle:focus,
.bootstrap-select > .dropdown-toggle.show {
    border-color: var(--vz-primary-border-subtle) !important;
}

/* Blazored Typeahead */
.blazored-typeahead {
    border-color: var(--vz-input-border-custom);
    border-radius: var(--vz-border-radius);
}

.blazored-typeahead__input {
    border-radius: var(--vz-border-radius);
}

.blazored-typeahead__input-mask,
.blazored-typeahead__input-mask-wrapper--disabled {
    border-radius: var(--vz-border-radius) 0 0 var(--vz-border-radius);
}

.blazored-typeahead__input-icon {
    border-radius: 0 var(--vz-border-radius) var(--vz-border-radius) 0;
}

.blazored-typeahead__results {
    z-index: 20;
    border-color: var(--vz-border-color);
    border-radius: var(--vz-border-radius);
}

.blazored-typeahead__active-item,
.blazored-typeahead__result:hover,
.blazored-typeahead__result:focus {
    color: #fff;
    background-color: var(--vz-primary) !important;
    border-top-color: var(--vz-primary);
    border-bottom-color: var(--vz-primary);
}

    .blazored-typeahead__active-item .text-info,
    .blazored-typeahead__result:hover .text-info,
    .blazored-typeahead__result:focus .text-info {
        color: #fff !important;
    }

/* Date range picker */
.daterangepicker .ranges li {
    font-weight: bold;
    background-color: #f3f6f9;
    border: 1px solid #f3f6f9;
    border-radius: var(--vz-border-radius);
    margin: 5px;
}

    .daterangepicker .ranges li.active {
        background-color: var(--vz-primary) !important;
    }

.daterangepicker td.today {
    background-color: #e8f1ff;
    color: #0d6efd;
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(13, 110, 253, 0.18);
    border-radius: var(--vz-border-radius);
}

.daterangepicker td.active {
    background-color: var(--vz-primary) !important;
}

.monthselect,
.yearselect {
    border: var(--vz-border-width) solid var(--vz-input-border-custom);
    border-radius: var(--vz-border-radius);
}


/* ============================================================
   9. COMPONENTS
   ============================================================ */
.bg-primary,
.bg-primary > a {
    color: #fff !important;
}

.actions-btn {
    font-weight: bold;
}

/* Info box */
.info-box {
    box-shadow: 0 0 1px rgba(0, 0, 0, 0.125), 0 1px 3px rgba(0, 0, 0, 0.2);
    border-radius: var(--vz-border-radius);
    background-color: #fff;
    display: flex;
    min-height: 60px;
    padding: .5rem;
    position: relative;
    width: 100%;
}

    .info-box .info-box-icon {
        border-radius: var(--vz-border-radius);
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        font-size: 1.875rem;
        width: 50px;
    }

    .info-box .info-box-content {
        display: flex;
        flex-direction: column;
        justify-content: center;
        line-height: 1.8;
        flex: 1;
        padding: 0 10px;
        overflow: hidden;
    }

/* Thanh tiến trình (progress) */
.progress-bar {
    height: 100%;
    width: 0%;
    border-radius: 12px;
    background: linear-gradient(90deg, #0072ff, #00c6ff);
    box-shadow: 0 0 8px rgba(0, 114, 255, 0.5);
    transition: width 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    position: relative;
    display: flex;
    align-items: center;
    padding-right: 10px;
    font-size: 12px;
    font-weight: bold;
    color: white;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
}

    /* Hiệu ứng ánh sáng chạy trên thanh tiến trình */
    .progress-bar::after {
        content: "";
        position: absolute;
        top: 0;
        left: -50px;
        width: 50px;
        height: 100%;
        background: rgba(255, 255, 255, 0.2);
        transform: skewX(-25deg);
        animation: light-wave 1.5s infinite linear;
    }

/* Chuông rung */
.bell-shake {
    display: inline-block;
    animation: ring 1s ease-in-out infinite;
    transform-origin: top center;
}

/* Segmented control chuyển chế độ xem (RoomMap: Danh sách / Sơ đồ; Hồ sơ nhân sự) */
.view-toggle {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    background: #eef1f4;
    border: 1px solid #e3e7eb;
    border-radius: 999px;
}

.view-toggle .vt-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 0;
    background: transparent;
    color: #6b7280;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1;
    padding: 6px 14px;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
    transition: color .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.view-toggle .vt-btn i {
    font-size: 13px;
}

.view-toggle .vt-btn:hover {
    color: #374151;
}

.view-toggle .vt-btn.active {
    background: #ffffff;
    color: var(--vz-primary, #26506C);
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 2px 6px rgba(0,0,0,.10);
}

.view-toggle .vt-btn:focus-visible {
    outline: 2px solid var(--vz-primary, #26506C);
    outline-offset: 1px;
}

/* Tab trên đầu thẻ kiểu Velzon "Card Header Tabs" (nav-tabs-custom card-header-tabs — Support/Template/ui-tabs.html)
   có ô lọc/nút cùng hàng (AgreementText, DayOff). Tab không xuống dòng, thiếu chỗ thì cuộn ngang.
   Điện thoại: tab nằm hàng riêng phía trên → bỏ margin âm ở đáy (không đè hàng dưới), thu đệm ngang */
.card-header-tabs-stack {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
}

.card-header-tabs-stack .nav-link {
    white-space: nowrap;
}

@media (max-width: 767.98px) {
    .nav-tabs-custom.card-header-tabs.card-header-tabs-stack {
        margin-top: -.5rem;
        margin-bottom: 0;
    }

    .nav-tabs-custom.card-header-tabs.card-header-tabs-stack .nav-link {
        padding: .75rem .5rem;
    }
}


/* ============================================================
   10. MÀU NỀN NGÀY (Thứ 7 / Chủ nhật / Ngày lễ)
   ============================================================ */
.bg-saturday-header {
    background-color: #fff3cd !important;
}

.bg-saturday {
    background-color: #FFFCF5 !important;
}

.bg-sunday-header {
    background-color: #f8d7da !important;
}

.bg-sunday {
    background-color: #FDF7F7 !important;
}

.bg-holiday-header {
    background-color: #FACCE5 !important;
}

.bg-holiday {
    background-color: #FEF4F9 !important;
}


/* ============================================================
   11. QUILLJS VIEW — chuẩn hóa margin/padding khi hiển thị
   ============================================================ */
.quill-note-view {
    line-height: 1.2;
    white-space: normal;
    word-break: break-word;
}

    .quill-note-view p {
        margin: 0;
        padding: 0;
    }

    .quill-note-view ul,
    .quill-note-view ol {
        margin: 0;
        padding-left: 1.2rem;
    }

    .quill-note-view br {
        line-height: 1.2;
    }

/* ============================================================
   12. FULLCALENDAR / ROOMPLAN / ROOMMAP
   ============================================================ */
.fc-event-main-frame {
    overflow: hidden;
}

    .fc-event-main-frame .badge,
    .fc-event-main-frame small.ms-auto {
        flex-shrink: 0;
    }

    .fc-event-main-frame small:not(.ms-auto) {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        min-width: 0;
    }

/* Căn giữa resource label (RoomPlan) */
.fc-datagrid-cell-frame {
    display: flex !important;
    align-items: center !important;
}

/* Hover chung cho event & room card */
.room-card {
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

    .fc-event:hover,
    .room-card:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.16), 0 2px 4px rgba(0, 0, 0, 0.10) !important;
    }

/* Popover đặt phòng */
.booking-popover {
    min-width: 350px !important;
}

    .booking-popover .popover-body {
        padding: 8px !important;
    }

/* Lớp phủ loading cho calendar — hiển thị ở phía trên */
.fc-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(8px);
    -webkit-backdrop-filter: saturate(180%) blur(8px);
    display: none;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding-top: 3rem;
    z-index: 999;
    border-radius: var(--vz-border-radius);
}

.fc-loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

    .fc-loading-spinner .spinner-border {
        width: 2.5rem;
        height: 2.5rem;
        border-width: 0.2rem;
        color: #0d6efd;
    }

    .fc-loading-spinner .text-muted {
        font-size: 0.875rem;
        font-weight: 400;
        margin: 0;
        color: #6c757d;
    }

#roomCalendar:has(.fc-loading-overlay[style*="display: flex"]) .fc {
    opacity: 0.5;
    pointer-events: none;
    filter: blur(1px);
}

/* Nút "Chọn ngày" — đồng tông với nhóm nút ‹ › (mặc định FullCalendar là #2C3E50) */
#roomCalendar .fc-goToDate-button {
    color: var(--vz-secondary);
    background-color: rgba(var(--vz-secondary-rgb), .15);
    border-color: transparent;
    box-shadow: var(--vz-element-shadow);
}

    #roomCalendar .fc-goToDate-button:hover,
    #roomCalendar .fc-goToDate-button:not(:disabled):active {
        color: #fff;
        background-color: var(--vz-secondary);
        border-color: var(--vz-secondary);
    }

    #roomCalendar .fc-goToDate-button:focus {
        box-shadow: 0 0 0 .2rem rgba(var(--vz-secondary-rgb), .25);
    }


/* ============================================================
   13. OCCUPANCY & LEADS
   ============================================================ */
.occ i.fa-circle-check,
.occ i.fa-circle-question {
    font-size: 13px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
    transition: transform 0.15s ease, background-color 0.15s ease;
}

    .occ i.fa-circle-check:hover,
    .occ i.fa-circle-question:hover {
        transform: scale(1.1);
    }

.occ i.fa-triangle-exclamation {
    animation: warningPulse 1.5s infinite ease-in-out;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

/* Leads */
.badge.cursor-pointer {
    cursor: pointer;
    transition: all 0.2s ease;
}

    .badge.cursor-pointer:hover {
        opacity: 0.8;
        transform: translateY(-2px);
    }


/* ============================================================
   14. SWEETALERT2
   ============================================================ */
div:where(.swal2-container) {
    z-index: 1165;
}

    div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm) {
        background-color: var(--vz-primary);
    }

div.swal2-container button.swal2-styled {
    border-radius: var(--vz-border-radius);
}


/* ============================================================
   15. KEYFRAMES
   ============================================================ */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes error-ui-fade {
    from {
        opacity: 0;
    }
}

@keyframes error-ui-in {
    from {
        opacity: 0;
        transform: translateY(-16px) scale(.98);
    }
}

@keyframes light-wave {
    0% {
        left: -50px;
    }

    100% {
        left: 100%;
    }
}

@keyframes ring {
    0% {
        transform: rotate(0);
    }

    10% {
        transform: rotate(15deg);
    }

    20% {
        transform: rotate(-15deg);
    }

    30% {
        transform: rotate(10deg);
    }

    40% {
        transform: rotate(-10deg);
    }

    50% {
        transform: rotate(5deg);
    }

    60% {
        transform: rotate(-5deg);
    }

    70%, 100% {
        transform: rotate(0);
    }
}


/* ============================================================
   16. RESPONSIVE
   ============================================================ */
#OpenModalUpdate_Reservation .modal-content,
#OpenModalUpdate_Voucher .modal-content {
    overflow-x: hidden;
}

@media (max-width: 767.98px) {

    #OpenModalUpdate_Reservation .modal-header.bg-light,
    #OpenModalUpdate_Voucher .modal-header.bg-light {
        position: sticky;
        top: 0;
        z-index: 2001;
        flex-wrap: wrap;
    }

    #OpenModalUpdate_Reservation .modal-footer,
    #OpenModalUpdate_Voucher .modal-footer {
        position: sticky;
        bottom: 0;
        z-index: 2000;
        flex-wrap: wrap;
    }
}
