/* ==========================================================================
   VENDOR PRICE COMPARISON (SO SÁNH & BIẾN ĐỘNG GIÁ NHÀ CUNG CẤP)
   ========================================================================== */

.vpc-container {
    padding: 12px 16px 40px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
}

/* ── Header Title Banner ── */
.vpc-header-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
    padding: 16px 24px;
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.25) 0%, rgba(15, 23, 42, 0.6) 100%);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.vpc-title-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

.vpc-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.vpc-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #f8fafc;
    margin: 0;
    line-height: 1.2;
}

.vpc-subtitle {
    font-size: 0.85rem;
    color: #94a3b8;
    margin: 4px 0 0;
}

.vpc-actions-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ── Filter Bar ── */
.vpc-filter-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.vpc-preset-btns {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.vpc-preset-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 4px;
}

.vpc-preset-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(30, 41, 59, 0.7);
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.vpc-preset-btn:hover {
    background: rgba(51, 65, 85, 0.9);
    color: #f1f5f9;
    border-color: rgba(255, 255, 255, 0.25);
}

.vpc-preset-btn.active {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
    color: #ffffff !important;
    border: 1px solid #38bdf8 !important;
    font-weight: 700 !important;
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.vpc-preset-btn.custom-btn.active {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    border: 1px solid #34d399 !important;
    box-shadow: 0 0 14px rgba(52, 211, 153, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* ── KPI Cards ── */
.vpc-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.vpc-kpi-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.vpc-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    border-color: rgba(59, 130, 246, 0.3);
}

.vpc-kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.vpc-kpi-icon.blue {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.vpc-kpi-icon.green {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.vpc-kpi-icon.red {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.vpc-kpi-icon.amber {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.vpc-kpi-icon.purple {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.vpc-kpi-body {
    flex-grow: 1;
}

.vpc-kpi-val {
    font-size: 1.35rem;
    font-weight: 700;
    color: #f8fafc;
    line-height: 1.2;
}

.vpc-kpi-label {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 2px;
}

.vpc-kpi-sub {
    font-size: 0.75rem;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.vpc-kpi-sub.inc { color: #f87171; }
.vpc-kpi-sub.dec { color: #4ade80; }
.vpc-kpi-sub.neutral { color: #94a3b8; }

/* ── Top 10 Summary Cards ── */
.vpc-top-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.vpc-top-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.vpc-top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.vpc-top-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #f1f5f9;
    display: flex;
    align-items: center;
    gap: 8px;
}

.vpc-rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
}

.vpc-rank-1 { background: #eab308; color: #0f172a; }
.vpc-rank-2 { background: #94a3b8; color: #0f172a; }
.vpc-rank-3 { background: #b45309; color: #ffffff; }
.vpc-rank-norm { background: rgba(255, 255, 255, 0.08); color: #94a3b8; }

/* ── Status Pills & Badges ── */
.vpc-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.vpc-pill.inc {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid #ef4444;
}

.vpc-pill.dec {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
    border: 1px solid #22c55e;
}

.vpc-pill.same {
    background: rgba(148, 163, 184, 0.2);
    color: #f1f5f9;
    border: 1px solid #94a3b8;
}

.vpc-pill.new {
    background: rgba(168, 85, 247, 0.2);
    color: #e9d5ff;
    border: 1px solid #a855f7;
}

.vpc-best-badge {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.5);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
}

/* ── Filter Trend Chips (High Contrast) ── */
.vpc-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(30, 41, 59, 0.8);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.15);
    white-space: nowrap;
}

.vpc-filter-chip:hover {
    background: rgba(51, 65, 85, 0.95);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
}

.vpc-filter-chip.active-all {
    background: #0284c7 !important;
    color: #ffffff !important;
    border: 1px solid #38bdf8 !important;
    font-weight: 700 !important;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.45);
}

.vpc-filter-chip.chip-inc {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.4);
}
.vpc-filter-chip.chip-inc.active-inc {
    background: #dc2626 !important;
    color: #ffffff !important;
    border: 1px solid #f87171 !important;
    font-weight: 700 !important;
    box-shadow: 0 0 12px rgba(220, 38, 38, 0.45);
}

.vpc-filter-chip.chip-dec {
    background: rgba(34, 197, 94, 0.15);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.4);
}
.vpc-filter-chip.chip-dec.active-dec {
    background: #16a34a !important;
    color: #ffffff !important;
    border: 1px solid #4ade80 !important;
    font-weight: 700 !important;
    box-shadow: 0 0 12px rgba(22, 163, 74, 0.45);
}

/* KHÔNG ĐỔI: Chữ sáng rõ nét #f1f5f9, viền rõ ràng */
.vpc-filter-chip.chip-same {
    background: rgba(100, 116, 139, 0.25);
    color: #f1f5f9;
    border: 1px solid rgba(148, 163, 184, 0.45);
}
.vpc-filter-chip.chip-same.active-same {
    background: #475569 !important;
    color: #ffffff !important;
    border: 1px solid #94a3b8 !important;
    font-weight: 700 !important;
    box-shadow: 0 0 12px rgba(148, 163, 184, 0.45);
}

/* MỚI: Tím tươi sáng rực rỡ #e9d5ff */
.vpc-filter-chip.chip-new {
    background: rgba(168, 85, 247, 0.18);
    color: #e9d5ff;
    border: 1px solid rgba(168, 85, 247, 0.45);
}
.vpc-filter-chip.chip-new.active-new {
    background: #9333ea !important;
    color: #ffffff !important;
    border: 1px solid #c084fc !important;
    font-weight: 700 !important;
    box-shadow: 0 0 12px rgba(147, 51, 234, 0.45);
}

.chip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.chip-dot.dot-red { background: #ef4444; box-shadow: 0 0 6px #ef4444; }
.chip-dot.dot-green { background: #22c55e; box-shadow: 0 0 6px #22c55e; }
.chip-dot.dot-gray { background: #cbd5e1; box-shadow: 0 0 6px #cbd5e1; }
.chip-dot.dot-purple { background: #c084fc; box-shadow: 0 0 6px #c084fc; }

/* ── Unit & Count Badges inside Table Cells ── */
.vpc-unit-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.35);
}

.vpc-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 22px;
    padding: 0 6px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}
.vpc-count-badge.multi {
    background: rgba(14, 165, 233, 0.2);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.5);
}
.vpc-count-badge.single {
    background: rgba(100, 116, 139, 0.2);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.35);
}

/* ── Nested Sub-table for Disparity ── */
.vpc-nested-box {
    background: rgba(15, 23, 42, 0.75);
    border-radius: 8px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    padding: 12px 16px;
    margin: 8px 16px;
}

.vpc-best-price-row {
    background: rgba(34, 197, 94, 0.08) !important;
}

/* ── Main DataGrid Wrap & Horizontal Scrolling ── */
.vpc-table-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

/* Bật cuộn ngang và cuộn dọc mượt mà cho bảng */
.vpc-table-card .mud-table-container {
    overflow-x: auto !important;
    overflow-y: auto !important;
    width: 100% !important;
    max-height: 640px !important;
    display: block !important;
    scrollbar-width: thin;
    scrollbar-color: #38bdf8 rgba(15, 23, 42, 0.95);
}

.vpc-table-card .mud-table-container::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
.vpc-table-card .mud-table-container::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.95);
    border-radius: 6px;
}
.vpc-table-card .mud-table-container::-webkit-scrollbar-thumb {
    background: #0284c7;
    border-radius: 6px;
    border: 2px solid rgba(15, 23, 42, 0.95);
}
.vpc-table-card .mud-table-container::-webkit-scrollbar-thumb:hover {
    background: #38bdf8;
}

/* Chiều rộng tối thiểu để luôn luôn kích hoạt scrollbar ngang ngay cả trên màn hình 1920px Full-HD */
.vpc-trend-table table.mud-table-root {
    min-width: 1950px !important;
    width: 100% !important;
}

.vpc-disparity-table table.mud-table-root {
    min-width: 1850px !important;
    width: 100% !important;
}

.vpc-detail-table table.mud-table-root {
    min-width: 1950px !important;
    width: 100% !important;
}

.vpc-detail-table th, .vpc-detail-table td,
.vpc-trend-table th, .vpc-trend-table td,
.vpc-disparity-table th, .vpc-disparity-table td {
    white-space: nowrap !important;
}

.vpc-table-header-custom {
    background: #0f172a !important;
}

.vpc-table-header-custom th {
    position: sticky !important;
    top: 0 !important;
    z-index: 3 !important;
    background: #0f172a !important;
    color: #94a3b8 !important;
    font-weight: 700 !important;
    font-size: 0.8rem !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid rgba(59, 130, 246, 0.4) !important;
    white-space: nowrap !important;
}

/* ── Top 10 View Mode & Chart Extensions ── */
.vpc-top-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 12px;
}

.vpc-view-mode-group {
    display: inline-flex;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
}

.vpc-view-mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.vpc-view-mode-btn:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.06);
}

.vpc-view-mode-btn.active {
    background: #0284c7;
    color: #ffffff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* Split view layout: Table left, Chart right */
.vpc-split-container {
    display: grid;
    grid-template-columns: 1.12fr 0.88fr;
    gap: 16px;
    align-items: stretch;
}

.vpc-split-container.chart-only {
    grid-template-columns: 1fr;
}

.vpc-split-container.table-only {
    grid-template-columns: 1fr;
}

@media (max-width: 1280px) {
    .vpc-split-container {
        grid-template-columns: 1fr;
    }
}

.vpc-chart-panel {
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 14px 12px 10px 12px;
    display: flex;
    flex-direction: column;
}

.vpc-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}

.vpc-chart-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 6px;
}

.vpc-chart-subtitle {
    font-size: 0.72rem;
    color: #64748b;
    margin-top: 2px;
}

