/* =====================================================================
   VietHRM — lớp giao diện (nạp SAU globalStyle.css)
   Mục tiêu: tách khỏi format của web cũ. Chỉ chỉnh bề mặt (màu, bo góc,
   đổ bóng, khoảng cách) nên không đụng tới hành vi của DevExpress/Tabler.
   Màu chủ đạo lấy từ css/skins/*.css qua biến --h1-navbar-bg-color.
   ===================================================================== */

:root {
    /* nền & bề mặt */
    --vhrm-canvas: #F4F6FB;
    --vhrm-surface: #FFFFFF;
    --vhrm-border: #E3E8F0;
    --vhrm-border-strong: #CBD5E1;
    --vhrm-text: #1E293B;
    --vhrm-muted: #64748B;
    /* bo góc */
    --vhrm-radius-sm: 6px;
    --vhrm-radius: 10px;
    --vhrm-radius-lg: 16px;
    /* đổ bóng */
    --vhrm-shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
    --vhrm-shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 6px 16px -8px rgba(15, 23, 42, .12);
    --vhrm-shadow-lg: 0 12px 32px -12px rgba(15, 23, 42, .25);
    /* gradient thương hiệu */
    --vhrm-brand-gradient: linear-gradient(135deg, var(--h1-navbar-bg-color) 0%, var(--h1-primary-dark, #3730A3) 100%);
    /* đồng bộ primary của Tabler với màu skin đang chọn */
    --tblr-primary: var(--h1-navbar-bg-color);
    --tblr-primary-rgb: var(--h1-bg-primary);
    --tblr-link-color: var(--h1-navbar-bg-color);
    --tblr-link-color-rgb: var(--h1-bg-primary);
}

body {
    background-color: var(--vhrm-canvas);
    color: var(--vhrm-text);
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

/* ---------------------------------------------------------------------
   1. Thanh header trên cùng
   --------------------------------------------------------------------- */
.navbar.navbar-expand-md.sticky-top {
    background: var(--vhrm-surface);
    border-bottom: 1px solid var(--vhrm-border);
    box-shadow: var(--vhrm-shadow-sm);
    min-height: 52px;
    padding-top: .25rem;
    padding-bottom: .25rem;
}

/* khối logo + chữ VietHRM */
.vhrm-brand {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    text-decoration: none;
    line-height: 1;
}

.vhrm-brand__mark {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: block;
    box-shadow: 0 2px 6px rgba(var(--h1-bg-primary), .35);
}

.vhrm-brand__text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.vhrm-brand__name {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -.3px;
    color: var(--vhrm-text);
}

    .vhrm-brand__name span {
        color: var(--h1-navbar-bg-color);
    }

.vhrm-brand__tag {
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: .9px;
    text-transform: uppercase;
    color: var(--vhrm-muted);
}

/* nhóm icon bên phải header */
.navbar .nav-item > .nav-link {
    color: var(--vhrm-muted);
    border-radius: var(--vhrm-radius-sm);
    transition: color .15s ease, background-color .15s ease;
}

    .navbar .nav-item > .nav-link:hover {
        color: var(--h1-navbar-bg-color);
    }

.vhrm-icon-btn {
    position: relative;
    width: 34px;
    height: 34px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border-radius: var(--vhrm-radius-sm);
}

    .vhrm-icon-btn:hover {
        background: var(--h1-primary-soft, #EEF2FF);
    }

/* Số thông báo: viên thuốc nhỏ nằm đè lên góc trên phải của chuông.
   Markup chặn ở "99+" nên badge không bao giờ dài quá chuông. */
.vhrm-badge {
    position: absolute;
    top: 3px;
    right: 3px;
    box-sizing: border-box;
    min-width: 16px;
    height: 16px;
    padding: 0 3px;
    border-radius: 999px;
    border: 2px solid var(--vhrm-surface);
    background: #E11D48;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    line-height: 12px;
    text-align: center;
    letter-spacing: -.2px;
    pointer-events: none;
}

/* menu xổ xuống của header trên cùng (tài khoản, ...).
   Loại trừ dropdown-menu-card vì loại đó bọc sẵn một .card bên trong. */
.navbar .dropdown-menu:not(.dropdown-menu-card) {
    min-width: 210px;
    padding: .25rem;
    margin-top: .4rem;
    border: 1px solid var(--vhrm-border);
    border-radius: var(--vhrm-radius);
    box-shadow: var(--vhrm-shadow-lg);
}

    .navbar .dropdown-menu:not(.dropdown-menu-card) .dropdown-item {
        display: flex;
        align-items: center;
        gap: .55rem;
        min-height: 0;
        padding: .45rem .55rem;
        font-size: 12.5px;
        line-height: 1.3;
        border-radius: var(--vhrm-radius-sm);
        color: var(--vhrm-text);
    }

        .navbar .dropdown-menu:not(.dropdown-menu-card) .dropdown-item:hover,
        .navbar .dropdown-menu:not(.dropdown-menu-card) .dropdown-item:focus {
            background: var(--h1-primary-soft, #EEF2FF);
            color: var(--h1-navbar-bg-color);
        }

        .navbar .dropdown-menu:not(.dropdown-menu-card) .dropdown-item i {
            width: 14px;
            text-align: center;
            color: var(--vhrm-muted);
        }

        .navbar .dropdown-menu:not(.dropdown-menu-card) .dropdown-item:hover i {
            color: var(--h1-navbar-bg-color);
        }

/* khối tài khoản người dùng */
.vhrm-user {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .25rem .5rem;
    border-radius: var(--vhrm-radius);
    transition: background-color .15s ease;
}

    .vhrm-user:hover {
        background: var(--h1-primary-soft, #EEF2FF);
    }

.vhrm-user__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--vhrm-brand-gradient);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    flex: 0 0 auto;
}

.vhrm-user__name {
    font-size: 12px;
    font-weight: 600;
    color: var(--vhrm-text);
}

.vhrm-user__code {
    font-size: 11px;
    color: var(--vhrm-muted);
}

/* ---------------------------------------------------------------------
   2. Thanh menu chính — thay dải màu đặc của web cũ bằng gradient + pill
   --------------------------------------------------------------------- */
#navbar-menu .navbar {
    background: var(--vhrm-brand-gradient) !important;
    padding: .2rem 0;
    box-shadow: 0 4px 14px -8px rgba(var(--h1-bg-primary), .8);
}

#navbar-menu .navbar .nav-link {
    color: rgba(255, 255, 255, .88);
    font-size: 12.5px;
    font-weight: 500;
    padding: .4rem .7rem;
    border-radius: 999px;
    transition: background-color .15s ease, color .15s ease;
}

    #navbar-menu .navbar .nav-link:hover,
    #navbar-menu .navbar .nav-link:focus,
    #navbar-menu .navbar .nav-item.show > .nav-link {
        background: rgba(255, 255, 255, .16);
        color: #fff;
    }

    #navbar-menu .navbar .nav-link .nav-link-icon {
        color: rgba(255, 255, 255, .8);
        margin-right: .3rem;
    }

/* menu xổ xuống */
#navbar-menu .dropdown-menu {
    border: 1px solid var(--vhrm-border);
    border-radius: var(--vhrm-radius);
    box-shadow: var(--vhrm-shadow-lg);
    padding: .3rem;
    margin-top: .35rem;
}

#navbar-menu .dropdown-item {
    font-size: 12.5px;
    border-radius: var(--vhrm-radius-sm);
    padding: .4rem .6rem;
    color: var(--vhrm-text);
}

    #navbar-menu .dropdown-item:hover,
    #navbar-menu .dropdown-item:focus {
        background: var(--h1-primary-soft, #EEF2FF);
        color: var(--h1-navbar-bg-color);
    }

@media (max-width: 767.98px) {
    .navbar-expand-md .navbar-collapse .dropdown-menu .dropdown-item {
        color: #fff !important;
    }
}

/* ---------------------------------------------------------------------
   3. Vùng nội dung: breadcrumb, filter, card
   --------------------------------------------------------------------- */
.page-wrapper {
    background: transparent;
}

.h-breadcrumb {
    border: 1px solid var(--vhrm-border);
    border-bottom: 0;
    border-radius: var(--vhrm-radius) var(--vhrm-radius) 0 0;
    background: var(--vhrm-surface);
    box-shadow: none;
    font-size: 12px;
    padding: .35rem .6rem;
}

    .h-breadcrumb .breadcrumb-item a {
        color: var(--vhrm-muted);
        text-decoration: none;
    }

        .h-breadcrumb .breadcrumb-item a:hover {
            color: var(--h1-navbar-bg-color);
        }

    .h-breadcrumb .breadcrumb-item.active {
        color: var(--vhrm-text);
        font-weight: 600;
    }

.h-content-filter {
    border: 1px solid var(--vhrm-border);
    border-top: 0;
    border-radius: 0 0 var(--vhrm-radius) var(--vhrm-radius);
    padding: .6rem;
    background: var(--vhrm-surface);
    box-shadow: var(--vhrm-shadow-sm);
}

.card {
    border: 1px solid var(--vhrm-border);
    border-radius: var(--vhrm-radius);
    box-shadow: var(--vhrm-shadow-sm);
}

.card-header {
    background: #FAFBFE;
    border-bottom: 1px solid var(--vhrm-border);
    border-radius: var(--vhrm-radius) var(--vhrm-radius) 0 0;
    font-weight: 600;
    color: var(--vhrm-text);
}

/* ---------------------------------------------------------------------
   4. Nút & ô nhập
   --------------------------------------------------------------------- */
.btn,
.dxbl-btn {
    border-radius: var(--vhrm-radius-sm) !important;
    font-weight: 500;
}

.btn-primary {
    box-shadow: 0 1px 2px rgba(var(--h1-bg-primary), .35);
}

.dxbl-text-edit,
.dxbl-edit,
.form-control,
.form-select {
    border-radius: var(--vhrm-radius-sm) !important;
}

.dxbl-text-edit.dxbl-focused,
.dxbl-text-edit:focus-within,
.form-control:focus {
    border-color: var(--h1-navbar-bg-color) !important;
    box-shadow: 0 0 0 3px rgba(var(--h1-bg-primary), .14) !important;
}

/* ---------------------------------------------------------------------
   5. Lưới dữ liệu — đầu cột nhạt, hàng kẻ mềm hơn
   --------------------------------------------------------------------- */
.dxbl-grid .dxbl-grid-table > thead > tr > th {
    background: #F8FAFC;
    color: var(--vhrm-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .3px;
    font-size: 11px !important;
}

.dxbl-grid .dxbl-grid-table > tbody > tr:hover > td {
    background: var(--h1-primary-soft, #EEF2FF);
}

.header-grid-template {
    border: 1px solid var(--vhrm-border);
    border-bottom: 0;
    border-radius: var(--vhrm-radius) var(--vhrm-radius) 0 0;
    background: #FAFBFE;
}

/* ---------------------------------------------------------------------
   6. Chân trang
   --------------------------------------------------------------------- */
.vhrm-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .6rem 0;
    margin-top: .6rem;
    border-top: 1px solid var(--vhrm-border);
    color: var(--vhrm-muted);
    font-size: 11.5px;
}

    .vhrm-footer strong {
        color: var(--h1-navbar-bg-color);
        font-weight: 600;
    }

/* nút back-to-top */
#btn-back-to-top {
    background: var(--vhrm-brand-gradient);
    box-shadow: var(--vhrm-shadow);
}

/* ---------------------------------------------------------------------
   7. Trang đăng nhập /dang-nhap
   --------------------------------------------------------------------- */
.vhrm-auth {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    background: var(--vhrm-surface);
}

/* --- cột trái: panel thương hiệu --- */
.vhrm-auth__brand {
    position: relative;
    overflow: hidden;
    background: var(--vhrm-brand-gradient);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3.5rem 4rem;
}

    /* hoa văn nền: lưới chấm + 2 quầng sáng */
    .vhrm-auth__brand::before {
        content: "";
        position: absolute;
        inset: 0;
        background-image: radial-gradient(circle at 18% 22%, rgba(255, 255, 255, .22) 0, transparent 42%), radial-gradient(circle at 88% 82%, rgba(255, 255, 255, .14) 0, transparent 45%);
        pointer-events: none;
    }

    .vhrm-auth__brand::after {
        content: "";
        position: absolute;
        inset: 0;
        background-image: radial-gradient(rgba(255, 255, 255, .16) 1px, transparent 1px);
        background-size: 22px 22px;
        opacity: .5;
        pointer-events: none;
    }

.vhrm-auth__brand-inner {
    position: relative;
    z-index: 1;
    max-width: 460px;
}

.vhrm-auth__logo {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 2.25rem;
}

    .vhrm-auth__logo img {
        width: 46px;
        height: 46px;
        border-radius: 13px;
        box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .45);
    }

.vhrm-auth__logo-name {
    font-size: 23px;
    font-weight: 700;
    letter-spacing: -.5px;
    color: #fff;
    line-height: 1.1;
}

.vhrm-auth__logo-tag {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .72);
}

.vhrm-auth__headline {
    font-size: 30px;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -.6px;
    margin: 0 0 .85rem;
}

.vhrm-auth__sub {
    font-size: 14px;
    line-height: 1.65;
    color: rgba(255, 255, 255, .8);
    margin: 0 0 2.25rem;
}

.vhrm-auth__features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .85rem 1.25rem;
}

    .vhrm-auth__features li {
        display: flex;
        align-items: flex-start;
        gap: .6rem;
        font-size: 13px;
        line-height: 1.45;
        color: rgba(255, 255, 255, .95);
    }

.vhrm-auth__feature-icon {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .22);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.vhrm-auth__feature-title {
    display: block;
    font-weight: 600;
}

.vhrm-auth__feature-desc {
    display: block;
    font-size: 11.5px;
    color: rgba(255, 255, 255, .68);
}

/* --- cột phải: biểu mẫu --- */
.vhrm-auth__form {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    background: var(--vhrm-canvas);
}

.vhrm-auth-card {
    width: 100%;
    max-width: 392px;
}

.vhrm-auth-card__box {
    background: var(--vhrm-surface);
    border: 1px solid var(--vhrm-border);
    border-radius: var(--vhrm-radius-lg);
    box-shadow: var(--vhrm-shadow-lg);
    padding: 2rem 1.9rem 1.75rem;
}

.vhrm-auth-card__mark {
    display: none;
    margin: 0 auto 1rem;
    width: 44px;
    height: 44px;
    border-radius: 13px;
}

.vhrm-auth-card__title {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -.3px;
    color: var(--vhrm-text);
    margin: 0 0 .3rem;
}

.vhrm-auth-card__desc {
    font-size: 12.5px;
    color: var(--vhrm-muted);
    margin: 0 0 1.5rem;
}

.vhrm-auth-card .form-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--vhrm-text);
    margin-bottom: .3rem;
}

.vhrm-auth-card .form-label-description a {
    font-weight: 500;
    color: var(--h1-navbar-bg-color);
    text-decoration: none;
}

    .vhrm-auth-card .form-label-description a:hover {
        text-decoration: underline;
    }

.vhrm-auth-card .form-check-label {
    font-size: 12.5px;
    color: var(--vhrm-muted);
}

.vhrm-auth-card .dxbl-text-edit {
    --dxbl-text-edit-height: 42px;
}

.vhrm-auth__submit {
    width: 100%;
    height: 42px;
    border: 0;
    border-radius: var(--vhrm-radius-sm);
    background: var(--vhrm-brand-gradient);
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    box-shadow: 0 6px 16px -8px rgba(var(--h1-bg-primary), .9);
    transition: filter .15s ease, transform .15s ease;
}

    .vhrm-auth__submit:hover:not(:disabled) {
        filter: brightness(1.08);
    }

    .vhrm-auth__submit:active:not(:disabled) {
        transform: translateY(1px);
    }

.vhrm-auth__help {
    margin-top: 1.1rem;
    text-align: center;
    font-size: 11.5px;
    line-height: 1.7;
    color: var(--vhrm-muted);
}

    .vhrm-auth__help a {
        color: var(--h1-navbar-bg-color);
        text-decoration: none;
        font-weight: 500;
    }

        .vhrm-auth__help a:hover {
            text-decoration: underline;
        }

.vhrm-auth__copyright {
    margin-top: 1.25rem;
    text-align: center;
    font-size: 11px;
    color: #94A3B8;
}

/* --- thu gọn ở màn hình nhỏ --- */
@media (max-width: 1199.98px) {
    .vhrm-auth {
        grid-template-columns: 1fr 1fr;
    }

    .vhrm-auth__brand {
        padding: 3rem 2.5rem;
    }

    .vhrm-auth__headline {
        font-size: 25px;
    }

    .vhrm-auth__features {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 991.98px) {
    .vhrm-auth {
        grid-template-columns: minmax(0, 1fr);
    }

    .vhrm-auth__brand {
        display: none;
    }

    .vhrm-auth__form {
        min-height: 100vh;
    }

    .vhrm-auth-card__mark {
        display: block;
    }
}

@media (max-width: 575.98px) {
    .vhrm-auth-card__box {
        padding: 1.6rem 1.25rem 1.4rem;
        border-radius: var(--vhrm-radius);
    }
}

/* ---------------------------------------------------------------------
   8. Bộ chọn màu giao diện (dropdown hình bảng màu trên header)
   --------------------------------------------------------------------- */
.vhrm-skin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .35rem;
    width: 228px;
}

.vhrm-skin {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .4rem .5rem;
    border: 1px solid var(--vhrm-border);
    border-radius: var(--vhrm-radius-sm);
    background: var(--vhrm-surface);
    font-size: 12px;
    color: var(--vhrm-text);
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
}

    .vhrm-skin:hover {
        border-color: var(--vhrm-border-strong);
        background: #F8FAFC;
    }

    .vhrm-skin.is-active {
        border-color: var(--h1-navbar-bg-color);
        background: var(--h1-primary-soft, #EEF2FF);
        font-weight: 600;
    }

.vhrm-skin__dot {
    width: 16px;
    height: 16px;
    border-radius: 5px;
    flex: 0 0 auto;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .12);
}

.vhrm-auth__copyright strong {
    color: var(--h1-navbar-bg-color);
    font-weight: 600;
}

/* ---------------------------------------------------------------------
   9. Trang trạng thái: 404 / 401 / 500
   --------------------------------------------------------------------- */
.vhrm-status {
    min-height: 62vh; /* nằm trong MainLayout (trang 404 / 401) */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
}

    .vhrm-status.vhrm-status--full { /* đứng một mình, không có layout (trang /Error) */
        min-height: 100vh;
        background: var(--vhrm-canvas);
    }

.vhrm-status__card {
    width: 100%;
    max-width: 440px;
    text-align: center;
    background: var(--vhrm-surface);
    border: 1px solid var(--vhrm-border);
    border-radius: var(--vhrm-radius-lg);
    box-shadow: var(--vhrm-shadow-lg);
    padding: 2.5rem 2rem;
}

.vhrm-status__mark {
    width: 48px;
    height: 48px;
    border-radius: 13px;
    margin-bottom: 1.25rem;
}

.vhrm-status__code {
    font-size: 54px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -2px;
    background: var(--vhrm-brand-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.vhrm-status__title {
    font-size: 19px;
    font-weight: 700;
    color: var(--vhrm-text);
    margin: .75rem 0 .4rem;
}

.vhrm-status__desc {
    font-size: 13px;
    line-height: 1.65;
    color: var(--vhrm-muted);
    margin: 0 0 1.5rem;
}

.vhrm-status__trace {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    padding: .65rem .75rem;
    margin-bottom: 1.5rem;
    border-radius: var(--vhrm-radius-sm);
    background: #F8FAFC;
    border: 1px solid var(--vhrm-border);
    font-size: 11px;
    color: var(--vhrm-muted);
    word-break: break-all;
}

    .vhrm-status__trace code {
        color: var(--vhrm-text);
        font-size: 11.5px;
    }

.vhrm-status__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    height: 40px;
    padding: 0 1.25rem;
    border-radius: var(--vhrm-radius-sm);
    background: var(--vhrm-brand-gradient);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 6px 16px -8px rgba(var(--h1-bg-primary), .9);
    transition: filter .15s ease;
}

    .vhrm-status__action:hover {
        color: #fff;
        filter: brightness(1.08);
    }
