/* ============================================================
   components.css — ABU (All Business Utility)
   Gom từ: 3 inline <style> blocks trong index.html
            + 940 inline style="" được chuẩn hoá thành utility classes
   ============================================================ */

/* ─── 1. UTILITY CLASSES (thay thế inline styles lặp lại) ─── */

/* Flex helpers */
.flex-center {
    display: flex;
    align-items: center;
}

.flex-center-gap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.flex-center-gap6 {
    display: flex;
    align-items: center;
    gap: 6px;
}

.flex-center-gap10 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-end {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

.flex-col-gap12 {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.flex-jcenter {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

/* Modal overlay — dùng cho tất cả .modal */
.modal-overlay {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-overlay-high {
    z-index: 1050;
}

.modal-overlay-top {
    z-index: 99999;
}

/* Modal title bar — gradient xanh */
.modal-titlebar {
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-titlebar-content {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
}

.modal-titlebar-title {
    font-weight: bold;
    font-size: 15px;
    color: white;
}

.modal-close-btn {
    color: white;
    font-size: 22px;
    cursor: pointer;
    font-weight: bold;
    line-height: 1;
    background: none;
    border: none;
}

.modal-close-btn-lg {
    font-size: 24px;
}

/* Icon sizes */
.icon-xs {
    width: 12px;
    height: 12px;
}

.icon-sm {
    width: 14px;
    height: 14px;
}

.icon-md {
    width: 16px;
    height: 16px;
}

.icon-18 {
    width: 18px;
    height: 18px;
}

.icon-20 {
    width: 20px;
    height: 20px;
}

.icon-lg {
    width: 24px;
    height: 24px;
}

.icon-xl {
    width: 28px;
    height: 28px;
}

.icon-2xl {
    width: 30px;
    height: 30px;
}

.icon-3xl {
    width: 36px;
    height: 36px;
}

.icon-4xl {
    width: 48px;
    height: 48px;
}

/* Button with icon */
.btn-icon-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-icon-inline-5 {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Form inputs */
.input-full {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.input-full-sm {
    width: 100%;
    padding: 8px 8px 8px 35px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.input-select-sm {
    padding: 5px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 12px;
    width: 115px;
}

/* Form label */
.form-label-sm {
    font-size: 12px;
    color: #666;
    display: block;
    margin-bottom: 4px;
}

/* Table common */
.table-full {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table-th {
    padding: 10px 8px;
    text-align: left;
    color: #475569;
    font-weight: 600;
    white-space: nowrap;
}

.table-th-center {
    padding: 10px;
    text-align: center;
}

/* Search input wrapper */
.search-icon-wrapper {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #94a3b8;
}

/* Grid 2 col */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Table/Card toolbar row */
.toolbar-row {
    padding: 10px;
    background: #f1f2f6;
    border-bottom: 1px solid #ddd;
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Divider */
.divider-top {
    border-top: 1px solid #eee;
    margin: 4px 0;
}

/* ─── 2. INLINE STYLE BLOCK 1 — Reports / KPI (dòng 969) ─── */

.sub-panel {
    display: none;
}

.sub-panel.active {
    display: flex;
    flex-direction: column;
}

/* Contextual KPI Cards */
.kpi-mini-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    transition: all 0.2s ease;
}

.kpi-mini-card:hover {
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.kpi-label {
    font-size: 14px;
    color: #475569;
    font-weight: 700;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-value {
    font-size: 24px;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.2;
}

.kpi-count {
    font-size: 14px;
    color: #64748b;
    margin-top: 5px;
    font-weight: 600;
}

.kpi-badge {
    position: absolute;
    top: -12px;
    left: -12px;
    background: #f59e0b;
    color: white;
    font-size: 16px;
    font-weight: 800;
    padding: 5px 12px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    z-index: 10;
    border: 2px solid white;
    min-width: 45px;
    text-align: center;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

@media (max-width: 768px) {
    .kpi-mini-card {
        padding: 10px;
    }

    .kpi-value {
        font-size: 20px;
    }

    .kpi-label {
        font-size: 13px;
    }
}

/* ─── 3. INLINE STYLE BLOCK 2 — Return Import responsive (dòng 2308) ─── */

@media (max-width: 768px) {
    #returnImportItemsTable {
        display: none !important;
    }

    #returnImportItemsCards {
        display: block !important;
    }

    #returnImportFooterGrid {
        grid-template-columns: 1fr !important;
    }

    .return-import-card {
        background: #fff;
        border: 1px solid #e5e7eb;
        border-left: 4px solid #e67e22;
        border-radius: 10px;
        padding: 12px 14px;
        margin-bottom: 10px;
        box-shadow: 0 1px 5px rgba(0, 0, 0, 0.07);
    }
}

@media (min-width: 769px) {
    #returnImportItemsTable {
        display: block !important;
    }

    #returnImportItemsCards {
        display: none !important;
    }
}

/* ─── 4. INLINE STYLE BLOCK 3 — Import Cart responsive (dòng 2838) ─── */

@media (max-width: 768px) {
    #importCartTable {
        display: none !important;
    }

    #importCartCards {
        display: block !important;
    }

    #purchaseFooterGrid {
        grid-template-columns: 1fr !important;
    }

    .import-card {
        background: #fff;
        border: 1px solid #e5e7eb;
        border-radius: 10px;
        border-left: 4px solid #27ae60;
        padding: 12px 14px;
        margin-bottom: 10px;
        box-shadow: 0 1px 5px rgba(0, 0, 0, 0.07);
    }

    .import-card.is-service {
        border-left-color: #7c3aed;
        background: #faf5ff;
    }

    .import-card input[type=text],
    .import-card input[type=number] {
        font-size: 16px !important;
        padding: 9px 10px !important;
        width: 100%;
        box-sizing: border-box;
        border: 1px solid #ddd;
        border-radius: 6px;
    }

    .import-card-row {
        display: flex;
        gap: 10px;
        margin-top: 8px;
    }

    .import-card-row>div {
        flex: 1;
    }

    .import-card-row label {
        font-size: 11px;
        color: #64748b;
        font-weight: 600;
        display: block;
        margin-bottom: 4px;
        text-transform: uppercase;
        letter-spacing: 0.4px;
    }

    .import-card-footer {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 10px;
        padding-top: 9px;
        border-top: 1px dashed #e5e7eb;
    }

    .import-card-total {
        font-size: 16px;
        font-weight: 800;
        color: #e74c3c;
    }

    .import-card-total.is-service {
        color: #7c3aed;
        font-size: 13px;
    }

    .import-serial-area {
        margin-top: 8px;
    }

    .import-serial-area .sn-chips {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
        margin-bottom: 6px;
        min-height: 22px;
    }

    .import-serial-area .sn-input-row {
        display: flex;
        gap: 6px;
        align-items: center;
    }

    .import-serial-area input {
        flex: 1;
        font-family: 'JetBrains Mono', monospace;
        background: #f0f9ff !important;
        border: 1px dashed #93c5fd !important;
    }
}

@media (min-width: 769px) {
    #importCartTable {
        display: block !important;
    }

    #importCartCards {
        display: none !important;
    }
}

/* ─── 5. VISIBILITY HELPERS (thay thế display:none inline) ─── */

.hidden {
    display: none !important;
}

.visible-flex {
    display: flex !important;
}

.visible-block {
    display: block !important;
}

.visible-inline-flex {
    display: inline-flex !important;
}


/* Auto-added UI Utility Classes */
.text-nowrap {
    white-space: nowrap !important;
}

.text-right {
    text-align: right !important;
}

.text-center {
    text-align: center !important;
}

.modal-body {
    padding: 20px;
}

.mt-20 {
    margin-top: 20px;
}

.flex-col-gap10 {
    display: flex;
    flex-direction: column;
    gap: 10px;
}


/* Auto-added UI Utility Classes Part 2 */
.text-left {
    text-align: left !important;
}

.mb-15 {
    margin-bottom: 15px;
}

.mb-12 {
    margin-bottom: 12px;
}

.p-5-10 {
    padding: 5px 10px;
}

.cursor-pointer {
    cursor: pointer;
}


/* Auto-added UI Utility Classes Part 3 */
.fs-15 {
    font-size: 15px !important;
}

.fs-24 {
    font-size: 24px !important;
}

.btn-close-icon {
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
}

.table-cell-bordered {
    padding: 10px;
    border: 1px solid #ddd;
}

.p-8-15 {
    padding: 8px 15px;
}

.kpi-icon-blue {
    color: #2196f3;
    display: flex;
    justify-content: center;
    margin-bottom: 5px;
}

.kpi-icon-green {
    color: #4caf50;
    display: flex;
    justify-content: center;
    margin-bottom: 5px;
}

.w-15 {
    width: 15% !important;
}

.w-120 {
    width: 120px !important;
}

.w-150 {
    width: 150px !important;
}

.w-40 {
    width: 40px !important;
}


/* Auto-added UI Utility Classes Part 4 - Colors & Borders */
.text-666 {
    color: #666;
}

.text-blue {
    color: #2196f3;
}

.text-green {
    color: #4caf50;
}

.text-orange {
    color: #ff9800;
}

.text-red {
    color: #f44336;
}

.text-danger {
    color: #e74c3c;
}

.text-primary-light {
    color: #0984e3;
}

.text-slate-600 {
    color: #475569;
}

.text-slate-500 {
    color: #64748b;
}

.text-slate-400 {
    color: #94a3b8;
}

.bg-gradient-blue {
    background: linear-gradient(135deg, #3b82f6, #1e40af);
}

.bg-gradient-orange {
    background: linear-gradient(135deg, #e67e22, #d35400);
}

.bg-white {
    background: #fff;
}

.bg-gray-100 {
    background: #f1f2f6;
}

.bg-blue-50 {
    background: #e3f2fd;
}

.bg-orange-50 {
    background: #fff3e0;
}

.bg-red-50 {
    background: #ffebee;
}

.bg-green-50 {
    background: #e8f5e9;
}

.border-ddd {
    border: 1px solid #ddd;
}

.border-b-ddd {
    border-bottom: 1px solid #ddd;
}

.border-t-dashed {
    border-top: 1px dashed #ccc;
}

.border-collapse {
    border-collapse: collapse;
}

.rounded-4 {
    border-radius: 4px;
}

.rounded-6 {
    border-radius: 6px;
}

.rounded-8 {
    border-radius: 8px;
}

.border-l-blue {
    border-left: 4px solid #2196f3;
}

.border-l-orange {
    border-left: 4px solid #ff9800;
}

.border-l-red {
    border-left: 4px solid #f44336;
}

.border-l-green {
    border-left: 4px solid #4caf50;
}

.m-0 {
    margin: 0;
}

.mt-4 {
    margin-top: 4px;
}

.mb-4 {
    margin-bottom: 4px;
}

.mb-5 {
    margin-bottom: 5px;
}

.p-10 {
    padding: 10px;
}

.p-14-18 {
    padding: 14px 18px;
}

.p-12 {
    padding: 12px;
}


/* Auto-added UI Utility Classes Part 5 - Typography, Modals, Flex */
.fs-11 {
    font-size: 11px !important;
}

.fs-12 {
    font-size: 12px;
}

.fs-13 {
    font-size: 13px;
}

.fs-14 {
    font-size: 14px;
}



.btn-icon {
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #475569;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #f1f5f9;
}

.fs-17 {
    font-size: 17px !important;
}

.fs-18 {
    font-size: 18px !important;
}

.fs-36 {
    font-size: 36px !important;
}

.fw-600 {
    font-weight: 600;
}

.text-uppercase {
    text-transform: uppercase;
}

.fst-italic {
    font-style: italic;
}

.w-100 {
    width: 100%;
}

.w-100px {
    width: 100px;
}

.w-48 {
    width: 48px;
}

.icon-32 {
    width: 32px;
    height: 32px;
}

.icon-48 {
    width: 48px;
    height: 48px;
}

.flex-1 {
    flex: 1;
}

.position-relative {
    position: relative;
}

.justify-content-between {
    justify-content: space-between;
}

.flex-gap-10 {
    display: flex;
    gap: 10px;
}

.flex-center-gap10 {
    display: flex;
    gap: 10px;
    align-items: center;
}

.d-flex {
    display: flex;
}

.align-items-center {
    align-items: center;
}

.justify-content-center {
    justify-content: center;
}

.flex-col-gap5 {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.modal-overlay {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.z-1000 {
    z-index: 1000;
}

.z-1001 {
    z-index: 1001;
}

.z-1002 {
    z-index: 1002;
}

.z-1060 {
    z-index: 1060;
}

.modal-content-lg {
    margin: 5% auto;
    padding: 0;
    border: 1px solid #888;
    width: 90%;
    max-width: 600px;
    overflow: hidden;
    background-color: #fefefe;
}

.modal-content-sm {
    margin: 15% auto;
    padding: 0;
    border: 1px solid #888;
    width: 80%;
    max-width: 400px;
    overflow: hidden;
    background-color: #fefefe;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
}

.alert-danger {
    background: #fef2f2;
    color: #991b1b;
}

.pointer-none {
    pointer-events: none;
}

.btn-danger-borderless {
    background: #e74c3c;
    border: none;
}


/* Auto-added UI Utility Classes Part 6 - Font weights, specific colors, and remaining forms */
.fw-600 {
    font-weight: 600 !important;
}

.fw-800 {
    font-weight: 800;
}

.fw-900 {
    font-weight: 900;
}

.fs-22 {
    font-size: 22px;
}

.text-blue-700 {
    color: #1976d2;
}

.text-red-700 {
    color: #c0392b;
}

.text-green-600 {
    color: #27ae60;
}

.text-blue-900 {
    color: #1e3a8a;
}

.text-orange-600 {
    color: #e67e22;
}

.text-orange-700 {
    color: #d35400;
}

.text-yellow-800 {
    color: #856404;
}

.text-primary {
    color: var(--primary-color);
}

.text-revenue {
    color: var(--color-revenue);
}

.h-48 {
    height: 48px;
}

.w-98 {
    width: 98%;
}

.h-100 {
    height: 100%;
}

.align-items-center {
    align-items: center;
}

.inline-flex-gap4 {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.inline-flex-gap5 {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.grid-2-gap15 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.grid-2-gap20 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.modal-content-xl {
    margin: 1% auto;
    padding: 0;
    border-radius: 12px;
    max-width: 1150px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    background-color: #fff;
}

.mt-2 {
    margin-top: 2px;
}

.mt-0 {
    margin-top: 0;
}

.mt-5 {
    margin-top: 5px;
}

.mt-8 {
    margin-top: 8px;
}

.mt-14 {
    margin-top: 14px;
}

.my-3 {
    margin: 3px 0;
}

.p-8 {
    padding: 8px;
}

.mb-10 {
    margin-bottom: 10px;
}

.p-15 {
    padding: 15px;
}

.border-dfe6e9 {
    border: 1px solid #dfe6e9;
}

.box-border {
    box-sizing: border-box;
}

.p-8-20 {
    padding: 8px 20px;
}

.p-16-20 {
    padding: 16px 20px;
}

.d-inline-block {
    display: inline-block;
}

.align-middle {
    vertical-align: middle;
}

.overflow-x-auto {
    overflow-x: auto;
}

.border-e5e7eb {
    border: 1px solid #e5e7eb;
}

.lh-1 {
    line-height: 1;
}

.lh-14 {
    line-height: 1.4;
}


/* JS Extracted utilities */
.text-dark {
    color: #2c3e50;
}

.flex-center-gap4 {
    display: flex;
    align-items: center;
    gap: 4px;
}

.me-3 {
    margin-right: 3px;
}

.p-20 {
    padding: 20px;
}


/* JS Extracted utilities Part 2 */
.p-0 {
    padding: 0 !important;
}

.p-4 {
    padding: 4px;
}

.p-8 {
    padding: 8px;
}

.p-8-10 {
    padding: 8px 10px;
}

.p-30 {
    padding: 30px;
}

.p-5 {
    padding: 5px;
}

.p-6 {
    padding: 6px;
}

.fs-10 {
    font-size: 10px;
}

.text-slate-800 {
    color: #1e293b;
}

.text-blue-600 {
    color: #2563eb;
}

.text-emerald-500 {
    color: #10b981;
}

.align-middle {
    vertical-align: middle;
}

.d-inline-block {
    display: inline-block;
}

.w-60 {
    width: 60px;
}

.flex-center-col-gap15 {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 15px;
}

.h-400 {
    height: 400px;
}

.flex-between-start {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}


/* JS Extracted utilities Part 3 */
.d-inline-block {
    display: inline-block;
}

.border-ddd {
    border: 1px solid #ddd;
}

.me-4 {
    margin-right: 4px;
}

.mb-5 {
    margin-bottom: 5px;
}

.text-black {
    color: #000;
}

.text-violet-600 {
    color: #7c3aed;
}

.text-green-600 {
    color: #27ae60;
}

.text-gray-700 {
    color: #374151;
}

.text-gray-500 {
    color: #6b7280;
}

.text-gray-400 {
    color: #9ca3af;
}

.fw-500 {
    font-weight: 500;
}

.text-strike {
    text-decoration: line-through;
}

.cursor-pointer {
    cursor: pointer;
}

.border-collapse {
    border-collapse: collapse;
}