/* ==========================================================================
   HỆ THỐNG GIAO DIỆN ERP DOANH NGHIỆP XĂNG DẦU CHUYÊN NGHIỆP (PETROL ERP)
   Chuẩn thiết kế: High-Density Petrol Business UI & Data Grid System
   100% Độ trung thực theo Video Mẫu thực tế 1 & 2
   Tối giản - Đẳng cấp - Đa nhiệm - Tương thích hoàn hảo PC, Tablet, Mobile
   ========================================================================== */

:root {
    /* Bảng màu nhận diện Petrol ERP chuẩn */
    --mau-petrol-chinh: #0073c6;
    --mau-petrol-hover: #005a9e;
    --mau-petrol-dam: #004578;
    --mau-petrol-nhat: #e5f1fb;
    --mau-petrol-vien: #b9d9f5;

    --mau-nen-app: #f4f6f8;
    --mau-nen-the: #ffffff;
    --mau-nen-phu: #f8fafc;
    --mau-nen-hover: #f1f5f9;
    --mau-nen-active: #e2e8f0;
    
    --mau-chu-chinh: #1e293b;
    --mau-chu-phu: #64748b;
    --mau-chu-nhat: #94a3b8;
    
    --mau-vien: #e2e8f0;
    --mau-vien-dam: #cbd5e1;
    --mau-vien-nhan: #94a3b8;
    
    --mau-do-petrol: #dc2626;
    --mau-do-nhat: #fee2e2;
    --mau-do-chu: #991b1b;
    --mau-do-vien: #fecaca;
    
    --mau-xanh-la-petrol: #16a34a;
    --mau-xanh-la-dam: #166534;
    --mau-xanh-la-nhat: #d1fae5;
    --mau-xanh-la-chu: #065f46;
    --mau-xanh-la-vien: #a7f3d0;
    
    --mau-cam-petrol: #ea580c;
    --mau-cam-nhat: #ffedd5;
    --mau-cam-chu: #9a3412;
    
    --mau-vang-tong: #fef08a;
    --mau-vang-vien: #fde047;
    
    --font-chuan: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --bo-goc: 4px;
    --bo-goc-pill: 20px;
    --bo-goc-lon: 8px;
    --bo-goc-card: 20px;
    
    --bong-nhe: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --bong-vua: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --bong-popover: 0 10px 25px -3px rgba(0, 0, 0, 0.15), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --bong-modal: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}
/* ==========================================================================
   QHU SMARTPHONE UI V2 — hệ primitive dùng chung cho các trang nghiệp vụ
   ========================================================================== */
.erp-mobile-only {
    display: none !important;
}

.erp-desktop-only {
    display: block;
}

.erp-badge-pill.badge-da-huy {
    color: #475569;
    background: #e2e8f0;
}

@media (max-width: 768px) {
    .erp-desktop-only {
        display: none !important;
    }

    .erp-mobile-only {
        display: block !important;
    }
    /* [AI-CHUC_NANG]: Luong mobile mot cot, khong cuon ngang va co safe-area. */
    .qhu-mobile-page {
        min-width: 0;
        width: 100%;
        height: 100%;
        overflow: hidden;
        background: #f4f7fb !important;
    }

    /* [AI-CHUC_NANG]: Thanh Toolbar một hàng với vùng chạm tối thiểu 44px theo QHU-SMARTPHONE. */
    /* [AI-NGUON]: Codex */
    /* [AI-SUA_GAN_NHAT]: Codex */
    /* [AI-NGAY]: 2026-08-30 */
    /* [AI-TRANG_THAI]: dang_kiem_tra */
    .erp-action-toolbar.qhu-mobile-toolbar {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        height: 56px !important;
        gap: 6px !important;
        padding: 6px 8px !important;
        border-bottom-color: #dbe4ef;
        background: #ffffff !important;
        align-items: center !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch;
    }

    .qhu-mobile-toolbar::-webkit-scrollbar {
        display: none !important;
    }

    .qhu-mobile-toolbar .erp-toolbar-nhom-trai {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        width: 100% !important;
        min-width: 0 !important;
        gap: 6px !important;
        align-items: center !important;
    }

    .qhu-mobile-toolbar .erp-toolbar-nhom-phai,
    .qhu-mobile-secondary-action {
        display: none !important;
    }

    .qhu-mobile-toolbar .erp-nut-toolbar {
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: max-content !important;
        height: 44px !important;
        min-height: 44px !important;
        padding: 0 10px !important;
        justify-content: center !important;
        font-size: 12.5px !important;
        font-weight: 700 !important;
        border-radius: 8px !important;
        white-space: nowrap !important;
        touch-action: manipulation;
    }

    .qhu-mobile-toolbar .qhu-mobile-primary-action {
        flex: 0 0 auto !important;
        width: auto !important;
        flex-basis: auto !important;
        order: initial !important;
    }

    .qhu-mobile-toolbar .erp-sub-filter-search-pill {
        flex: 1 1 auto !important;
        width: 100% !important;
        min-width: 120px !important;
        max-width: 100% !important;
        height: 44px !important;
        margin: 0 !important;
        position: relative !important;
    }

    .qhu-mobile-toolbar .erp-sub-filter-search-pill input {
        width: 100% !important;
        height: 44px !important;
        font-size: 16px !important;
        padding: 0 10px 0 34px !important; /* Đảm bảo chữ không che icon kính lúp! */
        border-radius: 18px !important;
    }

    .qhu-mobile-toolbar .erp-sub-filter-search-pill .icon-search {
        position: absolute !important;
        left: 10px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        font-size: 14px !important;
        color: #64748b !important;
        pointer-events: none !important;
        z-index: 2 !important;
    }

    .qhu-mobile-toolbar select {
        flex: 1 1 100%;
        border: 1px solid #cbd5e1 !important;
        border-radius: 9px !important;
        background: #fff;
        padding: 0 12px !important;
    }

    .erp-filter-panel-collapsible {
        flex: 0 0 auto;
        max-height: min(46vh, 420px);
        overflow-y: auto;
        padding: 12px 10px !important;
        overscroll-behavior: contain;
    }

    .erp-filter-grid-form {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 10px !important;
    }

    .erp-filter-grid-form input,
    .erp-filter-grid-form select {
        min-height: 44px !important;
        height: 44px !important;
        font-size: 16px !important;
    }

    .erp-filter-grid-form label {
        min-height: auto !important;
        height: auto !important;
        font-size: 13px !important;
        font-weight: 700 !important;
        color: #0f172a !important;
        margin-bottom: 2px !important;
        margin-top: 4px !important;
        line-height: 1.2 !important;
    }

    /* Sua specificity: danh sach mobile phai la flex de gap va flex:1 co hieu luc. */
    .erp-mobile-card-list.erp-mobile-only,
    .qhu-mobile-card-list.erp-mobile-only {
        display: flex !important;
    }

    .erp-mobile-card-list,
    .qhu-mobile-card-list {
        min-width: 0;
        min-height: 0;
        flex: 1 1 auto;
        flex-direction: column;
        gap: 10px;
        overflow-x: hidden;
        overflow-y: auto;
        padding: 10px 10px calc(16px + env(safe-area-inset-bottom));
        background: #f4f7fb;
        overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch;
    }

    .qhu-mobile-summary {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .qhu-mobile-summary__item {
        min-width: 0;
        padding: 10px 11px;
        border: 1px solid #dbe6f1;
        border-radius: 11px;
        background: #fff;
    }

    .qhu-mobile-summary__item--wide { grid-column: 1 / -1; }

    .qhu-mobile-summary__label,
    .qhu-mobile-metric__label,
    .qhu-mobile-card__eyebrow {
        display: block;
        color: #64748b;
        font-size: 10.5px;
        font-weight: 700;
        line-height: 1.25;
        letter-spacing: .035em;
        text-transform: uppercase;
    }

    .qhu-mobile-summary__value {
        display: block;
        margin-top: 3px;
        overflow-wrap: anywhere;
        color: #0f3f62;
        font-size: 17px;
        font-weight: 800;
        line-height: 1.2;
    }

    /* [AI-CHUC_NANG]: Thẻ mobile phẳng, dùng vạch đáy để phân tách thay vì khung lồng khung. */
    /* [AI-NGUON]: Codex */
    /* [AI-SUA_GAN_NHAT]: Codex */
    /* [AI-NGAY]: 2026-08-30 */
    /* [AI-TRANG_THAI]: dang_kiem_tra */
    .erp-driver-card,
    .qhu-mobile-card {
        position: relative;
        display: flex;
        min-width: 0;
        flex: 0 0 auto;
        flex-direction: column;
        gap: 12px;
        padding: 14px;
        overflow: hidden;
        border: 0;
        border-left: 4px solid #0284c7;
        border-bottom: 2px solid #cbd5e1;
        border-radius: 0;
        background: #fff;
        box-shadow: none;
    }

    .qhu-mobile-card--success { border-left-color: #16a34a; }
    .qhu-mobile-card--warning { border-left-color: #d97706; }
    .qhu-mobile-card--danger { border-left-color: #dc2626; }
    .qhu-mobile-card--neutral { border-left-color: #64748b; }

    .erp-driver-card-header,
    .qhu-mobile-card__header {
        display: flex;
        min-width: 0;
        align-items: flex-start;
        justify-content: space-between;
        gap: 10px;
        padding: 0 0 10px;
        border-bottom: 1px solid #edf2f7;
    }

    .qhu-mobile-card__identity { min-width: 0; }

    .erp-driver-card-title,
    .qhu-mobile-card__title {
        display: block;
        margin-top: 2px;
        overflow-wrap: anywhere;
        color: #0f3f62;
        font-size: 17px;
        font-weight: 800;
        line-height: 1.25;
    }

    .qhu-mobile-card__subtitle {
        display: block;
        margin-top: 3px;
        overflow-wrap: anywhere;
        color: #64748b;
        font-size: 12px;
        line-height: 1.35;
    }

    .qhu-mobile-badge {
        flex: 0 0 auto;
        max-width: 46%;
        padding: 5px 8px;
        border-radius: 999px;
        font-size: 11px;
        font-weight: 800;
        line-height: 1.25;
        text-align: center;
    }

    .qhu-mobile-badge--success { color: #166534; background: #dcfce7; }
    .qhu-mobile-badge--warning { color: #92400e; background: #fef3c7; }
    .qhu-mobile-badge--danger { color: #991b1b; background: #fee2e2; }
    .qhu-mobile-badge--neutral { color: #475569; background: #e2e8f0; }
    .qhu-mobile-badge--info { color: #075985; background: #e0f2fe; }

    .qhu-mobile-metric-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .qhu-mobile-metric {
        min-width: 0;
        padding: 8px 2px;
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    .qhu-mobile-metric__value {
        display: block;
        margin-top: 4px;
        overflow-wrap: anywhere;
        color: #0f172a;
        font-size: 18px;
        font-weight: 800;
        line-height: 1.15;
        font-variant-numeric: tabular-nums;
    }

    .qhu-mobile-metric__value--primary { color: #0369a1; font-size: 23px; }
    .qhu-mobile-value--success { color: #15803d !important; }
    .qhu-mobile-value--warning { color: #c2410c !important; }
    .qhu-mobile-value--danger { color: #dc2626 !important; }

    .qhu-mobile-progress-block {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .qhu-mobile-progress__labels {
        display: flex;
        justify-content: space-between;
        gap: 10px;
        color: #64748b;
        font-size: 11.5px;
    }

    .erp-driver-card-progress,
    .qhu-mobile-progress {
        height: 9px;
        overflow: hidden;
        border-radius: 999px;
        background: #e2e8f0;
    }

    .erp-driver-card-progress-bar,
    .qhu-mobile-progress__bar {
        height: 100%;
        border-radius: inherit;
        background: #0284c7;
        transition: width .2s ease-out;
    }

    .qhu-mobile-meta { display: grid; gap: 7px; }

    .qhu-mobile-meta__row {
        display: grid;
        grid-template-columns: minmax(86px, .8fr) minmax(0, 1.35fr);
        align-items: baseline;
        gap: 10px;
        color: #64748b;
        font-size: 12px;
        line-height: 1.4;
    }

    .qhu-mobile-meta__row > strong,
    .qhu-mobile-meta__row > span:last-child {
        overflow-wrap: anywhere;
        color: #334155;
        font-weight: 700;
        text-align: right;
    }

    .erp-driver-card-actions,
    .qhu-mobile-card__actions {
        display: flex;
        gap: 8px;
        padding-top: 10px;
        border-top: 1px solid #edf2f7;
    }

    .erp-driver-card-btn,
    .qhu-mobile-action {
        display: inline-flex;
        min-height: 48px;
        min-width: 0;
        flex: 1 1 auto;
        align-items: center;
        justify-content: center;
        gap: 7px;
        padding: 10px 12px;
        border: 1px solid #0284c7;
        border-radius: 10px;
        background: #0284c7;
        color: #fff;
        font-size: 13.5px;
        font-weight: 800;
        line-height: 1.25;
        text-align: center;
        text-decoration: none;
        touch-action: manipulation;
    }

    .qhu-mobile-action--secondary {
        border-color: #cbd5e1;
        background: #fff;
        color: #334155;
    }

    .qhu-mobile-state {
        display: flex;
        min-height: 180px;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 24px 18px;
        border: 1px dashed #cbd5e1;
        border-radius: 13px;
        background: #fff;
        color: #64748b;
        text-align: center;
    }

    .qhu-mobile-state__title { color: #0f3f62; font-size: 15px; font-weight: 800; }
    .qhu-mobile-state__description { max-width: 30rem; font-size: 13px; line-height: 1.5; }

    .qhu-mobile-note {
        padding: 10px 12px;
        border: 1px solid #bae6fd;
        border-radius: 10px;
        background: #f0f9ff;
        color: #0c4a6e;
        font-size: 12.5px;
        line-height: 1.45;
    }

    .qhu-mobile-note--warning { border-color: #fecaca; background: #fef2f2; color: #991b1b; }

    .erp-toast-fixed-top-right {
        top: calc(8px + env(safe-area-inset-top)) !important;
        right: 10px !important;
        left: 10px !important;
        width: auto !important;
        max-width: none !important;
    }

    /* Modal full-width co safe-area, ho tro vuot cuon 100% den nut Luu tren dien thoai. */
    .lop-phu-modal {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        overflow-y: auto !important; /* QUAN TRỌNG: Lớp phủ cho phép vuốt cuộn mượt 100% trên màn hình di động */
        -webkit-overflow-scrolling: touch !important;
        touch-action: pan-y !important;
        display: block !important;
        padding: max(12px, env(safe-area-inset-top)) 10px max(40px, env(safe-area-inset-bottom)) !important;
        box-sizing: border-box !important;
        z-index: 99999 !important;
    }

    .lop-phu-modal .khung-modal,
    .lop-phu-modal .khung-modal.khung-modal-lon {
        width: 100% !important;
        max-width: 560px !important;
        max-height: none !important; /* QUAN TRỌNG: Không khống chế max-height cứng để các nút Lưu/Hủy luôn cuộn ra hoàn toàn */
        display: flex !important;
        flex-direction: column !important;
        margin: 8px auto 30px auto !important;
        border-radius: 16px !important;
        overflow: visible !important;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35) !important;
    }

    .lop-phu-modal .khung-modal form {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        overflow: visible !important;
    }

    .modal-header { min-height: 48px; padding: 12px 14px !important; border-top-left-radius: 16px; border-top-right-radius: 16px; }
    .modal-header h2 { min-width: 0; margin: 0; font-size: 16px !important; line-height: 1.3; overflow-wrap: anywhere; }
    .nut-dong-modal { min-width: 44px; min-height: 44px; }
    .modal-body {
        padding: 16px 14px !important;
        overflow: visible !important;
    }
    .luoi-form-2cot { grid-template-columns: minmax(0, 1fr) !important; }

    .truong-nhap-hien-dai input,
    .truong-nhap-hien-dai select,
    .truong-nhap-hien-dai textarea {
        min-height: 44px !important;
        font-size: 16px !important;
        padding: 11px 12px !important;
    }

    .modal-footer {
        gap: 10px !important;
        padding: 12px 14px calc(14px + env(safe-area-inset-bottom)) !important;
        border-bottom-left-radius: 16px;
        border-bottom-right-radius: 16px;
    }

    .lop-phu-modal .modal-footer button,
    .lop-phu-modal .modal-footer > div button {
        min-height: 48px !important;
        flex: 1 1 0;
        font-size: 15px !important;
        font-weight: 700 !important;
    }

    .modal-footer > div { display: flex; min-width: 0; flex: 1 1 100%; gap: 8px; }
    .khung-chon-vai-tro { max-height: none !important; overflow: visible !important; }
    .muc-chon-vai-tro { min-height: 44px; }
}

/* [AI-CHUC_NANG]: Chuẩn hóa các thẻ mobile kế thừa sang cấu trúc phẳng QHU-SMARTPHONE. */
/* [AI-NGUON]: Codex */
/* [AI-SUA_GAN_NHAT]: Codex */
/* [AI-NGAY]: 2026-08-30 */
/* [AI-TRANG_THAI]: dang_kiem_tra */
@media (max-width: 768px) {
    .erp-fintech-card.qhu-mobile-card,
    .erp-fuel-request-card.qhu-mobile-card {
        gap: 12px !important;
        padding: 14px !important;
        border: 0 !important;
        border-left: 4px solid #0284c7 !important;
        border-bottom: 2px solid #cbd5e1 !important;
        border-radius: 0 !important;
        background: #fff !important;
        box-shadow: none !important;
    }

    .qhu-mobile-card.qhu-mobile-card--success { border-left-color: #16a34a !important; }
    .qhu-mobile-card.qhu-mobile-card--danger { border-left-color: #dc2626 !important; }

    .qhu-mobile-card .erp-fuel-hero-box,
    .qhu-mobile-card .erp-fuel-detail-box {
        margin-top: 0 !important;
        padding: 10px 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    .qhu-mobile-card .erp-fuel-toggle-btn,
    .qhu-mobile-card .erp-nut-toolbar {
        min-height: 44px !important;
        height: 44px !important;
        font-size: 14px !important;
    }
}

@media (max-width: 380px) {
    .qhu-mobile-summary,
    .qhu-mobile-metric-grid { grid-template-columns: minmax(0, 1fr); }
    .qhu-mobile-summary__item--wide { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
    .erp-driver-card-progress-bar,
    .qhu-mobile-progress__bar { transition: none !important; }
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

svg {
    width: 16px;
    height: 16px;
    max-width: 100%;
    vertical-align: middle;
    display: inline-block;
    flex-shrink: 0;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font-chuan);
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--mau-chu-chinh);
    background-color: var(--mau-nen-app);
    height: 100%;
    -webkit-font-smoothing: antialiased;
}

/* KHUNG APP TỔNG THỂ */
.khung-erp-chinh {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background-color: var(--mau-nen-app);
    position: relative;
}

/* [AI-CHUC_NANG]: Vùng keep-alive của Page theo tab; Page ẩn vẫn giữ state nhưng không chiếm bố cục. */
/* [AI-NGUON]: Codex | [AI-SUA_GAN_NHAT]: Codex | [AI-NGAY]: 2026-08-31 | [AI-TRANG_THAI]: da_kiem_tra */
.erp-noi-dung-tab {
    display: none;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.erp-noi-dung-tab.active {
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   1. MÀN HÌNH ĐĂNG NHẬP (AMBIENT MODERN LOGIN - FRAME 001)
   ========================================================================== */
.khung-trang-dang-nhap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 20% 20%, #e0f2fe 0%, #f0f9ff 35%, #e2e8f0 100%);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.khung-trang-dang-nhap::before {
    content: "";
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 115, 198, 0.08) 0%, rgba(255, 255, 255, 0) 70%);
    top: -150px;
    left: -150px;
    border-radius: 50%;
    pointer-events: none;
}

.khung-trang-dang-nhap::after {
    content: "";
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(22, 163, 74, 0.06) 0%, rgba(255, 255, 255, 0) 70%);
    bottom: -100px;
    right: -100px;
    border-radius: 50%;
    pointer-events: none;
}

.the-dang-nhap-hien-dai {
    width: 100%;
    max-width: 440px;
    background: #ffffff;
    border-radius: var(--bo-goc-card);
    box-shadow: 0 20px 40px -15px rgba(0, 75, 140, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04);
    padding: 2.5rem 2.25rem 2rem 2.25rem;
    position: relative;
    z-index: 1;
}

.the-dang-nhap-dau {
    text-align: center;
    margin-bottom: 2rem;
}

.the-dang-nhap-logo-ambient {
    width: 72px;
    height: 72px;
    background: #e0f2fe;
    border: 3px solid #bae6fd;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: var(--mau-petrol-chinh);
    box-shadow: 0 4px 12px rgba(0, 115, 198, 0.15);
}

.the-dang-nhap-logo-ambient svg {
    width: 40px;
    height: 40px;
}

.the-dang-nhap-tieu-de {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--mau-petrol-dam);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    margin-bottom: 0.35rem;
}

.the-dang-nhap-phu {
    font-size: 0.9rem;
    color: var(--mau-chu-phu);
}

/* Ô nhập liệu có Icon bên trái */
.nhom-input-icon {
    position: relative;
    margin-bottom: 1.25rem;
}

.nhom-input-icon .icon-trai {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--mau-petrol-chinh);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    font-size: 16px;
}

.nhom-input-icon .icon-trai svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.nhom-input-icon input {
    width: 100%;
    height: 42px;
    padding: 0 12px 0 38px;
    font-size: 13.5px;
    border: 1.5px solid var(--mau-vien-dam);
    border-radius: var(--bo-goc-lon);
    background: #ffffff;
    color: var(--mau-chu-chinh);
    transition: all 0.2s ease;
    font-family: inherit;
}

.nhom-input-icon input:focus {
    outline: none;
    border-color: var(--mau-petrol-chinh);
    box-shadow: 0 0 0 3px rgba(0, 115, 198, 0.15);
}

.nhom-input-icon label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--mau-chu-chinh);
    margin-bottom: 5px;
}

.nhom-checkbox-ghi-nho {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--mau-chu-chinh);
    margin-bottom: 1.5rem;
    cursor: pointer;
}

.nhom-checkbox-ghi-nho input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--mau-petrol-chinh);
    cursor: pointer;
}

.nut-dang-nhap-chinh {
    width: 100%;
    height: 44px;
    background: var(--mau-petrol-chinh);
    color: #ffffff;
    border: none;
    border-radius: var(--bo-goc-lon);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 115, 198, 0.3);
    transition: all 0.15s ease;
}

.nut-dang-nhap-chinh:hover {
    background: var(--mau-petrol-hover);
    box-shadow: 0 6px 16px rgba(0, 115, 198, 0.4);
    transform: translateY(-1px);
}

.nut-dang-nhap-chinh:active {
    transform: translateY(0);
}

.nut-dang-nhap-chinh:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* ==========================================================================
   2. TOPBAR & DYNAMIC BROWSER TABS (HEADER XANH PETROL #0073c6)
   ========================================================================== */
.erp-topbar {
    height: 40px;
    background-color: var(--mau-petrol-chinh);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.5rem 0 0.25rem;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    z-index: 100;
}

.erp-topbar-trai {
    display: flex;
    align-items: flex-end;
    height: 100%;
    gap: 4px;
    overflow: hidden;
}

.erp-nut-menu {
    height: 32px;
    width: 32px;
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    border-radius: var(--bo-goc);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    transition: background 0.15s ease;
    margin-right: 4px;
}

.erp-nut-menu:hover, .erp-nut-menu.active {
    background: rgba(255, 255, 255, 0.25);
}

.erp-nut-menu svg {
    width: 20px;
    height: 20px;
    fill: #ffffff;
}

.erp-tieu-de-cong-ty-topbar {
    align-self: center;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #ffffff;
    padding: 0 8px;
    white-space: nowrap;
}

/* Danh sách Tab điều hướng giống trình duyệt */
.erp-danh-sach-tab {
    display: flex;
    align-items: flex-end;
    height: 100%;
    gap: 3px;
    overflow-x: auto;
    scrollbar-width: none;
}

.erp-danh-sach-tab::-webkit-scrollbar {
    display: none;
}

.erp-tab-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 14px;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-bottom: none;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.15s ease;
}

.erp-tab-item:hover {
    background: rgba(255, 255, 255, 0.32);
    color: #ffffff;
}

.erp-tab-item.active {
    background: #ffffff !important;
    color: var(--mau-petrol-dam) !important;
    border-color: #ffffff !important;
    box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.1);
}

.erp-tab-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    fill: currentColor;
}

.erp-tab-dong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    font-size: 11px;
    opacity: 0.7;
    border-radius: 50%;
    line-height: 1;
    margin-left: 6px;
    transition: all 0.15s ease;
    border: 1px solid currentColor;
}

.erp-tab-dong:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.15);
}

/* Topbar Phải */
.erp-topbar-phai {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
}

.erp-user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    font-weight: 700;
    font-size: 13.5px;
}

.erp-user-avatar {
    width: 28px;
    height: 28px;
    background: #ffffff;
    color: var(--mau-petrol-chinh);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.erp-nut-dang-xuat-icon {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    color: #ffffff;
    border-radius: var(--bo-goc);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background 0.15s ease;
}

.erp-nut-dang-xuat-icon:hover {
    background: rgba(255, 255, 255, 0.25);
}

.erp-nut-dang-xuat-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* ==========================================================================
   3. MEGA MENU POPOVER FLYOUT 3 CẤP (FRAME 004, 005, 042)
   ========================================================================== */
.erp-mega-menu-backdrop {
    position: fixed;
    top: 40px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    z-index: 998;
}

.erp-mega-menu-popover {
    position: fixed;
    top: 40px;
    left: 0;
    background: #ffffff;
    border-right: 1px solid var(--mau-vien-dam);
    border-bottom: 1px solid var(--mau-vien-dam);
    box-shadow: var(--bong-popover);
    z-index: 999;
    display: flex;
    min-height: 420px;
}

.erp-mega-menu-col {
    width: 260px;
    background: #ffffff;
    border-right: 1px solid var(--mau-vien);
    display: flex;
    flex-direction: column;
    padding: 8px 6px;
}

.erp-mega-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px;
    margin-bottom: 3px;
    color: var(--mau-chu-chinh);
    text-decoration: none;
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.12s ease;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}

.erp-mega-menu-item-trai {
    display: flex;
    align-items: center;
    gap: 12px;
}

.erp-mega-menu-item-trai svg {
    width: 18px;
    height: 18px;
    fill: var(--mau-petrol-chinh);
    flex-shrink: 0;
}

.erp-mega-menu-item:hover,
.erp-mega-menu-item.active {
    background: var(--mau-petrol-nhat);
    color: var(--mau-petrol-dam);
    font-weight: 700;
}

.erp-mega-menu-item .chevron {
    font-size: 13px;
    color: var(--mau-chu-nhat);
}

/* ==========================================================================
   4. SUB-FILTER BAR (DÒNG 1 DƯỚI HEADER - FRAME 010)
   ========================================================================== */
.erp-sub-filter-bar {
    background: #ffffff;
    border-bottom: 1px solid var(--mau-vien);
    padding: 8px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    flex-shrink: 0;
    min-height: 42px;
}

.erp-sub-filter-trai {
    display: flex;
    align-items: center;
    gap: 14px;
}

.erp-sub-filter-group-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--mau-chu-chinh);
}

.erp-sub-filter-group-badge .icon-pos-do {
    color: var(--mau-do-petrol);
    display: flex;
    align-items: center;
}

.erp-sub-filter-group-badge .icon-pos-do svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.erp-sub-filter-badge-dem {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    border: 1px solid var(--mau-vien-dam);
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--mau-chu-chinh);
    font-weight: 700;
}

.erp-sub-filter-search-pill {
    position: relative;
    display: flex;
    align-items: center;
}

.erp-sub-filter-search-pill input {
    height: 35px;
    padding: 0 14px 0 34px;
    font-size: 14.5px;
    font-weight: 500;
    border: 1px solid var(--mau-vien-dam);
    border-radius: 18px;
    background: #ffffff;
    color: var(--mau-chu-chinh);
    width: 380px;
    font-family: inherit;
    transition: all 0.2s ease-in-out;
}

.erp-sub-filter-search-pill input:focus {
    outline: none;
    border-color: var(--mau-petrol-chinh);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.erp-sub-filter-search-pill .icon-search {
    position: absolute;
    left: 11px;
    font-size: 15px;
    color: var(--mau-chu-phu);
    pointer-events: none;
}

/* ==========================================================================
   5. ACTION TOOLBAR (THANH TÁC VỤ DÒNG 2 - FRAME 010, 045)
   ========================================================================== */
.erp-action-toolbar {
    background: #ffffff;
    border-bottom: 1px solid var(--mau-vien-dam);
    padding: 8px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    flex-shrink: 0;
    min-height: 46px;
}

.erp-toolbar-nhom-trai, .erp-toolbar-nhom-phai {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.erp-nut-toolbar {
    height: 34px;
    padding: 4px 14px;
    font-size: 13.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    background: transparent;
    color: var(--mau-chu-chinh);
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.12s ease;
}

.erp-nut-toolbar svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Biến thể nút Toolbar chuẩn Video */
.erp-nut-toolbar-do {
    color: var(--mau-do-petrol);
    font-weight: 700;
}
.erp-nut-toolbar-do:hover, .erp-nut-toolbar-do.active {
    background: var(--mau-do-nhat);
}

.erp-nut-toolbar-xanh {
    color: var(--mau-petrol-chinh);
    font-weight: 700;
}
.erp-nut-toolbar-xanh:hover {
    background: var(--mau-petrol-nhat);
}

.erp-nut-toolbar-xanh-la {
    color: var(--mau-xanh-la-petrol);
    font-weight: 700;
}
.erp-nut-toolbar-xanh-la:hover {
    background: var(--mau-xanh-la-nhat);
}

.erp-nut-toolbar-xam {
    color: var(--mau-chu-chinh);
    border-color: transparent;
}
.erp-nut-toolbar-xam:hover {
    background: var(--mau-nen-hover);
    border-color: var(--mau-vien);
}

/* ==========================================================================
   6. COLLAPSIBLE FILTER PANEL (BẢNG BỘ LỌC THU GỌN - FRAME 035, 045)
   ========================================================================== */
.erp-filter-panel-collapsible {
    background: #f8fafc;
    border-bottom: 1.5px solid var(--mau-petrol-vien);
    padding: 10px 14px;
    flex-shrink: 0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.03);
    animation: slideDown 0.18s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.erp-filter-grid-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px 12px;
    align-items: flex-end;
}

.erp-form-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.erp-form-field label {
    font-size: 14.5px !important;
    font-weight: 700;
    color: var(--mau-petrol-dam);
}

.erp-form-field input,
.erp-form-field select {
    height: 38px !important;
    width: 100%;
    padding: 6px 12px;
    border: 1px solid var(--mau-vien-dam);
    border-radius: var(--bo-goc);
    font-size: 14.5px !important;
    font-weight: 600;
    color: var(--mau-chu-chinh);
    background: #ffffff;
}

.erp-form-field-checkboxes {
    min-width: 320px;
}

.erp-checkbox-group-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 4px 14px;
    border: 2px solid #ef4444;
    border-radius: 8px;
    background: #ffffff;
    height: 38px;
    white-space: nowrap;
}

.erp-checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: 700;
    font-size: 13.5px;
    margin: 0;
    user-select: none;
}

.erp-checkbox-label.red {
    color: #dc2626;
}

.erp-checkbox-label.blue {
    color: #0284c7;
}

.erp-checkbox-label input[type="checkbox"] {
    width: 17px !important;
    height: 17px !important;
    cursor: pointer;
    accent-color: #dc2626;
}

/* Dòng Lọc Trên Từng Tiêu Đề Cột (Excel / DataGrid Column Filter Row) */
.erp-table-filter-row th {
    position: sticky;
    top: 38px;
    background-color: var(--mau-petrol-chinh) !important;
    padding: 4px 6px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.25) !important;
    z-index: 9;
}

.erp-th-input-loc {
    width: 100%;
    height: 30px;
    font-size: 13.5px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.95);
    color: var(--mau-chu-chinh);
    outline: none;
    transition: all 0.15s ease;
}

.erp-th-input-loc:focus {
    background: #ffffff;
    border-color: #fef08a;
    box-shadow: 0 0 0 2px rgba(254, 240, 138, 0.4);
}

.erp-th-select-loc {
    width: 100%;
    height: 30px;
    font-size: 13px;
    font-weight: 600;
    padding: 2px 4px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.95);
    color: var(--mau-chu-chinh);
    outline: none;
}


/* Nút Icon Phễu Lọc Cam ở mép phải ngoài cùng của tiêu đề cột */
.erp-btn-filter-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    border: none;
    background: transparent;
    cursor: pointer;
    margin-left: auto !important; /* Luôn nằm ngoài cùng bên phải tiêu đề cột */
    flex-shrink: 0;
    transition: all 0.12s ease;
    color: rgba(255, 255, 255, 0.8);
}

.erp-btn-filter-icon:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.erp-btn-filter-icon.active {
    background: #f97316 !important; /* Cam rực rỡ khi có filter */
    color: #ffffff !important;
    box-shadow: 0 0 6px rgba(249, 115, 22, 0.7);
}

/* Backdrop & Dialog Excel Filter Popover Dropdown THẢ TƯƠNG ĐỐI DƯỚI CỘT ĐƯỢC CHỌN */
.erp-th-filter-popover-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.12);
    z-index: 9998 !important;
}

.erp-th-filter-popover-dialog {
    position: absolute;
    top: calc(100% + 4px);
    right: 0; /* Thả xuống góc phải dính dưới tiêu đề cột */
    width: 320px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    box-shadow: 0 20px 35px -5px rgba(0, 0, 0, 0.28), 0 10px 15px -5px rgba(0, 0, 0, 0.15);
    z-index: 9999 !important; /* Đảm bảo luôn nổi lên trên cùng, đè lên tfoot dính */
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
    font-weight: normal;
    text-transform: none;
    animation: popIn 0.15s ease-out;
}

@keyframes popIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.erp-th-filter-popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
}

.erp-th-filter-popover-header .btn-close-pop {
    background: none;
    border: none;
    font-size: 18px;
    color: #94a3b8;
    cursor: pointer;
}

.erp-th-filter-popover-search {
    position: relative;
    display: flex;
    align-items: center;
}

.erp-th-filter-popover-search .icon-search {
    position: absolute;
    left: 10px;
    color: #94a3b8;
    font-size: 14px;
}

.erp-th-filter-popover-search input {
    width: 100%;
    height: 38px;
    padding: 6px 10px 6px 32px;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    color: #1e293b;
    outline: none;
}

.erp-th-filter-popover-search input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.erp-th-filter-popover-select-all {
    padding: 4px 0;
    border-bottom: 1px solid #f1f5f9;
}

.erp-th-filter-popover-select-all label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14.5px;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
}

.erp-th-filter-popover-select-all input[type="checkbox"],
.erp-th-filter-popover-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #3b82f6;
    cursor: pointer;
}

.erp-th-filter-popover-list {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 4px;
}

.erp-th-filter-popover-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #334155;
    cursor: pointer;
    padding: 3px 0;
}

.erp-th-filter-popover-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
}

.erp-th-filter-popover-footer .btn-cancel {
    height: 38px;
    padding: 0 20px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #e2e8f0;
    color: #475569;
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
}

.erp-th-filter-popover-footer .btn-cancel:hover {
    background: #cbd5e1;
}

.erp-th-filter-popover-footer .btn-apply {
    height: 38px;
    padding: 0 24px;
    border-radius: 8px;
    border: none;
    background: #bfdbfe;
    color: #1d4ed8;
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.erp-th-filter-popover-footer .btn-apply:hover {
    background: #93c5fd;
}

.erp-form-field input:focus,
.erp-form-field select:focus {
    outline: none;
    border-color: var(--mau-petrol-chinh);
    box-shadow: 0 0 0 3px rgba(0, 87, 158, 0.12);
}

.erp-dropdown-voi-clear select {
    width: 100%;
    padding-right: 24px;
}

.erp-checkbox-inline input {
    accent-color: var(--mau-petrol-chinh);
}

/* ==========================================================================
   7. HIGH-DENSITY DATA GRID SYSTEM (BẢNG DỮ LIỆU CHUẨN PETROL ERP)
   ========================================================================== */
/* ==========================================================================
   7. BẢNG DỮ LIỆU PETROL ERP CHUẨN (ĐỒNG NHẤT 100% KẺ Ô MỜ VÀ MÀU SẮC)
   ========================================================================== */
.khung-erp-bang-du-lieu {
    flex: 1;
    overflow: auto;
    background: #ffffff;
    position: relative;
    display: flex;
    flex-direction: column;
}

.erp-table-chuan, table.erp-bang, table {
    width: 100% !important;
    min-height: 100%;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    font-size: 15px;
    white-space: nowrap;
    border-top: 1px solid #cbd5e1 !important;
    border-left: 1px solid #cbd5e1 !important;
}

/* Cột Rỗng (Filler Column) hấp thụ toàn bộ khoảng trống thừa phía bên phải */
th.erp-th-filler,
td.erp-td-filler,
td.erp-td-filler-foot {
    width: auto !important;
    min-width: 0 !important;
    padding: 0 !important;
}

th.erp-th-filler {
    background-color: var(--mau-petrol-chinh) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.35) !important;
    border-bottom: 1px solid #cbd5e1 !important;
}

td.erp-td-filler {
    background-color: #ffffff !important;
    border-right: 1px solid #cbd5e1 !important;
    border-bottom: 1px solid #cbd5e1 !important;
}

td.erp-td-filler-foot {
    background-color: #fef08a !important;
    border-right: 1px solid #eab308 !important;
    border-bottom: 1px solid #eab308 !important;
    border-top: 2px solid #eab308 !important;
}

/* Header xanh Petrol có phân cách cột dọc mờ */
.erp-table-chuan thead th, table.erp-bang thead th, table thead th {
    position: sticky !important;
    top: 0 !important;
    background-color: var(--mau-petrol-chinh) !important;
    color: #ffffff !important;
    font-weight: 700;
    font-size: 14.5px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 10px 12px;
    text-align: left;
    border-right: 1px solid rgba(255, 255, 255, 0.35) !important;
    border-bottom: 1px solid #cbd5e1 !important;
    z-index: 90 !important;
}

.erp-th-sap-xep {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease;
}

.erp-th-sap-xep:hover {
    background-color: var(--mau-petrol-dam) !important;
}

.erp-th-khung-tieu-de {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.erp-icon-sort {
    font-size: 12px;
    color: #fef08a;
    font-weight: 800;
    margin-left: 2px;
}

.can-giua,
.erp-table-chuan thead th.can-giua,
.erp-table-chuan tr td.can-giua,
.erp-table-chuan tr th.can-giua,
.erp-subtotal-row td.can-giua,
.erp-grand-total-row td.can-giua,
tfoot td.can-giua {
    text-align: center !important;
}

.can-phai,
.erp-table-chuan tr td.can-phai,
.erp-table-chuan tr th.can-phai,
.erp-subtotal-row td.can-phai,
.erp-grand-total-row td.can-phai,
tfoot td.can-phai {
    text-align: right !important;
}

/* Kẻ ô mờ sắc nét 100% và khoảng cách dòng dữ liệu bảng thoáng đẹp */
.erp-table-chuan tbody td,
table.erp-bang tbody td,
table tbody td {
    padding: 7px 14px !important; /* QHU-UI: giảm ~25% tổng chiều cao dòng so với ban đầu (Phase-96) */
    font-size: 15px;
    line-height: 1.15; /* line-height gọn gàng, vẫn đảm bảo dễ đọc */
    border-right: 1px solid #cbd5e1 !important;
    border-bottom: 1px solid #cbd5e1 !important;
    color: var(--mau-chu-chinh);
    vertical-align: middle;
    background: #ffffff;
}

.erp-table-chuan tbody tr:hover td,
table.erp-bang tbody tr:hover td,
table tbody tr:hover td {
    background-color: var(--mau-petrol-nhat) !important;
}

/* Cột Chevron mở rộng dòng › */
.erp-btn-chevron-expand {
    background: transparent;
    border: none;
    color: var(--mau-petrol-chinh);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: var(--bo-goc);
    transition: transform 0.15s ease;
}

.erp-btn-chevron-expand.expanded {
    transform: rotate(90deg);
}

/* Nút !≡ Chức năng: KHÔNG bao ô đỏ phía ngoài, chỉ để dòng gạch đít dưới */
.erp-btn-chuc-nang-dong {
    height: auto;
    padding: 2px 4px;
    background: transparent !important;
    border: none !important;
    border-bottom: 1.5px solid var(--mau-do-petrol) !important;
    color: var(--mau-do-petrol) !important;
    font-size: 13px;
    font-weight: 700;
    border-radius: 0 !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    transition: all 0.12s ease;
    text-decoration: none;
}

.erp-btn-chuc-nang-dong:hover {
    color: #991b1b !important;
    border-bottom-color: #991b1b !important;
    background: transparent !important;
}

/* Badge tình trạng Pill */
.erp-badge-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12.5px;
    font-weight: 600;
    text-align: center;
}

.badge-da-phat-hanh, .badge-hoat-dong {
    background: var(--mau-xanh-la-nhat);
    color: var(--mau-xanh-la-chu);
    border: 1px solid var(--mau-xanh-la-vien);
}

.badge-chua-phat-hanh, .badge-tam-dung {
    background: var(--mau-do-nhat);
    color: var(--mau-do-chu);
    border: 1px solid var(--mau-do-vien);
}

.badge-khong-phat-hanh, .badge-chua-cap {
    background: #f1f5f9;
    color: var(--mau-chu-phu);
    border: 1px solid var(--mau-vien-dam);
}

/* Số tiền & tổng metric xanh lá đậm */
.erp-so-tien-xanh {
    font-weight: 700;
    color: var(--mau-xanh-la-petrol);
}

/* Tránh dãn chiều cao vô lý của các dòng tr khi table height 100% */
.erp-table-chuan tbody tr {
    height: 1px; /* Trình duyệt tự thu gọn vừa đúng nội dung dòng */
}

/* Dòng rỗng Spacer thu khoảng trống thừa đẩy tfoot dính cứng xuống đáy */
tr.erp-table-spacer-row {
    height: 100% !important;
}

tr.erp-table-spacer-row td {
    border: none !important;
    background: #ffffff !important;
    padding: 0 !important;
    height: 100% !important;
}

/* Tái Thiết Kế Group Header Row Đẳng Cấp Enterprise UI/UX */
.erp-group-header-row {
    background-color: #f8fafc !important;
    cursor: pointer;
}

.erp-group-header-row:hover td {
    background-color: #f1f5f9 !important;
}

.erp-group-header-row td {
    padding: 8px 12px !important;
    border-bottom: 1px solid #cbd5e1 !important;
    border-top: 1px solid #cbd5e1 !important;
    background-color: #f8fafc !important;
}

.erp-group-header-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.erp-btn-chevron-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    background: #0284c7;
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    transition: transform 0.2s ease;
}

.erp-btn-chevron-badge.expanded {
    transform: rotate(90deg);
}

.erp-group-badge-bienso {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    border: 1px solid #0284c7;
    color: #0369a1;
    padding: 3px 10px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 13.5px;
}

.erp-group-metric-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 12.5px;
    font-weight: 600;
}

.metric-tag-giao-dich {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
}

.metric-tag-thuc-te {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
}

.metric-tag-thanh-tien {
    background: #ffedd5;
    color: #c2410c;
    border: 1px solid #fed7aa;
}

/* Subtotal Row - Kẻ ô mờ */
.erp-subtotal-row td {
    background: #ffffff !important;
    font-weight: 700;
    font-size: 14.5px;
    padding: 9px 12px !important;
    border-right: 1px solid #cbd5e1 !important;
    border-bottom: 1px solid #cbd5e1 !important;
}

/* Grand Total Footer Vàng Sáng (Sticky Bottom Footer - Dính cố định ở đáy bảng) */
.erp-table-chuan tfoot,
table tfoot,
.erp-grand-total-row {
    position: sticky;
    bottom: 0;
    margin-top: auto !important;
    z-index: 20;
    background-color: #fef08a !important;
}

.erp-grand-total-row td,
tfoot tr td {
    position: sticky;
    bottom: 0;
    z-index: 20;
    background-color: #fef08a !important;
    color: #1e293b !important;
    font-weight: 800;
    font-size: 15px !important;
    padding: 10px 12px !important;
    border-right: 1px solid #eab308 !important;
    border-bottom: 1px solid #eab308 !important;
    border-top: 2px solid #eab308 !important;
    box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.08);
}

.erp-grand-total-row .so-tong-xanh, tfoot td.so-tong-xanh {
    color: var(--mau-xanh-la-dam) !important;
    font-weight: 800;
}

/* ==========================================================================
   9. POPOVER MENU TÁC VỤ DÒNG (!≡ CHỨC NĂNG - FRAME 005 VIDEO 2)
   ========================================================================== */
.erp-popover-chuc-nang-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
}

.erp-popover-btn {
    height: 28px;
    padding: 0 10px;
    border-radius: var(--bo-goc);
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    border: 1px solid transparent;
    background: #ffffff;
    transition: all 0.12s ease;
}

.erp-popover-btn-xanh {
    border-color: var(--mau-petrol-vien);
    color: var(--mau-petrol-chinh);
}
.erp-popover-btn-xanh:hover {
    background: var(--mau-petrol-nhat);
}

.erp-popover-btn-xam {
    border-color: var(--mau-vien-dam);
    color: var(--mau-chu-chinh);
    background: #f8fafc;
}
.erp-popover-btn-xam:hover {
    background: var(--mau-nen-hover);
}

/* ==========================================================================
   10. MASTER-DETAIL EXPANDED ROW (FRAME 025 VIDEO 1 & FRAME 030 VIDEO 2)
   ========================================================================== */
.erp-detail-expanded-container {
    background: #fafbfc;
    padding: 12px 18px;
    border-bottom: 2px solid var(--mau-petrol-vien);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.04);
}

.erp-detail-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 8px 16px;
    margin-bottom: 12px;
}

.erp-detail-meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.erp-detail-meta-item .nhan {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--mau-chu-phu);
    text-transform: uppercase;
}

.erp-detail-meta-item .gia-tri {
    font-size: 12px;
    font-weight: 600;
    color: var(--mau-chu-chinh);
}

.erp-detail-sub-table th {
    background: var(--mau-petrol-chinh);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 6px 8px;
    text-align: left;
    border-right: 1px solid rgba(255, 255, 255, 0.25);
}

.erp-detail-sub-table td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--mau-vien);
    font-size: 11.5px;
}

/* ==========================================================================
   11. PROGRESS BAR CAPSULE PILL % CHỈ TIÊU (FRAME 050, 057)
   ========================================================================== */
.erp-progress-pill {
    width: 90px;
    height: 14px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    display: inline-block;
    vertical-align: middle;
}

/* ==========================================================================
   12. MODAL DIALOG "THÊM THÔNG TIN KHÁCH HÀNG" (FRAME 010 VIDEO 2)
   ========================================================================== */
.erp-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.erp-modal-search-input-wrapper input {
    width: 100%;
    height: 30px;
    padding: 0 28px 0 28px;
    font-size: 12px;
    border: 1px solid var(--mau-petrol-vien);
    border-radius: var(--bo-goc);
    background: #ffffff;
}

/* ==========================================================================
   13. TOAST ALERT NỔI GÓC PHẢI TRÊN (FRAME 015 VIDEO 2)
   ========================================================================== */
.erp-toast-fixed-top-right {
    position: fixed;
    top: 48px;
    right: 14px;
    z-index: 1100;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: var(--bo-goc);
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: fadeInRight 0.2s ease-out;
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
}

.erp-toast-loi {
    background: #ef4444;
    color: #ffffff;
}

.erp-toast-thanh-cong {
    background: #10b981;
    color: #ffffff;
}

.erp-toast-close-btn {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    font-size: 13px;
    opacity: 0.8;
}

.erp-toast-close-btn:hover { opacity: 1; }

/* Responsive Media Queries */
@media (max-width: 768px) {
    .the-dang-nhap-hien-dai {
        padding: 1.5rem;
        border-radius: var(--bo-goc-lon);
    }
    
    .erp-danh-sach-tab {
        display: none;
    }
    
    .erp-mega-menu-popover {
        flex-direction: column;
        width: 100%;
    }
    
    .erp-mega-menu-col {
        border-right: none;
        border-bottom: 1px solid var(--mau-vien);
    }
}

/* ==========================================================================
   MÀN HÌNH DASHBOARD TỔNG QUAN (PETROL ERP DASHBOARD PRO)
   ========================================================================== */
.erp-dashboard-container {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background-color: var(--mau-nen-app);
    min-height: calc(100vh - 48px);
    overflow-y: auto;
}

.erp-dashboard-banner {
    background: linear-gradient(135deg, #003a66 0%, #005a9e 50%, #0073c6 100%);
    border-radius: 10px;
    padding: 18px 24px;
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 87, 158, 0.2);
    position: relative;
    overflow: hidden;
}

.erp-dashboard-banner::after {
    content: '';
    position: absolute;
    right: -40px;
    top: -40px;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    pointer-events: none;
}

.erp-banner-trai h1 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 6px 0;
    letter-spacing: -0.2px;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.erp-banner-trai p {
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.88);
    margin: 0;
}

.erp-banner-phai {
    display: flex;
    align-items: center;
    gap: 12px;
}

.erp-user-info-pill {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
}

.erp-badge-online-dot {
    width: 8px;
    height: 8px;
    background-color: #4ade80;
    border-radius: 50%;
    box-shadow: 0 0 8px #4ade80;
}

.erp-section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--mau-petrol-dam);
    margin: 4px 0 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.erp-module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 14px;
}

.erp-module-card {
    background: #ffffff;
    border: 1px solid var(--mau-vien-dam);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.erp-module-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    border-color: var(--mau-petrol-chinh);
}

.erp-module-header {
    padding: 14px 16px;
    background: linear-gradient(to right, #f8fafc, #ffffff);
    border-bottom: 1px solid var(--mau-vien);
    display: flex;
    align-items: center;
    gap: 12px;
}

.erp-module-badge-icon {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: var(--mau-petrol-nhat);
    color: var(--mau-petrol-chinh);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.erp-module-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--mau-chu-chinh);
    margin: 0;
}

.erp-module-body {
    padding: 14px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.erp-module-desc {
    font-size: 12px;
    color: var(--mau-chu-phu);
    margin-bottom: 12px;
    line-height: 1.5;
}

.erp-module-features {
    list-style: none;
    padding: 0;
    margin: 0 0 16px 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.erp-module-features li {
    font-size: 11.5px;
    color: var(--mau-chu-chinh);
    display: flex;
    align-items: center;
    gap: 6px;
}

.erp-module-features li::before {
    content: '✓';
    color: var(--mau-xanh-la-petrol);
    font-weight: 700;
    font-size: 11px;
}

.erp-module-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px 14px;
    background: var(--mau-petrol-chinh);
    color: #ffffff;
    border: none;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s ease;
    cursor: pointer;
}

.erp-module-btn:hover {
    background: var(--mau-petrol-hover);
    color: #ffffff;
}

.erp-quick-bar {
    background: #ffffff;
    border: 1px solid var(--mau-vien-dam);
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.erp-quick-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--mau-petrol-dam);
}

.erp-quick-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ==========================================================================
   POPOVER MENU CHỨC NĂNG DÒNG (CONTEXT ACTION DROPDOWN)
   ========================================================================== */
.erp-action-dropdown-container {
    position: relative;
    display: inline-block;
}

.erp-action-popover-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 1050;
    background: #ffffff;
    border: 1px solid var(--mau-vien-dam);
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    min-width: 190px;
    padding: 4px 0;
    display: flex;
    flex-direction: column;
    animation: fadeInDown 0.15s ease-out;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.erp-action-popover-item {
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--mau-chu-chinh);
    background: none;
    border: none;
    text-align: left;
    width: 100%;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.12s ease, color 0.12s ease;
}

.erp-action-popover-item:hover {
    background: #f1f5f9;
    color: var(--mau-petrol-chinh);
}

.erp-action-popover-item.danger {
    color: var(--mau-do-petrol);
}

.erp-action-popover-item.danger:hover {
    background: #fef2f2;
}

.erp-action-popover-divider {
    height: 1px;
    background: var(--mau-vien);
    margin: 4px 0;
}

/* ==========================================================================
   MODAL BACKDROP OVERLAY NỔI TRÊN MÀN HÌNH (OVERLAY MODAL DIALOG)
   ========================================================================== */
.lop-phu-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background-color: rgba(15, 23, 42, 0.65) !important;
    backdrop-filter: blur(4px);
    z-index: 99999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 16px;
    box-sizing: border-box;
    animation: fadeInModal 0.2s ease-out;
}

@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

.khung-modal {
    background: #ffffff !important;
    border-radius: 10px !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.1) !important;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    animation: slideUpModal 0.2s ease-out;
    position: relative;
    z-index: 100000 !important;
}

.khung-modal form,
.lop-phu-modal form {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

.khung-modal.khung-modal-lon {
    max-width: 760px;
}

@keyframes slideUpModal {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    padding: 14px 20px;
    background: linear-gradient(to right, #f8fafc, #ffffff);
    border-bottom: 1px solid var(--mau-vien);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0 !important;
}

.modal-header h2 {
    font-size: 17px;
    font-weight: 800;
    color: var(--mau-petrol-dam);
    margin: 0;
}

.nut-dong-modal {
    background: none;
    border: none;
    font-size: 26px;
    line-height: 1;
    color: var(--mau-chu-phu);
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.15s ease;
}

.nut-dong-modal:hover {
    color: var(--mau-do-petrol);
}

.modal-body {
    padding: 22px;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
}

.modal-footer {
    padding: 14px 22px;
    background: #f8fafc;
    border-top: 1px solid var(--mau-vien);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-shrink: 0 !important;
}

.modal-footer .nut-phu {
    padding: 9px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--mau-chu-phu);
    background: #ffffff;
    border: 1px solid var(--mau-vien-dam);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.modal-footer .nut-phu:hover {
    background: #f1f5f9;
    color: var(--mau-chu-chinh);
    border-color: #cbd5e1;
}

.modal-footer .nut-chinh {
    padding: 9px 24px;
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    background: var(--mau-petrol-chinh);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 87, 158, 0.25);
    transition: background 0.15s ease;
}

.modal-footer .nut-chinh:hover {
    background: var(--mau-petrol-hover);
}

.luoi-form-2cot {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.truong-nhap-hien-dai {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.truong-nhap-hien-dai label {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--mau-chu-chinh);
}

.truong-nhap-hien-dai input,
.truong-nhap-hien-dai select,
.truong-nhap-hien-dai textarea {
    width: 100%;
    box-sizing: border-box;
    min-height: 38px;
    padding: 8px 12px;
    font-size: 13.5px;
    border: 1px solid var(--mau-vien-dam);
    border-radius: 6px;
    outline: none;
    background-color: #ffffff;
    color: var(--mau-chu-chinh);
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.truong-nhap-hien-dai input:focus,
.truong-nhap-hien-dai select:focus,
.truong-nhap-hien-dai textarea:focus {
    border-color: var(--mau-petrol-chinh);
    box-shadow: 0 0 0 3px rgba(0, 87, 158, 0.12);
}

.truong-nhap-hien-dai.cot-trai-rong {
    grid-column: 1 / -1;
}

/* ==========================================================================
   KHUNG CHỌN VAI TRÒ / CHECKBOX ĐỒNG BỘ FORM MODAL
   ========================================================================== */
.khung-chon-vai-tro {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 22px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid var(--mau-vien-dam);
    border-radius: 6px;
    margin-top: 4px;
}

.muc-chon-vai-tro {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--mau-chu-chinh);
    cursor: pointer;
    user-select: none;
}

.muc-chon-vai-tro input[type="checkbox"],
.muc-chon-vai-tro .erp-checkbox {
    width: 17px;
    height: 17px;
    accent-color: var(--mau-petrol-chinh);
    cursor: pointer;
    margin: 0;
}

/* ==========================================================================
   RESET VÀ ĐỒNG BỘ TOÀN BỘ DROPDOWN COMBOBOX (SELECT) TRÊN HỆ THỐNG
   ========================================================================== */
select,
select.form-select {
    box-sizing: border-box;
    font-family: inherit;
    font-size: 13.5px;
    height: 38px;
    border-radius: 6px;
    border: 1px solid var(--mau-vien-dam);
    background-color: #ffffff;
    color: var(--mau-chu-chinh);
}

/* ==========================================================================
   QUY CHUẨN QHU-UI: DRAG & DROP REORDER CỘT VÀ RESIZE ĐỘ RỘNG CỘT DATAGRID
   ========================================================================== */
.erp-th-draggable {
    cursor: grab;
    user-select: none;
    position: relative;
    transition: background-color 0.15s ease;
}

.erp-th-draggable:active {
    cursor: grabbing;
}

.erp-th-dragging {
    opacity: 0.45;
    background-color: #bae6fd !important;
}

.erp-th-dragover {
    border-left: 3px solid var(--mau-petrol-chinh, #0284c7) !important;
    background-color: #f0f9ff !important;
}

.erp-th-resizer {
    position: absolute;
    top: 0;
    right: -2px;
    bottom: 0;
    width: 6px;
    cursor: col-resize;
    user-select: none;
    z-index: 10;
    touch-action: none;
}

.erp-th-resizer:hover,
.erp-th-resizer.resizing {
    background-color: var(--mau-petrol-chinh, #0284c7);
}

.erp-sub-filter-bar select {
    height: 34px;
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 6px;
}

/* ==========================================================================
   QUY CHUẨN OPTIMIZE UI SMARTPHONE TÀI XẾ (QHU SMARTPHONE DRIVER UI)
   ========================================================================== */

/* Trạng thái xem mặc định Desktop / Mobile */
.erp-mobile-only {
    display: none !important;
}

.erp-desktop-only {
    display: block;
}

@media (max-width: 768px) {
    .erp-desktop-only {
        display: none !important;
    }

    .erp-mobile-only {
        display: block !important;
    }

    /* Thanh Toolbar cố định 1 HÀNG NGANG DÒNG ĐƠN duy nhất trên điện thoại (TUỆT ĐỐI KHÔNG XUỐNG HÀNG) */
    .erp-action-toolbar {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        gap: 6px !important;
        padding: 6px 10px !important;
        height: 48px !important;
        align-items: center !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch;
        background: #ffffff;
        border-bottom: 1px solid #e2e8f0;
    }

    .erp-action-toolbar::-webkit-scrollbar {
        display: none; /* Ẩn thanh cuộn xấu trên mobile */
    }

    .erp-toolbar-nhom-trai {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        width: 100% !important;
        gap: 6px !important;
        flex-shrink: 0 !important;
        align-items: center !important;
    }

    .erp-toolbar-nhom-phai {
        display: none !important; /* Ẩn nhóm nút phụ bên phải trên điện thoại để dành không gian 1 hàng duy nhất */
    }

    .qhu-mobile-secondary-action {
        display: none !important; /* Ẩn các nút phụ phụ trợ trên mobile để 1 hàng luôn vừa khít */
    }

    .erp-sub-filter-search-pill {
        flex: 1 1 auto !important;
        width: 100% !important;
        min-width: 120px !important;
        max-width: 100% !important;
        flex-shrink: 1 !important;
        margin: 0 !important;
        position: relative !important;
    }

    .erp-sub-filter-search-pill input {
        width: 100% !important;
        font-size: 13.5px !important;
        height: 36px !important;
        padding: 0 10px 0 34px !important; /* Đảm bảo chữ không che icon kính lúp! */
        border-radius: 18px !important;
    }

    .erp-nut-toolbar {
        flex: 0 0 auto !important;
        min-width: max-content !important;
        min-height: 36px !important;
        height: 36px !important;
        font-size: 12.5px !important;
        font-weight: 700 !important;
        padding: 0 10px !important;
        white-space: nowrap !important;
        justify-content: center !important;
        border-radius: 8px !important;
    }

    /* Danh sách dạng Thẻ Mobile chuyên dụng cho Tài Xế */
    .erp-mobile-card-list {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 10px;
        overflow-y: auto;
        flex: 1;
        background: #f8fafc;
    }

    .erp-driver-card {
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        padding: 14px 16px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        display: flex;
        flex-direction: column;
        gap: 10px;
        position: relative;
    }

    .erp-driver-card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px dashed #e2e8f0;
        padding-bottom: 8px;
    }

    .erp-driver-card-title {
        font-size: 16.5px;
        font-weight: 800;
        color: var(--mau-petrol-chinh);
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .erp-driver-card-sub {
        font-size: 12px;
        color: var(--mau-chu-phu);
    }

    .erp-driver-card-body {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .erp-driver-card-stat-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 13.5px;
    }

    .erp-driver-card-highlight-val {
        font-size: 20px;
        font-weight: 800;
    }

    .erp-driver-card-progress {
        height: 12px;
        background: #e2e8f0;
        border-radius: 6px;
        overflow: hidden;
        margin-top: 4px;
    }

    .erp-driver-card-progress-bar {
        height: 100%;
        border-radius: 6px;
        transition: width 0.3s ease;
    }

    .erp-driver-card-actions {
        display: flex;
        gap: 8px;
        margin-top: 6px;
        border-top: 1px solid #f1f5f9;
        padding-top: 10px;
    }

    .erp-driver-card-btn {
        flex: 1;
        min-height: 42px;
        border-radius: 8px;
        font-size: 13.5px;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        border: none;
        cursor: pointer;
        text-decoration: none;
    }

    /* Modal Form Overlay trên điện thoại */
    .khung-modal {
        width: 94% !important;
        max-height: 90vh !important;
        margin: 0 3% !important;
        border-radius: 16px !important;
    }

    .truong-nhap-hien-dai input,
    .truong-nhap-hien-dai select,
    .truong-nhap-hien-dai textarea {
        font-size: 16px !important; /* Chống phóng to màn hình iOS */
        padding: 12px !important;
    }

    .modal-footer button {
        min-height: 44px !important;
        font-size: 15px !important;
    }
}

/* ==========================================================================
   FINTECH / E-WALLET STYLE MOBILE DRIVER CARDS & DASHBOARD (QHU FINTECH UI)
   ========================================================================== */

@media (max-width: 768px) {
    .erp-fintech-card-container {
        display: flex;
        flex-direction: column;
        gap: 14px;
        padding: 12px;
        background: #f8fafc; /* Nền xám nhạt dịu mắt, sạch sẽ */
        overflow-y: auto;
        flex: 1;
    }

    .erp-fintech-card {
        background: #ffffff;
        border-radius: 12px;
        padding: 14px 16px;
        box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
        border: 1px solid #e2e8f0;
        border-bottom: 2px solid #cbd5e1; /* Đường gạch ngang phân cách đơn giản, tinh tế ở đáy card */
        display: flex;
        flex-direction: column;
        gap: 10px;
        position: relative;
    }

    .erp-card-divider-line {
        height: 1px;
        background: #e2e8f0;
        margin: 8px 0;
    }

    .erp-fintech-card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-bottom: 8px;
        border-bottom: 1px solid #f1f5f9;
    }

    .erp-fintech-plate-badge {
        background: linear-gradient(135deg, #0073c6 0%, #005a9e 100%);
        color: #ffffff;
        font-weight: 800;
        font-size: 15px;
        padding: 4px 12px;
        border-radius: 8px;
        letter-spacing: 0.5px;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        box-shadow: 0 2px 6px rgba(0, 115, 198, 0.25);
    }

    /* Dual stat row: Sóng đôi Xin vs Duyệt 2 bên */
    .erp-fintech-dual-stat-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 4px 0;
    }

    .erp-fintech-stat-col {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .erp-fintech-stat-col.col-right {
        text-align: right;
    }

    .erp-fintech-stat-label {
        font-size: 11px;
        font-weight: 700;
        color: #64748b;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .erp-fintech-stat-val {
        font-size: 22px;
        font-weight: 800;
        color: #0f172a;
        line-height: 1.2;
    }

    .erp-fintech-stat-val.val-green {
        color: #16a34a;
    }

    .erp-fintech-stat-val.val-amber {
        color: #ea580c;
    }

    .erp-fintech-stat-val.val-red {
        color: #dc2626;
    }

    .erp-fintech-progress-track {
        width: 100%;
        height: 6px;
        background: #e2e8f0;
        border-radius: 3px;
        overflow: hidden;
        margin-top: 2px;
    }

    .erp-fintech-progress-fill {
        height: 100%;
        border-radius: 3px;
        transition: width 0.4s ease;
    }

    /* Callout speech bubble cho lý do xin */
    .erp-fintech-callout {
        background: #f8fafc;
        border-left: 3px solid #0284c7;
        border-radius: 0 8px 8px 0;
        padding: 8px 12px;
        font-size: 13px;
        color: #334155;
        line-height: 1.4;
    }

    .erp-fintech-meta-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-size: 11.5px;
        color: #64748b;
        padding-top: 8px;
        border-top: 1px solid #f1f5f9;
    }

    .erp-fintech-details-toggle {
        background: none;
        border: none;
        color: var(--mau-petrol-chinh);
        font-size: 12px;
        font-weight: 700;
        cursor: pointer;
        padding: 2px 0;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        width: 100%;
    }

    .erp-fintech-details-panel {
        background: #f8fafc;
        border-radius: 8px;
        padding: 8px 12px;
        border: 1px solid #e2e8f0;
        display: flex;
        flex-direction: column;
        gap: 4px;
        font-size: 12px;
        color: #334155;
    }

    .erp-fintech-action-btn {
        width: 100%;
        min-height: 46px;
        background: linear-gradient(135deg, #0073c6 0%, #005a9e 100%);
        color: #ffffff;
        font-size: 14.5px;
        font-weight: 700;
        border: none;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        box-shadow: 0 4px 12px rgba(0, 115, 198, 0.3);
        cursor: pointer;
        text-decoration: none;
    }

    .erp-fintech-action-btn:active {
        transform: scale(0.98);
    }
}

/* ==========================================================================
   14. GIAO DIỆN CẤP PHÁT DI ĐỘNG MOBILE-FIRST (CAPPHATNHANH.RAZOR)
   ========================================================================== */
.qhu-mobile-capphat-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 12px;
    min-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
}

.qhu-mobile-card-main {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.qhu-mobile-card-header {
    padding: 18px 16px 12px;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    border-bottom: 1px solid #f1f5f9;
}

.qhu-mobile-icon-ambient {
    font-size: 36px;
    margin-bottom: 6px;
}

.qhu-mobile-title {
    font-size: 17px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 4px 0;
    letter-spacing: -0.2px;
}

.qhu-mobile-subtitle {
    font-size: 12.5px;
    color: #64748b;
    margin: 0;
}

.qhu-step-indicator {
    display: inline-block;
    background: #e0f2fe;
    color: #0284c7;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.qhu-mobile-card-body {
    padding: 16px;
}

.qhu-btn-primary-large {
    width: 100%;
    min-height: 52px;
    background: linear-gradient(135deg, #0284c7 0%, #005a9e 100%);
    color: #ffffff;
    font-size: 15px;
    font-weight: 800;
    border: none;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
    transition: transform 0.1s ease;
}

.qhu-btn-primary-large:active {
    transform: scale(0.98);
}

.qhu-mobile-section-divider {
    text-align: center;
    margin: 18px 0 12px;
    position: relative;
}

.qhu-mobile-section-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e2e8f0;
}

.qhu-mobile-section-divider span {
    position: relative;
    background: #ffffff;
    padding: 0 10px;
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
}

.qhu-mobile-vehicle-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.qhu-vehicle-item-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.qhu-vehicle-item-card:hover, .qhu-vehicle-item-card:active {
    background: #f0f9ff;
    border-color: #0284c7;
    transform: translateY(-1px);
}

.qhu-vehicle-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.qhu-plate-badge {
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: 0.5px;
}

.qhu-fuel-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
}

.qhu-badge-gas {
    background: #dcfce7;
    color: #15803d;
}

.qhu-badge-diesel {
    background: #ffedd5;
    color: #c2410c;
}

.qhu-vehicle-item-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #64748b;
}

.qhu-quota-text {
    font-weight: 700;
    color: #0284c7;
}

/* Camera viewport & scanner */
.qhu-camera-viewport-container {
    position: relative;
    width: 100%;
    height: 340px;
    min-height: 340px;
    background: #000000;
    overflow: hidden;
    border-radius: 12px;
}

.qhu-camera-video {
    width: 100% !important;
    height: 340px !important;
    position: relative;
    background: #000000;
    overflow: hidden;
}

.qhu-camera-video video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

.qhu-camera-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.qhu-camera-reticle {
    width: 220px;
    height: 220px;
    border: 3px solid #0284c7;
    border-radius: 16px;
    position: relative;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.qhu-reticle-line {
    width: 100%;
    height: 3px;
    background: #ef4444;
    position: absolute;
    top: 0;
    animation: scanPulse 2s infinite ease-in-out;
    box-shadow: 0 0 8px #ef4444;
}

@keyframes scanPulse {
    0% { top: 0; }
    50% { top: 100%; }
    100% { top: 0; }
}

.qhu-mobile-card-footer {
    padding: 14px 16px;
    border-top: 1px solid #f1f5f9;
}

.qhu-btn-secondary {
    width: 100%;
    min-height: 44px;
    background: #f1f5f9;
    color: #475569;
    font-size: 13.5px;
    font-weight: 700;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    cursor: pointer;
}

.qhu-vehicle-confirmed-card {
    background: linear-gradient(135deg, #0284c7 0%, #005a9e 100%);
    border-radius: 14px;
    padding: 16px;
    color: #ffffff;
    margin: 0 16px 16px;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}

.qhu-plate-hero {
    text-align: center;
    margin-bottom: 12px;
}

.qhu-plate-hero-text {
    font-size: 26px;
    font-weight: 900;
    letter-spacing: 1px;
    background: #ffffff;
    color: #0f172a;
    padding: 4px 16px;
    border-radius: 8px;
    display: inline-block;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.qhu-vehicle-specs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: rgba(255, 255, 255, 0.12);
    padding: 10px;
    border-radius: 10px;
}

.qhu-spec-item {
    display: flex;
    flex-direction: column;
}

.qhu-spec-label {
    font-size: 11px;
    opacity: 0.85;
}

.qhu-spec-value {
    font-size: 13.5px;
    font-weight: 800;
}

.qhu-color-success {
    color: #4ade80 !important;
}

.qhu-liters-input-section {
    padding: 0 16px 16px;
}

.qhu-input-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 6px;
}

.qhu-liters-display-box {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 2px solid #0284c7;
    border-radius: 14px;
    padding: 8px 16px;
    margin-bottom: 12px;
}

.qhu-liters-big-input {
    flex: 1;
    font-size: 36px;
    font-weight: 900;
    text-align: center;
    border: none;
    background: transparent;
    color: #0f172a;
    outline: none;
}

.qhu-liters-unit {
    font-size: 16px;
    font-weight: 800;
    color: #0284c7;
}

.qhu-quick-liters-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.qhu-btn-pill {
    flex: 1;
    height: 38px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
}

.qhu-btn-pill-max {
    background: #ffedd5;
    border-color: #fed7aa;
    color: #c2410c;
}

.qhu-mobile-actions-row {
    display: flex;
    gap: 10px;
    padding: 0 16px 16px;
}

.qhu-btn-primary {
    flex: 2;
    min-height: 48px;
    background: linear-gradient(135deg, #0284c7 0%, #005a9e 100%);
    color: #ffffff;
    font-size: 14.5px;
    font-weight: 800;
    border: none;
    border-radius: 12px;
    cursor: pointer;
}

.qhu-pending-order-summary {
    background: #f0f9ff;
    border-bottom: 1px solid #bae6fd;
    padding: 8px 16px;
    font-size: 12.5px;
    display: flex;
    justify-content: space-between;
    color: #0369a1;
}

/* Live status view */
.qhu-live-status-header {
    background: linear-gradient(135deg, #0284c7 0%, #005a9e 100%);
    padding: 18px 16px;
    text-align: center;
    color: #ffffff;
}

.qhu-live-plate-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 4px;
    opacity: 0.9;
}

.qhu-live-plate-number {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 1px;
    background: #ffffff;
    color: #0f172a;
    padding: 4px 18px;
    border-radius: 8px;
    display: inline-block;
}

.qhu-live-status-body {
    padding: 24px 16px;
    text-align: center;
}

.qhu-pulsing-pump {
    font-size: 48px;
    animation: pumpPulse 1.5s infinite;
}

@keyframes pumpPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.12); }
    100% { transform: scale(1); }
}

.qhu-fueling-title {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    margin: 8px 0 4px;
}

.qhu-fueling-station-name {
    font-size: 14px;
    font-weight: 700;
    color: #0284c7;
    margin: 0 0 4px;
}

.qhu-fueling-instruct {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 16px;
}

.qhu-fueling-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 14px;
}

.qhu-stat-title {
    display: block;
    font-size: 11px;
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
}

.qhu-stat-val {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
}

.qhu-timeout-notice {
    font-size: 12.5px;
    color: #ea580c;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    padding: 6px 12px;
    border-radius: 20px;
    display: inline-block;
}

.qhu-btn-danger {
    width: 100%;
    min-height: 44px;
    background: #fee2e2;
    color: #dc2626;
    font-size: 14px;
    font-weight: 800;
    border: 1px solid #fca5a5;
    border-radius: 12px;
    cursor: pointer;
}

.qhu-celebration-icon {
    font-size: 52px;
    margin-bottom: 8px;
}

.qhu-success-title {
    font-size: 20px;
    font-weight: 800;
    color: #16a34a;
    margin: 0 0 12px;
}

.qhu-dispensed-liters-box {
    background: #f0fdf4;
    border: 2px solid #86efac;
    border-radius: 16px;
    padding: 14px;
    margin-bottom: 12px;
}

.qhu-dispensed-number {
    display: block;
    font-size: 40px;
    font-weight: 900;
    color: #15803d;
}

.qhu-dispensed-unit {
    font-size: 13px;
    font-weight: 800;
    color: #16a34a;
    letter-spacing: 0.5px;
}

.qhu-success-desc {
    font-size: 13px;
    color: #475569;
    margin: 0;
}

/* ==========================================================================
   CARD ĐỀ NGHỊ CẤP NHIÊN LIỆU (FUEL REQUEST CARD MATCHING MOCKUP)
   ========================================================================== */
.erp-fuel-request-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    transition: all 0.2s ease;
}

.erp-fuel-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.erp-plate-badge-blue {
    background: #1d4ed8;
    color: #ffffff;
    font-weight: 800;
    font-size: 15px;
    padding: 6px 14px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 6px rgba(29, 78, 216, 0.25);
}

.erp-badge-pill-soft {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.erp-badge-pill-soft.badge-duyet-mot-phan {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.erp-badge-pill-soft.badge-da-duyet {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.erp-badge-pill-soft.badge-cho-duyet {
    background: #fefce8;
    color: #ca8a04;
    border: 1px solid #fde68a;
}

.erp-badge-pill-soft.badge-tu-choi {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.erp-fuel-hero-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    margin-top: 12px;
}

.erp-fuel-hero-label {
    font-size: 11.5px;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.erp-fuel-hero-val {
    font-size: 32px;
    font-weight: 900;
    color: #1e3a8a;
    margin: 4px 0 2px 0;
    line-height: 1.1;
}

.erp-fuel-hero-sub {
    font-size: 13px;
    color: #475569;
}

.erp-fuel-hero-sub .text-orange {
    color: #ea580c;
    font-weight: 800;
}

.erp-fuel-hero-sub .text-muted {
    color: #64748b;
    font-weight: 400;
}

.erp-fuel-toggle-btn {
    width: 100%;
    border: 1.5px solid #2563eb;
    background: #ffffff;
    color: #2563eb;
    font-weight: 700;
    font-size: 13.5px;
    border-radius: 10px;
    padding: 9px 14px;
    margin-top: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.erp-fuel-toggle-btn:hover {
    background: #eff6ff;
}

.erp-fuel-detail-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 16px;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.erp-fuel-detail-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: #334155;
}

.erp-fuel-detail-row .icon {
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 1px;
}

.erp-fuel-detail-row .label {
    color: #64748b;
    flex-shrink: 0;
}

.erp-fuel-detail-row .val {
    color: #0f172a;
    font-weight: 600;
    word-break: break-all;
}

.erp-fuel-history-section {
    margin-top: 14px;
}

.erp-fuel-history-header {
    font-size: 11.5px;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.erp-fuel-history-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.erp-fuel-history-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.erp-fuel-history-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #eff6ff;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.erp-fuel-history-info .title {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
    display: block;
    line-height: 1.2;
}

.erp-fuel-history-info .sub {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

.erp-fuel-history-info .detail {
    font-size: 11.5px;
    color: #94a3b8;
    font-style: italic;
}

.erp-fuel-history-empty {
    font-size: 12.5px;
    color: #94a3b8;
    font-style: italic;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 8px;
    text-align: center;
}

/* ==========================================================================
   REUSABLE SEARCHABLE SELECT DROPDOWN COMPONENT (ERPCHONTIMKIEM.RAZOR)
   ========================================================================== */
.erp-searchable-select {
    position: relative;
    width: 100%;
    display: inline-block;
}

.erp-searchable-select.is-open {
    z-index: 99999 !important;
}

.erp-combobox-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--mau-vien-dam, #cbd5e1);
    border-radius: 6px;
    transition: all 0.15s ease;
}

.erp-combobox-wrapper:hover:not(.disabled) {
    border-color: var(--mau-petrol-chinh, #0073c6);
}

.erp-combobox-wrapper.open,
.erp-combobox-wrapper:focus-within {
    border-color: var(--mau-petrol-chinh, #0073c6);
    box-shadow: 0 0 0 3px rgba(0, 115, 198, 0.15);
    z-index: 99999 !important;
}

.erp-combobox-wrapper.disabled {
    background: #f1f5f9;
    cursor: not-allowed;
    border-color: #e2e8f0;
}

.erp-combobox-input {
    flex: 1;
    width: 100%;
    min-height: 38px;
    height: 38px;
    padding: 6px 42px 6px 12px;
    border: none;
    background: transparent;
    font-size: 14px;
    color: var(--mau-chu-chinh, #0f172a);
    font-weight: 500;
    outline: none;
    border-radius: 6px;
}

.erp-combobox-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.erp-combobox-input:disabled {
    cursor: not-allowed;
    color: #94a3b8;
}

.erp-combobox-actions {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 4px;
    pointer-events: auto;
}

.erp-combobox-actions button {
    background: none;
    border: none;
    padding: 2px 5px;
    cursor: pointer;
    color: #64748b;
    font-size: 12px;
    line-height: 1;
    border-radius: 4px;
}

.erp-combobox-actions .btn-clear:hover {
    background: #fee2e2;
    color: #dc2626;
}

.erp-combobox-actions .btn-arrow:hover {
    color: #0284c7;
}

.erp-select-trigger-icons .btn-clear:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Backdrop dismiss */
.erp-select-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 99998;
    background: transparent;
}

/* Dropdown Dialog Popover */
.erp-select-dropdown-dialog {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    min-width: 260px;
    max-width: 480px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.25);
    z-index: 100000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: fadeInSelect 0.15s ease-out;
}

@keyframes fadeInSelect {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.erp-select-search-header {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    gap: 8px;
}

.erp-select-search-header .icon-search {
    font-size: 14px;
    color: #64748b;
}

.erp-select-search-input {
    flex: 1;
    height: 34px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0 10px;
    font-size: 13.5px;
    outline: none;
}

.erp-select-search-input:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

.erp-select-search-header .btn-close-pop {
    background: none;
    border: none;
    font-size: 18px;
    color: #94a3b8;
    cursor: pointer;
    padding: 0 4px;
}

.erp-select-search-header .btn-close-pop:hover {
    color: #ef4444;
}

.erp-select-item-list {
    max-height: 260px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px 0;
}

.erp-select-item {
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-size: 13.5px;
    color: #1e293b;
    transition: background 0.1s ease;
}

.erp-select-item:hover {
    background: #f0f9ff;
    color: #0284c7;
}

.erp-select-item.selected {
    background: #e0f2fe;
    color: #0369a1;
    font-weight: 700;
}

.erp-select-item-main {
    display: flex;
    flex-direction: column;
}

.erp-select-item-sub {
    font-size: 11.5px;
    color: #64748b;
    font-weight: 400;
}

.erp-select-item .check-icon {
    font-weight: 800;
    color: #0284c7;
}

.erp-select-empty-notice {
    padding: 16px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
}

.erp-select-footer-info {
    padding: 6px 12px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    font-size: 11px;
    color: #94a3b8;
    text-align: right;
}

/* Smartphone optimization for ErpChonTimKiem */
@media (max-width: 768px) {
    .erp-combobox-input {
        height: 40px !important;
        min-height: 40px !important;
        font-size: 16px !important; /* Dùng 16px để tránh auto-zoom trên iOS Safari */
    }

    .erp-select-backdrop {
        background: rgba(15, 23, 42, 0.25) !important;
        backdrop-filter: blur(1px);
    }

    .erp-select-dropdown-dialog {
        position: absolute !important;
        top: calc(100% + 4px) !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        border-radius: 8px !important;
        box-shadow: 0 10px 30px rgba(15, 23, 42, 0.35) !important;
        max-height: 250px !important;
        z-index: 100000 !important;
    }

    .erp-select-item-list {
        max-height: 200px !important;
    }

    .erp-select-item {
        padding: 11px 14px !important;
        font-size: 14.5px !important;
        min-height: 42px !important;
    }

    .erp-combobox-actions button {
        padding: 4px 8px !important;
        font-size: 14px !important;
    }
}
