/* Custom Styles for Smart Inventory Hub */
@import url('./design-tokens.css');

/* Typography & Font Chuẩn Tiếng Việt Toàn Hệ Thống */
html, body {
    font-family: var(--th-font-ui);
    background-color: var(--th-bg-app);
    color: var(--th-ink-900);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.font-tabular, .tabular-nums, .font-mono, [id^="dash-kpi-"], [id^="dash-inv-"] {
    font-family: var(--th-font-numbers);
    font-variant-numeric: tabular-nums;
}

/* Luxury card styling */
.th-card {
    background: var(--th-bg-surface);
    border: 1px solid var(--th-border);
    border-radius: var(--th-radius-card);
    box-shadow: var(--th-shadow-card);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.th-card:hover {
    box-shadow: var(--th-shadow-hover);
}

/* Thin Scrollbar for Navigation and Drilldown Table */
.scrollbar-thin {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
.scrollbar-thin::-webkit-scrollbar {
    height: 4px;
    width: 4px;
}
.scrollbar-thin::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 9999px;
}
.scrollbar-thin::-webkit-scrollbar-track {
    background-color: transparent;
}

/* Active Tab Styling */
.active-tab {
    background-color: #EFF6FF !important;
    color: #1D4ED8 !important;
    border-bottom: 2px solid #2563EB !important;
}

/* Active Filter Button */
.active-filter {
    background-color: #2563EB !important;
    color: #FFFFFF !important;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2), 0 2px 4px -2px rgba(37, 99, 235, 0.2) !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #F1F5F9;
}

::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

/* Pulse Glow Animation */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 15px rgba(37, 99, 235, 0.4);
    }
    50% {
        box-shadow: 0 0 25px rgba(37, 99, 235, 0.8);
    }
}

.animate-glow {
    animation: pulse-glow 2s infinite;
}

/* Drag over style for Dropzone */
.dragover {
    border-color: #2563EB !important;
    background-color: #EFF6FF !important;
    transform: scale(1.01);
}

/* Hide scrollbar utility */
.no-scrollbar::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ==================== TỐI ƯU PIN & HIỆU NĂNG CHO THIẾT BỊ DI ĐỘNG (MOBILE BATTERY SAVER) ==================== */
@media screen and (max-width: 768px) {
    /* 1. Tắt các bộ lọc làm mờ xuyên thấu (backdrop-filter) ngốn GPU di động */
    .backdrop-blur-xs,
    .backdrop-blur-sm,
    .backdrop-blur-md,
    .backdrop-blur-lg,
    .backdrop-blur-xl {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
    
    /* 2. Đơn giản hóa các hiệu ứng phát sáng lặp vô tận */
    .animate-glow {
        animation: none !important;
        box-shadow: 0 0 10px rgba(37, 99, 235, 0.3) !important;
    }

    /* 3. Giảm nhấp nháy liên tục của các chấm tín hiệu */
    .animate-ping {
        animation: none !important;
        opacity: 0.8 !important;
    }

    .animate-pulse {
        animation-duration: 3s !important;
    }
}

/* 4. Tự động tương thích với Chế Độ Tiết Kiệm Pin của hệ điều hành iOS / Android */
@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ==================== MẪU IN PHIẾU XUẤT KHO / HÓA ĐƠN ==================== */
@media print {
    body * {
        visibility: hidden;
    }
    #pos-printable-receipt, #pos-printable-receipt * {
        visibility: visible;
    }
    #pos-printable-receipt {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        display: block !important;
        margin: 0 !important;
        padding: 15px !important;
    }
    #pos-receipt-modal {
        background: transparent !important;
        position: static !important;
        padding: 0 !important;
        display: block !important;
    }
}




/* ==================== ENTERPRISE SAAS SOFT SHADOWS & LUXURY BORDERS ==================== */
.shadow-soft-xs {
    box-shadow: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
}
.shadow-soft {
    box-shadow: 0 2px 10px 0 rgba(15, 23, 42, 0.04), 0 1px 3px 0 rgba(15, 23, 42, 0.02);
}
.shadow-soft-md {
    box-shadow: 0 6px 20px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
}
.shadow-soft-lg {
    box-shadow: 0 12px 32px -4px rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.04);
}
.shadow-inner-soft {
    box-shadow: inset 0 1px 2px 0 rgba(15, 23, 42, 0.03);
}
.enterprise-border {
    border: 1px solid rgba(226, 232, 240, 0.9);
}
.squircle-icon {
    box-shadow: 0 2px 8px -1px rgba(0, 0, 0, 0.06);
}
