:root {
    --primary: #125e3a; /* Green from Lê La */
    --primary-dark: #0d462a;
    --sidebar-bg: #1e293b;
    --bg-color: #f1f5f9;
    --text-main: #334155;
    --white: #ffffff;
    --border: #e2e8f0;
    --radius: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Quicksand', sans-serif; }

body { background-color: var(--bg-color); color: var(--text-main); }

/* --- Login Screen --- */
.login-container {
    height: 100vh; height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), #2a885b);
}

.login-box {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-logo {
    font-size: 2rem;
    color: var(--primary);
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.login-box h2 {
    font-size: 1.2rem;
    color: #64748b;
    margin-bottom: 2rem;
}

.input-group {
    text-align: left;
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.input-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    font-size: 1rem;
    transition: 0.2s;
}

.input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(18, 94, 58, 0.1);
}

.btn-primary {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    white-space: nowrap;
}

.btn-primary:hover { background: var(--primary-dark); }

.error-msg { color: #ef4444; margin-top: 1rem; font-size: 0.9rem; font-weight: 600; }


/* --- Dashboard Layout --- */
.dashboard-layout {
    display: flex;
    height: 100vh; height: 100dvh;
    width: 100%;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 260px;
    min-width: 260px;
    max-width: 260px;
    flex-shrink: 0;
    background-color: var(--sidebar-bg);
    color: var(--white);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    color: #4ade80;
}

.nav-links {
    list-style: none;
    padding: 1rem 0;
    flex-grow: 1;
}

.nav-links li {
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-weight: 500;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #cbd5e1;
    border-left: 4px solid transparent;
}

.nav-links li:hover, .nav-links li.active {
    background: rgba(255,255,255,0.05);
    color: var(--white);
    border-left-color: var(--primary);
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    cursor: pointer;
    color: #ef4444;
    font-weight: 600;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-footer:hover { background: rgba(239, 68, 68, 0.1); }


/* Main Content */
.main-content {
    flex-grow: 1;
    flex-shrink: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
    width: calc(100% - 260px);
    scrollbar-gutter: stable;
}

.top-header {
    background: var(--white);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.top-header h2 { font-size: 1.25rem; }

.user-info { display: flex; align-items: center; gap: 1rem; }
.avatar { 
    width: 40px; height: 40px; background: var(--bg-color); 
    border-radius: 50%; display: flex; align-items: center; 
    justify-content: center; color: var(--primary);
}

.content-body {
    padding: 2rem;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s;
    min-width: 0;
    width: 100%;
}
.tab-pane.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }


/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    min-width: 0;
}
.chart-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}
.chart-container {
    position: relative;
    height: 350px;
    width: 100%;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.stat-icon {
    width: 60px; height: 60px; border-radius: 12px;
    padding: 15px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
}

.stat-info h3 { font-size: 0.9rem; color: #64748b; margin-bottom: 0.25rem; font-weight: 600; }
.stat-info p { font-size: 1.5rem; font-weight: 700; color: var(--text-main); }


/* Tables */
.recent-section h3 { margin-bottom: 1rem; }
.table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    display: block;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}
.data-table {
    width: 100%; border-collapse: collapse; background: var(--white);
    border-radius: var(--radius); overflow: hidden; box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.data-table th, .data-table td { padding: 1rem; text-align: left; border-bottom: 1px solid var(--border); }
.data-table th { background: #f8fafc; font-weight: 600; color: #64748b; }
.badge { padding: 0.25rem 0.75rem; border-radius: 999px; font-size: 0.85rem; font-weight: 600; }
.badge.success { background: #dcfce7; color: #16a34a; }
.badge.warning { background: #fef3c7; color: #d97706; }
.td-img { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; }

.btn-icon { background: none; border: none; font-size: 1.1rem; cursor: pointer; padding: 0.25rem; margin-right: 0.5rem; color: #64748b;}
.btn-icon:hover { color: var(--primary); }
.text-red { color: #ef4444; } .text-blue { color: #3b82f6; }


/* Toolbars */
.toolbar { display: flex; gap: 1rem; margin-bottom: 1rem; }
.search-input { width: 300px; flex-shrink: 0; padding: 0.5rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); outline: none;}

/* Vouchers */
.voucher-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 1.5rem; }
.voucher-card { background: var(--white); padding: 1.5rem; border-radius: var(--radius); border-left: 4px solid var(--primary); box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.v-code { font-size: 1.25rem; font-weight: 700; color: var(--primary); margin-bottom: 0.5rem; }
.v-desc { color: var(--text-main); font-weight: 500; margin-bottom: 1rem; }
.v-status { font-size: 0.85rem; color: #64748b; }

/* Forms */
.form-container { background: var(--white); padding: 2rem; border-radius: var(--radius); max-width: 500px; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.form-container h3 { margin-bottom: 1.5rem; }

/* --- Sidebar Overlay --- */
.sidebar-overlay { display: none; }
.mobile-menu-btn { display: none; }

/* --- RESPONSIVE OPTIMIZATIONS (Tablet & Mobile) --- */
@media (max-width: 991px) {
    .dashboard-layout { flex-direction: row; height: 100vh; height: 100dvh; overflow: hidden; }
    
    .user-info { display: none !important; }
    
    .sidebar { 
        position: fixed; 
        top: 0; 
        left: -280px; 
        bottom: 0; 
        width: 260px !important; 
        max-width: 80vw; 
        height: 100vh; height: 100dvh; 
        z-index: 1000; 
        transition: 0.3s ease; 
        display: flex;
        flex-direction: column;
    }
    .sidebar.open { left: 0; }
    
    .sidebar-overlay { 
        display: block; 
        position: fixed; 
        inset: 0; 
        background: rgba(0,0,0,0.5); 
        z-index: 999; 
        opacity: 0; 
        pointer-events: none; 
        transition: 0.3s ease; 
    }
    .sidebar-overlay.open { opacity: 1; pointer-events: auto; }
    
    .mobile-menu-btn { 
        display: block; 
        background: none; 
        border: none; 
        font-size: 1.25rem; 
        color: var(--primary-color); 
        cursor: pointer; 
        padding: 5px; 
    }
    
    .sidebar-header { justify-content: flex-start; }
    .nav-links { display: block; overflow-y: auto; padding: 1rem 0; }
    .nav-links li { margin: 0; margin-bottom: 5px; white-space: normal; }
    .sidebar-footer { justify-content: flex-start; }
    
    .main-content { overflow-y: auto; padding: 0 !important; width: 100%; height: 100vh; height: 100dvh; }
    .top-header { padding: 8px 10px; }
    .content-body { padding: 10px 4% 4% 4%; }
    
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .charts-grid { grid-template-columns: 1fr; gap: 8px !important; margin-top: 10px !important; }
    .chart-card { padding: 10px !important; border-radius: 8px !important; }
    .chart-card h3 { margin-bottom: 10px !important; font-size: 1rem; }
    .chart-container { height: 220px; }
    
    .toolbar { flex-wrap: wrap; gap: 8px; margin-bottom: 10px !important; }
    .search-input { width: 100%; }
    
    /* Toolbar Thống kê */
    .stat-toolbar { flex-direction: column; align-items: stretch !important; gap: 12px; }
    .stat-divider { display: none; }
    .stat-filter-group { display: flex; width: 100%; gap: 5px; }
    .stat-filter-group .btn-primary { padding: 8px 5px; font-size: 13px; flex: 1; }
    .stat-custom-group { display: flex; width: 100%; gap: 5px; }
    .stat-custom-group .form-control { width: 100% !important; padding: 8px 10px; flex: 1; min-width: 0; }
    .stat-custom-group .btn-primary { padding: 8px 15px; width: auto !important; }
    
    /* Toolbar Đơn hàng */
    .orders-toolbar .search-input { width: 100%; margin-bottom: 5px; }
    .orders-actions-group { width: 100%; justify-content: space-between; margin-left: 0 !important; }
    
    /* Toolbar Sản phẩm & Vouchers */
    #tab-products .toolbar .btn-primary,
    #tab-vouchers .toolbar .btn-primary {
        width: 100% !important;
    }
}

@media (max-width: 768px) {
    .stats-grid { grid-template-columns: 1fr; }
    .top-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .voucher-grid { grid-template-columns: 1fr; }
    .table-responsive { overflow-x: auto; width: 100%; display: block; -webkit-overflow-scrolling: touch; }
    .data-table { min-width: 800px; } /* Force table to be wide so it scrolls */
}

.product-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
}

/* --- CỐ ĐỊNH KÍCH THƯỚC TRÁNH LỘN XỘN (ORDERS & PRODUCTS) --- */

/* 1. Bảng Đơn hàng */
#orders-table {
    table-layout: fixed;
    min-width: 1100px;
    width: 100%;
}
#orders-table th, #orders-table td {
    vertical-align: middle;
    box-sizing: border-box;
    padding: 10px 12px;
    word-break: break-word;
    overflow-wrap: anywhere;
}
#orders-table th:nth-child(1), #orders-table td:nth-child(1) { width: 125px; } /* Mã ĐH */
#orders-table th:nth-child(2), #orders-table td:nth-child(2) { width: 115px; } /* Thời gian */
#orders-table th:nth-child(3), #orders-table td:nth-child(3) { width: 250px; } /* Khách hàng */
#orders-table th:nth-child(4), #orders-table td:nth-child(4) { width: 260px; } /* Chi tiết món */
#orders-table th:nth-child(5), #orders-table td:nth-child(5) { width: 85px; text-align: center; } /* Loại */
#orders-table th:nth-child(6), #orders-table td:nth-child(6) { width: 125px; } /* Tổng tiền */
#orders-table th:nth-child(7), #orders-table td:nth-child(7) { width: 115px; text-align: center; } /* Trạng thái */
#orders-table th:nth-child(8), #orders-table td:nth-child(8) { width: 165px; text-align: center; } /* Thao tác (4 nút) */

#orders-table .btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    margin-right: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 13px;
    border: none;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}
#orders-table .btn-icon:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.order-customer-box {
    max-height: 140px;
    overflow-y: auto;
    padding-right: 4px;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.order-items-box {
    max-height: 140px;
    overflow-y: auto;
    padding-right: 4px;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.order-customer-box::-webkit-scrollbar,
.order-items-box::-webkit-scrollbar,
.card-scroll-box::-webkit-scrollbar {
    width: 4px;
}
.order-customer-box::-webkit-scrollbar-thumb,
.order-items-box::-webkit-scrollbar-thumb,
.card-scroll-box::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

/* 2. Bảng Sản phẩm */
#products-table {
    table-layout: fixed;
    min-width: 820px;
    width: 100%;
}
#products-table th, #products-table td {
    vertical-align: middle;
    box-sizing: border-box;
    padding: 10px 14px;
    word-break: break-word;
    overflow-wrap: anywhere;
}
#products-table th:nth-child(1), #products-table td:nth-child(1) { width: 40%; min-width: 260px; } /* Tên món */
#products-table th:nth-child(2), #products-table td:nth-child(2) { width: 15%; min-width: 110px; } /* Danh mục */
#products-table th:nth-child(3), #products-table td:nth-child(3) { width: 15%; min-width: 120px; } /* Giá bán */
#products-table th:nth-child(4), #products-table td:nth-child(4) { width: 15%; min-width: 120px; } /* Trạng thái */
#products-table th:nth-child(5), #products-table td:nth-child(5) { width: 15%; min-width: 110px; text-align: center; } /* Thao tác */

/* 3. Lưới Đơn hàng */
#orders-grid .product-card {
    min-height: 340px;
    display: flex;
    flex-direction: column;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* 4. Lưới Sản phẩm */
#products-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-top: 15px;
}
#products-grid .product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    word-break: break-word;
    overflow-wrap: anywhere;
}

@media (max-width: 1024px) {
    #products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
}

@media (max-width: 768px) {
    #products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }
    #products-grid .product-card {
        padding: 10px;
    }
    #products-grid .product-card h4 {
        font-size: 13px;
        min-height: 2.6em;
    }
    #products-grid .product-card .btn-icon {
        padding: 3px 5px;
        font-size: 13px;
        margin-right: 0;
    }
}

/* 5. Bộ chuyển đổi chế độ xem & Kho lưu trữ / Tự in bill */
.orders-sub-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 12px;
}

.orders-switches-group {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.orders-switches-group .switch-label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 600;
    color: #475569;
    user-select: none;
    transition: 0.2s;
}

.orders-switches-group .custom-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.orders-switches-group .custom-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.orders-switches-group .custom-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    transition: .3s;
    border-radius: 24px;
    background-color: #cbd5e1;
}

.orders-switches-group .custom-switch .slider-knob {
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

#toggle-history:checked + .slider {
    background-color: #ea580c !important;
}

#toggle-history:checked ~ .slider-knob {
    transform: translateX(20px);
}

.orders-switches-group .print-switch-label input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #10b981;
}

.orders-switches-group .print-switch-text {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #1e293b;
    font-size: 13.5px;
    font-weight: 600;
}

.view-toggle-group {
    display: flex;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 4px;
    align-items: center;
    border: 1px solid #e2e8f0;
}

.view-btn {
    background: transparent;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    color: #94a3b8;
    transition: 0.2s;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
}

.view-btn:hover { color: #475569; }
.view-btn.active {
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    color: #0f172a;
    pointer-events: none;
}

@media (max-width: 768px) {
    .orders-sub-bar {
        margin-top: 14px !important;
        margin-bottom: 12px !important;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .orders-sub-bar {
        margin-top: 14px !important;
        margin-bottom: 12px !important;
        background: #f8fafc;
        padding: 8px 10px;
        border-radius: 8px;
        border: 1px solid #e2e8f0;
        box-sizing: border-box;
    }
    .orders-switches-group {
        width: 100%;
        justify-content: space-between;
        gap: 8px;
    }
    .orders-switches-group .switch-label {
        font-size: 12px;
        gap: 6px;
    }
    .orders-switches-group .print-switch-text {
        font-size: 12px;
    }
    .orders-sub-bar .view-toggle-group {
        margin-left: auto;
        padding: 2px;
    }
    .orders-sub-bar .view-btn {
        padding: 4px 8px;
        font-size: 14px;
    }
}

/* 6. Bộ lọc danh mục sản phẩm Admin */
.admin-category-filters {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.admin-category-filters .filter-btn {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.admin-category-filters .filter-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
    border-color: #94a3b8;
}
.admin-category-filters .filter-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 2px 4px rgba(18, 94, 58, 0.2);
}
@media (max-width: 768px) {
    .admin-category-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        max-width: 100%;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }
    .admin-category-filters .filter-btn {
        padding: 5px 12px;
        font-size: 12px;
        flex-shrink: 0;
    }
}

/* 7. Thanh công cụ Đơn hàng & Nút Tạo đơn tay (POS) */
.orders-actions-group {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-left: auto;
}
.btn-admin-pos {
    width: auto;
    background: #10b981 !important;
    border: none;
    font-weight: 700;
    padding: 9px 14px;
    font-size: 13.5px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: var(--radius, 8px);
    transition: 0.2s;
    cursor: pointer;
}
.btn-admin-pos:hover {
    background: #059669 !important;
}
.btn-admin-refresh {
    width: auto;
    padding: 9px 14px;
    font-size: 13.5px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: var(--radius, 8px);
    cursor: pointer;
}
@media (max-width: 768px) {
    .orders-toolbar {
        flex-direction: column;
        align-items: stretch !important;
        gap: 8px !important;
    }
    .orders-toolbar .search-input {
        width: 100% !important;
        margin-bottom: 0 !important;
        box-sizing: border-box;
    }
    .orders-actions-group {
        width: 100% !important;
        margin-left: 0 !important;
        gap: 8px !important;
        display: flex !important;
    }
    .orders-actions-group .btn-admin-pos {
        flex: 1.3 1 0 !important;
        min-width: 0 !important;
        padding: 9px 6px !important;
        font-size: 12.5px !important;
    }
    .orders-actions-group .btn-admin-refresh {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        padding: 9px 6px !important;
        font-size: 12.5px !important;
    }
}
@media (max-width: 380px) {
    .orders-actions-group {
        gap: 5px !important;
    }
    .orders-actions-group .btn-admin-pos {
        font-size: 11px !important;
        padding: 8px 4px !important;
        letter-spacing: -0.2px;
    }
    .orders-actions-group .btn-admin-refresh {
        font-size: 11px !important;
        padding: 8px 4px !important;
    }
}

/* 8. Modal Tạo đơn Admin POS Tối ưu Responsive Mobile */
#modal-admin-pos {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    background: rgba(15, 23, 42, 0.65);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    padding: 12px;
    box-sizing: border-box;
}

#modal-admin-pos .admin-pos-modal {
    max-width: 860px;
    width: 95%;
    background: #ffffff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.05);
    max-height: 90vh;
    max-height: 90dvh;
    display: flex;
    flex-direction: column;
}

#modal-admin-pos .modal-header {
    padding: 12px 18px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    flex-shrink: 0;
}

#modal-admin-pos .modal-header h3 {
    margin: 0;
    font-size: 16px;
    color: #0f172a;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

#modal-admin-pos .admin-pos-body {
    display: flex;
    flex-direction: row;
    gap: 16px;
    padding: 16px 18px;
    overflow-y: auto;
    box-sizing: border-box;
    flex: 1;
}

#modal-admin-pos .admin-pos-col-left {
    flex: 1.1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e2e8f0;
    padding-right: 16px;
    box-sizing: border-box;
}

#modal-admin-pos .admin-pos-search-wrap {
    margin-bottom: 12px;
    display: flex;
    gap: 8px;
}

#modal-admin-pos .admin-pos-search-input {
    flex: 1;
    min-width: 0;
    padding: 9px 12px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    outline: none;
    font-size: 13.5px;
    box-sizing: border-box;
}

#modal-admin-pos .admin-pos-category-select {
    padding: 9px 8px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    outline: none;
    width: 110px;
    font-size: 13px;
    background: #fff;
    cursor: pointer;
    box-sizing: border-box;
}

#modal-admin-pos .admin-pos-products-list {
    flex: 1;
    max-height: 440px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
}

#modal-admin-pos .admin-pos-col-right {
    flex: 0.9;
    min-width: 0;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

#modal-admin-pos .admin-pos-cart-list {
    flex: 1;
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f8fafc;
    box-sizing: border-box;
}

#modal-admin-pos .admin-pos-checkout-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 12px 14px;
    border-radius: 8px;
    flex-shrink: 0;
    box-sizing: border-box;
}

/* TỐI ƯU GIAO DIỆN KHI XEM TRÊN ĐIỆN THOẠI HOẶC MÀN HÌNH NHỎ */
@media (max-width: 768px) {
    #modal-admin-pos {
        padding: 6px;
        align-items: center;
    }
    
    #modal-admin-pos .admin-pos-modal {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 95vh !important;
        max-height: 95dvh !important;
        border-radius: 12px !important;
    }

    #modal-admin-pos .modal-header {
        padding: 10px 14px;
    }
    
    #modal-admin-pos .modal-header h3 {
        font-size: 14.5px;
    }

    #modal-admin-pos .admin-pos-body {
        flex-direction: column;
        gap: 12px;
        padding: 10px 12px;
        overflow-y: auto;
    }

    #modal-admin-pos .admin-pos-col-left {
        width: 100% !important;
        border-right: none !important;
        padding-right: 0 !important;
    }

    #modal-admin-pos .admin-pos-search-wrap {
        margin-bottom: 8px;
        gap: 6px;
    }

    #modal-admin-pos .admin-pos-search-input {
        padding: 8px 10px;
        font-size: 13px;
    }

    #modal-admin-pos .admin-pos-category-select {
        width: 95px;
        padding: 8px 4px;
        font-size: 12.5px;
    }

    #modal-admin-pos .admin-pos-products-list {
        max-height: 200px;
        gap: 6px;
    }

    #modal-admin-pos .admin-pos-col-right {
        width: 100% !important;
    }

    #modal-admin-pos .admin-pos-cart-list {
        max-height: 140px;
        margin-bottom: 10px;
        padding: 6px;
    }

    #modal-admin-pos .admin-pos-checkout-box {
        padding: 10px 12px;
    }
}

@media (max-width: 400px) {
    #modal-admin-pos {
        padding: 0;
    }
    #modal-admin-pos .admin-pos-modal {
        border-radius: 0 !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
    }
    #modal-admin-pos .admin-pos-products-list {
        max-height: 170px;
    }
}


