/* --- admin.css (Phiên bản Cụng Ly Wine Premium) --- */
:root {
    --admin-primary: #5a1827; /* Đỏ rượu Burgundy đậm */
    --admin-secondary: #8b2b3d; /* Đỏ rượu nhạt hơn */
    --admin-bg: #f8f9fa;
    --text-main: #333333;
}
body { 
    background-color: var(--admin-bg); 
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; 
    color: var(--text-main);
}

/* Màn hình Login */
#loginScreen { height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); }
.login-box { background: white; padding: 40px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.08); width: 100%; max-width: 400px; border-top: 5px solid var(--admin-primary); }
.login-box h3 { color: var(--admin-primary); font-weight: 800; text-align: center; margin-bottom: 25px; letter-spacing: 1px; }

/* Giao diện Dashboard */
#mainDashboard { display: none; }
.sidebar {
    height: 100vh; background-color: white; border-right: 1px solid #e0e0e0; position: fixed; width: 250px; left: 0; top: 0; padding-top: 20px;
    box-shadow: 2px 0 10px rgba(0,0,0,0.03);
}
.sidebar-brand { font-size: 1.4rem; font-weight: 800; text-align: center; padding-bottom: 20px; margin-bottom: 20px; color: var(--admin-primary); letter-spacing: 1px;}
.nav-link { color: #555; padding: 12px 20px; font-size: 1.05rem; cursor: pointer; transition: all 0.2s ease;}
.nav-link:hover { color: var(--admin-primary); background-color: #f8f9fa; }
.nav-link.active { color: var(--admin-primary); background-color: #fcf0f2; border-right: 4px solid var(--admin-primary); font-weight: 600; }
.nav-link i { width: 30px; text-align: center; }

.main-content { margin-left: 250px; padding: 30px; }
.top-header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 15px; margin-bottom: 25px; }
.top-header h2 { font-weight: 700; color: var(--text-main); font-size: 1.8rem; margin: 0; }

/* Bảng dữ liệu (Table) */
.table { border-collapse: separate; border-spacing: 0; }
.table thead th { background-color: #f8f9fa; color: #666; font-weight: 600; text-transform: uppercase; font-size: 0.85rem; letter-spacing: 0.5px; border-bottom: 2px solid #e0e0e0; padding: 15px 10px; }
.table tbody td { padding: 15px 10px; vertical-align: middle; border-bottom: 1px solid #f0f0f0; }
.table-hover tbody tr:hover { background-color: #fcfcfc; }

/* Nút bấm (Buttons) tinh tế hơn */
.btn { border-radius: 6px; font-weight: 500; transition: all 0.2s; }
.btn-primary { background-color: var(--admin-primary); border-color: var(--admin-primary); }
.btn-primary:hover { background-color: var(--admin-secondary); border-color: var(--admin-secondary); }
.btn-outline-primary { color: var(--admin-primary); border-color: var(--admin-primary); }
.btn-outline-primary:hover { background-color: var(--admin-primary); color: white; }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.875rem; }

/* Badge (Nhãn trạng thái) */
.badge { padding: 0.4em 0.8em; border-radius: 50px; font-weight: 600; }
.bg-warning { background-color: #fff3cd !important; color: #856404 !important; border: 1px solid #ffeeba; }
.bg-success { background-color: #d4edda !important; color: #155724 !important; border: 1px solid #c3e6cb; }
.bg-danger { background-color: #f8d7da !important; color: #721c24 !important; border: 1px solid #f5c6cb; }

/* Khung Modal */
.modal-content { border: none; border-radius: 12px; box-shadow: 0 15px 35px rgba(0,0,0,0.2); overflow: hidden; }
.modal-header { background-color: #f8f9fa !important; border-bottom: 1px solid #e0e0e0; }
.modal-title { color: var(--text-main) !important; font-weight: 700; }
.modal-header.bg-primary { background-color: var(--admin-primary) !important; color: white !important; }
.modal-header.bg-primary .modal-title { color: white !important; }
/* --- TƯƠNG THÍCH MÀN HÌNH ĐIỆN THOẠI (RESPONSIVE) --- */
/* --- TƯƠNG THÍCH MÀN HÌNH ĐIỆN THOẠI (RESPONSIVE) CHUẨN UX --- */
/* --- TƯƠNG THÍCH MÀN HÌNH ĐIỆN THOẠI (RESPONSIVE) CHUẨN UX --- */
@media (max-width: 768px) {
    /* 1. Ẩn Sidebar sang trái, tạo hiệu ứng trượt */
    .sidebar { 
        position: fixed; left: -260px; top: 0; width: 250px; height: 100vh; 
        transition: 0.3s ease-in-out; z-index: 1050; border-right: none;
        box-shadow: 4px 0 15px rgba(0,0,0,0.1); 
    }
    .sidebar.show { left: 0; }
    
    .sidebar .nav { flex-direction: column !important; }
    .sidebar .nav-link { border-bottom: none; border-right: 4px solid transparent; }
    
    .main-content { margin-left: 0; padding: 15px; }
    .top-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; }
    .top-header h2 { font-size: 1.5rem; }

    /* 2. MA THUẬT: BIẾN BẢNG THÀNH CARD TRÊN MOBILE (ĐÃ KHOANH VÙNG) */
    #tableContainer .table-responsive { border: none !important; overflow-x: hidden; }
    #tableContainer .table thead { display: none; } /* Ẩn tiêu đề ngang */
    #tableContainer .table tbody tr { 
        display: block; background: #fff; margin-bottom: 16px; 
        border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.05); 
        border: 1px solid #e0e0e0; padding: 15px 10px; 
    }
    #tableContainer .table tbody td { 
        display: flex; justify-content: space-between; align-items: center; 
        border-bottom: 1px dashed #eee; padding: 10px 5px; 
    }
    #tableContainer .table tbody td:last-child { border-bottom: none; justify-content: center; gap: 8px; padding-top: 15px; }
    
    /* Lôi cái data-label ở file JS ra làm tiêu đề dọc */
    #tableContainer .table tbody td::before { 
        content: attr(data-label); font-weight: 600; color: #777; 
        text-align: left; flex-shrink: 0; margin-right: 15px; font-size: 0.9rem;
    }
    #tableContainer .table tbody td[data-label="Hành động"]::before { display: none; }
}

/* Giữ nguyên lớp bọc chống bể vỡ Hóa Đơn (bên ngoài media query) */
.invoice-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }