/* ==========================================================================
   NXB-CAND UNIFIED UI COMPONENTS BUNDLE (ZERO-CONFIG ARCHITECTURE)
   Đóng gói toàn bộ CSS chuẩn hóa cho các Blazor Common Components dùng chung
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. UNIVERSAL TAILWIND & COMMON COMPONENTS COMPATIBILITY RESETS (ROOT-LEVEL)
   Khắc phục triệt để lỗi mất border khi Tailwind chạy ở chế độ preflight: false
   và bảo vệ toàn bộ UI Components dùng chung khỏi xung đột với Bootstrap 5.
   -------------------------------------------------------------------------- */

/* 0.1. Reset nền tảng cho Border trong Tailwind (Khắc phục triệt để mất border toàn app) */
*, ::before, ::after {
    border-color: #e2e8f0;
    border-style: solid;
    border-width: 0;
}

/* 0.2. Font family chuẩn hóa toàn hệ thống (Inter + JetBrains Mono)
   Khắc phục triệt để lỗi vỡ font / fallback ký tự tiếng Việt do Poppins cục bộ gây ra. */
:root, [data-bs-theme=light], [data-bs-theme=dark] {
    --vz-font-sans-serif: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    --vz-body-font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    --vz-font-monospace: 'JetBrains Mono', SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important;
}

/* Áp dụng font Inter đồng bộ cho html, body, headings, form controls, buttons, cards, tables */
html,
body,
button,
input,
optgroup,
select,
textarea,
.form-control,
.form-select,
.btn,
.btn-component,
.badge,
.table,
.card,
.card-component,
.tree-select-wrapper,
.modal-content,
.dropdown-menu,
.nav-link,
.page-title-box,
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

/* Class tiện ích font-sans cho Tailwind / UI Components */
.font-sans {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

/* Monospace fonts dành riêng cho code, mã ID, badge kỹ thuật */
.font-mono,
.mono-font,
code,
kbd,
pre,
samp,
[class*="font-mono"] {
    font-family: 'JetBrains Mono', SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important;
}

/* Fallback phòng ngừa: Nếu có thành phần cũ gọi 'Poppins', ánh xạ dải ký tự tiếng Việt về 'Inter' / system font */
@font-face {
    font-family: 'Poppins';
    src: local('Inter'), local('Segoe UI');
    unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

/* 0.3. Bảo vệ .badge của Tailwind & Common Components khỏi Bootstrap ghi đè chữ trắng */
.badge[class*="text-"] {
    --bs-badge-color: currentColor !important;
    color: currentColor !important;
}
.badge[class*="bg-slate-"],
.badge[class*="bg-emerald-"],
.badge[class*="bg-teal-"],
.badge[class*="bg-rose-"],
.badge[class*="bg-amber-"],
.badge[class*="bg-blue-"],
.badge[class*="bg-purple-"],
.badge[class*="bg-gray-"] {
    --bs-badge-bg: transparent !important;
}
.badge {
    line-height: inherit;
}

/* 0.4. Custom scrollbar dùng chung toàn hệ thống */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 0.5. Khung ô ma trận khảo nghiệm đa ngành */
.matrix-cell-active {
    background-color: #ecfdf5 !important;
    border-color: #6ee7b7 !important;
}
.matrix-cell-inactive {
    background-color: #f8fafc !important;
    border-color: #e2e8f0 !important;
    opacity: 0.7;
}
.matrix-cell-incompatible {
    background-color: #fff1f2 !important;
    border-color: #fecdd3 !important;
    border-style: dashed !important;
}

/* 0.6. Animation popup chuẩn */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.97);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
.animate-popup {
    animation: fadeInScale 0.15s ease-out forwards;
}

/* --------------------------------------------------------------------------
   1. GLOBAL RESETS & UTILITIES FOR COMPONENTS
   -------------------------------------------------------------------------- */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border-width: 0 !important;
}

/* --------------------------------------------------------------------------
   2. TEXTFIELD COMPONENT STYLES
   -------------------------------------------------------------------------- */
.textfield-wrapper {
    width: 100%;
    position: relative;
}

.textfield-input-container {
    border: 1px solid #e2e8f0 !important;
    background-color: #ffffff !important;
    border-radius: 0.75rem !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    min-height: 38px !important;
    overflow: hidden !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
}

.textfield-input-container:hover:not(.opacity-60) {
    border-color: #cbd5e1 !important;
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.textfield-input-container:focus-within {
    border-color: #0d9488 !important;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12) !important;
    background-color: #ffffff !important;
}

.textfield-control {
    border: none !important;
    border-width: 0 !important;
    background: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    width: 100% !important;
    font-size: 0.8125rem !important;
    padding: 0.45rem 0.75rem !important;
    color: #1e293b !important;
    font-family: inherit;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.textfield-control:focus {
    border: none !important;
    border-width: 0 !important;
    outline: none !important;
    box-shadow: none !important;
}

textarea.textfield-control {
    min-height: 72px;
    resize: vertical;
}

.textfield-control[type="number"]::-webkit-inner-spin-button,
.textfield-control[type="number"]::-webkit-outer-spin-button {
    opacity: 0.6;
}

.textfield-addon {
    font-family: inherit;
    background-color: #f8fafc;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    border-color: #e2e8f0;
}

/* --------------------------------------------------------------------------
   3. CHECKBOX COMPONENT STYLES
   -------------------------------------------------------------------------- */
.checkbox-wrapper {
    position: relative;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

.checkbox-box {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
    border-radius: 5px !important;
    border: 1px solid #cbd5e1 !important;
    background-color: #ffffff !important;
    transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.checkbox-size-sm {
    width: 15px !important;
    height: 15px !important;
    min-width: 15px !important;
    min-height: 15px !important;
    font-size: 10px !important;
}

.checkbox-size-md {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    font-size: 12px !important;
}

.checkbox-size-lg {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    min-height: 22px !important;
    font-size: 14px !important;
}

.checkbox-state-unchecked {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
}

.checkbox-wrapper:hover:not(.opacity-50) .checkbox-state-unchecked {
    border-color: #94a3b8 !important;
    background-color: #f8fafc !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Color Variants */
.checkbox-color-teal {
    background: linear-gradient(180deg, #0d9488 0%, #0f766e 100%) !important;
    border-color: #115e59 !important;
    color: #ffffff !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 1px 2px rgba(15, 118, 110, 0.35);
}

.checkbox-color-emerald {
    background: linear-gradient(180deg, #059669 0%, #047857 100%) !important;
    border-color: #065f46 !important;
    color: #ffffff !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 1px 2px rgba(4, 120, 87, 0.35);
}

.checkbox-color-purple {
    background: linear-gradient(180deg, #9333ea 0%, #7e22ce 100%) !important;
    border-color: #6b21a8 !important;
    color: #ffffff !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 1px 2px rgba(126, 34, 206, 0.35);
}

.checkbox-color-blue {
    background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%) !important;
    border-color: #1e40af !important;
    color: #ffffff !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 1px 2px rgba(29, 78, 216, 0.35);
}

.checkbox-color-rose {
    background: linear-gradient(180deg, #e11d48 0%, #be123c 100%) !important;
    border-color: #9f1239 !important;
    color: #ffffff !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 1px 2px rgba(190, 18, 60, 0.35);
}

.checkbox-color-dark {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%) !important;
    border-color: #020617 !important;
    color: #ffffff !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 2px rgba(0, 0, 0, 0.35);
}

.checkbox-card-mode {
    cursor: pointer;
    width: 100%;
}

/* --------------------------------------------------------------------------
   4. TABSWITCHER COMPONENT STYLES
   -------------------------------------------------------------------------- */
.tabswitcher-container {
    background-color: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 0.25rem;
    border-radius: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.tabswitcher-btn {
    border: none;
    background: transparent;
    padding: 0.375rem 0.625rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    transition: all 0.15s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.tabswitcher-btn:hover {
    color: #1e293b;
}

.tabswitcher-btn.active {
    background-color: #ffffff !important;
    color: #0f766e !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* --------------------------------------------------------------------------
   5. BANNER / CALLOUT COMPONENT STYLES
   -------------------------------------------------------------------------- */
.banner-wrapper {
    border-radius: 1rem;
    transition: all 0.2s ease;
}

.banner-accent-left {
    border-left-width: 4px !important;
}

/* --------------------------------------------------------------------------
   6. COMMON FORM CONTROLS & CARDS IN CMS MODALS
   -------------------------------------------------------------------------- */
.target-type-check-card {
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 0.625rem 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #ffffff;
    user-select: none;
}

.target-type-check-card:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.btn-generate-code {
    width: 38px;
    height: 38px;
    border-radius: 0.75rem !important;
    border: 1px solid #e2e8f0 !important;
    background-color: #ffffff !important;
    color: #64748b !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-generate-code:hover {
    border-color: #0d9488 !important;
    color: #0d9488 !important;
    background-color: #f0fdf4 !important;
}

.form-select-modern {
    border: 1px solid #e2e8f0 !important;
    border-radius: 0.75rem !important;
    font-size: 0.8125rem !important;
    color: #1e293b !important;
    background-color: #ffffff !important;
    transition: all 0.2s ease !important;
}

/* --------------------------------------------------------------------------
   7. BUTTON COMPONENT STYLES - CRISP, HIGH-END & TACTILE DESIGN SYSTEM
   -------------------------------------------------------------------------- */
.btn-component {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
    letter-spacing: -0.012em;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
    white-space: nowrap;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    text-decoration: none !important;
    border-style: solid;
    border-width: 1px;
    border-color: transparent;
    transition: color 0.15s cubic-bezier(0.16, 1, 0.3, 1),
                background 0.15s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.15s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.15s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.08s ease;
}

.btn-component:active:not(:disabled) {
    transform: translateY(1px);
}

.btn-component:focus-visible {
    outline: 2px solid #0d9488;
    outline-offset: 2px;
}

/* 1. Primary Black (Shopify Polaris / Linear Dark) */
.btn-variant-primary,
.btn-variant-black {
    background: linear-gradient(180deg, #1f2937 0%, #111827 100%) !important;
    border: 1px solid #09090b !important;
    color: #ffffff !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 
                0 1px 2px rgba(0, 0, 0, 0.14) !important;
}
.btn-variant-primary:hover:not(:disabled),
.btn-variant-black:hover:not(:disabled) {
    background: linear-gradient(180deg, #374151 0%, #1f2937 100%) !important;
    border-color: #000000 !important;
    color: #ffffff !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 
                0 2px 4px rgba(0, 0, 0, 0.22) !important;
}
.btn-variant-primary:active:not(:disabled),
.btn-variant-black:active:not(:disabled) {
    background: #09090b !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4) !important;
}

/* 2. Secondary White */
.btn-variant-secondary,
.btn-variant-white {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: #1e293b !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 
                inset 0 -1px 0 rgba(0, 0, 0, 0.02) !important;
    font-weight: 600;
}
.btn-variant-secondary:hover:not(:disabled),
.btn-variant-white:hover:not(:disabled) {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}
.btn-variant-secondary:active:not(:disabled),
.btn-variant-white:active:not(:disabled) {
    background: #f1f5f9 !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06) !important;
}

/* 3. Outline & Colored Outlines */
.btn-variant-outline {
    background: transparent !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02) !important;
}
.btn-variant-outline:hover:not(:disabled) {
    background: #f8fafc !important;
    border-color: #94a3b8 !important;
    color: #0f172a !important;
}

.btn-variant-outline-primary,
.btn-variant-outline-teal {
    background: transparent !important;
    border: 1px solid #0d9488 !important;
    color: #0f766e !important;
}
.btn-variant-outline-primary:hover:not(:disabled),
.btn-variant-outline-teal:hover:not(:disabled) {
    background: rgba(13, 148, 136, 0.08) !important;
    border-color: #0f766e !important;
    color: #0f766e !important;
}

.btn-variant-outline-success {
    background: transparent !important;
    border: 1px solid #10b981 !important;
    color: #059669 !important;
}
.btn-variant-outline-success:hover:not(:disabled) {
    background: rgba(16, 185, 129, 0.08) !important;
    border-color: #047857 !important;
    color: #047857 !important;
}

.btn-variant-outline-danger {
    background: transparent !important;
    border: 1px solid #f43f5e !important;
    color: #e11d48 !important;
}
.btn-variant-outline-danger:hover:not(:disabled) {
    background: rgba(244, 63, 94, 0.08) !important;
    border-color: #be123c !important;
    color: #be123c !important;
}

.btn-variant-outline-purple {
    background: transparent !important;
    border: 1px solid #a855f7 !important;
    color: #7e22ce !important;
}
.btn-variant-outline-purple:hover:not(:disabled) {
    background: rgba(168, 85, 247, 0.08) !important;
    border-color: #6b21a8 !important;
    color: #6b21a8 !important;
}

.btn-variant-outline-warning {
    background: transparent !important;
    border: 1px solid #f59e0b !important;
    color: #d97706 !important;
}
.btn-variant-outline-warning:hover:not(:disabled) {
    background: rgba(245, 158, 11, 0.08) !important;
    border-color: #b45309 !important;
    color: #b45309 !important;
}

.btn-variant-outline-info {
    background: transparent !important;
    border: 1px solid #38bdf8 !important;
    color: #0284c7 !important;
}
.btn-variant-outline-info:hover:not(:disabled) {
    background: rgba(56, 189, 248, 0.08) !important;
    border-color: #0369a1 !important;
    color: #0369a1 !important;
}

.btn-variant-outline-dark {
    background: transparent !important;
    border: 1px solid #334155 !important;
    color: #1e293b !important;
}
.btn-variant-outline-dark:hover:not(:disabled) {
    background: rgba(51, 65, 85, 0.08) !important;
    border-color: #0f172a !important;
    color: #0f172a !important;
}

/* 4. Solid Gradients */
.btn-variant-teal {
    background: linear-gradient(180deg, #0d9488 0%, #0f766e 100%) !important;
    border: 1px solid #0f766e !important;
    color: #ffffff !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 
                0 1px 2px rgba(13, 148, 136, 0.25) !important;
}
.btn-variant-teal:hover:not(:disabled) {
    background: linear-gradient(180deg, #14b8a6 0%, #0d9488 100%) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 
                0 2px 4px rgba(13, 148, 136, 0.3) !important;
}

.btn-variant-purple {
    background: linear-gradient(180deg, #9333ea 0%, #7e22ce 100%) !important;
    border: 1px solid #7e22ce !important;
    color: #ffffff !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 
                0 1px 2px rgba(147, 51, 234, 0.25) !important;
}
.btn-variant-purple:hover:not(:disabled) {
    background: linear-gradient(180deg, #a855f7 0%, #9333ea 100%) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 
                0 2px 4px rgba(147, 51, 234, 0.3) !important;
}

.btn-variant-danger {
    background: linear-gradient(180deg, #e11d48 0%, #be123c 100%) !important;
    border: 1px solid #be123c !important;
    color: #ffffff !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 
                0 1px 2px rgba(225, 29, 72, 0.25) !important;
}
.btn-variant-danger:hover:not(:disabled) {
    background: linear-gradient(180deg, #f43f5e 0%, #e11d48 100%) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 
                0 2px 4px rgba(225, 29, 72, 0.3) !important;
}

.btn-variant-success {
    background: linear-gradient(180deg, #059669 0%, #047857 100%) !important;
    border: 1px solid #047857 !important;
    color: #ffffff !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 
                0 1px 2px rgba(5, 150, 105, 0.25) !important;
}
.btn-variant-success:hover:not(:disabled) {
    background: linear-gradient(180deg, #10b981 0%, #059669 100%) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 
                0 2px 4px rgba(5, 150, 105, 0.3) !important;
}

.btn-variant-warning {
    background: linear-gradient(180deg, #d97706 0%, #b45309 100%) !important;
    border: 1px solid #b45309 !important;
    color: #ffffff !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 
                0 1px 2px rgba(217, 119, 6, 0.25) !important;
}
.btn-variant-warning:hover:not(:disabled) {
    background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 
                0 2px 4px rgba(217, 119, 6, 0.3) !important;
}

.btn-variant-info {
    background: linear-gradient(180deg, #0284c7 0%, #0369a1 100%) !important;
    border: 1px solid #0369a1 !important;
    color: #ffffff !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 
                0 1px 2px rgba(2, 132, 199, 0.25) !important;
}
.btn-variant-info:hover:not(:disabled) {
    background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 
                0 2px 4px rgba(2, 132, 199, 0.3) !important;
}

.btn-variant-dark {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%) !important;
    border: 1px solid #0f172a !important;
    color: #ffffff !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 
                0 1px 2px rgba(0, 0, 0, 0.2) !important;
}
.btn-variant-dark:hover:not(:disabled) {
    background: linear-gradient(180deg, #334155 0%, #1e293b 100%) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25) !important;
}

/* 5. Ghost */
.btn-variant-ghost {
    background: transparent !important;
    border: 1px solid transparent !important;
    color: #475569 !important;
    box-shadow: none !important;
}
.btn-variant-ghost:hover:not(:disabled) {
    background: #f1f5f9 !important;
    border-color: transparent !important;
    color: #0f172a !important;
}
.btn-variant-ghost:active:not(:disabled) {
    background: #e2e8f0 !important;
}

/* 6. Soft Variants */
.btn-variant-danger-soft {
    background: #fff1f2 !important;
    border: 1px solid #fecdd3 !important;
    color: #be123c !important;
    box-shadow: 0 1px 2px rgba(244, 63, 94, 0.05) !important;
}
.btn-variant-danger-soft:hover:not(:disabled) {
    background: #ffe4e6 !important;
    border-color: #fda4af !important;
    color: #9f1239 !important;
}

.btn-variant-success-soft {
    background: #ecfdf5 !important;
    border: 1px solid #a7f3d0 !important;
    color: #047857 !important;
    box-shadow: 0 1px 2px rgba(16, 185, 129, 0.05) !important;
}
.btn-variant-success-soft:hover:not(:disabled) {
    background: #d1fae5 !important;
    border-color: #6ee7b7 !important;
    color: #065f46 !important;
}

.btn-variant-warning-soft {
    background: #fffbeb !important;
    border: 1px solid #fde68a !important;
    color: #b45309 !important;
    box-shadow: 0 1px 2px rgba(245, 158, 11, 0.05) !important;
}
.btn-variant-warning-soft:hover:not(:disabled) {
    background: #fef3c7 !important;
    border-color: #fcd34d !important;
    color: #92400e !important;
}

.btn-variant-purple-soft {
    background: #faf5ff !important;
    border: 1px solid #e9d5ff !important;
    color: #7e22ce !important;
    box-shadow: 0 1px 2px rgba(168, 85, 247, 0.05) !important;
}
.btn-variant-purple-soft:hover:not(:disabled) {
    background: #f3e8ff !important;
    border-color: #d8b4fe !important;
    color: #6b21a8 !important;
}

.btn-variant-teal-soft {
    background: #f0fdfa !important;
    border: 1px solid #99f6e4 !important;
    color: #0f766e !important;
    box-shadow: 0 1px 2px rgba(13, 148, 136, 0.05) !important;
}
.btn-variant-teal-soft:hover:not(:disabled) {
    background: #ccfbf1 !important;
    border-color: #5eead4 !important;
    color: #115e59 !important;
}

.btn-variant-info-soft {
    background: #f0f9ff !important;
    border: 1px solid #bae6fd !important;
    color: #0369a1 !important;
    box-shadow: 0 1px 2px rgba(56, 189, 248, 0.05) !important;
}
.btn-variant-info-soft:hover:not(:disabled) {
    background: #e0f2fe !important;
    border-color: #7dd3fc !important;
    color: #075985 !important;
}

/* 7. Badges & Spinners */
.btn-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    height: 16px;
    border-radius: 9999px;
    font-size: 10px;
    font-weight: 700;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    line-height: 1;
    letter-spacing: -0.02em;
    margin-left: 6px;
    flex-shrink: 0;
}
.btn-badge-default {
    background: rgba(0, 0, 0, 0.12);
    color: inherit;
}
.btn-variant-primary .btn-badge-default,
.btn-variant-black .btn-badge-default,
.btn-variant-dark .btn-badge-default,
.btn-variant-teal .btn-badge-default,
.btn-variant-purple .btn-badge-default,
.btn-variant-danger .btn-badge-default,
.btn-variant-success .btn-badge-default,
.btn-variant-warning .btn-badge-default,
.btn-variant-info .btn-badge-default {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.btn-badge-danger {
    background: #f43f5e !important;
    color: #ffffff !important;
}
.btn-badge-success {
    background: #10b981 !important;
    color: #ffffff !important;
}
.btn-badge-warning {
    background: #f59e0b !important;
    color: #ffffff !important;
}
.btn-badge-info {
    background: #0ea5e9 !important;
    color: #ffffff !important;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 0.75s linear infinite;
}

/* --------------------------------------------------------------------------
   8. DATATABLE COMPONENT STYLES
   -------------------------------------------------------------------------- */
.datatable-wrapper {
    position: relative;
    background: #ffffff;
    border-radius: 0.75rem;
    overflow: hidden;
    font-family: inherit;
}

.datatable-scroll-container {
    position: relative;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.datatable-main {
    width: 100%;
    margin-bottom: 0;
    border-collapse: collapse;
}

.datatable-main thead th {
    font-weight: 700;
    font-size: 0.8125rem;
    letter-spacing: 0.01em;
    padding: 0.7rem 0.8rem;
    vertical-align: middle;
    white-space: nowrap;
    border-bottom: 2px solid #5eead4;
    border-right: none;
    user-select: none;
    color: #0f172a;
    background-color: #f0fdfa;
    box-shadow: 0 1px 2px rgba(13, 148, 136, 0.05);
}

.datatable-main thead th span,
.datatable-main thead th div {
    color: #0f172a;
    font-weight: 700;
}

.datatable-main thead th i {
    color: #0d9488;
    font-size: 13.5px;
    vertical-align: -1px;
}

.datatable-header-sortable:hover {
    background-color: rgba(0, 0, 0, 0.025);
}

.datatable-sort-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
}

.datatable-main tbody td {
    padding: 0.6rem 0.8rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

.datatable-compact tbody td,
.datatable-compact thead th {
    padding: 0.4rem 0.6rem;
}

.datatable-row:hover {
    background-color: #f8fafc !important;
}

.datatable-row-selected {
    background-color: rgba(13, 148, 136, 0.05) !important;
}

.datatable-color-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.15rem 0.45rem;
    border-radius: 9999px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.datatable-color-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.datatable-mono-text {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
}

/* Skeleton Loading Shimmer */
.skeleton-shimmer {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0.25rem;
}

.skeleton-cell {
    height: 14px;
}

.skeleton-checkbox {
    width: 16px;
    height: 16px;
    margin: 0 auto;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* --------------------------------------------------------------------------
   9. DATEPICKER COMPONENT STYLES
   -------------------------------------------------------------------------- */
.datepicker-component {
    position: relative;
    width: 100%;
    font-family: inherit;
}

.datepicker-input-wrapper {
    position: relative;
    width: 100%;
}

.datepicker-input {
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0;
    border-radius: 0.625rem;
    padding-left: 2.35rem;
    padding-right: 2rem;
    font-size: 0.8125rem;
    color: #1e293b;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    height: 38px;
}

.datepicker-input:focus {
    border-color: #0d9488 !important;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12) !important;
}

.datepicker-sm .datepicker-input {
    height: 32px;
    padding-left: 2rem;
    font-size: 0.75rem;
}

.datepicker-lg .datepicker-input {
    height: 44px;
    padding-left: 2.75rem;
    font-size: 0.875rem;
}

.datepicker-clear-btn {
    right: 0.5rem;
    z-index: 4;
}

.datepicker-popup {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 1050;
    min-width: 290px;
    background: #ffffff;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    user-select: none;
    animation: fadeIn 0.15s ease-out;
}

.datepicker-presets-sidebar {
    width: 110px;
    flex-shrink: 0;
}

.datepicker-preset-btn {
    font-size: 0.75rem;
    padding: 0.35rem 0.5rem;
    color: #475569;
}

.datepicker-preset-btn:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

.datepicker-calendar-main {
    min-width: 260px;
}

.datepicker-weekdays-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.datepicker-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.cal-day-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.1s ease-in-out;
    color: #334155;
}

.cal-day-cell:hover:not(.is-disabled):not(.is-empty) {
    background-color: #f1f5f9;
    color: #0f172a;
}

.cal-day-cell.is-empty {
    cursor: default;
    pointer-events: none;
}

.cal-day-cell.is-other-month {
    color: #cbd5e1;
}

.cal-day-cell.is-today {
    font-weight: 700;
    position: relative;
}

.cal-day-cell.is-today::after {
    content: '';
    position: absolute;
    bottom: 2px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: #0d9488;
}

.cal-day-cell.is-selected {
    background-color: #0d9488 !important;
    color: #ffffff !important;
    font-weight: 700;
}

.cal-day-cell.is-range-start {
    background-color: #0d9488 !important;
    color: #ffffff !important;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.cal-day-cell.is-range-end {
    background-color: #0d9488 !important;
    color: #ffffff !important;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.cal-day-cell.is-in-range {
    background-color: #ccfbf1 !important;
    color: #0f766e !important;
    border-radius: 0;
}

.cal-day-cell.is-disabled {
    color: #e2e8f0;
    cursor: not-allowed;
    background: transparent !important;
}

/* Color Variant Overrides */
[data-color="purple"] .datepicker-input:focus {
    border-color: #a855f7 !important;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.12) !important;
}
[data-color="purple"] .cal-day-cell.is-selected,
[data-color="purple"] .cal-day-cell.is-range-start,
[data-color="purple"] .cal-day-cell.is-range-end {
    background-color: #a855f7 !important;
}
[data-color="purple"] .cal-day-cell.is-in-range {
    background-color: #f3e8ff !important;
    color: #7e22ce !important;
}
[data-color="purple"] .cal-day-cell.is-today::after {
    background-color: #a855f7;
}

[data-color="blue"] .datepicker-input:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12) !important;
}
[data-color="blue"] .cal-day-cell.is-selected,
[data-color="blue"] .cal-day-cell.is-range-start,
[data-color="blue"] .cal-day-cell.is-range-end {
    background-color: #3b82f6 !important;
}
[data-color="blue"] .cal-day-cell.is-in-range {
    background-color: #dbeafe !important;
    color: #1d4ed8 !important;
}
[data-color="blue"] .cal-day-cell.is-today::after {
    background-color: #3b82f6;
}

/* --------------------------------------------------------------------------
   10. STATCARD COMPONENT STYLES
   -------------------------------------------------------------------------- */
.statcard-component {
    width: 100%;
    font-family: inherit;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.statcard-inner {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.statcard-inner:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.06), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
}

.statcard-icon-box {
    width: 44px;
    height: 44px;
    transition: transform 0.2s ease;
}

.statcard-inner:hover .statcard-icon-box {
    transform: scale(1.05);
}

.statcard-value {
    font-size: 1.625rem;
    line-height: 1.2;
}

.statcard-sm .statcard-value {
    font-size: 1.25rem;
}
.statcard-sm .statcard-icon-box {
    width: 36px;
    height: 36px;
}
.statcard-sm .statcard-inner {
    padding: 0.75rem 1rem;
}

.statcard-lg .statcard-value {
    font-size: 2.125rem;
}
.statcard-lg .statcard-icon-box {
    width: 52px;
    height: 52px;
}

.statcard-chip {
    transition: all 0.15s ease-in-out;
}

.statcard-chip:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.statcard-chip.is-active {
    background-color: #f0fdfa;
    border-color: #0d9488 !important;
}

.statcard-gradient .statcard-inner {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

/* --------------------------------------------------------------------------
   11. BADGE COMPONENT STYLES
   -------------------------------------------------------------------------- */
.badge-component {
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    transition: all 0.15s ease-in-out;
}

.badge-link:hover {
    filter: brightness(0.95);
    transform: translateY(-1px);
}

.badge-xs {
    padding: 0.125rem 0.375rem;
    font-size: 0.6875rem;
}
.badge-xs .badge-dot {
    width: 5px;
    height: 5px;
}

.badge-sm {
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
}
.badge-sm .badge-dot {
    width: 6px;
    height: 6px;
}

.badge-md {
    padding: 0.3rem 0.625rem;
    font-size: 0.8125rem;
}
.badge-md .badge-dot {
    width: 7px;
    height: 7px;
}

.badge-lg {
    padding: 0.4rem 0.75rem;
    font-size: 0.875rem;
}
.badge-lg .badge-dot {
    width: 8px;
    height: 8px;
}

.badge-variant-soft.badge-color-teal {
    background-color: #f0fdfa;
    color: #0f766e;
    border: 1px solid #ccfbf1;
}
.badge-variant-soft.badge-color-purple {
    background-color: #faf5ff;
    color: #7e22ce;
    border: 1px solid #f3e8ff;
}
.badge-variant-soft.badge-color-emerald {
    background-color: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}
.badge-variant-soft.badge-color-amber {
    background-color: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}
.badge-variant-soft.badge-color-rose {
    background-color: #fff1f2;
    color: #be123c;
    border: 1px solid #fecdd3;
}
.badge-variant-soft.badge-color-blue {
    background-color: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}
.badge-variant-soft.badge-color-slate {
    background-color: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.badge-variant-solid.badge-color-teal {
    background-color: #0d9488;
    color: #ffffff;
}
.badge-variant-solid.badge-color-purple {
    background-color: #9333ea;
    color: #ffffff;
}
.badge-variant-solid.badge-color-emerald {
    background-color: #10b981;
    color: #ffffff;
}
.badge-variant-solid.badge-color-amber {
    background-color: #f59e0b;
    color: #ffffff;
}
.badge-variant-solid.badge-color-rose {
    background-color: #f43f5e;
    color: #ffffff;
}
.badge-variant-solid.badge-color-blue {
    background-color: #3b82f6;
    color: #ffffff;
}
.badge-variant-solid.badge-color-slate {
    background-color: #475569;
    color: #ffffff;
}

.badge-variant-outline.badge-color-teal {
    background-color: transparent;
    color: #0d9488;
    border: 1px solid #0d9488;
}
.badge-variant-outline.badge-color-purple {
    background-color: transparent;
    color: #9333ea;
    border: 1px solid #9333ea;
}
.badge-variant-outline.badge-color-emerald {
    background-color: transparent;
    color: #10b981;
    border: 1px solid #10b981;
}
.badge-variant-outline.badge-color-amber {
    background-color: transparent;
    color: #f59e0b;
    border: 1px solid #f59e0b;
}
.badge-variant-outline.badge-color-rose {
    background-color: transparent;
    color: #f43f5e;
    border: 1px solid #f43f5e;
}
.badge-variant-outline.badge-color-blue {
    background-color: transparent;
    color: #3b82f6;
    border: 1px solid #3b82f6;
}
.badge-variant-outline.badge-color-slate {
    background-color: transparent;
    color: #64748b;
    border: 1px solid #94a3b8;
}

/* --------------------------------------------------------------------------
   12. MODAL & DRAWER COMPONENT STYLES
   -------------------------------------------------------------------------- */
.modal-component {
    font-family: inherit;
}

.modal-content {
    border: none !important;
    border-radius: 1.25rem !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    background: #ffffff;
}

.modal-header,
.offcanvas-header {
    border-bottom: 1px solid #f1f5f9;
}

.modal-footer,
.offcanvas-footer {
    border-top: 1px solid #f1f5f9;
}

.modal-close-btn {
    width: 32px;
    height: 32px;
}

.modal-drawer-wrapper.offcanvas-end {
    width: 480px;
    max-width: 90vw;
    border-left: 1px solid #e2e8f0;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
}

.modal-drawer-wrapper.offcanvas-start {
    width: 480px;
    max-width: 90vw;
    border-right: 1px solid #e2e8f0;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.1);
}

.btn-purple {
    background-color: #9333ea !important;
    border-color: #9333ea !important;
    color: #ffffff !important;
}
.btn-purple:hover {
    background-color: #7e22ce !important;
    border-color: #7e22ce !important;
}

.btn-emerald {
    background-color: #10b981 !important;
    border-color: #10b981 !important;
    color: #ffffff !important;
}
.btn-emerald:hover {
    background-color: #059669 !important;
    border-color: #059669 !important;
}

.btn-amber {
    background-color: #f59e0b !important;
    border-color: #f59e0b !important;
    color: #ffffff !important;
}

.btn-rose {
    background-color: #f43f5e !important;
    border-color: #f43f5e !important;
    color: #ffffff !important;
}

/* --------------------------------------------------------------------------
   13. EMPTYSTATE COMPONENT STYLES
   -------------------------------------------------------------------------- */
.emptystate-component {
    width: 100%;
    font-family: inherit;
}

.emptystate-inner {
    max-width: 540px;
}

.emptystate-icon-box {
    width: 64px;
    height: 64px;
    transition: transform 0.2s ease;
}

.emptystate-component:hover .emptystate-icon-box {
    transform: scale(1.06);
}

.emptystate-sm .emptystate-icon-box {
    width: 44px;
    height: 44px;
}
.emptystate-sm .emptystate-inner {
    max-width: 360px;
}

.emptystate-lg .emptystate-icon-box {
    width: 80px;
    height: 80px;
}
.emptystate-lg .emptystate-inner {
    max-width: 640px;
}

.emptystate-compact {
    padding: 1.25rem 1rem !important;
}
.emptystate-compact .emptystate-icon-box {
    width: 40px;
    height: 40px;
    margin-bottom: 0.5rem !important;
}
.emptystate-compact .emptystate-desc {
    margin-bottom: 0.75rem !important;
}

/* --------------------------------------------------------------------------
   14. PAGEHEADER COMPONENT STYLES (Mảnh mai & Tinh tế)
   -------------------------------------------------------------------------- */
.pageheader-component {
    width: 100%;
    font-family: inherit;
}

.pageheader-main-box {
    transition: all 0.2s ease-in-out;
    min-height: 48px;
}

.pageheader-back-btn {
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    padding: 0;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    color: #64748b;
    border-radius: 8px;
    transition: all 0.15s ease-in-out;
}

.pageheader-back-btn:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

.pageheader-icon-box {
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    border-radius: 8px;
}

.pageheader-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.25;
}

.pageheader-subtitle {
    font-size: 11.5px;
    line-height: 1.25;
    color: #64748b;
}

.pageheader-breadcrumbs {
    font-size: 11.5px;
}

.pageheader-breadcrumbs .breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    color: #cbd5e1;
    padding: 0 0.35rem;
}

.pageheader-hero .pageheader-main-box {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
    border-color: #334155 !important;
    color: #ffffff !important;
}
.pageheader-hero .pageheader-title {
    color: #ffffff !important;
}
.pageheader-hero .pageheader-subtitle {
    color: #94a3b8 !important;
}

.pageheader-minimal .pageheader-main-box {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0.35rem 0 !important;
    min-height: auto;
}

/* ─── Rating Tiers Flexbox (Dải đều tối đa 5 items / hàng) ────────── */
.rating-tiers-flex {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.625rem !important;
    width: 100% !important;
}

.rating-tier-flex-item {
    min-width: 140px;
    flex: 1 1 100%;
}

@media (min-width: 640px) {
    .rating-tier-flex-item {
        flex: 1 1 calc(50% - 0.3125rem);
    }
}

@media (min-width: 1024px) {
    /* Khi <= 5 items: Tự động nở đều lấp đầy 100% hàng (3 items -> 33.3%, 4 items -> 25%, 5 items -> 20%) */
    .rating-tier-flex-item.tier-flex-auto {
        flex: 1 1 0% !important;
        max-width: none !important;
        min-width: 140px !important;
    }
    /* Khi > 5 items: Cố định chuẩn 5 items / hàng (ngắt dòng tuyệt đối tại item thứ 6, không bị co ép) */
    .rating-tier-flex-item.tier-flex-max5 {
        flex: 0 0 calc(20% - 0.5rem) !important;
        width: calc(20% - 0.5rem) !important;
        max-width: calc(20% - 0.5rem) !important;
        min-width: 0 !important;
    }
}






